Found during the PR #899 (#878) review; pre-existing on both the release/v0.1.0 branch and main (not introduced by #878).
Symptom
A generic instantiated at the zero-size Unit type passes vera check but fails at codegen:
private fn mku(@Int -> @Unit) requires(true) ensures(true) effects(pure) { () }
private forall<T> fn idt(@T -> @T) requires(true) ensures(true) effects(pure) { @T.0 }
public fn main(@Unit -> @Int) requires(true) ensures(true) effects(pure)
{ let @Unit = idt(mku(5)); 7 }
vera check → OK.
vera run → fails, and the exact failure is hash-seed-dependent: observed E699 (function skipped), "No exported functions to call" (main dropped), and — worst — a codegen invariant violation — … the type checker should have rejected the input before it reached this point. Please file a bug report crash.
The crash message is itself telling: the codegen invariant expects the checker to have already rejected forall<T> at T = Unit.
Nature
Instantiating a generic at Unit is a degenerate/niche case (identity over a zero-size value). The right fix is likely a checker-side clean rejection (a proper diagnostic that generics may not be instantiated at Unit, if that's the intended design) rather than a codegen change — OR codegen support for the Unit monomorphization. Either way, a check-green program must not reach a "file a bug report" codegen crash.
Pre-existing; surfaced by an edge-shape probe during #878's clone-naming work. Related: #878 (the user-fn-return-into-generic-arg clone naming this sits adjacent to).
Found during the PR #899 (#878) review; pre-existing on both the release/v0.1.0 branch and main (not introduced by #878).
Symptom
A generic instantiated at the zero-size
Unittype passesvera checkbut fails at codegen:vera check→ OK.vera run→ fails, and the exact failure is hash-seed-dependent: observedE699(function skipped), "No exported functions to call" (maindropped), and — worst — acodegen invariant violation — … the type checker should have rejected the input before it reached this point. Please file a bug reportcrash.The crash message is itself telling: the codegen invariant expects the checker to have already rejected
forall<T>atT = Unit.Nature
Instantiating a generic at
Unitis a degenerate/niche case (identity over a zero-size value). The right fix is likely a checker-side clean rejection (a proper diagnostic that generics may not be instantiated atUnit, if that's the intended design) rather than a codegen change — OR codegen support for theUnitmonomorphization. Either way, a check-green program must not reach a "file a bug report" codegen crash.Pre-existing; surfaced by an edge-shape probe during #878's clone-naming work. Related: #878 (the user-fn-return-into-generic-arg clone naming this sits adjacent to).