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:
agra
2026-05-30 03:00:58 +03:00
parent a922814ba3
commit 39d77ff886
5 changed files with 89 additions and 3 deletions

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1,3 @@
a: 11 x
p: x=22 y=y .0=22
p.x after .0=33: 33