Accept new baselines
This commit is contained in:
parent
1299c9395e
commit
919fce95fc
14 changed files with 60 additions and 56 deletions
|
@ -76,26 +76,26 @@ t4 = [E1.one, E2.two, 20];
|
|||
>20 : 20
|
||||
|
||||
var e1 = t1[2]; // {}
|
||||
>e1 : ((x: number) => string) | ((x: number) => number)
|
||||
>t1[2] : ((x: number) => string) | ((x: number) => number)
|
||||
>e1 : undefined
|
||||
>t1[2] : undefined
|
||||
>t1 : [(x: number) => string, (x: number) => number]
|
||||
>2 : 2
|
||||
|
||||
var e2 = t2[2]; // {}
|
||||
>e2 : E1 | E2
|
||||
>t2[2] : E1 | E2
|
||||
>e2 : undefined
|
||||
>t2[2] : undefined
|
||||
>t2 : [E1, E2]
|
||||
>2 : 2
|
||||
|
||||
var e3 = t3[2]; // any
|
||||
>e3 : any
|
||||
>t3[2] : any
|
||||
>e3 : undefined
|
||||
>t3[2] : undefined
|
||||
>t3 : [number, any]
|
||||
>2 : 2
|
||||
|
||||
var e4 = t4[3]; // number
|
||||
>e4 : number
|
||||
>t4[3] : number
|
||||
>e4 : undefined
|
||||
>t4[3] : undefined
|
||||
>t4 : [E1, E2, number]
|
||||
>3 : 3
|
||||
|
||||
|
|
|
@ -49,32 +49,32 @@ var t5: [C1, F]
|
|||
>t5 : [C1, F]
|
||||
|
||||
var e11 = t1[4]; // base
|
||||
>e11 : base | C
|
||||
>t1[4] : base | C
|
||||
>e11 : undefined
|
||||
>t1[4] : undefined
|
||||
>t1 : [C, base]
|
||||
>4 : 4
|
||||
|
||||
var e21 = t2[4]; // {}
|
||||
>e21 : C | D
|
||||
>t2[4] : C | D
|
||||
>e21 : undefined
|
||||
>t2[4] : undefined
|
||||
>t2 : [C, D]
|
||||
>4 : 4
|
||||
|
||||
var e31 = t3[4]; // C1
|
||||
>e31 : C1 | D1
|
||||
>t3[4] : C1 | D1
|
||||
>e31 : undefined
|
||||
>t3[4] : undefined
|
||||
>t3 : [C1, D1]
|
||||
>4 : 4
|
||||
|
||||
var e41 = t4[2]; // base1
|
||||
>e41 : base1 | C1
|
||||
>t4[2] : base1 | C1
|
||||
>e41 : undefined
|
||||
>t4[2] : undefined
|
||||
>t4 : [base1, C1]
|
||||
>2 : 2
|
||||
|
||||
var e51 = t5[2]; // {}
|
||||
>e51 : F | C1
|
||||
>t5[2] : F | C1
|
||||
>e51 : undefined
|
||||
>t5[2] : undefined
|
||||
>t5 : [C1, F]
|
||||
>2 : 2
|
||||
|
||||
|
|
|
@ -83,8 +83,8 @@ var eleFromCDA1 = classCDATuple[2]; // A
|
|||
>2 : 2
|
||||
|
||||
var eleFromCDA2 = classCDATuple[5]; // C | D | A
|
||||
>eleFromCDA2 : A | C | D
|
||||
>classCDATuple[5] : A | C | D
|
||||
>eleFromCDA2 : undefined
|
||||
>classCDATuple[5] : undefined
|
||||
>classCDATuple : [C, D, A]
|
||||
>5 : 5
|
||||
|
||||
|
|
|
@ -9,4 +9,4 @@ var y = x[0];
|
|||
|
||||
//// [emptyTuplesTypeAssertion01.d.ts]
|
||||
declare let x: [];
|
||||
declare let y: never;
|
||||
declare let y: undefined;
|
||||
|
|
|
@ -5,8 +5,8 @@ let x = <[]>[];
|
|||
>[] : []
|
||||
|
||||
let y = x[0];
|
||||
>y : never
|
||||
>x[0] : never
|
||||
>y : undefined
|
||||
>x[0] : undefined
|
||||
>x : []
|
||||
>0 : 0
|
||||
|
||||
|
|
|
@ -9,4 +9,4 @@ var y = x[0];
|
|||
|
||||
//// [emptyTuplesTypeAssertion02.d.ts]
|
||||
declare let x: [];
|
||||
declare let y: never;
|
||||
declare let y: undefined;
|
||||
|
|
|
@ -5,8 +5,8 @@ let x = [] as [];
|
|||
>[] : []
|
||||
|
||||
let y = x[0];
|
||||
>y : never
|
||||
>x[0] : never
|
||||
>y : undefined
|
||||
>x[0] : undefined
|
||||
>x : []
|
||||
>0 : 0
|
||||
|
||||
|
|
|
@ -2,8 +2,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup
|
|||
Types of property 'length' are incompatible.
|
||||
Type '4' is not assignable to type '2'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(13,20): error TS2733: Index '2' is out-of-bounds in tuple of length 2.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'.
|
||||
Type '{ a: string; }' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,1): error TS2322: Type '{ a: string; }' is not assignable to type 'undefined'.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(14,11): error TS2733: Index '3' is out-of-bounds in tuple of length 2.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(15,20): error TS2733: Index '3' is out-of-bounds in tuple of length 2.
|
||||
tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTupleType.ts(22,14): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
|
@ -36,8 +35,7 @@ tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithTup
|
|||
!!! error TS2733: Index '2' is out-of-bounds in tuple of length 2.
|
||||
i1.tuple1[3] = { a: "string" };
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{ a: string; }' is not assignable to type 'string | number'.
|
||||
!!! error TS2322: Type '{ a: string; }' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type '{ a: string; }' is not assignable to type 'undefined'.
|
||||
~
|
||||
!!! error TS2733: Index '3' is out-of-bounds in tuple of length 2.
|
||||
var e4 = i1.tuple1[3]; // {}
|
||||
|
|
|
@ -48,8 +48,8 @@ i1.tuple1 = ["foo", 5, false, true];
|
|||
>true : true
|
||||
|
||||
var e3 = i1.tuple1[2]; // {}
|
||||
>e3 : string | number
|
||||
>i1.tuple1[2] : string | number
|
||||
>e3 : undefined
|
||||
>i1.tuple1[2] : undefined
|
||||
>i1.tuple1 : [string, number]
|
||||
>i1 : I<string, number>
|
||||
>tuple1 : [string, number]
|
||||
|
@ -57,7 +57,7 @@ var e3 = i1.tuple1[2]; // {}
|
|||
|
||||
i1.tuple1[3] = { a: "string" };
|
||||
>i1.tuple1[3] = { a: "string" } : { a: string; }
|
||||
>i1.tuple1[3] : string | number
|
||||
>i1.tuple1[3] : undefined
|
||||
>i1.tuple1 : [string, number]
|
||||
>i1 : I<string, number>
|
||||
>tuple1 : [string, number]
|
||||
|
@ -67,8 +67,8 @@ i1.tuple1[3] = { a: "string" };
|
|||
>"string" : "string"
|
||||
|
||||
var e4 = i1.tuple1[3]; // {}
|
||||
>e4 : string | number
|
||||
>i1.tuple1[3] : string | number
|
||||
>e4 : undefined
|
||||
>i1.tuple1[3] : undefined
|
||||
>i1.tuple1 : [string, number]
|
||||
>i1 : I<string, number>
|
||||
>tuple1 : [string, number]
|
||||
|
|
|
@ -47,8 +47,8 @@ var ele11 = strNumTuple[1]; // number
|
|||
>1 : 1
|
||||
|
||||
var ele12 = strNumTuple[2]; // string | number
|
||||
>ele12 : string | number
|
||||
>strNumTuple[2] : string | number
|
||||
>ele12 : undefined
|
||||
>strNumTuple[2] : undefined
|
||||
>strNumTuple : [string, number]
|
||||
>2 : 2
|
||||
|
||||
|
@ -83,8 +83,8 @@ var strNumTuple1 = numTupleTuple[1]; //[string, number];
|
|||
>1 : 1
|
||||
|
||||
var ele17 = numTupleTuple[2]; // number | [string, number]
|
||||
>ele17 : number | [string, number]
|
||||
>numTupleTuple[2] : number | [string, number]
|
||||
>ele17 : undefined
|
||||
>numTupleTuple[2] : undefined
|
||||
>numTupleTuple : [number, [string, number]]
|
||||
>2 : 2
|
||||
|
||||
|
@ -101,8 +101,8 @@ var eleUnion11 = unionTuple1[1]; // string | number
|
|||
>1 : 1
|
||||
|
||||
var eleUnion12 = unionTuple1[2]; // string | number
|
||||
>eleUnion12 : string | number
|
||||
>unionTuple1[2] : string | number
|
||||
>eleUnion12 : undefined
|
||||
>unionTuple1[2] : undefined
|
||||
>unionTuple1 : [number, string | number]
|
||||
>2 : 2
|
||||
|
||||
|
@ -143,8 +143,8 @@ var eleUnion21 = unionTuple2[1]; // string | number
|
|||
>1 : 1
|
||||
|
||||
var eleUnion22 = unionTuple2[2]; // string | number | boolean
|
||||
>eleUnion22 : string | number | boolean
|
||||
>unionTuple2[2] : string | number | boolean
|
||||
>eleUnion22 : undefined
|
||||
>unionTuple2[2] : undefined
|
||||
>unionTuple2 : [boolean, string | number]
|
||||
>2 : 2
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ type Q31 = [string, number][1]; // number
|
|||
>Q31 : number
|
||||
|
||||
type Q32 = [string, number][2]; // string | number
|
||||
>Q32 : string | number
|
||||
>Q32 : undefined
|
||||
|
||||
type Q33 = [string, number][E.A]; // string
|
||||
>Q33 : string
|
||||
|
@ -157,7 +157,7 @@ type Q34 = [string, number][E.B]; // number
|
|||
>E : any
|
||||
|
||||
type Q35 = [string, number][E.C]; // string | number
|
||||
>Q35 : string | number
|
||||
>Q35 : undefined
|
||||
>E : any
|
||||
|
||||
type Q36 = [string, number]["0"]; // string
|
||||
|
|
|
@ -12,14 +12,14 @@ const a1 = a[1]
|
|||
>1 : 1
|
||||
|
||||
const a2 = a[2]
|
||||
>a2 : string | number
|
||||
>a[2] : string | number
|
||||
>a2 : undefined
|
||||
>a[2] : undefined
|
||||
>a : [number, string]
|
||||
>2 : 2
|
||||
|
||||
const a3 = a[1000]
|
||||
>a3 : string | number
|
||||
>a[1000] : string | number
|
||||
>a3 : undefined
|
||||
>a[1000] : undefined
|
||||
>a : [number, string]
|
||||
>1000 : 1000
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
tests/cases/compiler/tupleTypes.ts(11,12): error TS2733: Index '2' is out-of-bounds in tuple of length 2.
|
||||
tests/cases/compiler/tupleTypes.ts(12,5): error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type 'undefined', but here has type 'string | number'.
|
||||
tests/cases/compiler/tupleTypes.ts(14,1): error TS2322: Type '[]' is not assignable to type '[number, string]'.
|
||||
Property '0' is missing in type '[]'.
|
||||
tests/cases/compiler/tupleTypes.ts(15,1): error TS2322: Type '[number]' is not assignable to type '[number, string]'.
|
||||
|
@ -9,6 +10,7 @@ tests/cases/compiler/tupleTypes.ts(18,1): error TS2322: Type '[number, string, n
|
|||
Types of property 'length' are incompatible.
|
||||
Type '3' is not assignable to type '2'.
|
||||
tests/cases/compiler/tupleTypes.ts(35,14): error TS2733: Index '2' is out-of-bounds in tuple of length 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 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'.
|
||||
|
@ -22,7 +24,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n
|
|||
Type '{}' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/tupleTypes.ts (12 errors) ====
|
||||
==== tests/cases/compiler/tupleTypes.ts (14 errors) ====
|
||||
var v1: []; // Error
|
||||
var v2: [number];
|
||||
var v3: [number, string];
|
||||
|
@ -37,6 +39,8 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n
|
|||
~
|
||||
!!! error TS2733: Index '2' is out-of-bounds in tuple of length 2.
|
||||
var t2: number|string;
|
||||
~~
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type 'undefined', but here has type 'string | number'.
|
||||
|
||||
t = []; // Error
|
||||
~
|
||||
|
@ -77,6 +81,8 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n
|
|||
~
|
||||
!!! error TS2733: Index '2' is out-of-bounds in tuple of length 2.
|
||||
var tt2: number | string;
|
||||
~~~
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'tt2' must be of type 'undefined', but here has type 'string | number'.
|
||||
|
||||
tt = tuple2(1, undefined);
|
||||
tt = [1, undefined];
|
||||
|
|
|
@ -33,13 +33,13 @@ var t1: string;
|
|||
>t1 : string
|
||||
|
||||
var t2 = t[2]; // number|string
|
||||
>t2 : string | number
|
||||
>t[2] : string | number
|
||||
>t2 : undefined
|
||||
>t[2] : undefined
|
||||
>t : [number, string]
|
||||
>2 : 2
|
||||
|
||||
var t2: number|string;
|
||||
>t2 : string | number
|
||||
>t2 : undefined
|
||||
|
||||
t = []; // Error
|
||||
>t = [] : []
|
||||
|
@ -144,13 +144,13 @@ var tt1: string;
|
|||
>tt1 : string
|
||||
|
||||
var tt2 = tt[2];
|
||||
>tt2 : string | number
|
||||
>tt[2] : string | number
|
||||
>tt2 : undefined
|
||||
>tt[2] : undefined
|
||||
>tt : [number, string]
|
||||
>2 : 2
|
||||
|
||||
var tt2: number | string;
|
||||
>tt2 : string | number
|
||||
>tt2 : undefined
|
||||
|
||||
tt = tuple2(1, undefined);
|
||||
>tt = tuple2(1, undefined) : [number, any]
|
||||
|
|
Loading…
Reference in a new issue