A comptime value param whose constraint is a plain enum ($o: Ord) now binds its enum-literal argument to the variant tag during inlined comptime-call lowering. The tag is recorded in comptime_value_bindings (readable downstream via comptimeIntNamed / direct map lookup, and as an array-dim style const-int leaf) AND the param is bound into scope as an enum_init value so body comparisons like 'if o == .a' lower as ordinary enum comparisons. Distinct ordering args monomorphize the inlined body per value. A non-constant argument or an unknown variant emits a loud diagnostic and binds nothing — never a silent default. Locked by examples/0627-comptime-enum-value-param.sx.
2 lines
2 B
Plaintext
2 lines
2 B
Plaintext
0
|