selfhost/cmd/wcc: stamp e.type_ for N_SPREAD (A.6.2.0e)

Port head-only of cstage cmd/wcc/check.c:1212-1213 to exprtype's
new N_SPREAD arm. The spread expression `xs...` carries the
operand's type — pass-through stamp, no structural synthesis.

A.6.2 step 5 of 8 (γ order). The smallest stamp arm in the
series; mirrors cstage's one-liner directly.

`make test-unit` green; full `make test` batched per option B.
This commit is contained in:
2026-05-21 21:14:08 +09:00
parent 48c758bbe7
commit afd62a9187
3 changed files with 21 additions and 0 deletions

View File

@@ -8890,6 +8890,13 @@ fn exprtype(c: *checker, e: *node, hint: *node) *node = {
};
return nil;
};
if (k == nkind.N_SPREAD) {
// A.6.2.0e — pass-through stamp. Mirrors cstage check.c:1212-1213.
// The spread expression `xs...` carries the operand's type.
let t: *node = exprtype(c, e.lhs, nil);
if (t != nil) { e.type_ = tinfofornode(c, t): *void; };
return t;
};
if (k == nkind.N_TRYPROP) {
// success unwrap: the success-variant type of operand's
// tagged union.

View File

@@ -1926,6 +1926,13 @@ fn exprtype(c: *checker, e: *node, hint: *node) *node = {
};
return nil;
};
if (k == nkind.N_SPREAD) {
// A.6.2.0e — pass-through stamp. Mirrors cstage check.c:1212-1213.
// The spread expression `xs...` carries the operand's type.
let t: *node = exprtype(c, e.lhs, nil);
if (t != nil) { e.type_ = tinfofornode(c, t): *void; };
return t;
};
if (k == nkind.N_TRYPROP) {
// success unwrap: the success-variant type of operand's
// tagged union.

View File

@@ -8890,6 +8890,13 @@ fn exprtype(c: *checker, e: *node, hint: *node) *node = {
};
return nil;
};
if (k == nkind.N_SPREAD) {
// A.6.2.0e — pass-through stamp. Mirrors cstage check.c:1212-1213.
// The spread expression `xs...` carries the operand's type.
let t: *node = exprtype(c, e.lhs, nil);
if (t != nil) { e.type_ = tinfofornode(c, t): *void; };
return t;
};
if (k == nkind.N_TRYPROP) {
// success unwrap: the success-variant type of operand's
// tagged union.