47d75d9b593ee13be2d503e2bf9c25775961654a
Tagged-union widening already fired for `let r: (str|rune) = "...";`, `r = "...";`, and `return "..."` from a tagged-returning fn — but not at call sites, so `fn f(x: (str|rune))` couldn't be called with a bare str or rune. The arg was pushed as its own static type (2 words for str, 1 for rune) while the callee's slot expected 3 (tag + payload). C cgen: at the call boundary, look up the callee's declared param type per arg. When the param is TY_TAGGED and the arg is a concrete variant, materialise (tag, value-words, padding) sized to the param's tagged_arg_size — then the existing pop-into-arg-regs logic picks it up. Nullable `(*T | void)` collapses to a single 8B push. selfhost: fnret now carries the params head alongside rtype (amalloc bumped to 48); pushargsrev takes the matching param node and runs the same widening sequence per arg. The pop drain in cgcall already handled extra slot words, so no change needed on that side. Verified with a smoke covering str/rune literals, typed locals, pre-existing tagged-local pass-through, and nullable widening from a raw pointer. Selfhost emits byte-identical asm to C cgen on the test.
Description
No description provided
Languages
C
89.4%
Python
7.2%
Makefile
2.3%
Shell
0.8%
Assembly
0.3%