Files
tsgo/testdata/baselines/reference/compiler/inferRestTupleShortSource.errors.txt
902a32bb2e Fix panic when inferring [...rest, ...T] from tuple shorter than fixed-arity constraint (#3917)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jakebailey <[email protected]>
Co-authored-by: ahejlsberg <[email protected]>
2026-05-18 17:37:29 +00:00

16 lines
654 B
Plaintext

inferRestTupleShortSource.ts(7,3): error TS2345: Argument of type '[]' is not assignable to parameter of type '[...string[], string]'.
Source has 0 element(s) but target requires 1.
==== inferRestTupleShortSource.ts (1 errors) ====
// Regression test: tsgo panics when inferring [...rest, ...T] from a tuple shorter than fixed-arity constraint
function f<T extends [string]>(args: [...string[], ...T]) {
// ...
}
f([])
~~
!!! error TS2345: Argument of type '[]' is not assignable to parameter of type '[...string[], string]'.
!!! error TS2345: Source has 0 element(s) but target requires 1.