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.
9.5 KiB
9.5 KiB