Commit 958b356
Fix Call.target_type() for variadic builtin.tuple
builtin.tuple is registered as variadic (arity -1), so make_builtin
gives it an empty param list and the generic type-variable matching
can't resolve the return type T. Add a special case that infers
TupleType directly from the argument types, matching what _infer_type
already does in the parser.
Without this, IfElse nodes wrapping tuple constructs were typed as
interface{} in Go, causing a compile error when the function's declared
return type is []interface{}.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent dfed824 commit 958b356
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
348 | 351 | | |
349 | 352 | | |
350 | 353 | | |
| |||
0 commit comments