define(handle, info) is now an ordinary sx fn in modules/std/meta.sx: it matches the TypeInfo union and calls the abi(.compiler) register_type primitive with the matching kind code, decoding the variant/field/element list into []Member. An all-void enum variant set registers as kind 2 (actual enum); any payload variant as kind 3 (tagged_union). To support matching the TypeInfo VALUE in the comptime VM, added tagged-union value support: kindOf now treats tagged_union as a by-address aggregate, enum_tag reads the tag word at offset 0, and a new enum_payload arm reads the active payload at tag_size (both bail loudly on backing_type unions, whose layout differs). register_type's duplicate-name diagnostics now include the offending name. Dropped the define interception in tryLowerReflectionCall; the .enum(...) arg infers TypeInfo from the sx fn's param type via the ordinary call path. Regenerated 1179/1180 diagnostic snapshots (same span/line; the message now names register_type instead of define()). define/type_info builtins still exist pending dead-code removal.
6 lines
317 B
Plaintext
6 lines
317 B
Plaintext
error: comptime type construction failed: comptime register_type: a type with no members is never valid
|
|
--> examples/1179-diagnostics-comptime-type-construction-bail.sx:14:10
|
|
|
|
|
14 | Empty :: define(declare("Empty"), .enum(.{ variants = .[] }));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|