green(reify): field_type($T, i) -> Type over the type table
REIFY Phase 2.1. fieldTypeOf (lower/generic.zig, re-exported on Lowering) returns the i-th member type of T: struct field / tagged-union + union variant payload (.void for a tagless variant) / tuple element / array + vector element. Out-of-range and memberless types poison to .unresolved with a loud diagnostic (never a silent default). Wired into resolveTypeCallWithBindings (replacing the Phase-2 bail); since it folds to a TypeId at lower time it composes inside type_eq / type_name / any type-arg slot. examples/0616 green: struct fields (name via field_name + type via field_type), type_eq fold, tagged-union payloads incl. quit -> void. Suite green (672 examples, 447 unit). type_info($T) -> TypeInfo (reflect into a value, inverse of reify) is NOT done — still bails loudly; it's the larger Phase 2.2 step (widen the TypeInfo data model + comptime value construction). Plan/checkpoint updated.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
0
|
||||
|
||||
1
examples/expected/0616-comptime-field-type.stderr
Normal file
1
examples/expected/0616-comptime-field-type.stderr
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
9
examples/expected/0616-comptime-field-type.stdout
Normal file
9
examples/expected/0616-comptime-field-type.stdout
Normal file
@@ -0,0 +1,9 @@
|
||||
Point has 3 fields
|
||||
0: x : i64
|
||||
1: y : f64
|
||||
2: on : bool
|
||||
field 0 is i64: true
|
||||
field 1 is f64: true
|
||||
Msg.num payload: i64
|
||||
Msg.tag payload: bool
|
||||
Msg.quit payload: void
|
||||
Reference in New Issue
Block a user