diff --git a/tests/baselines/reference/arrayFrom.errors.txt b/tests/baselines/reference/arrayFrom.errors.txt index 7d9645f9420..615bd1bf769 100644 --- a/tests/baselines/reference/arrayFrom.errors.txt +++ b/tests/baselines/reference/arrayFrom.errors.txt @@ -1,7 +1,6 @@ tests/cases/compiler/arrayFrom.ts(20,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'. Property 'b' is missing in type 'A' but required in type 'B'. tests/cases/compiler/arrayFrom.ts(23,7): error TS2322: Type 'A[]' is not assignable to type 'B[]'. - Type 'A' is not assignable to type 'B'. ==== tests/cases/compiler/arrayFrom.ts (2 errors) ==== @@ -34,7 +33,6 @@ tests/cases/compiler/arrayFrom.ts(23,7): error TS2322: Type 'A[]' is not assigna const result6: B[] = Array.from(inputALike); // expect error ~~~~~~~ !!! error TS2322: Type 'A[]' is not assignable to type 'B[]'. -!!! error TS2322: Type 'A' is not assignable to type 'B'. const result7: B[] = Array.from(inputALike, ({ a }): B => ({ b: a })); const result8: A[] = Array.from(inputARand); const result9: B[] = Array.from(inputARand, ({ a }): B => ({ b: a })); diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index 56941dfddd0..0a1d592e8b1 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -4,7 +4,6 @@ tests/cases/conformance/types/tuple/castingTuple.ts(14,15): error TS2352: Conver Types of property 'length' are incompatible. Type '3' is not comparable to type '2'. tests/cases/conformance/types/tuple/castingTuple.ts(15,14): error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Property '2' is missing in type '[number, string]' but required in type '[number, string, boolean]'. tests/cases/conformance/types/tuple/castingTuple.ts(18,21): error TS2352: Conversion of type '[C, D]' to type '[C, D, A]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Property '2' is missing in type '[C, D]' but required in type '[C, D, A]'. tests/cases/conformance/types/tuple/castingTuple.ts(20,33): error TS2493: Tuple type '[C, D, A]' of length '3' has no element at index '5'. @@ -41,7 +40,6 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot var longer = numStrTuple as [number, string, boolean] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2352: Conversion of type '[number, string]' to type '[number, string, boolean]' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. -!!! error TS2352: Property '2' is missing in type '[number, string]' but required in type '[number, string, boolean]'. var classCDTuple: [C, D] = [new C(), new D()]; var interfaceIITuple = <[I, I]>classCDTuple; var classCDATuple = <[C, D, A]>classCDTuple; diff --git a/tests/baselines/reference/checkJsxChildrenProperty3.types b/tests/baselines/reference/checkJsxChildrenProperty3.types index 2d4380a1975..f2ed3dc8fd0 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty3.types +++ b/tests/baselines/reference/checkJsxChildrenProperty3.types @@ -31,11 +31,11 @@ class FetchUser extends React.Component { ? this.props.children(this.state.result) >this.props.children(this.state.result) : JSX.Element ->this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | React.ReactElement | any[])[]) +>this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) >this.props : IFetchUserProps & { children?: React.ReactNode; } >this : this >props : IFetchUserProps & { children?: React.ReactNode; } ->children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | React.ReactElement | any[])[]) +>children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) >this.state.result : any >this.state : any >this : this diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt index 40eb1d77677..34bd2189964 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/jsx/file.tsx(24,28): error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'? -tests/cases/conformance/jsx/file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | ReactElement | any[]'. - Type '(user: IUser) => Element' is missing the following properties from type 'any[]': push, pop, concat, join, and 15 more. -tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | ReactElement | any[]'. - Type '(user: IUser) => Element' is missing the following properties from type 'any[]': push, pop, concat, join, and 15 more. +tests/cases/conformance/jsx/file.tsx(36,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement'. + Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement': type, props +tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement'. + Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement': type, props ==== tests/cases/conformance/jsx/file.tsx (3 errors) ==== @@ -50,8 +50,8 @@ tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) } ~~~~~~~~~~~~~ -!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | ReactElement | any[]'. -!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'any[]': push, pop, concat, join, and 15 more. +!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement'. +!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement': type, props !!! related TS6212 tests/cases/conformance/jsx/file.tsx:36:15: Did you mean to call this expression? { user => ( ~~~~~~~~~ @@ -59,8 +59,8 @@ tests/cases/conformance/jsx/file.tsx(39,15): error TS2322: Type '(user: IUser) = ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ) } ~~~~~~~~~~~~~ -!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | ReactElement | any[]'. -!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'any[]': push, pop, concat, join, and 15 more. +!!! error TS2322: Type '(user: IUser) => Element' is not assignable to type 'string | number | boolean | any[] | ReactElement'. +!!! error TS2322: Type '(user: IUser) => Element' is missing the following properties from type 'ReactElement': type, props !!! related TS6212 tests/cases/conformance/jsx/file.tsx:39:15: Did you mean to call this expression? ); diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.types b/tests/baselines/reference/checkJsxChildrenProperty4.types index 4f753cf9f3b..067e8f2611a 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.types +++ b/tests/baselines/reference/checkJsxChildrenProperty4.types @@ -31,11 +31,11 @@ class FetchUser extends React.Component { ? this.props.children(this.state.result) >this.props.children(this.state.result) : JSX.Element ->this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | React.ReactElement | any[])[]) +>this.props.children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) >this.props : IFetchUserProps & { children?: React.ReactNode; } >this : this >props : IFetchUserProps & { children?: React.ReactNode; } ->children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | React.ReactElement | any[])[]) +>children : ((user: IUser) => JSX.Element) | (((user: IUser) => JSX.Element) & string) | (((user: IUser) => JSX.Element) & number) | (((user: IUser) => JSX.Element) & false) | (((user: IUser) => JSX.Element) & true) | (((user: IUser) => JSX.Element) & React.ReactElement) | (((user: IUser) => JSX.Element) & (string | number | boolean | any[] | React.ReactElement)[]) >this.state.result : any >this.state : any >this : this diff --git a/tests/baselines/reference/complexRecursiveCollections.types b/tests/baselines/reference/complexRecursiveCollections.types index 2450407e90d..feaff620486 100644 --- a/tests/baselines/reference/complexRecursiveCollections.types +++ b/tests/baselines/reference/complexRecursiveCollections.types @@ -1029,28 +1029,28 @@ declare module Immutable { >value : T[K] merge(...collections: Array | Iterable<[string, any]>>): this; ->merge : (...collections: (Partial | Iterable<[string, any]>)[]) => this ->collections : (Partial | Iterable<[string, any]>)[] +>merge : (...collections: (Iterable<[string, any]> | Partial)[]) => this +>collections : (Iterable<[string, any]> | Partial)[] mergeDeep(...collections: Array | Iterable<[string, any]>>): this; ->mergeDeep : (...collections: (Partial | Iterable<[string, any]>)[]) => this ->collections : (Partial | Iterable<[string, any]>)[] +>mergeDeep : (...collections: (Iterable<[string, any]> | Partial)[]) => this +>collections : (Iterable<[string, any]> | Partial)[] mergeWith(merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: Array | Iterable<[string, any]>>): this; ->mergeWith : (merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: (Partial | Iterable<[string, any]>)[]) => this +>mergeWith : (merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: (Iterable<[string, any]> | Partial)[]) => this >merger : (oldVal: any, newVal: any, key: keyof T) => any >oldVal : any >newVal : any >key : keyof T ->collections : (Partial | Iterable<[string, any]>)[] +>collections : (Iterable<[string, any]> | Partial)[] mergeDeepWith(merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array | Iterable<[string, any]>>): this; ->mergeDeepWith : (merger: (oldVal: any, newVal: any, key: any) => any, ...collections: (Partial | Iterable<[string, any]>)[]) => this +>mergeDeepWith : (merger: (oldVal: any, newVal: any, key: any) => any, ...collections: (Iterable<[string, any]> | Partial)[]) => this >merger : (oldVal: any, newVal: any, key: any) => any >oldVal : any >newVal : any >key : any ->collections : (Partial | Iterable<[string, any]>)[] +>collections : (Iterable<[string, any]> | Partial)[] delete(key: K): this; >delete : (key: K) => this diff --git a/tests/baselines/reference/contextualSignatureInstantiation.types b/tests/baselines/reference/contextualSignatureInstantiation.types index 57e8f79a28f..ae5a4000537 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation.types +++ b/tests/baselines/reference/contextualSignatureInstantiation.types @@ -108,7 +108,7 @@ var d = bar(1, "one", h); // Should be number[] | string[] var d = bar("one", 1, h); // Should be number[] | string[] >d : number[] | string[] ->bar("one", 1, h) : string[] | number[] +>bar("one", 1, h) : number[] | string[] >bar : (x: T, y: U, cb: (x: T, y: U) => V) => V >"one" : "one" >1 : 1 diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt index d3960267177..15e654df9a7 100644 --- a/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.errors.txt @@ -4,9 +4,15 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts( tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(7,6): error TS2456: Type alias 'T0_3' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(11,6): error TS2456: Type alias 'T1' circularly references itself. tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(14,6): error TS2456: Type alias 'T2' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(25,5): error TS2502: 'x' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(26,6): error TS2456: Type alias 'T5' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(29,6): error TS2456: Type alias 'T6' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(30,6): error TS2456: Type alias 'T7' circularly references itself. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(31,5): error TS2502: 'yy' is referenced directly or indirectly in its own type annotation. +tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts(32,6): error TS2456: Type alias 'T8' circularly references itself. -==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (6 errors) ==== +==== tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts (12 errors) ==== // It is an error for the type specified in a type alias to depend on that type alias // A type alias directly depends on the type it aliases. @@ -44,13 +50,25 @@ tests/cases/conformance/types/typeAliases/directDependenceBetweenTypeAliases.ts( // A type query directly depends on the type of the referenced entity. var x: T5[] = [] + ~ +!!! error TS2502: 'x' is referenced directly or indirectly in its own type annotation. type T5 = typeof x + ~~ +!!! error TS2456: Type alias 'T5' circularly references itself. class C1 {} type T6 = T7 | number + ~~ +!!! error TS2456: Type alias 'T6' circularly references itself. type T7 = typeof yy + ~~ +!!! error TS2456: Type alias 'T7' circularly references itself. var yy: [string, T8[]]; + ~~ +!!! error TS2502: 'yy' is referenced directly or indirectly in its own type annotation. type T8 = C + ~~ +!!! error TS2456: Type alias 'T8' circularly references itself. // legal cases type T9 = () => T9 diff --git a/tests/baselines/reference/directDependenceBetweenTypeAliases.types b/tests/baselines/reference/directDependenceBetweenTypeAliases.types index 431b65eea8c..1ddbeb019cf 100644 --- a/tests/baselines/reference/directDependenceBetweenTypeAliases.types +++ b/tests/baselines/reference/directDependenceBetweenTypeAliases.types @@ -39,28 +39,28 @@ type T4 = [number, T4] // A type query directly depends on the type of the referenced entity. var x: T5[] = [] ->x : any[][][][][][][][][][][] +>x : any >[] : undefined[] type T5 = typeof x ->T5 : any[][][][][][][][][][][] ->x : any[][][][][][][][][][][] +>T5 : any +>x : any class C1 {} >C1 : C1 type T6 = T7 | number ->T6 : T6 +>T6 : any type T7 = typeof yy ->T7 : [string, C[]] ->yy : [string, C[]] +>T7 : any +>yy : any var yy: [string, T8[]]; ->yy : [string, C[]] +>yy : any type T8 = C ->T8 : C +>T8 : any // legal cases type T9 = () => T9 diff --git a/tests/baselines/reference/recursiveResolveTypeMembers.errors.txt b/tests/baselines/reference/recursiveResolveTypeMembers.errors.txt index 7bb5c554984..ad5fe6dc1ae 100644 --- a/tests/baselines/reference/recursiveResolveTypeMembers.errors.txt +++ b/tests/baselines/reference/recursiveResolveTypeMembers.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/recursiveResolveTypeMembers.ts(4,49): error TS2589: Type instantiation is excessively deep and possibly infinite. +tests/cases/compiler/recursiveResolveTypeMembers.ts(4,49): error TS2577: Return type annotation circularly references itself. tests/cases/compiler/recursiveResolveTypeMembers.ts(4,58): error TS2304: Cannot find name 'H'. tests/cases/compiler/recursiveResolveTypeMembers.ts(4,62): error TS2574: A rest element type must be an array type. tests/cases/compiler/recursiveResolveTypeMembers.ts(4,79): error TS2304: Cannot find name 'R'. @@ -10,7 +10,7 @@ tests/cases/compiler/recursiveResolveTypeMembers.ts(4,79): error TS2304: Cannot type PromisedTuple void> = U extends (h: infer H, ...args: infer R) => [Promise, ...PromisedTuple] ? [] : [] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2589: Type instantiation is excessively deep and possibly infinite. +!!! error TS2577: Return type annotation circularly references itself. ~ !!! error TS2304: Cannot find name 'H'. ~~~~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/recursiveTypesWithTypeof.errors.txt b/tests/baselines/reference/recursiveTypesWithTypeof.errors.txt index 2807613c3d9..0604e38bd94 100644 --- a/tests/baselines/reference/recursiveTypesWithTypeof.errors.txt +++ b/tests/baselines/reference/recursiveTypesWithTypeof.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithType tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(6,5): error TS2502: 'e' is referenced directly or indirectly in its own type annotation. tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(10,5): error TS2502: 'f' is referenced directly or indirectly in its own type annotation. tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(12,5): error TS2502: 'f2' is referenced directly or indirectly in its own type annotation. -tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f3' must be of type 'Foo[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]', but here has type 'any'. +tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(14,5): error TS2502: 'f3' is referenced directly or indirectly in its own type annotation. tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts(51,5): error TS2502: 'hy3' is referenced directly or indirectly in its own type annotation. @@ -32,10 +32,9 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithType !!! error TS2502: 'f2' is referenced directly or indirectly in its own type annotation. var f2: any; var f3: Foo[]; - var f3: any; ~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f3' must be of type 'Foo[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[]', but here has type 'any'. -!!! related TS6203 tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts:14:5: 'f3' was also declared here. +!!! error TS2502: 'f3' is referenced directly or indirectly in its own type annotation. + var f3: any; // None of these declarations should have any errors! // Truly recursive types diff --git a/tests/baselines/reference/recursiveTypesWithTypeof.types b/tests/baselines/reference/recursiveTypesWithTypeof.types index 1a527bfa470..5625e7919cd 100644 --- a/tests/baselines/reference/recursiveTypesWithTypeof.types +++ b/tests/baselines/reference/recursiveTypesWithTypeof.types @@ -37,11 +37,11 @@ var f2: any; >f2 : any var f3: Foo[]; ->f3 : Foo[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[] ->f3 : Foo[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[] +>f3 : any +>f3 : any var f3: any; ->f3 : Foo[]>[]>[]>[]>[]>[]>[]>[]>[]>[]>[] +>f3 : any // None of these declarations should have any errors! // Truly recursive types diff --git a/tests/baselines/reference/spreadTypeVariable.types b/tests/baselines/reference/spreadTypeVariable.types index 0e836355d42..c5de712fb19 100644 --- a/tests/baselines/reference/spreadTypeVariable.types +++ b/tests/baselines/reference/spreadTypeVariable.types @@ -37,7 +37,7 @@ function f4(arg: T) { } function f5(arg: T) { ->f5 : (arg: T) => T +>f5 : (arg: T) => T >key : string >arg : T diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index a3c2fc00eb4..af76c872a6f 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[number, string, n Type '3' is not assignable to type '2'. tests/cases/compiler/tupleTypes.ts(35,14): error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. tests/cases/compiler/tupleTypes.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'tt2' must be of type 'undefined', but here has type 'string | number'. -tests/cases/compiler/tupleTypes.ts(41,1): error TS2739: Type '[]' is missing the following properties from type '[number, string]': 0, 1 +tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type '[]' is not assignable to type '[number, string]'. tests/cases/compiler/tupleTypes.ts(47,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'. Type 'string | number' is not assignable to type 'number'. Type 'string' is not assignable to type 'number'. @@ -87,7 +87,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n tt = [undefined, undefined]; tt = []; // Error ~~ -!!! error TS2739: Type '[]' is missing the following properties from type '[number, string]': 0, 1 +!!! error TS2322: Type '[]' is not assignable to type '[number, string]'. var a: number[]; var a1: [number, string]; diff --git a/tests/baselines/reference/typeInferenceLiteralUnion.types b/tests/baselines/reference/typeInferenceLiteralUnion.types index 84a65ccbc53..de4637c52c5 100644 --- a/tests/baselines/reference/typeInferenceLiteralUnion.types +++ b/tests/baselines/reference/typeInferenceLiteralUnion.types @@ -56,11 +56,11 @@ export function extent(array: Array): [T | Pri let extentMixed: [Primitive | NumCoercible, Primitive | NumCoercible] | [undefined, undefined]; ->extentMixed : [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] | [undefined, undefined] +>extentMixed : [undefined, undefined] | [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] extentMixed = extent([new NumCoercible(10), 13, '12', true]); >extentMixed = extent([new NumCoercible(10), 13, '12', true]) : [undefined, undefined] | [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] ->extentMixed : [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] | [undefined, undefined] +>extentMixed : [undefined, undefined] | [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] >extent([new NumCoercible(10), 13, '12', true]) : [undefined, undefined] | [string | number | boolean | Date | NumCoercible, string | number | boolean | Date | NumCoercible] >extent : (array: (string | number | boolean | Date | T)[]) => [string | number | boolean | Date | T, string | number | boolean | Date | T] | [undefined, undefined] >[new NumCoercible(10), 13, '12', true] : (string | number | true | NumCoercible)[]