-
Notifications
You must be signed in to change notification settings - Fork 716
Open
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checkingType OrderingAn issue related to ordering of typesAn issue related to ordering of types
Description
Steps to reproduce
declare function flat<T>(args: T[] | T[][]): void;
type Value = 1 | 2
declare const n: Value[] | Value[][]
flat(n)
Behavior with typescript@5.8
Type checks, T
is inferred as Value
Behavior with tsgo
We get an error in flat(n)
:
error TS2345: Argument of type 'Value[][] | Value[]' is not assignable to parameter of type 'Value[][][] | Value[][]'.
Type 'Value[]' is not assignable to type 'Value[][][] | Value[][]'.
Type 'Value[]' is not assignable to type 'Value[][][]'.
Type 'number' is not assignable to type 'Value[][]'.
Type 'number' is not assignable to type 'Value[][]'.
Metadata
Metadata
Assignees
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checkingType OrderingAn issue related to ordering of typesAn issue related to ordering of types