lang: tuple element assignment + named-tuple field names
Two fixes: - Element assignment `t.0 = v` (the known Phase-4.2 gap): the lvalue path looked the element up by NAME via getStructFields, never matched a tuple (positional), and left field_ty .unresolved -> ptr(.unresolved) -> codegen panic. Added a tuple branch to the field-assignment lowering that indexes by position (numeric) or name (tup.names), mirroring the read path. Fixes `c.sources.0 = v` on a generic-instance pack field too. - Named tuples: the parser dropped captured field names for a tuple TYPE `(x: T, y: U)` (passed field_names=null), and resolveTupleTypeWithBindings also nulled them. Both now preserve names (synthesizing _<i> for any unnamed slot), so `t.x` reads/writes by name and `.0` by position. examples/208. 243 examples + unit green.
This commit is contained in:
1
tests/expected/208-tuple-element-assign.exit
Normal file
1
tests/expected/208-tuple-element-assign.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
3
tests/expected/208-tuple-element-assign.txt
Normal file
3
tests/expected/208-tuple-element-assign.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
a: 11 x
|
||||
p: x=22 y=y .0=22
|
||||
p.x after .0=33: 33
|
||||
Reference in New Issue
Block a user