Skip to content
ZOLO / TE192 Type · error

nominal string literal requires a proved validated str constructor and an accepted static predicate

Compiler diagnostic TE192: nominal string literal requires a proved validated str constructor and an accepted static predicate.

Why this fires

Email"ana@empresa.com" requires the actual visible runtime constructor of a validated str newtype. The compiler runs its declared pure predicate on the decoded static string, and retains the sealed .new(...).unwrap() constructor.

Use Email.new(input) and handle the Result for variable strings. Nominal literals reject interpolation, unvalidated/numeric newtypes, nominal instances, type-only aliases, hidden constructors, missing source environments and a false predicate. An immutable binding initialized at runtime is not a static snapshot. This initial implementation represents captured constants as scalar literals; broader constant evaluation requires a separate admitted source proof.

Callable tags retain ordinary template semantics, including required-label checks. A function-only factory import does not make its return type constructible. Import a public declaration through its actual named import or re-export alias.

The diagnostic anchors the prefix identifier and offers the fallible constructor as a structured suggestion. It never edits a complete literal into an unchecked cast or automatically inserts an unwrap.

An Email language annotation on a fenced code block is not a nominal prefix. Macro templates retain the exact parsed prefix or fenced origin; unknown copied origins cannot authorize a nominal constructor.

JavaScript lowering explicitly rejects these validated nominal values. VM and AOT raw APIs require the canonical frontend to materialize them before lowering; unadmitted private origin markers are also refused.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

en