Accepting new baselines

This commit is contained in:
Anders Hejlsberg
2015-07-19 11:23:19 -07:00
parent 3cbc3db201
commit 592319d23e
105 changed files with 664 additions and 662 deletions

View File

@@ -1,4 +1,4 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'number | string' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type 'string' is not assignable to type 'number'.
@@ -8,7 +8,7 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error
var tuple: [number, string] = [2, "3"];
for ([a = 1, b = ""] of tuple) {
~~~~~~~~~~~~~~~
!!! error TS2461: Type 'string | number' is not an array type.
!!! error TS2461: Type 'number | string' is not an array type.
~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
~

View File

@@ -1,4 +1,4 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts(3,6): error TS2322: Type 'string | number' is not assignable to type 'string'.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts(3,6): error TS2322: Type 'number | string' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
@@ -7,5 +7,5 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck11.ts(3,6)
var v: string;
for (v of union) { }
~
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number | string' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.

View File

@@ -3,6 +3,6 @@ var union: string | number[];
>union : string | number[]
for (var v of union) { }
>v : string | number
>v : number | string
>union : string | number[]

View File

@@ -1,8 +1,8 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts(2,15): error TS2461: Type 'number | symbol | string[]' is not an array type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts(2,15): error TS2461: Type 'string[] | number | symbol' is not an array type.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck9.ts (1 errors) ====
var union: string | string[] | number | symbol;
for (let v of union) { }
~~~~~
!!! error TS2461: Type 'number | symbol | string[]' is not an array type.
!!! error TS2461: Type 'string[] | number | symbol' is not an array type.

View File

@@ -6,14 +6,14 @@ enum Color { R, G, B }
>B : Color
function f1(x: Color | string) {
>f1 : (x: string | Color) => void
>x : string | Color
>f1 : (x: Color | string) => void
>x : Color | string
>Color : Color
if (typeof x === "number") {
>typeof x === "number" : boolean
>typeof x : string
>x : string | Color
>x : Color | string
>"number" : string
var y = x;
@@ -35,14 +35,14 @@ function f1(x: Color | string) {
}
function f2(x: Color | string | string[]) {
>f2 : (x: string | Color | string[]) => void
>x : string | Color | string[]
>f2 : (x: Color | string | string[]) => void
>x : Color | string | string[]
>Color : Color
if (typeof x === "object") {
>typeof x === "object" : boolean
>typeof x : string
>x : string | Color | string[]
>x : Color | string | string[]
>"object" : string
var y = x;
@@ -55,7 +55,7 @@ function f2(x: Color | string | string[]) {
if (typeof x === "number") {
>typeof x === "number" : boolean
>typeof x : string
>x : string | Color | string[]
>x : Color | string | string[]
>"number" : string
var z = x;
@@ -77,7 +77,7 @@ function f2(x: Color | string | string[]) {
if (typeof x === "string") {
>typeof x === "string" : boolean
>typeof x : string
>x : string | Color | string[]
>x : Color | string | string[]
>"string" : string
var a = x;

View File

@@ -769,22 +769,22 @@ module NonEmptyTypes {
>base2 : typeof base2
var b1 = [baseObj, base2Obj, ifaceObj];
>b1 : (iface | base | base2)[]
>[baseObj, base2Obj, ifaceObj] : (iface | base | base2)[]
>b1 : (base | base2 | iface)[]
>[baseObj, base2Obj, ifaceObj] : (base | base2 | iface)[]
>baseObj : base
>base2Obj : base2
>ifaceObj : iface
var b2 = [base2Obj, baseObj, ifaceObj];
>b2 : (iface | base | base2)[]
>[base2Obj, baseObj, ifaceObj] : (iface | base | base2)[]
>b2 : (base2 | base | iface)[]
>[base2Obj, baseObj, ifaceObj] : (base2 | base | iface)[]
>base2Obj : base2
>baseObj : base
>ifaceObj : iface
var b3 = [baseObj, ifaceObj, base2Obj];
>b3 : (iface | base | base2)[]
>[baseObj, ifaceObj, base2Obj] : (iface | base | base2)[]
>b3 : (base | iface | base2)[]
>[baseObj, ifaceObj, base2Obj] : (base | iface | base2)[]
>baseObj : base
>ifaceObj : iface
>base2Obj : base2

View File

@@ -1,7 +1,7 @@
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(8,5): error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => number'.
Type 'string | number' is not assignable to type 'number'.
Type '() => number | string' is not assignable to type '() => number'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionContextualTyping.ts(14,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
Property '0' is missing in type 'number[]'.
@@ -19,8 +19,8 @@ tests/cases/conformance/expressions/contextualTyping/arrayLiteralExpressionConte
~~~~
!!! error TS2322: Type '[number, number, number, string]' is not assignable to type '[number, number, number]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'.
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
!!! error TS2322: Type '() => number | string' is not assignable to type '() => number'.
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
// In a contextually typed array literal expression containing one or more spread elements,

View File

@@ -23,8 +23,8 @@ var as = [a, b]; // { x: number; y?: number };[]
>b : { x: number; z?: number; }
var bs = [b, a]; // { x: number; z?: number };[]
>bs : ({ x: number; y?: number; } | { x: number; z?: number; })[]
>[b, a] : ({ x: number; y?: number; } | { x: number; z?: number; })[]
>bs : ({ x: number; z?: number; } | { x: number; y?: number; })[]
>[b, a] : ({ x: number; z?: number; } | { x: number; y?: number; })[]
>b : { x: number; z?: number; }
>a : { x: number; y?: number; }

View File

@@ -24,8 +24,8 @@ var a1 = ["hello", "world"]
>"world" : string
var a2 = [, , , ...a0, "hello"];
>a2 : (string | number)[]
>[, , , ...a0, "hello"] : (string | number)[]
>a2 : (number | string)[]
>[, , , ...a0, "hello"] : (number | string)[]
> : undefined
> : undefined
> : undefined
@@ -151,8 +151,8 @@ interface myArray2 extends Array<Number|String> { }
>String : String
var d0 = [1, true, ...temp,]; // has type (string|number|boolean)[]
>d0 : (string | number | boolean)[]
>[1, true, ...temp,] : (string | number | boolean)[]
>d0 : (number | boolean | string)[]
>[1, true, ...temp,] : (number | boolean | string)[]
>1 : number
>true : boolean
>...temp : string
@@ -214,8 +214,8 @@ var d8: number[][] = [[...temp1]]
>temp1 : number[]
var d9 = [[...temp1], ...["hello"]];
>d9 : (string | number[])[]
>[[...temp1], ...["hello"]] : (string | number[])[]
>d9 : (number[] | string)[]
>[[...temp1], ...["hello"]] : (number[] | string)[]
>[...temp1] : number[]
>...temp1 : number
>temp1 : number[]

View File

@@ -24,8 +24,8 @@ var a1 = ["hello", "world"]
>"world" : string
var a2 = [, , , ...a0, "hello"];
>a2 : (string | number)[]
>[, , , ...a0, "hello"] : (string | number)[]
>a2 : (number | string)[]
>[, , , ...a0, "hello"] : (number | string)[]
> : undefined
> : undefined
> : undefined
@@ -140,8 +140,8 @@ interface myArray2 extends Array<Number|String> { }
>String : String
var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[]
>d0 : (string | number | boolean)[]
>[1, true, ...temp, ] : (string | number | boolean)[]
>d0 : (number | boolean | string)[]
>[1, true, ...temp, ] : (number | boolean | string)[]
>1 : number
>true : boolean
>...temp : string
@@ -176,10 +176,10 @@ var d4: myArray2 = [...temp, ...temp1];
>temp1 : number[]
var d5 = [...a2];
>d5 : (string | number)[]
>[...a2] : (string | number)[]
>...a2 : string | number
>a2 : (string | number)[]
>d5 : (number | string)[]
>[...a2] : (number | string)[]
>...a2 : number | string
>a2 : (number | string)[]
var d6 = [...a3];
>d6 : number[]
@@ -201,8 +201,8 @@ var d8: number[][] = [[...temp1]]
>temp1 : number[]
var d9 = [[...temp1], ...["hello"]];
>d9 : (string | number[])[]
>[[...temp1], ...["hello"]] : (string | number[])[]
>d9 : (number[] | string)[]
>[[...temp1], ...["hello"]] : (number[] | string)[]
>[...temp1] : number[]
>...temp1 : number
>temp1 : number[]

View File

@@ -5,18 +5,18 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error
Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'.
Types of property 'pop' are incompatible.
Type '() => string | number | boolean' is not assignable to type '() => number'.
Type 'string | number | boolean' is not assignable to type 'number'.
Type '() => number | string | boolean' is not assignable to type '() => number'.
Type 'number | string | boolean' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(32,5): error TS2322: Type '(number[] | string[])[]' is not assignable to type 'tup'.
Property '0' is missing in type '(number[] | string[])[]'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(33,5): error TS2322: Type 'number[]' is not assignable to type '[number, number, number]'.
Property '0' is missing in type 'number[]'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'.
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error TS2322: Type '(number | string)[]' is not assignable to type 'myArray'.
Types of property 'push' are incompatible.
Type '(...items: (string | number)[]) => number' is not assignable to type '(...items: Number[]) => number'.
Type '(...items: (number | string)[]) => number' is not assignable to type '(...items: Number[]) => number'.
Types of parameters 'items' and 'items' are incompatible.
Type 'string | number' is not assignable to type 'Number'.
Type 'number | string' is not assignable to type 'Number'.
Type 'string' is not assignable to type 'Number'.
Property 'toFixed' is missing in type 'String'.
@@ -49,8 +49,8 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error
~~~~~~~~
!!! error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => number'.
!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'number'.
!!! error TS2322: Type '() => number | string | boolean' is not assignable to type '() => number'.
!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
// The resulting type an array literal expression is determined as follows:
@@ -76,11 +76,11 @@ tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(34,5): error
!!! error TS2322: Property '0' is missing in type 'number[]'.
var c2: myArray = [...temp1, ...temp]; // Error cannot assign (number|string)[] to number[]
~~
!!! error TS2322: Type '(string | number)[]' is not assignable to type 'myArray'.
!!! error TS2322: Type '(number | string)[]' is not assignable to type 'myArray'.
!!! error TS2322: Types of property 'push' are incompatible.
!!! error TS2322: Type '(...items: (string | number)[]) => number' is not assignable to type '(...items: Number[]) => number'.
!!! error TS2322: Type '(...items: (number | string)[]) => number' is not assignable to type '(...items: Number[]) => number'.
!!! error TS2322: Types of parameters 'items' and 'items' are incompatible.
!!! error TS2322: Type 'string | number' is not assignable to type 'Number'.
!!! error TS2322: Type 'number | string' is not assignable to type 'Number'.
!!! error TS2322: Type 'string' is not assignable to type 'Number'.
!!! error TS2322: Property 'toFixed' is missing in type 'String'.

View File

@@ -24,12 +24,12 @@ var z = Date as any as string;
// Should parse as a union type, not a bitwise 'or' of (32 as number) and 'string'
var j = 32 as number|string;
>j : string | number
>32 as number|string : string | number
>j : number | string
>32 as number|string : number | string
>32 : number
j = '';
>j = '' : string
>j : string | number
>j : number | string
>'' : string

View File

@@ -1,7 +1,7 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => number'.
Type 'string | number' is not assignable to type 'number'.
Type '() => number | string' is not assignable to type '() => number'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]'.
Property '0' is missing in type '{}[]'.
@@ -28,8 +28,8 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignme
~~~~~~~~
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'.
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
!!! error TS2322: Type '() => number | string' is not assignable to type '() => number'.
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
emptyObjTuple = emptyObjArray;
~~~~~~~~~~~~~

View File

@@ -1,6 +1,6 @@
=== tests/cases/conformance/async/es6/awaitUnion_es6.ts ===
declare let a: number | string;
>a : string | number
>a : number | string
declare let b: PromiseLike<number> | PromiseLike<string>;
>b : PromiseLike<number> | PromiseLike<string>
@@ -8,7 +8,7 @@ declare let b: PromiseLike<number> | PromiseLike<string>;
>PromiseLike : PromiseLike<T>
declare let c: PromiseLike<number | string>;
>c : PromiseLike<string | number>
>c : PromiseLike<number | string>
>PromiseLike : PromiseLike<T>
declare let d: number | PromiseLike<string>;
@@ -16,29 +16,29 @@ declare let d: number | PromiseLike<string>;
>PromiseLike : PromiseLike<T>
declare let e: number | PromiseLike<number | string>;
>e : number | PromiseLike<string | number>
>e : number | PromiseLike<number | string>
>PromiseLike : PromiseLike<T>
async function f() {
>f : () => Promise<void>
let await_a = await a;
>await_a : string | number
>await_a : number | string
>a : any
let await_b = await b;
>await_b : string | number
>await_b : number | string
>b : any
let await_c = await c;
>await_c : string | number
>await_c : number | string
>c : any
let await_d = await d;
>await_d : string | number
>await_d : number | string
>d : any
let await_e = await e;
>await_e : string | number
>await_e : number | string
>e : any
}

View File

@@ -60,8 +60,8 @@ var r4 = true ? a : b; // typeof a
>b : { x: number; z?: number; }
var r5 = true ? b : a; // typeof b
>r5 : { x: number; y?: number; } | { x: number; z?: number; }
>true ? b : a : { x: number; y?: number; } | { x: number; z?: number; }
>r5 : { x: number; z?: number; } | { x: number; y?: number; }
>true ? b : a : { x: number; z?: number; } | { x: number; y?: number; }
>true : boolean
>b : { x: number; z?: number; }
>a : { x: number; y?: number; }

View File

@@ -98,8 +98,8 @@ var e3 = t3[2]; // any
>2 : number
var e4 = t4[3]; // number
>e4 : number | E1 | E2
>t4[3] : number | E1 | E2
>e4 : E1 | E2 | number
>t4[3] : E1 | E2 | number
>t4 : [E1, E2, number]
>3 : number

View File

@@ -66,8 +66,8 @@ var t5: [C1, F]
>F : F
var e11 = t1[4]; // base
>e11 : base | C
>t1[4] : base | C
>e11 : C | base
>t1[4] : C | base
>t1 : [C, base]
>4 : number
@@ -90,8 +90,8 @@ var e41 = t4[2]; // base1
>2 : number
var e51 = t5[2]; // {}
>e51 : F | C1
>t5[2] : F | C1
>e51 : C1 | F
>t5[2] : C1 | F
>t5 : [C1, F]
>2 : number

View File

@@ -34,36 +34,36 @@ var b1 = [x, y, z];
>z : Z
var b2 = [x, z, y];
>b2 : (X | Y | Z)[]
>[x, z, y] : (X | Y | Z)[]
>b2 : (X | Z | Y)[]
>[x, z, y] : (X | Z | Y)[]
>x : X
>z : Z
>y : Y
var b3 = [y, x, z];
>b3 : (X | Y | Z)[]
>[y, x, z] : (X | Y | Z)[]
>b3 : (Y | X | Z)[]
>[y, x, z] : (Y | X | Z)[]
>y : Y
>x : X
>z : Z
var b4 = [y, z, x];
>b4 : (X | Y | Z)[]
>[y, z, x] : (X | Y | Z)[]
>b4 : (Y | Z | X)[]
>[y, z, x] : (Y | Z | X)[]
>y : Y
>z : Z
>x : X
var b5 = [z, x, y];
>b5 : (X | Y | Z)[]
>[z, x, y] : (X | Y | Z)[]
>b5 : (Z | X | Y)[]
>[z, x, y] : (Z | X | Y)[]
>z : Z
>x : X
>y : Y
var b6 = [z, y, x];
>b6 : (X | Y | Z)[]
>[z, y, x] : (X | Y | Z)[]
>b6 : (Z | Y | X)[]
>[z, y, x] : (Z | Y | X)[]
>z : Z
>y : Y
>x : X

View File

@@ -163,8 +163,8 @@ xa[1].foo(1, 2, ...a, "abc");
>xa : X[]
>1 : number
>foo : (x: number, y: number, ...z: string[]) => any
>...[1, 2, "abc"] : string | number
>[1, 2, "abc"] : (string | number)[]
>...[1, 2, "abc"] : number | string
>[1, 2, "abc"] : (number | string)[]
>1 : number
>2 : number
>"abc" : string

View File

@@ -164,8 +164,8 @@ xa[1].foo(1, 2, ...a, "abc");
>xa : X[]
>1 : number
>foo : (x: number, y: number, ...z: string[]) => any
>...[1, 2, "abc"] : string | number
>[1, 2, "abc"] : (string | number)[]
>...[1, 2, "abc"] : number | string
>[1, 2, "abc"] : (number | string)[]
>1 : number
>2 : number
>"abc" : string

View File

@@ -8,11 +8,12 @@ tests/cases/conformance/types/tuple/castingTuple.ts(28,10): error TS2352: Neithe
tests/cases/conformance/types/tuple/castingTuple.ts(29,10): error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other.
Types of property '0' are incompatible.
Type 'C' is not assignable to type 'A'.
Property 'a' is missing in type 'C'.
tests/cases/conformance/types/tuple/castingTuple.ts(30,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'.
tests/cases/conformance/types/tuple/castingTuple.ts(30,14): error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => number'.
Type 'string | number' is not assignable to type 'number'.
Type '() => number | string' is not assignable to type '() => number'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/tuple/castingTuple.ts(31,1): error TS2304: Cannot find name 't4'.
@@ -61,14 +62,15 @@ tests/cases/conformance/types/tuple/castingTuple.ts(31,1): error TS2304: Cannot
!!! error TS2352: Neither type '[C, D]' nor type '[A, I]' is assignable to the other.
!!! error TS2352: Types of property '0' are incompatible.
!!! error TS2352: Type 'C' is not assignable to type 'A'.
!!! error TS2352: Property 'a' is missing in type 'C'.
var array1 = <number[]>numStrTuple;
~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'.
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2352: Neither type '[number, string]' nor type 'number[]' is assignable to the other.
!!! error TS2352: Types of property 'pop' are incompatible.
!!! error TS2352: Type '() => string | number' is not assignable to type '() => number'.
!!! error TS2352: Type 'string | number' is not assignable to type 'number'.
!!! error TS2352: Type '() => number | string' is not assignable to type '() => number'.
!!! error TS2352: Type 'number | string' is not assignable to type 'number'.
!!! error TS2352: Type 'string' is not assignable to type 'number'.
t4[2] = 10;
~~

View File

@@ -17,9 +17,9 @@ declare function foo<T>(obj: I<T>): T
>T : T
foo({
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[]
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | (() => void) | boolean | number | number[]
>foo : <T>(obj: I<T>) => T
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; 0: () => void; p: string; }
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | (() => void) | boolean | number | number[]; 0: () => void; p: string; }
p: "",
>p : string

View File

@@ -17,9 +17,9 @@ declare function foo<T>(obj: I<T>): T
>T : T
foo({
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | number | boolean | (() => void) | number[]
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : string | (() => void) | boolean | number | number[]
>foo : <T>(obj: I<T>) => T
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | number | boolean | (() => void) | number[]; 0: () => void; p: string; }
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: string]: string | (() => void) | boolean | number | number[]; 0: () => void; p: string; }
p: "",
>p : string

View File

@@ -17,9 +17,9 @@ declare function foo<T>(obj: I<T>): T
>T : T
foo({
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[]
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : (() => void) | number | number[]
>foo : <T>(obj: I<T>) => T
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: number | (() => void) | number[]; 0: () => void; p: string; }
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: (() => void) | number | number[]; 0: () => void; p: string; }
p: "",
>p : string

View File

@@ -17,9 +17,9 @@ declare function foo<T>(obj: I<T>): T
>T : T
foo({
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : number | (() => void) | number[]
>foo({ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]}) : (() => void) | number | number[]
>foo : <T>(obj: I<T>) => T
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: number | (() => void) | number[]; 0: () => void; p: string; }
>{ p: "", 0: () => { }, ["hi" + "bye"]: true, [0 + 1]: 0, [+"hi"]: [0]} : { [x: number]: (() => void) | number | number[]; 0: () => void; p: string; }
p: "",
>p : string

View File

@@ -1,9 +1,9 @@
tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'string | number' is not assignable to type 'boolean'.
Type 'string' is not assignable to type 'boolean'.
tests/cases/compiler/conditionalExpression1.ts(1,5): error TS2322: Type 'number | string' is not assignable to type 'boolean'.
Type 'number' is not assignable to type 'boolean'.
==== tests/cases/compiler/conditionalExpression1.ts (1 errors) ====
var x: boolean = (true ? 1 : ""); // should be an error
~
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
!!! error TS2322: Type 'number | string' is not assignable to type 'boolean'.
!!! error TS2322: Type 'number' is not assignable to type 'boolean'.

View File

@@ -45,7 +45,7 @@ var result1 = true ? x : a;
//Expr1 and Expr2 are literals
true ? {} : 1;
>true ? {} : 1 : number | {}
>true ? {} : 1 : {} | number
>true : boolean
>{} : {}
>1 : number
@@ -63,8 +63,8 @@ true ? { a: 1 } : { a: 2, b: 'string' };
>'string' : string
var result2 = true ? {} : 1;
>result2 : number | {}
>true ? {} : 1 : number | {}
>result2 : {} | number
>true ? {} : 1 : {} | number
>true : boolean
>{} : {}
>1 : number
@@ -111,14 +111,14 @@ var result4: (t: A) => any = true ? (m) => m.propertyX : (n) => n.propertyA;
//Cond ? Expr1 : Expr2, Expr2 is supertype
//Be Not contextually typed
true ? a : x;
>true ? a : x : X | A
>true ? a : x : A | X
>true : boolean
>a : A
>x : X
var result5 = true ? a : x;
>result5 : X | A
>true ? a : x : X | A
>result5 : A | X
>true ? a : x : A | X
>true : boolean
>a : A
>x : X
@@ -218,7 +218,7 @@ var result10: (t: X) => any = true ? (m) => m.propertyX1 : (n) => n.propertyX2;
//Expr1 and Expr2 are literals
var result11: any = true ? 1 : 'string';
>result11 : any
>true ? 1 : 'string' : string | number
>true ? 1 : 'string' : number | string
>true : boolean
>1 : number
>'string' : string

View File

@@ -87,24 +87,24 @@ var a = baz(1, 1, g); // Should be number
>g : <T>(x: T, y: T) => T
var b: number | string;
>b : string | number
>b : number | string
var b = foo(g); // Should be number | string
>b : string | number
>foo(g) : string | number
>b : number | string
>foo(g) : number | string
>foo : <T>(cb: (x: number, y: string) => T) => T
>g : <T>(x: T, y: T) => T
var b = bar(1, "one", g); // Should be number | string
>b : string | number
>bar(1, "one", g) : string | number
>b : number | string
>bar(1, "one", g) : number | string
>bar : <T, U, V>(x: T, y: U, cb: (x: T, y: U) => V) => V
>1 : number
>"one" : string
>g : <T>(x: T, y: T) => T
var b = bar("one", 1, g); // Should be number | string
>b : string | number
>b : number | string
>bar("one", 1, g) : string | number
>bar : <T, U, V>(x: T, y: U, cb: (x: T, y: U) => V) => V
>"one" : string
@@ -112,11 +112,11 @@ var b = bar("one", 1, g); // Should be number | string
>g : <T>(x: T, y: T) => T
var b = baz(b, b, g); // Should be number | string
>b : string | number
>baz(b, b, g) : string | number
>b : number | string
>baz(b, b, g) : number | string
>baz : <T, U>(x: T, y: T, cb: (x: T, y: T) => U) => U
>b : string | number
>b : string | number
>b : number | string
>b : number | string
>g : <T>(x: T, y: T) => T
var d: number[] | string[];
@@ -138,7 +138,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) : number[] | string[]
>bar("one", 1, h) : string[] | number[]
>bar : <T, U, V>(x: T, y: U, cb: (x: T, y: U) => V) => V
>"one" : string
>1 : number

View File

@@ -1,9 +1,9 @@
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(3,5): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
Types of property 'pop' are incompatible.
Type '() => string | number | boolean' is not assignable to type '() => string | number'.
Type 'string | number | boolean' is not assignable to type 'string | number'.
Type 'boolean' is not assignable to type 'string | number'.
Type 'boolean' is not assignable to type 'number'.
Type '() => number | string | boolean' is not assignable to type '() => number | string'.
Type 'number | string | boolean' is not assignable to type 'number | string'.
Type 'boolean' is not assignable to type 'number | string'.
Type 'boolean' is not assignable to type 'string'.
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(15,1): error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(18,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]'.
Types of property '0' are incompatible.
@@ -31,10 +31,10 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23
~~~~~~~~~~~~
!!! error TS2322: Type '[number, string, boolean]' is not assignable to type '[number, string]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number | boolean' is not assignable to type '() => string | number'.
!!! error TS2322: Type 'string | number | boolean' is not assignable to type 'string | number'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string | number'.
!!! error TS2322: Type 'boolean' is not assignable to type 'number'.
!!! error TS2322: Type '() => number | string | boolean' is not assignable to type '() => number | string'.
!!! error TS2322: Type 'number | string | boolean' is not assignable to type 'number | string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'number | string'.
!!! error TS2322: Type 'boolean' is not assignable to type 'string'.
var numStrBoolTuple: [number, string, boolean] = [5, "foo", true];
var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5];
var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]];

View File

@@ -1,5 +1,5 @@
tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'.
Type 'number | { id: number; }' is not assignable to type '{ id: number; }'.
tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '({ id: number; } | number)[]' is not assignable to type '{ id: number; }[]'.
Type '{ id: number; } | number' is not assignable to type '{ id: number; }'.
Type 'number' is not assignable to type '{ id: number; }'.
Property 'id' is missing in type 'Number'.
@@ -7,7 +7,7 @@ tests/cases/compiler/contextualTyping21.ts(1,36): error TS2322: Type '(number |
==== tests/cases/compiler/contextualTyping21.ts (1 errors) ====
var foo:{id:number;}[] = [{id:1}]; foo = [{id:1}, 1];
~~~
!!! error TS2322: Type '(number | { id: number; })[]' is not assignable to type '{ id: number; }[]'.
!!! error TS2322: Type 'number | { id: number; }' is not assignable to type '{ id: number; }'.
!!! error TS2322: Type '({ id: number; } | number)[]' is not assignable to type '{ id: number; }[]'.
!!! error TS2322: Type '{ id: number; } | number' is not assignable to type '{ id: number; }'.
!!! error TS2322: Type 'number' is not assignable to type '{ id: number; }'.
!!! error TS2322: Property 'id' is missing in type 'Number'.

View File

@@ -1,11 +1,11 @@
tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
Type 'string | number' is not assignable to type 'number'.
tests/cases/compiler/contextualTyping30.ts(1,37): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/contextualTyping30.ts (1 errors) ====
function foo(param:number[]){}; foo([1, "a"]);
~~~~~~~~
!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'string | number' is not assignable to type 'number'.
!!! error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'number | string' is not assignable to type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.

View File

@@ -1,6 +1,6 @@
tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(number | Date)[]' is not assignable to type 'I'.
tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Type '(Date | number)[]' is not assignable to type 'I'.
Index signatures are incompatible.
Type 'number | Date' is not assignable to type 'Date'.
Type 'Date | number' is not assignable to type 'Date'.
Type 'number' is not assignable to type 'Date'.
Property 'toDateString' is missing in type 'Number'.
@@ -12,9 +12,9 @@ tests/cases/compiler/contextualTypingOfArrayLiterals1.ts(5,5): error TS2322: Typ
var x3: I = [new Date(), 1];
~~
!!! error TS2322: Type '(number | Date)[]' is not assignable to type 'I'.
!!! error TS2322: Type '(Date | number)[]' is not assignable to type 'I'.
!!! error TS2322: Index signatures are incompatible.
!!! error TS2322: Type 'number | Date' is not assignable to type 'Date'.
!!! error TS2322: Type 'Date | number' is not assignable to type 'Date'.
!!! error TS2322: Type 'number' is not assignable to type 'Date'.
!!! error TS2322: Property 'toDateString' is missing in type 'Number'.
var r2 = x3[1];

View File

@@ -29,4 +29,4 @@ declare class c {
declare var x: (() => c)[];
declare var y: (() => c)[];
declare var k: (() => c) | string;
declare var l: string | (() => c);
declare var l: (() => c) | string;

View File

@@ -23,9 +23,9 @@ var y = [() => new c()];
>c : typeof c
var k: (() => c) | string = (() => new c()) || "";
>k : string | (() => c)
>k : (() => c) | string
>c : c
>(() => new c()) || "" : string | (() => c)
>(() => new c()) || "" : (() => c) | string
>(() => new c()) : () => c
>() => new c() : () => c
>new c() : c
@@ -33,8 +33,8 @@ var k: (() => c) | string = (() => new c()) || "";
>"" : string
var l = (() => new c()) || "";
>l : string | (() => c)
>(() => new c()) || "" : string | (() => c)
>l : (() => c) | string
>(() => new c()) || "" : (() => c) | string
>(() => new c()) : () => c
>() => new c() : () => c
>new c() : c

View File

@@ -47,7 +47,7 @@ module M {
>M : typeof M
export type W = Window | string;
>W : string | Window
>W : Window | string
>Window : Window
export module N {
@@ -57,7 +57,7 @@ module M {
>Window : Window
export var p: W;
>p : string | Window
>W : string | Window
>p : Window | string
>W : Window | string
}
}

View File

@@ -15,4 +15,4 @@ function foo(_a) {
//// [declarationEmitDestructuring3.d.ts]
declare function bar([x, z, ...w]: any[]): void;
declare function foo([x, ...y]?: (string | number | boolean)[]): void;
declare function foo([x, ...y]?: (number | string | boolean)[]): void;

View File

@@ -6,10 +6,10 @@ function bar([x, z, ...w]) { }
>w : any[]
function foo([x, ...y] = [1, "string", true]) { }
>foo : ([x, ...y]?: (string | number | boolean)[]) => void
>x : string | number | boolean
>y : (string | number | boolean)[]
>[1, "string", true] : (string | number | boolean)[]
>foo : ([x, ...y]?: (number | string | boolean)[]) => void
>x : number | string | boolean
>y : (number | string | boolean)[]
>[1, "string", true] : (number | string | boolean)[]
>1 : number
>"string" : string
>true : boolean

View File

@@ -23,6 +23,6 @@ var x3 = a[0], y3 = a[1], z3 = a[2]; // emit x3, y3, z3
declare var x: number;
declare var x1: number, y1: string;
declare var z1: number;
declare var a: (string | number)[];
declare var x2: string | number;
declare var x3: string | number, y3: string | number, z3: string | number;
declare var a: (number | string)[];
declare var x2: number | string;
declare var x3: number | string, y3: number | string, z3: number | string;

View File

@@ -1,7 +1,7 @@
=== tests/cases/compiler/declarationEmitDestructuringArrayPattern1.ts ===
var [] = [1, "hello"]; // Dont emit anything
>[1, "hello"] : (string | number)[]
>[1, "hello"] : (number | string)[]
>1 : number
>"hello" : string
@@ -28,18 +28,18 @@ var [, , z1] = [0, 1, 2]; // emit z1: number
>2 : number
var a = [1, "hello"];
>a : (string | number)[]
>[1, "hello"] : (string | number)[]
>a : (number | string)[]
>[1, "hello"] : (number | string)[]
>1 : number
>"hello" : string
var [x2] = a; // emit x2: number | string
>x2 : string | number
>a : (string | number)[]
>x2 : number | string
>a : (number | string)[]
var [x3, y3, z3] = a; // emit x3, y3, z3
>x3 : string | number
>y3 : string | number
>z3 : string | number
>a : (string | number)[]
>x3 : number | string
>y3 : number | string
>z3 : number | string
>a : (number | string)[]

View File

@@ -25,7 +25,7 @@ declare var x11: number, y11: string;
declare var a11: any, b11: any, c11: any;
declare var a2: number, b2: string, x12: number, c2: boolean;
declare var x13: number, y13: string;
declare var a3: (string | number)[], b3: {
declare var a3: (number | string)[], b3: {
x: number;
y: string;
};

View File

@@ -56,10 +56,10 @@ var [x13, y13] = [1, "hello"];
>"hello" : string
var [a3, b3] = [[x13, y13], { x: x13, y: y13 }];
>a3 : (string | number)[]
>a3 : (number | string)[]
>b3 : { x: number; y: string; }
>[[x13, y13], { x: x13, y: y13 }] : [(string | number)[], { x: number; y: string; }]
>[x13, y13] : (string | number)[]
>[[x13, y13], { x: x13, y: y13 }] : [(number | string)[], { x: number; y: string; }]
>[x13, y13] : (number | string)[]
>x13 : number
>y13 : string
>{ x: x13, y: y13 } : { x: number; y: string; }

View File

@@ -25,7 +25,7 @@ declare var a5: number[];
declare var x14: number, a6: number[];
declare var x15: number, y15: number, a7: number[];
declare var x16: number, y16: number, z16: number, a8: number[];
declare var a9: (string | number | boolean)[];
declare var x17: string | number | boolean, a10: (string | number | boolean)[];
declare var x18: string | number | boolean, y18: string | number | boolean, a12: (string | number | boolean)[];
declare var x19: string | number | boolean, y19: string | number | boolean, z19: string | number | boolean, a13: (string | number | boolean)[];
declare var a9: (number | string | boolean)[];
declare var x17: number | string | boolean, a10: (number | string | boolean)[];
declare var x18: number | string | boolean, y18: number | string | boolean, a12: (number | string | boolean)[];
declare var x19: number | string | boolean, y19: number | string | boolean, z19: number | string | boolean, a13: (number | string | boolean)[];

View File

@@ -34,35 +34,35 @@ var [x16, y16, z16, ...a8] = [1, 2, 3];
>3 : number
var [...a9] = [1, "hello", true];
>a9 : (string | number | boolean)[]
>[1, "hello", true] : (string | number | boolean)[]
>a9 : (number | string | boolean)[]
>[1, "hello", true] : (number | string | boolean)[]
>1 : number
>"hello" : string
>true : boolean
var [x17, ...a10] = [1, "hello", true];
>x17 : string | number | boolean
>a10 : (string | number | boolean)[]
>[1, "hello", true] : (string | number | boolean)[]
>x17 : number | string | boolean
>a10 : (number | string | boolean)[]
>[1, "hello", true] : (number | string | boolean)[]
>1 : number
>"hello" : string
>true : boolean
var [x18, y18, ...a12] = [1, "hello", true];
>x18 : string | number | boolean
>y18 : string | number | boolean
>a12 : (string | number | boolean)[]
>[1, "hello", true] : (string | number | boolean)[]
>x18 : number | string | boolean
>y18 : number | string | boolean
>a12 : (number | string | boolean)[]
>[1, "hello", true] : (number | string | boolean)[]
>1 : number
>"hello" : string
>true : boolean
var [x19, y19, z19, ...a13] = [1, "hello", true];
>x19 : string | number | boolean
>y19 : string | number | boolean
>z19 : string | number | boolean
>a13 : (string | number | boolean)[]
>[1, "hello", true] : (string | number | boolean)[]
>x19 : number | string | boolean
>y19 : number | string | boolean
>z19 : number | string | boolean
>a13 : (number | string | boolean)[]
>[1, "hello", true] : (number | string | boolean)[]
>1 : number
>"hello" : string
>true : boolean

View File

@@ -148,8 +148,8 @@ var [,,,...c10] = [1, 2, 3, 4, "hello"];
> : undefined
> : undefined
> : undefined
>c10 : (string | number)[]
>[1, 2, 3, 4, "hello"] : (string | number)[]
>c10 : (number | string)[]
>[1, 2, 3, 4, "hello"] : (number | string)[]
>1 : number
>2 : number
>3 : number
@@ -157,10 +157,10 @@ var [,,,...c10] = [1, 2, 3, 4, "hello"];
>"hello" : string
var [c11, c12, ...c13] = [1, 2, "string"];
>c11 : string | number
>c12 : string | number
>c13 : (string | number)[]
>[1, 2, "string"] : (string | number)[]
>c11 : number | string
>c12 : number | string
>c13 : (number | string)[]
>[1, 2, "string"] : (number | string)[]
>1 : number
>2 : number
>"string" : string

View File

@@ -149,8 +149,8 @@ var [,,,...c10] = [1, 2, 3, 4, "hello"];
> : undefined
> : undefined
> : undefined
>c10 : (string | number)[]
>[1, 2, 3, 4, "hello"] : (string | number)[]
>c10 : (number | string)[]
>[1, 2, 3, 4, "hello"] : (number | string)[]
>1 : number
>2 : number
>3 : number
@@ -158,10 +158,10 @@ var [,,,...c10] = [1, 2, 3, 4, "hello"];
>"hello" : string
var [c11, c12, ...c13] = [1, 2, "string"];
>c11 : string | number
>c12 : string | number
>c13 : (string | number)[]
>[1, 2, "string"] : (string | number)[]
>c11 : number | string
>c12 : number | string
>c13 : (number | string)[]
>[1, 2, "string"] : (number | string)[]
>1 : number
>2 : number
>"string" : string

View File

@@ -4,8 +4,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(7,29): error TS1005: ',' expected.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(8,4): error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'.
Types of property 'pop' are incompatible.
Type '() => string | number | string[][]' is not assignable to type '() => number | string[][]'.
Type 'string | number | string[][]' is not assignable to type 'number | string[][]'.
Type '() => number | string[][] | string' is not assignable to type '() => number | string[][]'.
Type 'number | string[][] | string' is not assignable to type 'number | string[][]'.
Type 'string' is not assignable to type 'number | string[][]'.
Type 'string' is not assignable to type 'string[][]'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(16,8): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
@@ -26,10 +26,10 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(37,4): error TS2345: Argument of type '{ z: boolean; }' is not assignable to parameter of type '{ z?: number; }'.
Types of property 'z' are incompatible.
Type 'boolean' is not assignable to type 'number'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(38,4): error TS2345: Argument of type '{ b: boolean; }' is not assignable to parameter of type '{ b: string | number; }'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(38,4): error TS2345: Argument of type '{ b: boolean; }' is not assignable to parameter of type '{ b: number | string; }'.
Types of property 'b' are incompatible.
Type 'boolean' is not assignable to type 'string | number'.
Type 'boolean' is not assignable to type 'number'.
Type 'boolean' is not assignable to type 'number | string'.
Type 'boolean' is not assignable to type 'string'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(39,4): error TS2345: Argument of type '[number, number, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'.
Types of property '2' are incompatible.
Type 'boolean' is not assignable to type '[[any]]'.
@@ -73,8 +73,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '[number, number, string[][], string]' is not assignable to parameter of type '[number, number, string[][]]'.
!!! error TS2345: Types of property 'pop' are incompatible.
!!! error TS2345: Type '() => string | number | string[][]' is not assignable to type '() => number | string[][]'.
!!! error TS2345: Type 'string | number | string[][]' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type '() => number | string[][] | string' is not assignable to type '() => number | string[][]'.
!!! error TS2345: Type 'number | string[][] | string' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type 'string' is not assignable to type 'number | string[][]'.
!!! error TS2345: Type 'string' is not assignable to type 'string[][]'.
@@ -135,10 +135,10 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration2.ts(
!!! error TS2345: Type 'boolean' is not assignable to type 'number'.
c3({ b: true }); // Error, implied type is { b: number|string }.
~~~~~~~~~~~
!!! error TS2345: Argument of type '{ b: boolean; }' is not assignable to parameter of type '{ b: string | number; }'.
!!! error TS2345: Argument of type '{ b: boolean; }' is not assignable to parameter of type '{ b: number | string; }'.
!!! error TS2345: Types of property 'b' are incompatible.
!!! error TS2345: Type 'boolean' is not assignable to type 'string | number'.
!!! error TS2345: Type 'boolean' is not assignable to type 'number'.
!!! error TS2345: Type 'boolean' is not assignable to type 'number | string'.
!!! error TS2345: Type 'boolean' is not assignable to type 'string'.
c5([1, 2, false, true]); // Error, implied type is [any, any, [[any]]]
~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '[number, number, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'.

View File

@@ -23,8 +23,8 @@ type stringOrNumArray = Array<String|Number>;
>Number : Number
function a1(...x: (number|string)[]) { }
>a1 : (...x: (string | number)[]) => void
>x : (string | number)[]
>a1 : (...x: (number | string)[]) => void
>x : (number | string)[]
function a2(...a) { }
>a2 : (...a: any[]) => void
@@ -75,8 +75,8 @@ var array = [1, 2, 3];
>3 : number
var array2 = [true, false, "hello"];
>array2 : (string | boolean)[]
>[true, false, "hello"] : (string | boolean)[]
>array2 : (boolean | string)[]
>[true, false, "hello"] : (boolean | string)[]
>true : boolean
>false : boolean
>"hello" : string
@@ -90,7 +90,7 @@ a2([...array]);
a1(...array);
>a1(...array) : void
>a1 : (...x: (string | number)[]) => void
>a1 : (...x: (number | string)[]) => void
>...array : number
>array : number[]
@@ -109,7 +109,7 @@ a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]
a10([1, 2, [["string"]], false, true]); // Parameter type is any[]
>a10([1, 2, [["string"]], false, true]) : void
>a10 : ([a, b, [[c]], ...x]: Iterable<any>) => void
>[1, 2, [["string"]], false, true] : (number | boolean | string[][])[]
>[1, 2, [["string"]], false, true] : (number | string[][] | boolean)[]
>1 : number
>2 : number
>[["string"]] : string[][]

View File

@@ -23,8 +23,8 @@ type stringOrNumArray = Array<String|Number>;
>Number : Number
function a1(...x: (number|string)[]) { }
>a1 : (...x: (string | number)[]) => void
>x : (string | number)[]
>a1 : (...x: (number | string)[]) => void
>x : (number | string)[]
function a2(...a) { }
>a2 : (...a: any[]) => void
@@ -75,8 +75,8 @@ var array = [1, 2, 3];
>3 : number
var array2 = [true, false, "hello"];
>array2 : (string | boolean)[]
>[true, false, "hello"] : (string | boolean)[]
>array2 : (boolean | string)[]
>[true, false, "hello"] : (boolean | string)[]
>true : boolean
>false : boolean
>"hello" : string
@@ -90,7 +90,7 @@ a2([...array]);
a1(...array);
>a1(...array) : void
>a1 : (...x: (string | number)[]) => void
>a1 : (...x: (number | string)[]) => void
>...array : number
>array : number[]
@@ -109,7 +109,7 @@ a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]
a10([1, 2, [["string"]], false, true]); // Parameter type is any[]
>a10([1, 2, [["string"]], false, true]) : void
>a10 : ([a, b, [[c]], ...x]: Iterable<any>) => void
>[1, 2, [["string"]], false, true] : (number | boolean | string[][])[]
>[1, 2, [["string"]], false, true] : (number | string[][] | boolean)[]
>1 : number
>2 : number
>[["string"]] : string[][]

View File

@@ -1,7 +1,7 @@
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(11,13): error TS2370: A rest parameter must be of an array type.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(13,13): error TS2370: A rest parameter must be of an array type.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(20,19): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string | number'.
Type 'boolean' is not assignable to type 'number'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(20,19): error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number | string'.
Type 'boolean' is not assignable to type 'string'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(21,7): error TS2304: Cannot find name 'array2'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(22,4): error TS2345: Argument of type '[number, number, string, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'.
Types of property '2' are incompatible.
@@ -9,8 +9,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(
Property '0' is missing in type 'String'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(23,4): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]]]'.
Property '2' is missing in type '[number, number]'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(24,4): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
Type 'string | number' is not assignable to type 'number'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(24,4): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(29,24): error TS1005: ',' expected.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(34,22): error TS2304: Cannot find name 'E1'.
@@ -43,8 +43,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(
a1(1, 2, "hello", true); // Error, parameter type is (number|string)[]
~~~~
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'string | number'.
!!! error TS2345: Type 'boolean' is not assignable to type 'number'.
!!! error TS2345: Argument of type 'boolean' is not assignable to parameter of type 'number | string'.
!!! error TS2345: Type 'boolean' is not assignable to type 'string'.
a1(...array2); // Error parameter type is (number|string)[]
~~~~~~
!!! error TS2304: Cannot find name 'array2'.
@@ -60,8 +60,8 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts(
!!! error TS2345: Property '2' is missing in type '[number, number]'.
a6([1, 2, "string"]); // Error, parameter type is number[]
~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'string | number' is not assignable to type 'number'.
!!! error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'number | string' is not assignable to type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.

View File

@@ -84,8 +84,8 @@ var [...c1] = [1,2,3];
>3 : number
var [...c2] = [1,2,3, "string"];
>c2 : (string | number)[]
>[1,2,3, "string"] : (string | number)[]
>c2 : (number | string)[]
>[1,2,3, "string"] : (number | string)[]
>1 : number
>2 : number
>3 : number
@@ -113,9 +113,9 @@ var temp1 = [true, false, true]
>true : boolean
var [d3, d4] = [1, "string", ...temp1];
>d3 : string | number | boolean
>d4 : string | number | boolean
>[1, "string", ...temp1] : (string | number | boolean)[]
>d3 : number | string | boolean
>d4 : number | string | boolean
>[1, "string", ...temp1] : (number | string | boolean)[]
>1 : number
>"string" : string
>...temp1 : boolean

View File

@@ -84,8 +84,8 @@ var [...c1] = [1,2,3];
>3 : number
var [...c2] = [1,2,3, "string"];
>c2 : (string | number)[]
>[1,2,3, "string"] : (string | number)[]
>c2 : (number | string)[]
>[1,2,3, "string"] : (number | string)[]
>1 : number
>2 : number
>3 : number
@@ -113,9 +113,9 @@ var temp1 = [true, false, true]
>true : boolean
var [d3, d4] = [1, "string", ...temp1];
>d3 : string | number | boolean
>d4 : string | number | boolean
>[1, "string", ...temp1] : (string | number | boolean)[]
>d3 : number | string | boolean
>d4 : number | string | boolean
>[1, "string", ...temp1] : (number | string | boolean)[]
>1 : number
>"string" : string
>...temp1 : boolean

View File

@@ -172,8 +172,8 @@ enum E9 {
// (refer to .js to validate)
// Enum constant members are propagated
var doNotPropagate = [
>doNotPropagate : (E3 | E4 | E7 | E8)[]
>[ E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z] : (E3 | E4 | E7 | E8)[]
>doNotPropagate : (E8 | E7 | E4 | E3)[]
>[ E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z] : (E8 | E7 | E4 | E3)[]
E8.B, E7.A, E4.Z, E3.X, E3.Y, E3.Z
>E8.B : E8
@@ -198,8 +198,8 @@ var doNotPropagate = [
];
// Enum computed members are not propagated
var doPropagate = [
>doPropagate : (E5 | E6 | E9)[]
>[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : (E5 | E6 | E9)[]
>doPropagate : (E9 | E6 | E5)[]
>[ E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C] : (E9 | E6 | E5)[]
E9.A, E9.B, E6.B, E6.C, E6.A, E5.A, E5.B, E5.C
>E9.A : E9

View File

@@ -1,4 +1,4 @@
tests/cases/conformance/es6/for-ofStatements/for-of11.ts(2,6): error TS2322: Type 'string | number' is not assignable to type 'string'.
tests/cases/conformance/es6/for-ofStatements/for-of11.ts(2,6): error TS2322: Type 'number | string' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
@@ -6,5 +6,5 @@ tests/cases/conformance/es6/for-ofStatements/for-of11.ts(2,6): error TS2322: Typ
var v: string;
for (v of [0, ""]) { }
~
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number | string' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.

View File

@@ -1,4 +1,4 @@
tests/cases/conformance/es6/for-ofStatements/for-of12.ts(2,6): error TS2322: Type 'string | number' is not assignable to type 'string'.
tests/cases/conformance/es6/for-ofStatements/for-of12.ts(2,6): error TS2322: Type 'number | string' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
@@ -6,5 +6,5 @@ tests/cases/conformance/es6/for-ofStatements/for-of12.ts(2,6): error TS2322: Typ
var v: string;
for (v of [0, ""].values()) { }
~
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type 'number | string' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.

View File

@@ -324,7 +324,7 @@ class AnotherClass { private x }
var f7: (x: number) => string | number = x => { // should be (x: number) => number | string
>f7 : (x: number) => string | number
>x : number
>x => { // should be (x: number) => number | string if (x < 0) { return x; } return x.toString();} : (x: number) => string | number
>x => { // should be (x: number) => number | string if (x < 0) { return x; } return x.toString();} : (x: number) => number | string
>x : number
if (x < 0) { return x; }

View File

@@ -2198,8 +2198,8 @@ var x222 = (<Array<Base>>undefined) || [d1, d2];
>d2 : Derived2
var x223 = (<{ [n: number]: Base; }>undefined) || [d1, d2];
>x223 : (Derived1 | Derived2)[] | { [n: number]: Base; }
>(<{ [n: number]: Base; }>undefined) || [d1, d2] : (Derived1 | Derived2)[] | { [n: number]: Base; }
>x223 : { [n: number]: Base; } | (Derived1 | Derived2)[]
>(<{ [n: number]: Base; }>undefined) || [d1, d2] : { [n: number]: Base; } | (Derived1 | Derived2)[]
>(<{ [n: number]: Base; }>undefined) : { [n: number]: Base; }
><{ [n: number]: Base; }>undefined : { [n: number]: Base; }
>n : number

View File

@@ -49,7 +49,7 @@ _.all([true, 1, null, 'yes'], _.identity);
>_.all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => boolean
>_ : Underscore.Static
>all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => boolean
>[true, 1, null, 'yes'] : (string | number | boolean)[]
>[true, 1, null, 'yes'] : (boolean | number | string)[]
>true : boolean
>1 : number
>null : null

View File

@@ -46,10 +46,10 @@ var r3 = foo<number[]>([]); // number[]
>[] : undefined[]
var r4 = foo([1, '']); // {}[]
>r4 : (string | number)[]
>foo([1, '']) : (string | number)[]
>r4 : (number | string)[]
>foo([1, '']) : (number | string)[]
>foo : <T>(t: T) => T
>[1, ''] : (string | number)[]
>[1, ''] : (number | string)[]
>1 : number
>'' : string
@@ -57,7 +57,7 @@ var r5 = foo<any[]>([1, '']); // any[]
>r5 : any[]
>foo<any[]>([1, '']) : any[]
>foo : <T>(t: T) => T
>[1, ''] : (string | number)[]
>[1, ''] : (number | string)[]
>1 : number
>'' : string
@@ -66,7 +66,7 @@ var r6 = foo<Object[]>([1, '']); // Object[]
>foo<Object[]>([1, '']) : Object[]
>foo : <T>(t: T) => T
>Object : Object
>[1, ''] : (string | number)[]
>[1, ''] : (number | string)[]
>1 : number
>'' : string

View File

@@ -42,12 +42,12 @@ declare var _: Underscore.Static;
>Static : Underscore.Static
var r = _.all([true, 1, null, 'yes'], _.identity);
>r : string | number | boolean
>_.all([true, 1, null, 'yes'], _.identity) : string | number | boolean
>r : boolean | number | string
>_.all([true, 1, null, 'yes'], _.identity) : boolean | number | string
>_.all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
>_ : Underscore.Static
>all : <T>(list: T[], iterator?: Underscore.Iterator<T, boolean>, context?: any) => T
>[true, 1, null, 'yes'] : (string | number | boolean)[]
>[true, 1, null, 'yes'] : (boolean | number | string)[]
>true : boolean
>1 : number
>null : null

View File

@@ -1,5 +1,5 @@
tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'.
Type 'string | number' is not assignable to type 'string'.
tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'string[]'.
Type 'number | string' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
@@ -14,8 +14,8 @@ tests/cases/compiler/heterogeneousArrayAndOverloads.ts(9,19): error TS2345: Argu
this.test([]);
this.test([1, 2, "hi", 5]); // Error
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string[]'.
!!! error TS2345: Type 'string | number' is not assignable to type 'string'.
!!! error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'string[]'.
!!! error TS2345: Type 'number | string' is not assignable to type 'string'.
!!! error TS2345: Type 'number' is not assignable to type 'string'.
}
}

View File

@@ -2,8 +2,8 @@
// type of an array is the best common type of its elements (plus its contextual type if it exists)
var a = [1, '']; // {}[]
>a : (string | number)[]
>[1, ''] : (string | number)[]
>a : (number | string)[]
>[1, ''] : (number | string)[]
>1 : number
>'' : string
@@ -14,21 +14,21 @@ var b = [1, null]; // number[]
>null : null
var c = [1, '', null]; // {}[]
>c : (string | number)[]
>[1, '', null] : (string | number)[]
>c : (number | string)[]
>[1, '', null] : (number | string)[]
>1 : number
>'' : string
>null : null
var d = [{}, 1]; // {}[]
>d : (number | {})[]
>[{}, 1] : (number | {})[]
>d : ({} | number)[]
>[{}, 1] : ({} | number)[]
>{} : {}
>1 : number
var e = [{}, Object]; // {}[]
>e : (ObjectConstructor | {})[]
>[{}, Object] : (ObjectConstructor | {})[]
>e : ({} | ObjectConstructor)[]
>[{}, Object] : ({} | ObjectConstructor)[]
>{} : {}
>Object : ObjectConstructor
@@ -219,8 +219,8 @@ module Derived {
>derived2 : Derived2
var p = [derived, derived2, base]; // Base[]
>p : (Base | Derived | Derived2)[]
>[derived, derived2, base] : (Base | Derived | Derived2)[]
>p : (Derived | Derived2 | Base)[]
>[derived, derived2, base] : (Derived | Derived2 | Base)[]
>derived : Derived
>derived2 : Derived2
>base : Base
@@ -296,8 +296,8 @@ function foo<T, U>(t: T, u: U) {
>u : U
var d = [t, 1]; // {}[]
>d : (number | T)[]
>[t, 1] : (number | T)[]
>d : (T | number)[]
>[t, 1] : (T | number)[]
>t : T
>1 : number
@@ -350,8 +350,8 @@ function foo2<T extends Base, U extends Derived>(t: T, u: U) {
>u : U
var d = [t, 1]; // {}[]
>d : (number | T)[]
>[t, 1] : (number | T)[]
>d : (T | number)[]
>[t, 1] : (T | number)[]
>t : T
>1 : number
@@ -374,26 +374,26 @@ function foo2<T extends Base, U extends Derived>(t: T, u: U) {
>null : null
var g = [t, base]; // Base[]
>g : (Base | T)[]
>[t, base] : (Base | T)[]
>g : (T | Base)[]
>[t, base] : (T | Base)[]
>t : T
>base : Base
var h = [t, derived]; // Derived[]
>h : (Derived | T)[]
>[t, derived] : (Derived | T)[]
>h : (T | Derived)[]
>[t, derived] : (T | Derived)[]
>t : T
>derived : Derived
var i = [u, base]; // Base[]
>i : (Base | U)[]
>[u, base] : (Base | U)[]
>i : (U | Base)[]
>[u, base] : (U | Base)[]
>u : U
>base : Base
var j = [u, derived]; // Derived[]
>j : (Derived | U)[]
>[u, derived] : (Derived | U)[]
>j : (U | Derived)[]
>[u, derived] : (U | Derived)[]
>u : U
>derived : Derived
}
@@ -428,8 +428,8 @@ function foo3<T extends Derived, U extends Derived>(t: T, u: U) {
>u : U
var d = [t, 1]; // {}[]
>d : (number | T)[]
>[t, 1] : (number | T)[]
>d : (T | number)[]
>[t, 1] : (T | number)[]
>t : T
>1 : number
@@ -452,26 +452,26 @@ function foo3<T extends Derived, U extends Derived>(t: T, u: U) {
>null : null
var g = [t, base]; // Base[]
>g : (Base | T)[]
>[t, base] : (Base | T)[]
>g : (T | Base)[]
>[t, base] : (T | Base)[]
>t : T
>base : Base
var h = [t, derived]; // Derived[]
>h : (Derived | T)[]
>[t, derived] : (Derived | T)[]
>h : (T | Derived)[]
>[t, derived] : (T | Derived)[]
>t : T
>derived : Derived
var i = [u, base]; // Base[]
>i : (Base | U)[]
>[u, base] : (Base | U)[]
>i : (U | Base)[]
>[u, base] : (U | Base)[]
>u : U
>base : Base
var j = [u, derived]; // Derived[]
>j : (Derived | U)[]
>[u, derived] : (Derived | U)[]
>j : (U | Derived)[]
>[u, derived] : (U | Derived)[]
>u : U
>derived : Derived
}
@@ -506,8 +506,8 @@ function foo4<T extends Base, U extends Base>(t: T, u: U) {
>u : U
var d = [t, 1]; // {}[]
>d : (number | T)[]
>[t, 1] : (number | T)[]
>d : (T | number)[]
>[t, 1] : (T | number)[]
>t : T
>1 : number
@@ -530,26 +530,26 @@ function foo4<T extends Base, U extends Base>(t: T, u: U) {
>null : null
var g = [t, base]; // Base[]
>g : (Base | T)[]
>[t, base] : (Base | T)[]
>g : (T | Base)[]
>[t, base] : (T | Base)[]
>t : T
>base : Base
var h = [t, derived]; // Derived[]
>h : (Derived | T)[]
>[t, derived] : (Derived | T)[]
>h : (T | Derived)[]
>[t, derived] : (T | Derived)[]
>t : T
>derived : Derived
var i = [u, base]; // Base[]
>i : (Base | U)[]
>[u, base] : (Base | U)[]
>i : (U | Base)[]
>[u, base] : (U | Base)[]
>u : U
>base : Base
var j = [u, derived]; // Derived[]
>j : (Derived | U)[]
>[u, derived] : (Derived | U)[]
>j : (U | Derived)[]
>[u, derived] : (U | Derived)[]
>u : U
>derived : Derived

View File

@@ -101,20 +101,20 @@ var eleUnion11 = unionTuple1[1]; // string | number
>1 : number
var eleUnion12 = unionTuple1[2]; // string | number
>eleUnion12 : string | number
>unionTuple1[2] : string | number
>eleUnion12 : number | string
>unionTuple1[2] : number | string
>unionTuple1 : [number, string | number]
>2 : number
var eleUnion13 = unionTuple1[idx0]; // string | number
>eleUnion13 : string | number
>unionTuple1[idx0] : string | number
>eleUnion13 : number | string
>unionTuple1[idx0] : number | string
>unionTuple1 : [number, string | number]
>idx0 : number
var eleUnion14 = unionTuple1[idx1]; // string | number
>eleUnion14 : string | number
>unionTuple1[idx1] : string | number
>eleUnion14 : number | string
>unionTuple1[idx1] : number | string
>unionTuple1 : [number, string | number]
>idx1 : number
@@ -143,20 +143,20 @@ var eleUnion21 = unionTuple2[1]; // string | number
>1 : number
var eleUnion22 = unionTuple2[2]; // string | number | boolean
>eleUnion22 : string | number | boolean
>unionTuple2[2] : string | number | boolean
>eleUnion22 : boolean | string | number
>unionTuple2[2] : boolean | string | number
>unionTuple2 : [boolean, string | number]
>2 : number
var eleUnion23 = unionTuple2[idx0]; // string | number | boolean
>eleUnion23 : string | number | boolean
>unionTuple2[idx0] : string | number | boolean
>eleUnion23 : boolean | string | number
>unionTuple2[idx0] : boolean | string | number
>unionTuple2 : [boolean, string | number]
>idx0 : number
var eleUnion24 = unionTuple2[idx1]; // string | number | boolean
>eleUnion24 : string | number | boolean
>unionTuple2[idx1] : string | number | boolean
>eleUnion24 : boolean | string | number
>unionTuple2[idx1] : boolean | string | number
>unionTuple2 : [boolean, string | number]
>idx1 : number

View File

@@ -49,10 +49,10 @@ class ObjectField<A, T extends { [name: string]: Field<any> }> {
}
var person = new ObjectField({
>person : ObjectField<{}, { [x: string]: CharField | NumberField; id: NumberField; name: CharField; }>
>new ObjectField({ id: new NumberField(), name: new CharField()}) : ObjectField<{}, { [x: string]: CharField | NumberField; id: NumberField; name: CharField; }>
>person : ObjectField<{}, { [x: string]: NumberField | CharField; id: NumberField; name: CharField; }>
>new ObjectField({ id: new NumberField(), name: new CharField()}) : ObjectField<{}, { [x: string]: NumberField | CharField; id: NumberField; name: CharField; }>
>ObjectField : typeof ObjectField
>{ id: new NumberField(), name: new CharField()} : { [x: string]: CharField | NumberField; id: NumberField; name: CharField; }
>{ id: new NumberField(), name: new CharField()} : { [x: string]: NumberField | CharField; id: NumberField; name: CharField; }
id: new NumberField(),
>id : NumberField
@@ -68,8 +68,8 @@ var person = new ObjectField({
person.fields.id;
>person.fields.id : NumberField
>person.fields : { [x: string]: CharField | NumberField; id: NumberField; name: CharField; }
>person : ObjectField<{}, { [x: string]: CharField | NumberField; id: NumberField; name: CharField; }>
>fields : { [x: string]: CharField | NumberField; id: NumberField; name: CharField; }
>person.fields : { [x: string]: NumberField | CharField; id: NumberField; name: CharField; }
>person : ObjectField<{}, { [x: string]: NumberField | CharField; id: NumberField; name: CharField; }>
>fields : { [x: string]: NumberField | CharField; id: NumberField; name: CharField; }
>id : NumberField

View File

@@ -1,9 +1,9 @@
=== tests/cases/conformance/es6/spread/iteratorSpreadInCall12.ts ===
new Foo(...[...new SymbolIterator, ...[...new StringIterator]]);
>new Foo(...[...new SymbolIterator, ...[...new StringIterator]]) : Foo<string | symbol>
>new Foo(...[...new SymbolIterator, ...[...new StringIterator]]) : Foo<symbol | string>
>Foo : typeof Foo
>...[...new SymbolIterator, ...[...new StringIterator]] : string | symbol
>[...new SymbolIterator, ...[...new StringIterator]] : (string | symbol)[]
>...[...new SymbolIterator, ...[...new StringIterator]] : symbol | string
>[...new SymbolIterator, ...[...new StringIterator]] : (symbol | string)[]
>...new SymbolIterator : symbol
>new SymbolIterator : SymbolIterator
>SymbolIterator : typeof SymbolIterator

View File

@@ -1,7 +1,7 @@
=== tests/cases/conformance/es6/spread/iteratorSpreadInCall5.ts ===
foo(...new SymbolIterator, ...new StringIterator);
>foo(...new SymbolIterator, ...new StringIterator) : void
>foo : (...s: (string | symbol)[]) => void
>foo : (...s: (symbol | string)[]) => void
>...new SymbolIterator : symbol
>new SymbolIterator : SymbolIterator
>SymbolIterator : typeof SymbolIterator
@@ -10,8 +10,8 @@ foo(...new SymbolIterator, ...new StringIterator);
>StringIterator : typeof StringIterator
function foo(...s: (symbol | string)[]) { }
>foo : (...s: (string | symbol)[]) => void
>s : (string | symbol)[]
>foo : (...s: (symbol | string)[]) => void
>s : (symbol | string)[]
class SymbolIterator {
>SymbolIterator : SymbolIterator

View File

@@ -1,12 +1,12 @@
tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts(1,28): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number | symbol'.
Type 'string' is not assignable to type 'symbol'.
tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts(1,28): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol | number'.
Type 'string' is not assignable to type 'number'.
==== tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts (1 errors) ====
foo(...new SymbolIterator, ...new StringIterator);
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number | symbol'.
!!! error TS2345: Type 'string' is not assignable to type 'symbol'.
!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol | number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
function foo(...s: (symbol | number)[]) { }
class SymbolIterator {

View File

@@ -121,26 +121,26 @@ var rb4 = a4 || a2; // string || boolean is string | boolean
>a2 : boolean
var rb5 = a5 || a2; // void || boolean is void | boolean
>rb5 : boolean | void
>a5 || a2 : boolean | void
>rb5 : void | boolean
>a5 || a2 : void | boolean
>a5 : void
>a2 : boolean
var rb6 = a6 || a2; // enum || boolean is E | boolean
>rb6 : boolean | E
>a6 || a2 : boolean | E
>rb6 : E | boolean
>a6 || a2 : E | boolean
>a6 : E
>a2 : boolean
var rb7 = a7 || a2; // object || boolean is object | boolean
>rb7 : boolean | { a: string; }
>a7 || a2 : boolean | { a: string; }
>rb7 : { a: string; } | boolean
>a7 || a2 : { a: string; } | boolean
>a7 : { a: string; }
>a2 : boolean
var rb8 = a8 || a2; // array || boolean is array | boolean
>rb8 : boolean | string[]
>a8 || a2 : boolean | string[]
>rb8 : string[] | boolean
>a8 || a2 : string[] | boolean
>a8 : string[]
>a2 : boolean
@@ -163,8 +163,8 @@ var rc1 = a1 || a3; // any || number is any
>a3 : number
var rc2 = a2 || a3; // boolean || number is boolean | number
>rc2 : number | boolean
>a2 || a3 : number | boolean
>rc2 : boolean | number
>a2 || a3 : boolean | number
>a2 : boolean
>a3 : number
@@ -181,26 +181,26 @@ var rc4 = a4 || a3; // string || number is string | number
>a3 : number
var rc5 = a5 || a3; // void || number is void | number
>rc5 : number | void
>a5 || a3 : number | void
>rc5 : void | number
>a5 || a3 : void | number
>a5 : void
>a3 : number
var rc6 = a6 || a3; // enum || number is number
>rc6 : number | E
>a6 || a3 : number | E
>rc6 : E | number
>a6 || a3 : E | number
>a6 : E
>a3 : number
var rc7 = a7 || a3; // object || number is object | number
>rc7 : number | { a: string; }
>a7 || a3 : number | { a: string; }
>rc7 : { a: string; } | number
>a7 || a3 : { a: string; } | number
>a7 : { a: string; }
>a3 : number
var rc8 = a8 || a3; // array || number is array | number
>rc8 : number | string[]
>a8 || a3 : number | string[]
>rc8 : string[] | number
>a8 || a3 : string[] | number
>a8 : string[]
>a3 : number
@@ -223,14 +223,14 @@ var rd1 = a1 || a4; // any || string is any
>a4 : string
var rd2 = a2 || a4; // boolean || string is boolean | string
>rd2 : string | boolean
>a2 || a4 : string | boolean
>rd2 : boolean | string
>a2 || a4 : boolean | string
>a2 : boolean
>a4 : string
var rd3 = a3 || a4; // number || string is number | string
>rd3 : string | number
>a3 || a4 : string | number
>rd3 : number | string
>a3 || a4 : number | string
>a3 : number
>a4 : string
@@ -241,26 +241,26 @@ var rd4 = a4 || a4; // string || string is string
>a4 : string
var rd5 = a5 || a4; // void || string is void | string
>rd5 : string | void
>a5 || a4 : string | void
>rd5 : void | string
>a5 || a4 : void | string
>a5 : void
>a4 : string
var rd6 = a6 || a4; // enum || string is enum | string
>rd6 : string | E
>a6 || a4 : string | E
>rd6 : E | string
>a6 || a4 : E | string
>a6 : E
>a4 : string
var rd7 = a7 || a4; // object || string is object | string
>rd7 : string | { a: string; }
>a7 || a4 : string | { a: string; }
>rd7 : { a: string; } | string
>a7 || a4 : { a: string; } | string
>a7 : { a: string; }
>a4 : string
var rd8 = a8 || a4; // array || string is array | string
>rd8 : string | string[]
>a8 || a4 : string | string[]
>rd8 : string[] | string
>a8 || a4 : string[] | string
>a8 : string[]
>a4 : string
@@ -307,20 +307,20 @@ var re5 = a5 || a5; // void || void is void
>a5 : void
var re6 = a6 || a5; // enum || void is enum | void
>re6 : void | E
>a6 || a5 : void | E
>re6 : E | void
>a6 || a5 : E | void
>a6 : E
>a5 : void
var re7 = a7 || a5; // object || void is object | void
>re7 : void | { a: string; }
>a7 || a5 : void | { a: string; }
>re7 : { a: string; } | void
>a7 || a5 : { a: string; } | void
>a7 : { a: string; }
>a5 : void
var re8 = a8 || a5; // array || void is array | void
>re8 : void | string[]
>a8 || a5 : void | string[]
>re8 : string[] | void
>a8 || a5 : string[] | void
>a8 : string[]
>a5 : void
@@ -373,14 +373,14 @@ var rg6 = a6 || a6; // enum || enum is E
>a6 : E
var rg7 = a7 || a6; // object || enum is object | enum
>rg7 : E | { a: string; }
>a7 || a6 : E | { a: string; }
>rg7 : { a: string; } | E
>a7 || a6 : { a: string; } | E
>a7 : { a: string; }
>a6 : E
var rg8 = a8 || a6; // array || enum is array | enum
>rg8 : E | string[]
>a8 || a6 : E | string[]
>rg8 : string[] | E
>a8 || a6 : string[] | E
>a8 : string[]
>a6 : E
@@ -439,8 +439,8 @@ var rh7 = a7 || a7; // object || object is object
>a7 : { a: string; }
var rh8 = a8 || a7; // array || object is array | object
>rh8 : { a: string; } | string[]
>a8 || a7 : { a: string; } | string[]
>rh8 : string[] | { a: string; }
>a8 || a7 : string[] | { a: string; }
>a8 : string[]
>a7 : { a: string; }

View File

@@ -1,6 +1,6 @@
tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(7,30): error TS2349: Cannot invoke an expression whose type lacks a call signature.
tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,30): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
Type 'string | number' is not assignable to type 'number'.
tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(10,30): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): error TS2346: Supplied parameters do not match any signature of call target.
@@ -19,8 +19,8 @@ tests/cases/compiler/mismatchedExplicitTypeParameterAndArgumentType.ts(11,11): e
var r6 = map<Object, Object>([1, ""], (x) => x.toString());
var r7 = map<number, string>([1, ""], (x) => x.toString()); // error
~~~~~~~
!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'string | number' is not assignable to type 'number'.
!!! error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'number | string' is not assignable to type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
var r7b = map<number>([1, ""], (x) => x.toString()); // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -22,24 +22,24 @@
}
type FileMatchOrMatch = FileMatch | Match;
>FileMatchOrMatch : Match | FileMatch
>FileMatchOrMatch : FileMatch | Match
>FileMatch : FileMatch
>Match : Match
let elementA: FileMatchOrMatch, elementB: FileMatchOrMatch;
>elementA : Match | FileMatch
>FileMatchOrMatch : Match | FileMatch
>elementB : Match | FileMatch
>FileMatchOrMatch : Match | FileMatch
>elementA : FileMatch | Match
>FileMatchOrMatch : FileMatch | Match
>elementB : FileMatch | Match
>FileMatchOrMatch : FileMatch | Match
if (elementA instanceof FileMatch && elementB instanceof FileMatch) {
>elementA instanceof FileMatch && elementB instanceof FileMatch : boolean
>elementA instanceof FileMatch : boolean
>elementA : Match | FileMatch
>elementA : FileMatch | Match
>FileMatch : typeof FileMatch
>elementB instanceof FileMatch : boolean
>elementB : Match | FileMatch
>elementB : FileMatch | Match
>FileMatch : typeof FileMatch
let a = elementA.resource().path;
@@ -63,10 +63,10 @@ if (elementA instanceof FileMatch && elementB instanceof FileMatch) {
} else if (elementA instanceof Match && elementB instanceof Match) {
>elementA instanceof Match && elementB instanceof Match : boolean
>elementA instanceof Match : boolean
>elementA : Match | FileMatch
>elementA : FileMatch | Match
>Match : typeof Match
>elementB instanceof Match : boolean
>elementB : Match | FileMatch
>elementB : FileMatch | Match
>Match : typeof Match
let a = elementA.range();

View File

@@ -1,9 +1,9 @@
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(16,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(25,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(34,5): error TS2412: Property '3.0' of type 'number' is not assignable to numeric index type 'A'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2322: Type '{ [x: number]: number | A | B; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerConstrainsPropertyDeclarations2.ts(39,5): error TS2322: Type '{ [x: number]: A | B | number; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'.
Index signatures are incompatible.
Type 'number | A | B' is not assignable to type 'A'.
Type 'A | B | number' is not assignable to type 'A'.
Type 'number' is not assignable to type 'A'.
@@ -54,9 +54,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/numericIndexerCo
// error
var b: { [x: number]: A } = {
~
!!! error TS2322: Type '{ [x: number]: number | A | B; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'.
!!! error TS2322: Type '{ [x: number]: A | B | number; 1.0: A; 2.0: B; 3.0: number; "2.5": B; "4.0": string; }' is not assignable to type '{ [x: number]: A; }'.
!!! error TS2322: Index signatures are incompatible.
!!! error TS2322: Type 'number | A | B' is not assignable to type 'A'.
!!! error TS2322: Type 'A | B | number' is not assignable to type 'A'.
!!! error TS2322: Type 'number' is not assignable to type 'A'.
1.0: new A(),
2.0: new B(),

View File

@@ -1,4 +1,4 @@
tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: A | B; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'.
tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{ [x: string]: B | A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'.
Index signatures are incompatible.
Type 'A' is not assignable to type 'B'.
@@ -18,7 +18,7 @@ tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2322: Type '{
var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A
~~
!!! error TS2322: Type '{ [x: string]: A | B; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'.
!!! error TS2322: Type '{ [x: string]: B | A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [s: string]: A; [n: number]: B; }'.
!!! error TS2322: Index signatures are incompatible.
!!! error TS2322: Type 'A' is not assignable to type 'B'.
o1 = { x: c, 0: a }; // string indexer is any, number indexer is A

View File

@@ -22,9 +22,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(71,5): error TS2411: Property 'foo' of type '() => string' is not assignable to string index type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(73,5): error TS2411: Property '"4.0"' of type 'number' is not assignable to string index type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(74,5): error TS2411: Property 'f' of type 'MyString' is not assignable to string index type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: string]: string | number | MyString | (() => void) | (() => string); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(78,5): error TS2322: Type '{ [x: string]: string | number | (() => void) | MyString | (() => string); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'.
Index signatures are incompatible.
Type 'string | number | MyString | (() => void) | (() => string)' is not assignable to type 'string'.
Type 'string | number | (() => void) | MyString | (() => string)' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(90,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerConstrainsPropertyDeclarations.ts(93,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -160,9 +160,9 @@ tests/cases/conformance/types/objectTypeLiteral/indexSignatures/stringIndexerCon
// error
var b: { [x: string]: string; } = {
~
!!! error TS2322: Type '{ [x: string]: string | number | MyString | (() => void) | (() => string); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'.
!!! error TS2322: Type '{ [x: string]: string | number | (() => void) | MyString | (() => string); 1.0: string; 2.0: number; a: string; b: number; c: () => void; "d": string; "e": number; "3.0": string; "4.0": number; f: MyString; X: string; foo(): string; }' is not assignable to type '{ [x: string]: string; }'.
!!! error TS2322: Index signatures are incompatible.
!!! error TS2322: Type 'string | number | MyString | (() => void) | (() => string)' is not assignable to type 'string'.
!!! error TS2322: Type 'string | number | (() => void) | MyString | (() => string)' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
a: '',
b: 1,

View File

@@ -12,21 +12,21 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(28,5): error TS2411: Property 'foo16' of type 'T' is not assignable to string index type 'string | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(29,5): error TS2411: Property 'foo17' of type 'Object' is not assignable to string index type 'string | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(30,5): error TS2411: Property 'foo18' of type '{}' is not assignable to string index type 'string | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(35,5): error TS2411: Property 'foo2' of type 'string' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(37,5): error TS2411: Property 'foo4' of type 'boolean' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(39,5): error TS2411: Property 'foo6' of type 'Date' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(40,5): error TS2411: Property 'foo7' of type 'RegExp' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(41,5): error TS2411: Property 'foo8' of type '{ bar: number; }' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(42,5): error TS2411: Property 'foo9' of type 'I8' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(43,5): error TS2411: Property 'foo10' of type 'A' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(44,5): error TS2411: Property 'foo11' of type 'A2<number>' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(45,5): error TS2411: Property 'foo12' of type '(x: any) => number' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(46,5): error TS2411: Property 'foo13' of type '<T>(x: T) => T' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(47,5): error TS2411: Property 'foo14' of type 'typeof f' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(48,5): error TS2411: Property 'foo15' of type 'typeof c' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(49,5): error TS2411: Property 'foo16' of type 'T' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(50,5): error TS2411: Property 'foo17' of type 'Object' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(51,5): error TS2411: Property 'foo18' of type '{}' is not assignable to string index type 'number | E'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(35,5): error TS2411: Property 'foo2' of type 'string' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(37,5): error TS2411: Property 'foo4' of type 'boolean' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(39,5): error TS2411: Property 'foo6' of type 'Date' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(40,5): error TS2411: Property 'foo7' of type 'RegExp' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(41,5): error TS2411: Property 'foo8' of type '{ bar: number; }' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(42,5): error TS2411: Property 'foo9' of type 'I8' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(43,5): error TS2411: Property 'foo10' of type 'A' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(44,5): error TS2411: Property 'foo11' of type 'A2<number>' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(45,5): error TS2411: Property 'foo12' of type '(x: any) => number' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(46,5): error TS2411: Property 'foo13' of type '<T>(x: T) => T' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(47,5): error TS2411: Property 'foo14' of type 'typeof f' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(48,5): error TS2411: Property 'foo15' of type 'typeof c' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(49,5): error TS2411: Property 'foo16' of type 'T' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(50,5): error TS2411: Property 'foo17' of type 'Object' is not assignable to string index type 'E | number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts(51,5): error TS2411: Property 'foo18' of type '{}' is not assignable to string index type 'E | number'.
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOfUnion.ts (29 errors) ====
@@ -94,49 +94,49 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/subtypesOf
foo: any; // ok
foo2: string; // error
~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'string' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo2' of type 'string' is not assignable to string index type 'E | number'.
foo3: number; // ok
foo4: boolean; // error
~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo4' of type 'boolean' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo4' of type 'boolean' is not assignable to string index type 'E | number'.
foo5: E; // ok
foo6: Date; // error
~~~~~~~~~~~
!!! error TS2411: Property 'foo6' of type 'Date' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo6' of type 'Date' is not assignable to string index type 'E | number'.
foo7: RegExp; // error
~~~~~~~~~~~~~
!!! error TS2411: Property 'foo7' of type 'RegExp' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo7' of type 'RegExp' is not assignable to string index type 'E | number'.
foo8: { bar: number }; // error
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo8' of type '{ bar: number; }' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo8' of type '{ bar: number; }' is not assignable to string index type 'E | number'.
foo9: I8; // error
~~~~~~~~~
!!! error TS2411: Property 'foo9' of type 'I8' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo9' of type 'I8' is not assignable to string index type 'E | number'.
foo10: A; // error
~~~~~~~~~
!!! error TS2411: Property 'foo10' of type 'A' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo10' of type 'A' is not assignable to string index type 'E | number'.
foo11: A2<number>; // error
~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo11' of type 'A2<number>' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo11' of type 'A2<number>' is not assignable to string index type 'E | number'.
foo12: (x) => number; //error
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo12' of type '(x: any) => number' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo12' of type '(x: any) => number' is not assignable to string index type 'E | number'.
foo13: <T>(x: T) => T; // error
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo13' of type '<T>(x: T) => T' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo13' of type '<T>(x: T) => T' is not assignable to string index type 'E | number'.
foo14: typeof f; // error
~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo14' of type 'typeof f' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo14' of type 'typeof f' is not assignable to string index type 'E | number'.
foo15: typeof c; // error
~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo15' of type 'typeof c' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo15' of type 'typeof c' is not assignable to string index type 'E | number'.
foo16: T; // error
~~~~~~~~~
!!! error TS2411: Property 'foo16' of type 'T' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo16' of type 'T' is not assignable to string index type 'E | number'.
foo17: Object; // error
~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo17' of type 'Object' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo17' of type 'Object' is not assignable to string index type 'E | number'.
foo18: {}; // error
~~~~~~~~~~
!!! error TS2411: Property 'foo18' of type '{}' is not assignable to string index type 'number | E'.
!!! error TS2411: Property 'foo18' of type '{}' is not assignable to string index type 'E | number'.
}

View File

@@ -331,8 +331,8 @@ var r1 = foo1(r1arg1); // any, return types are not subtype of first overload
>r1arg1 : <T>(x: T) => T[]
var r1a = [r1arg2, r1arg1]; // generic signature, subtype in both directions
>r1a : ((<T>(x: T) => T[]) | ((x: number) => number[]))[]
>[r1arg2, r1arg1] : ((<T>(x: T) => T[]) | ((x: number) => number[]))[]
>r1a : (((x: number) => number[]) | (<T>(x: T) => T[]))[]
>[r1arg2, r1arg1] : (((x: number) => number[]) | (<T>(x: T) => T[]))[]
>r1arg2 : (x: number) => number[]
>r1arg1 : <T>(x: T) => T[]
@@ -371,8 +371,8 @@ var r2a = [r2arg1, r2arg2];
>r2arg2 : (x: number) => string[]
var r2b = [r2arg2, r2arg1];
>r2b : ((<T>(x: T) => string[]) | ((x: number) => string[]))[]
>[r2arg2, r2arg1] : ((<T>(x: T) => string[]) | ((x: number) => string[]))[]
>r2b : (((x: number) => string[]) | (<T>(x: T) => string[]))[]
>[r2arg2, r2arg1] : (((x: number) => string[]) | (<T>(x: T) => string[]))[]
>r2arg2 : (x: number) => string[]
>r2arg1 : <T>(x: T) => string[]
@@ -402,8 +402,8 @@ var r3a = [r3arg1, r3arg2];
>r3arg2 : (x: number) => void
var r3b = [r3arg2, r3arg1];
>r3b : ((<T>(x: T) => T) | ((x: number) => void))[]
>[r3arg2, r3arg1] : ((<T>(x: T) => T) | ((x: number) => void))[]
>r3b : (((x: number) => void) | (<T>(x: T) => T))[]
>[r3arg2, r3arg1] : (((x: number) => void) | (<T>(x: T) => T))[]
>r3arg2 : (x: number) => void
>r3arg1 : <T>(x: T) => T
@@ -438,8 +438,8 @@ var r4a = [r4arg1, r4arg2];
>r4arg2 : (x: string, y: number) => string
var r4b = [r4arg2, r4arg1];
>r4b : ((<T, U>(x: T, y: U) => T) | ((x: string, y: number) => string))[]
>[r4arg2, r4arg1] : ((<T, U>(x: T, y: U) => T) | ((x: string, y: number) => string))[]
>r4b : (((x: string, y: number) => string) | (<T, U>(x: T, y: U) => T))[]
>[r4arg2, r4arg1] : (((x: string, y: number) => string) | (<T, U>(x: T, y: U) => T))[]
>r4arg2 : (x: string, y: number) => string
>r4arg1 : <T, U>(x: T, y: U) => T
@@ -476,8 +476,8 @@ var r5a = [r5arg1, r5arg2];
>r5arg2 : (x: (arg: string) => number) => string
var r5b = [r5arg2, r5arg1];
>r5b : ((<T, U>(x: (arg: T) => U) => T) | ((x: (arg: string) => number) => string))[]
>[r5arg2, r5arg1] : ((<T, U>(x: (arg: T) => U) => T) | ((x: (arg: string) => number) => string))[]
>r5b : (((x: (arg: string) => number) => string) | (<T, U>(x: (arg: T) => U) => T))[]
>[r5arg2, r5arg1] : (((x: (arg: string) => number) => string) | (<T, U>(x: (arg: T) => U) => T))[]
>r5arg2 : (x: (arg: string) => number) => string
>r5arg1 : <T, U>(x: (arg: T) => U) => T
@@ -520,8 +520,8 @@ var r6a = [r6arg1, r6arg2];
>r6arg2 : (x: (arg: Base) => Derived) => Base
var r6b = [r6arg2, r6arg1];
>r6b : ((<T extends Base, U extends Derived>(x: (arg: T) => U) => T) | ((x: (arg: Base) => Derived) => Base))[]
>[r6arg2, r6arg1] : ((<T extends Base, U extends Derived>(x: (arg: T) => U) => T) | ((x: (arg: Base) => Derived) => Base))[]
>r6b : (((x: (arg: Base) => Derived) => Base) | (<T extends Base, U extends Derived>(x: (arg: T) => U) => T))[]
>[r6arg2, r6arg1] : (((x: (arg: Base) => Derived) => Base) | (<T extends Base, U extends Derived>(x: (arg: T) => U) => T))[]
>r6arg2 : (x: (arg: Base) => Derived) => Base
>r6arg1 : <T extends Base, U extends Derived>(x: (arg: T) => U) => T
@@ -570,8 +570,8 @@ var r7a = [r7arg1, r7arg2];
>r7arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived
var r7b = [r7arg2, r7arg1];
>r7b : ((<T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U) | ((x: (arg: Base) => Derived) => (r: Base) => Derived))[]
>[r7arg2, r7arg1] : ((<T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U) | ((x: (arg: Base) => Derived) => (r: Base) => Derived))[]
>r7b : (((x: (arg: Base) => Derived) => (r: Base) => Derived) | (<T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U))[]
>[r7arg2, r7arg1] : (((x: (arg: Base) => Derived) => (r: Base) => Derived) | (<T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U))[]
>r7arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived
>r7arg1 : <T extends Base, U extends Derived>(x: (arg: T) => U) => (r: T) => U
@@ -628,8 +628,8 @@ var r8a = [r8arg1, r8arg2];
>r8arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
var r8b = [r8arg2, r8arg1];
>r8b : ((<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[]
>[r8arg2, r8arg1] : ((<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[]
>r8b : (((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived) | (<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U))[]
>[r8arg2, r8arg1] : (((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived) | (<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U))[]
>r8arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
>r8arg1 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: T) => U) => (r: T) => U
@@ -687,8 +687,8 @@ var r9a = [r9arg1, r9arg2];
>r9arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
var r9b = [r9arg2, r9arg1];
>r9b : ((<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[]
>[r9arg2, r9arg1] : ((<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[]
>r9b : (((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived) | (<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U))[]
>[r9arg2, r9arg1] : (((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived) | (<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U))[]
>r9arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
>r9arg1 : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => (r: T) => U
@@ -725,8 +725,8 @@ var r10a = [r10arg1, r10arg2];
>r10arg2 : (...x: Derived[]) => Derived
var r10b = [r10arg2, r10arg1];
>r10b : ((<T extends Derived>(...x: T[]) => T) | ((...x: Derived[]) => Derived))[]
>[r10arg2, r10arg1] : ((<T extends Derived>(...x: T[]) => T) | ((...x: Derived[]) => Derived))[]
>r10b : (((...x: Derived[]) => Derived) | (<T extends Derived>(...x: T[]) => T))[]
>[r10arg2, r10arg1] : (((...x: Derived[]) => Derived) | (<T extends Derived>(...x: T[]) => T))[]
>r10arg2 : (...x: Derived[]) => Derived
>r10arg1 : <T extends Derived>(...x: T[]) => T
@@ -766,8 +766,8 @@ var r11a = [r11arg1, r11arg2];
>r11arg2 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
var r11b = [r11arg2, r11arg1];
>r11b : ((<T extends Base>(x: T, y: T) => T) | ((x: { foo: string; }, y: { foo: string; bar: string; }) => Base))[]
>[r11arg2, r11arg1] : ((<T extends Base>(x: T, y: T) => T) | ((x: { foo: string; }, y: { foo: string; bar: string; }) => Base))[]
>r11b : (((x: { foo: string; }, y: { foo: string; bar: string; }) => Base) | (<T extends Base>(x: T, y: T) => T))[]
>[r11arg2, r11arg1] : (((x: { foo: string; }, y: { foo: string; bar: string; }) => Base) | (<T extends Base>(x: T, y: T) => T))[]
>r11arg2 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>r11arg1 : <T extends Base>(x: T, y: T) => T
@@ -814,8 +814,8 @@ var r12a = [r12arg1, r12arg2];
>r12arg2 : (x: Base[], y: Derived2[]) => Derived[]
var r12b = [r12arg2, r12arg1];
>r12b : ((<T extends Base[]>(x: Base[], y: T) => Derived[]) | ((x: Base[], y: Derived2[]) => Derived[]))[]
>[r12arg2, r12arg1] : ((<T extends Base[]>(x: Base[], y: T) => Derived[]) | ((x: Base[], y: Derived2[]) => Derived[]))[]
>r12b : (((x: Base[], y: Derived2[]) => Derived[]) | (<T extends Base[]>(x: Base[], y: T) => Derived[]))[]
>[r12arg2, r12arg1] : (((x: Base[], y: Derived2[]) => Derived[]) | (<T extends Base[]>(x: Base[], y: T) => Derived[]))[]
>r12arg2 : (x: Base[], y: Derived2[]) => Derived[]
>r12arg1 : <T extends Base[]>(x: Base[], y: T) => Derived[]
@@ -859,8 +859,8 @@ var r13a = [r13arg1, r13arg2];
>r13arg2 : (x: Base[], y: Derived[]) => Derived[]
var r13b = [r13arg2, r13arg1];
>r13b : ((<T extends Derived[]>(x: Base[], y: T) => T) | ((x: Base[], y: Derived[]) => Derived[]))[]
>[r13arg2, r13arg1] : ((<T extends Derived[]>(x: Base[], y: T) => T) | ((x: Base[], y: Derived[]) => Derived[]))[]
>r13b : (((x: Base[], y: Derived[]) => Derived[]) | (<T extends Derived[]>(x: Base[], y: T) => T))[]
>[r13arg2, r13arg1] : (((x: Base[], y: Derived[]) => Derived[]) | (<T extends Derived[]>(x: Base[], y: T) => T))[]
>r13arg2 : (x: Base[], y: Derived[]) => Derived[]
>r13arg1 : <T extends Derived[]>(x: Base[], y: T) => T
@@ -900,8 +900,8 @@ var r14a = [r14arg1, r14arg2];
>r14arg2 : (x: { a: string; b: number; }) => Object
var r14b = [r14arg2, r14arg1];
>r14b : ((<T>(x: { a: T; b: T; }) => T) | ((x: { a: string; b: number; }) => Object))[]
>[r14arg2, r14arg1] : ((<T>(x: { a: T; b: T; }) => T) | ((x: { a: string; b: number; }) => Object))[]
>r14b : (((x: { a: string; b: number; }) => Object) | (<T>(x: { a: T; b: T; }) => T))[]
>[r14arg2, r14arg1] : (((x: { a: string; b: number; }) => Object) | (<T>(x: { a: T; b: T; }) => T))[]
>r14arg2 : (x: { a: string; b: number; }) => Object
>r14arg1 : <T>(x: { a: T; b: T; }) => T

View File

@@ -291,8 +291,8 @@ module Errors {
>r2arg : <T extends Base, U extends Derived, V extends Derived2>(x: (arg: T) => U) => (r: T) => V
var r2a = [r2arg2, r2arg];
>r2a : ((<T extends Base, U extends Derived, V extends Derived2>(x: (arg: T) => U) => (r: T) => V) | ((x: (arg: Base) => Derived) => (r: Base) => Derived2))[]
>[r2arg2, r2arg] : ((<T extends Base, U extends Derived, V extends Derived2>(x: (arg: T) => U) => (r: T) => V) | ((x: (arg: Base) => Derived) => (r: Base) => Derived2))[]
>r2a : (((x: (arg: Base) => Derived) => (r: Base) => Derived2) | (<T extends Base, U extends Derived, V extends Derived2>(x: (arg: T) => U) => (r: T) => V))[]
>[r2arg2, r2arg] : (((x: (arg: Base) => Derived) => (r: Base) => Derived2) | (<T extends Base, U extends Derived, V extends Derived2>(x: (arg: T) => U) => (r: T) => V))[]
>r2arg2 : (x: (arg: Base) => Derived) => (r: Base) => Derived2
>r2arg : <T extends Base, U extends Derived, V extends Derived2>(x: (arg: T) => U) => (r: T) => V
@@ -349,8 +349,8 @@ module Errors {
>r3arg : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
var r3a = [r3arg2, r3arg];
>r3a : ((<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[]
>[r3arg2, r3arg] : ((<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U) | ((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived))[]
>r3a : (((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived) | (<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U))[]
>[r3arg2, r3arg] : (((x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived) | (<T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U))[]
>r3arg2 : (x: (arg: Base) => Derived, y: (arg2: Base) => Derived) => (r: Base) => Derived
>r3arg : <T extends Base, U extends Derived>(x: (arg: T) => U, y: (arg2: { foo: number; }) => U) => (r: T) => U
@@ -387,8 +387,8 @@ module Errors {
>r4arg : <T extends Derived>(...x: T[]) => T
var r4a = [r4arg2, r4arg];
>r4a : ((<T extends Derived>(...x: T[]) => T) | ((...x: Base[]) => Base))[]
>[r4arg2, r4arg] : ((<T extends Derived>(...x: T[]) => T) | ((...x: Base[]) => Base))[]
>r4a : (((...x: Base[]) => Base) | (<T extends Derived>(...x: T[]) => T))[]
>[r4arg2, r4arg] : (((...x: Base[]) => Base) | (<T extends Derived>(...x: T[]) => T))[]
>r4arg2 : (...x: Base[]) => Base
>r4arg : <T extends Derived>(...x: T[]) => T
@@ -430,8 +430,8 @@ module Errors {
>r5arg : <T extends Derived>(x: T, y: T) => T
var r5a = [r5arg2, r5arg];
>r5a : ((<T extends Derived>(x: T, y: T) => T) | ((x: { foo: string; }, y: { foo: string; bar: string; }) => Base))[]
>[r5arg2, r5arg] : ((<T extends Derived>(x: T, y: T) => T) | ((x: { foo: string; }, y: { foo: string; bar: string; }) => Base))[]
>r5a : (((x: { foo: string; }, y: { foo: string; bar: string; }) => Base) | (<T extends Derived>(x: T, y: T) => T))[]
>[r5arg2, r5arg] : (((x: { foo: string; }, y: { foo: string; bar: string; }) => Base) | (<T extends Derived>(x: T, y: T) => T))[]
>r5arg2 : (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>r5arg : <T extends Derived>(x: T, y: T) => T
@@ -478,8 +478,8 @@ module Errors {
>r6arg : (x: Base[], y: Derived2[]) => Derived[]
var r6a = [r6arg2, r6arg];
>r6a : (((x: Base[], y: Derived2[]) => Derived[]) | (<T extends Derived2[]>(x: Base[], y: Base[]) => T))[]
>[r6arg2, r6arg] : (((x: Base[], y: Derived2[]) => Derived[]) | (<T extends Derived2[]>(x: Base[], y: Base[]) => T))[]
>r6a : ((<T extends Derived2[]>(x: Base[], y: Base[]) => T) | ((x: Base[], y: Derived2[]) => Derived[]))[]
>[r6arg2, r6arg] : ((<T extends Derived2[]>(x: Base[], y: Base[]) => T) | ((x: Base[], y: Derived2[]) => Derived[]))[]
>r6arg2 : <T extends Derived2[]>(x: Base[], y: Base[]) => T
>r6arg : (x: Base[], y: Derived2[]) => Derived[]
@@ -517,8 +517,8 @@ module Errors {
>r7arg : <T>(x: { a: T; b: T; }) => T
var r7a = [r7arg2, r7arg];
>r7a : ((<T>(x: { a: T; b: T; }) => T) | ((x: { a: string; b: number; }) => number))[]
>[r7arg2, r7arg] : ((<T>(x: { a: T; b: T; }) => T) | ((x: { a: string; b: number; }) => number))[]
>r7a : (((x: { a: string; b: number; }) => number) | (<T>(x: { a: T; b: T; }) => T))[]
>[r7arg2, r7arg] : (((x: { a: string; b: number; }) => number) | (<T>(x: { a: T; b: T; }) => T))[]
>r7arg2 : (x: { a: string; b: number; }) => number
>r7arg : <T>(x: { a: T; b: T; }) => T
@@ -553,8 +553,8 @@ module Errors {
>r7arg3 : <T extends Base>(x: { a: T; b: T; }) => number
var r7e = [r7arg3, r7arg2];
>r7e : (((x: { a: string; b: number; }) => number) | (<T extends Base>(x: { a: T; b: T; }) => number))[]
>[r7arg3, r7arg2] : (((x: { a: string; b: number; }) => number) | (<T extends Base>(x: { a: T; b: T; }) => number))[]
>r7e : ((<T extends Base>(x: { a: T; b: T; }) => number) | ((x: { a: string; b: number; }) => number))[]
>[r7arg3, r7arg2] : ((<T extends Base>(x: { a: T; b: T; }) => number) | ((x: { a: string; b: number; }) => number))[]
>r7arg3 : <T extends Base>(x: { a: T; b: T; }) => number
>r7arg2 : (x: { a: string; b: number; }) => number

View File

@@ -323,8 +323,8 @@ var r3a = [r3arg, r3arg2];
>r3arg2 : <T>(x: T) => void
var r3b = [r3arg2, r3arg];
>r3b : ((<T>(x: T) => T) | (<T>(x: T) => void))[]
>[r3arg2, r3arg] : ((<T>(x: T) => T) | (<T>(x: T) => void))[]
>r3b : ((<T>(x: T) => void) | (<T>(x: T) => T))[]
>[r3arg2, r3arg] : ((<T>(x: T) => void) | (<T>(x: T) => T))[]
>r3arg2 : <T>(x: T) => void
>r3arg : <T>(x: T) => T
@@ -453,8 +453,8 @@ var r6a = [r6arg, r6arg2];
>r6arg2 : <T extends Base>(x: (arg: T) => Derived) => T
var r6b = [r6arg2, r6arg];
>r6b : ((<T extends Base, U extends Derived>(x: (arg: T) => U) => T) | (<T extends Base>(x: (arg: T) => Derived) => T))[]
>[r6arg2, r6arg] : ((<T extends Base, U extends Derived>(x: (arg: T) => U) => T) | (<T extends Base>(x: (arg: T) => Derived) => T))[]
>r6b : ((<T extends Base>(x: (arg: T) => Derived) => T) | (<T extends Base, U extends Derived>(x: (arg: T) => U) => T))[]
>[r6arg2, r6arg] : ((<T extends Base>(x: (arg: T) => Derived) => T) | (<T extends Base, U extends Derived>(x: (arg: T) => U) => T))[]
>r6arg2 : <T extends Base>(x: (arg: T) => Derived) => T
>r6arg : <T extends Base, U extends Derived>(x: (arg: T) => U) => T
@@ -504,8 +504,8 @@ var r11a = [r11arg, r11arg2];
>r11arg2 : <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
var r11b = [r11arg2, r11arg];
>r11b : ((<T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base) | (<T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base))[]
>[r11arg2, r11arg] : ((<T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base) | (<T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base))[]
>r11b : ((<T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base) | (<T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base))[]
>[r11arg2, r11arg] : ((<T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base) | (<T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base))[]
>r11arg2 : <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>r11arg : <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
@@ -549,8 +549,8 @@ var r15a = [r15arg, r15arg2];
>r15arg2 : <T>(x: { a: T; b: T; }) => T[]
var r15b = [r15arg2, r15arg];
>r15b : ((<U, V>(x: { a: U; b: V; }) => U[]) | (<T>(x: { a: T; b: T; }) => T[]))[]
>[r15arg2, r15arg] : ((<U, V>(x: { a: U; b: V; }) => U[]) | (<T>(x: { a: T; b: T; }) => T[]))[]
>r15b : ((<T>(x: { a: T; b: T; }) => T[]) | (<U, V>(x: { a: U; b: V; }) => U[]))[]
>[r15arg2, r15arg] : ((<T>(x: { a: T; b: T; }) => T[]) | (<U, V>(x: { a: U; b: V; }) => U[]))[]
>r15arg2 : <T>(x: { a: T; b: T; }) => T[]
>r15arg : <U, V>(x: { a: U; b: V; }) => U[]

View File

@@ -326,8 +326,8 @@ var r1 = foo1(r1arg1); // any, return types are not subtype of first overload
>r1arg1 : new <T>(x: T) => T[]
var r1a = [r1arg2, r1arg1]; // generic signature, subtype in both directions
>r1a : ((new <T>(x: T) => T[]) | (new (x: number) => number[]))[]
>[r1arg2, r1arg1] : ((new <T>(x: T) => T[]) | (new (x: number) => number[]))[]
>r1a : ((new (x: number) => number[]) | (new <T>(x: T) => T[]))[]
>[r1arg2, r1arg1] : ((new (x: number) => number[]) | (new <T>(x: T) => T[]))[]
>r1arg2 : new (x: number) => number[]
>r1arg1 : new <T>(x: T) => T[]
@@ -360,8 +360,8 @@ var r2a = [r2arg1, r2arg2];
>r2arg2 : new (x: number) => string[]
var r2b = [r2arg2, r2arg1];
>r2b : ((new <T>(x: T) => string[]) | (new (x: number) => string[]))[]
>[r2arg2, r2arg1] : ((new <T>(x: T) => string[]) | (new (x: number) => string[]))[]
>r2b : ((new (x: number) => string[]) | (new <T>(x: T) => string[]))[]
>[r2arg2, r2arg1] : ((new (x: number) => string[]) | (new <T>(x: T) => string[]))[]
>r2arg2 : new (x: number) => string[]
>r2arg1 : new <T>(x: T) => string[]
@@ -389,8 +389,8 @@ var r3a = [r3arg1, r3arg2];
>r3arg2 : new (x: number) => void
var r3b = [r3arg2, r3arg1];
>r3b : ((new <T>(x: T) => T) | (new (x: number) => void))[]
>[r3arg2, r3arg1] : ((new <T>(x: T) => T) | (new (x: number) => void))[]
>r3b : ((new (x: number) => void) | (new <T>(x: T) => T))[]
>[r3arg2, r3arg1] : ((new (x: number) => void) | (new <T>(x: T) => T))[]
>r3arg2 : new (x: number) => void
>r3arg1 : new <T>(x: T) => T
@@ -422,8 +422,8 @@ var r4a = [r4arg1, r4arg2];
>r4arg2 : new (x: string, y: number) => string
var r4b = [r4arg2, r4arg1];
>r4b : ((new <T, U>(x: T, y: U) => T) | (new (x: string, y: number) => string))[]
>[r4arg2, r4arg1] : ((new <T, U>(x: T, y: U) => T) | (new (x: string, y: number) => string))[]
>r4b : ((new (x: string, y: number) => string) | (new <T, U>(x: T, y: U) => T))[]
>[r4arg2, r4arg1] : ((new (x: string, y: number) => string) | (new <T, U>(x: T, y: U) => T))[]
>r4arg2 : new (x: string, y: number) => string
>r4arg1 : new <T, U>(x: T, y: U) => T
@@ -455,8 +455,8 @@ var r5a = [r5arg1, r5arg2];
>r5arg2 : new (x: new (arg: string) => number) => string
var r5b = [r5arg2, r5arg1];
>r5b : ((new <T, U>(x: new (arg: T) => U) => T) | (new (x: new (arg: string) => number) => string))[]
>[r5arg2, r5arg1] : ((new <T, U>(x: new (arg: T) => U) => T) | (new (x: new (arg: string) => number) => string))[]
>r5b : ((new (x: new (arg: string) => number) => string) | (new <T, U>(x: new (arg: T) => U) => T))[]
>[r5arg2, r5arg1] : ((new (x: new (arg: string) => number) => string) | (new <T, U>(x: new (arg: T) => U) => T))[]
>r5arg2 : new (x: new (arg: string) => number) => string
>r5arg1 : new <T, U>(x: new (arg: T) => U) => T
@@ -493,8 +493,8 @@ var r6a = [r6arg1, r6arg2];
>r6arg2 : new (x: new (arg: Base) => Derived) => Base
var r6b = [r6arg2, r6arg1];
>r6b : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T) | (new (x: new (arg: Base) => Derived) => Base))[]
>[r6arg2, r6arg1] : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T) | (new (x: new (arg: Base) => Derived) => Base))[]
>r6b : ((new (x: new (arg: Base) => Derived) => Base) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T))[]
>[r6arg2, r6arg1] : ((new (x: new (arg: Base) => Derived) => Base) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T))[]
>r6arg2 : new (x: new (arg: Base) => Derived) => Base
>r6arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T
@@ -535,8 +535,8 @@ var r7a = [r7arg1, r7arg2];
>r7arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived
var r7b = [r7arg2, r7arg1];
>r7b : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U) | (new (x: new (arg: Base) => Derived) => new (r: Base) => Derived))[]
>[r7arg2, r7arg1] : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U) | (new (x: new (arg: Base) => Derived) => new (r: Base) => Derived))[]
>r7b : ((new (x: new (arg: Base) => Derived) => new (r: Base) => Derived) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U))[]
>[r7arg2, r7arg1] : ((new (x: new (arg: Base) => Derived) => new (r: Base) => Derived) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U))[]
>r7arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived
>r7arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => new (r: T) => U
@@ -585,8 +585,8 @@ var r8a = [r8arg1, r8arg2];
>r8arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
var r8b = [r8arg2, r8arg1];
>r8b : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U) | (new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived))[]
>[r8arg2, r8arg1] : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U) | (new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived))[]
>r8b : ((new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U))[]
>[r8arg2, r8arg1] : ((new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U))[]
>r8arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>r8arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: new (arg2: T) => U) => new (r: T) => U
@@ -636,8 +636,8 @@ var r9a = [r9arg1, r9arg2];
>r9arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
var r9b = [r9arg2, r9arg1];
>r9b : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => new (r: T) => U) | (new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived))[]
>[r9arg2, r9arg1] : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => new (r: T) => U) | (new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived))[]
>r9b : ((new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => new (r: T) => U))[]
>[r9arg2, r9arg1] : ((new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => new (r: T) => U))[]
>r9arg2 : new (x: new (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>r9arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: string; bing: number; }) => U) => new (r: T) => U
@@ -668,8 +668,8 @@ var r10a = [r10arg1, r10arg2];
>r10arg2 : new (...x: Derived[]) => Derived
var r10b = [r10arg2, r10arg1];
>r10b : ((new <T extends Derived>(...x: T[]) => T) | (new (...x: Derived[]) => Derived))[]
>[r10arg2, r10arg1] : ((new <T extends Derived>(...x: T[]) => T) | (new (...x: Derived[]) => Derived))[]
>r10b : ((new (...x: Derived[]) => Derived) | (new <T extends Derived>(...x: T[]) => T))[]
>[r10arg2, r10arg1] : ((new (...x: Derived[]) => Derived) | (new <T extends Derived>(...x: T[]) => T))[]
>r10arg2 : new (...x: Derived[]) => Derived
>r10arg1 : new <T extends Derived>(...x: T[]) => T
@@ -705,8 +705,8 @@ var r11a = [r11arg1, r11arg2];
>r11arg2 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
var r11b = [r11arg2, r11arg1];
>r11b : ((new <T extends Base>(x: T, y: T) => T) | (new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base))[]
>[r11arg2, r11arg1] : ((new <T extends Base>(x: T, y: T) => T) | (new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base))[]
>r11b : ((new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base) | (new <T extends Base>(x: T, y: T) => T))[]
>[r11arg2, r11arg1] : ((new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base) | (new <T extends Base>(x: T, y: T) => T))[]
>r11arg2 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>r11arg1 : new <T extends Base>(x: T, y: T) => T
@@ -747,8 +747,8 @@ var r12a = [r12arg1, r12arg2];
>r12arg2 : new (x: Base[], y: Derived2[]) => Derived[]
var r12b = [r12arg2, r12arg1];
>r12b : ((new <T extends Base[]>(x: Base[], y: T) => Derived[]) | (new (x: Base[], y: Derived2[]) => Derived[]))[]
>[r12arg2, r12arg1] : ((new <T extends Base[]>(x: Base[], y: T) => Derived[]) | (new (x: Base[], y: Derived2[]) => Derived[]))[]
>r12b : ((new (x: Base[], y: Derived2[]) => Derived[]) | (new <T extends Base[]>(x: Base[], y: T) => Derived[]))[]
>[r12arg2, r12arg1] : ((new (x: Base[], y: Derived2[]) => Derived[]) | (new <T extends Base[]>(x: Base[], y: T) => Derived[]))[]
>r12arg2 : new (x: Base[], y: Derived2[]) => Derived[]
>r12arg1 : new <T extends Base[]>(x: Base[], y: T) => Derived[]
@@ -788,8 +788,8 @@ var r13a = [r13arg1, r13arg2];
>r13arg2 : new (x: Base[], y: Derived[]) => Derived[]
var r13b = [r13arg2, r13arg1];
>r13b : ((new <T extends Derived[]>(x: Base[], y: T) => T) | (new (x: Base[], y: Derived[]) => Derived[]))[]
>[r13arg2, r13arg1] : ((new <T extends Derived[]>(x: Base[], y: T) => T) | (new (x: Base[], y: Derived[]) => Derived[]))[]
>r13b : ((new (x: Base[], y: Derived[]) => Derived[]) | (new <T extends Derived[]>(x: Base[], y: T) => T))[]
>[r13arg2, r13arg1] : ((new (x: Base[], y: Derived[]) => Derived[]) | (new <T extends Derived[]>(x: Base[], y: T) => T))[]
>r13arg2 : new (x: Base[], y: Derived[]) => Derived[]
>r13arg1 : new <T extends Derived[]>(x: Base[], y: T) => T
@@ -823,8 +823,8 @@ var r14a = [r14arg1, r14arg2];
>r14arg2 : new (x: { a: string; b: number; }) => Object
var r14b = [r14arg2, r14arg1];
>r14b : ((new <T>(x: { a: T; b: T; }) => T) | (new (x: { a: string; b: number; }) => Object))[]
>[r14arg2, r14arg1] : ((new <T>(x: { a: T; b: T; }) => T) | (new (x: { a: string; b: number; }) => Object))[]
>r14b : ((new (x: { a: string; b: number; }) => Object) | (new <T>(x: { a: T; b: T; }) => T))[]
>[r14arg2, r14arg1] : ((new (x: { a: string; b: number; }) => Object) | (new <T>(x: { a: T; b: T; }) => T))[]
>r14arg2 : new (x: { a: string; b: number; }) => Object
>r14arg1 : new <T>(x: { a: T; b: T; }) => T

View File

@@ -224,8 +224,8 @@ module Errors {
>r1arg1 : new <T, U>(x: T) => U[]
var r1a = [r1arg2, r1arg1];
>r1a : ((new <T, U>(x: T) => U[]) | (new (x: number) => string[]))[]
>[r1arg2, r1arg1] : ((new <T, U>(x: T) => U[]) | (new (x: number) => string[]))[]
>r1a : ((new (x: number) => string[]) | (new <T, U>(x: T) => U[]))[]
>[r1arg2, r1arg1] : ((new (x: number) => string[]) | (new <T, U>(x: T) => U[]))[]
>r1arg2 : new (x: number) => string[]
>r1arg1 : new <T, U>(x: T) => U[]
@@ -268,8 +268,8 @@ module Errors {
>r2arg1 : new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V
var r2a = [r2arg2, r2arg1];
>r2a : ((new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V) | (new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2))[]
>[r2arg2, r2arg1] : ((new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V) | (new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2))[]
>r2a : ((new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2) | (new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V))[]
>[r2arg2, r2arg1] : ((new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2) | (new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V))[]
>r2arg2 : new (x: new (arg: Base) => Derived) => new (r: Base) => Derived2
>r2arg1 : new <T extends Base, U extends Derived, V extends Derived2>(x: new (arg: T) => U) => new (r: T) => V
@@ -318,8 +318,8 @@ module Errors {
>r3arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U
var r3a = [r3arg2, r3arg1];
>r3a : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U) | (new (x: (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived))[]
>[r3arg2, r3arg1] : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U) | (new (x: (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived))[]
>r3a : ((new (x: (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U))[]
>[r3arg2, r3arg1] : ((new (x: (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U))[]
>r3arg2 : new (x: (arg: Base) => Derived, y: new (arg2: Base) => Derived) => new (r: Base) => Derived
>r3arg1 : new <T extends Base, U extends Derived>(x: new (arg: T) => U, y: (arg2: { foo: number; }) => U) => new (r: T) => U
@@ -350,8 +350,8 @@ module Errors {
>r4arg1 : new <T extends Derived>(...x: T[]) => T
var r4a = [r4arg2, r4arg1];
>r4a : ((new <T extends Derived>(...x: T[]) => T) | (new (...x: Base[]) => Base))[]
>[r4arg2, r4arg1] : ((new <T extends Derived>(...x: T[]) => T) | (new (...x: Base[]) => Base))[]
>r4a : ((new (...x: Base[]) => Base) | (new <T extends Derived>(...x: T[]) => T))[]
>[r4arg2, r4arg1] : ((new (...x: Base[]) => Base) | (new <T extends Derived>(...x: T[]) => T))[]
>r4arg2 : new (...x: Base[]) => Base
>r4arg1 : new <T extends Derived>(...x: T[]) => T
@@ -387,8 +387,8 @@ module Errors {
>r5arg1 : new <T extends Derived>(x: T, y: T) => T
var r5a = [r5arg2, r5arg1];
>r5a : ((new <T extends Derived>(x: T, y: T) => T) | (new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base))[]
>[r5arg2, r5arg1] : ((new <T extends Derived>(x: T, y: T) => T) | (new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base))[]
>r5a : ((new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base) | (new <T extends Derived>(x: T, y: T) => T))[]
>[r5arg2, r5arg1] : ((new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base) | (new <T extends Derived>(x: T, y: T) => T))[]
>r5arg2 : new (x: { foo: string; }, y: { foo: string; bar: string; }) => Base
>r5arg1 : new <T extends Derived>(x: T, y: T) => T
@@ -429,8 +429,8 @@ module Errors {
>r6arg1 : new (x: Base[], y: Derived2[]) => Derived[]
var r6a = [r6arg2, r6arg1];
>r6a : ((new (x: Base[], y: Derived2[]) => Derived[]) | (new <T extends Derived2[]>(x: Base[], y: Base[]) => T))[]
>[r6arg2, r6arg1] : ((new (x: Base[], y: Derived2[]) => Derived[]) | (new <T extends Derived2[]>(x: Base[], y: Base[]) => T))[]
>r6a : ((new <T extends Derived2[]>(x: Base[], y: Base[]) => T) | (new (x: Base[], y: Derived2[]) => Derived[]))[]
>[r6arg2, r6arg1] : ((new <T extends Derived2[]>(x: Base[], y: Base[]) => T) | (new (x: Base[], y: Derived2[]) => Derived[]))[]
>r6arg2 : new <T extends Derived2[]>(x: Base[], y: Base[]) => T
>r6arg1 : new (x: Base[], y: Derived2[]) => Derived[]
@@ -463,8 +463,8 @@ module Errors {
>r7arg1 : new <T>(x: { a: T; b: T; }) => T
var r7a = [r7arg2, r7arg1];
>r7a : ((new <T>(x: { a: T; b: T; }) => T) | (new (x: { a: string; b: number; }) => number))[]
>[r7arg2, r7arg1] : ((new <T>(x: { a: T; b: T; }) => T) | (new (x: { a: string; b: number; }) => number))[]
>r7a : ((new (x: { a: string; b: number; }) => number) | (new <T>(x: { a: T; b: T; }) => T))[]
>[r7arg2, r7arg1] : ((new (x: { a: string; b: number; }) => number) | (new <T>(x: { a: T; b: T; }) => T))[]
>r7arg2 : new (x: { a: string; b: number; }) => number
>r7arg1 : new <T>(x: { a: T; b: T; }) => T
@@ -497,8 +497,8 @@ module Errors {
>r7arg3 : new <T extends Base>(x: { a: T; b: T; }) => number
var r7e = [r7arg3, r7arg2];
>r7e : ((new (x: { a: string; b: number; }) => number) | (new <T extends Base>(x: { a: T; b: T; }) => number))[]
>[r7arg3, r7arg2] : ((new (x: { a: string; b: number; }) => number) | (new <T extends Base>(x: { a: T; b: T; }) => number))[]
>r7e : ((new <T extends Base>(x: { a: T; b: T; }) => number) | (new (x: { a: string; b: number; }) => number))[]
>[r7arg3, r7arg2] : ((new <T extends Base>(x: { a: T; b: T; }) => number) | (new (x: { a: string; b: number; }) => number))[]
>r7arg3 : new <T extends Base>(x: { a: T; b: T; }) => number
>r7arg2 : new (x: { a: string; b: number; }) => number

View File

@@ -307,8 +307,8 @@ var r3a = [r3arg, r3arg2];
>r3arg2 : new <T>(x: T) => void
var r3b = [r3arg2, r3arg];
>r3b : ((new <T>(x: T) => T) | (new <T>(x: T) => void))[]
>[r3arg2, r3arg] : ((new <T>(x: T) => T) | (new <T>(x: T) => void))[]
>r3b : ((new <T>(x: T) => void) | (new <T>(x: T) => T))[]
>[r3arg2, r3arg] : ((new <T>(x: T) => void) | (new <T>(x: T) => T))[]
>r3arg2 : new <T>(x: T) => void
>r3arg : new <T>(x: T) => T
@@ -421,8 +421,8 @@ var r6a = [r6arg, r6arg2];
>r6arg2 : new <T extends Base>(x: new (arg: T) => Derived) => T
var r6b = [r6arg2, r6arg];
>r6b : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T) | (new <T extends Base>(x: new (arg: T) => Derived) => T))[]
>[r6arg2, r6arg] : ((new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T) | (new <T extends Base>(x: new (arg: T) => Derived) => T))[]
>r6b : ((new <T extends Base>(x: new (arg: T) => Derived) => T) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T))[]
>[r6arg2, r6arg] : ((new <T extends Base>(x: new (arg: T) => Derived) => T) | (new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T))[]
>r6arg2 : new <T extends Base>(x: new (arg: T) => Derived) => T
>r6arg : new <T extends Base, U extends Derived>(x: new (arg: T) => U) => T
@@ -466,8 +466,8 @@ var r11a = [r11arg, r11arg2];
>r11arg2 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
var r11b = [r11arg2, r11arg];
>r11b : ((new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base) | (new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base))[]
>[r11arg2, r11arg] : ((new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base) | (new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base))[]
>r11b : ((new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base) | (new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base))[]
>[r11arg2, r11arg] : ((new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base) | (new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base))[]
>r11arg2 : new <T>(x: { foo: T; }, y: { foo: T; bar: T; }) => Base
>r11arg : new <T, U>(x: { foo: T; }, y: { foo: U; bar: U; }) => Base
@@ -505,8 +505,8 @@ var r15a = [r15arg, r15arg2];
>r15arg2 : new <T>(x: { a: T; b: T; }) => T[]
var r15b = [r15arg2, r15arg];
>r15b : ((new <U, V>(x: { a: U; b: V; }) => U[]) | (new <T>(x: { a: T; b: T; }) => T[]))[]
>[r15arg2, r15arg] : ((new <U, V>(x: { a: U; b: V; }) => U[]) | (new <T>(x: { a: T; b: T; }) => T[]))[]
>r15b : ((new <T>(x: { a: T; b: T; }) => T[]) | (new <U, V>(x: { a: U; b: V; }) => U[]))[]
>[r15arg2, r15arg] : ((new <T>(x: { a: T; b: T; }) => T[]) | (new <U, V>(x: { a: U; b: V; }) => U[]))[]
>r15arg2 : new <T>(x: { a: T; b: T; }) => T[]
>r15arg : new <U, V>(x: { a: U; b: V; }) => U[]

View File

@@ -28,12 +28,12 @@ s || s;
>s : symbol
s || 1;
>s || 1 : number | symbol
>s || 1 : symbol | number
>s : symbol
>1 : number
({}) || s;
>({}) || s : symbol | {}
>({}) || s : {} | symbol
>({}) : {}
>{} : {}
>s : symbol

View File

@@ -4,7 +4,7 @@
var a : any[] = [1,2,"3"];
>a : any[]
>[1,2,"3"] : (string | number)[]
>[1,2,"3"] : (number | string)[]
>1 : number
>2 : number
>"3" : string

View File

@@ -1,5 +1,5 @@
tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | number)[]' is not assignable to type 'string[]'.
Type 'string | number' is not assignable to type 'string'.
tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(number | string)[]' is not assignable to type 'string[]'.
Type 'number | string' is not assignable to type 'string'.
Type 'number' is not assignable to type 'string'.
@@ -9,8 +9,8 @@ tests/cases/compiler/targetTypeTest3.ts(4,5): error TS2322: Type '(string | numb
var a : string[] = [1,2,"3"]; // should produce an error
~
!!! error TS2322: Type '(string | number)[]' is not assignable to type 'string[]'.
!!! error TS2322: Type 'string | number' is not assignable to type 'string'.
!!! error TS2322: Type '(number | string)[]' is not assignable to type 'string[]'.
!!! error TS2322: Type 'number | string' is not assignable to type 'string'.
!!! error TS2322: Type 'number' is not assignable to type 'string'.

View File

@@ -1,7 +1,7 @@
=== tests/cases/conformance/es6/templates/templateStringInArray.ts ===
var x = [1, 2, `abc${ 123 }def`];
>x : (string | number)[]
>[1, 2, `abc${ 123 }def`] : (string | number)[]
>x : (number | string)[]
>[1, 2, `abc${ 123 }def`] : (number | string)[]
>1 : number
>2 : number
>`abc${ 123 }def` : string

View File

@@ -2,7 +2,7 @@
var x = `abc${ true ? false : " " }def`;
>x : string
>`abc${ true ? false : " " }def` : string
>true ? false : " " : string | boolean
>true ? false : " " : boolean | string
>true : boolean
>false : boolean
>" " : string

View File

@@ -2,7 +2,7 @@
var x = `abc${ true ? false : " " }def`;
>x : string
>`abc${ true ? false : " " }def` : string
>true ? false : " " : string | boolean
>true ? false : " " : boolean | string
>true : boolean
>false : boolean
>" " : string

View File

@@ -1,8 +1,8 @@
tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(5,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
Type 'string | number' is not assignable to type 'number'.
tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(5,19): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
Type 'string | number' is not assignable to type 'number'.
tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
@@ -13,13 +13,13 @@ tests/cases/compiler/trailingCommaInHeterogenousArrayLiteral1.ts(6,19): error TS
// these two should give the same error
this.test([1, 2, "hi", 5, ]);
~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'string | number' is not assignable to type 'number'.
!!! error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'number | string' is not assignable to type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
this.test([1, 2, "hi", 5]);
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'string | number' is not assignable to type 'number'.
!!! error TS2345: Argument of type '(number | string)[]' is not assignable to parameter of type 'number[]'.
!!! error TS2345: Type 'number | string' is not assignable to type 'number'.
!!! error TS2345: Type 'string' is not assignable to type 'number'.
}
}

View File

@@ -9,8 +9,8 @@ tests/cases/compiler/tupleTypes.ts(17,1): error TS2322: Type '[string, number]'
tests/cases/compiler/tupleTypes.ts(41,1): error TS2322: Type 'undefined[]' 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[]'.
Types of property 'pop' are incompatible.
Type '() => string | number' is not assignable to type '() => number'.
Type 'string | number' is not assignable to type 'number'.
Type '() => number | string' is not assignable to type '() => number'.
Type 'number | string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
tests/cases/compiler/tupleTypes.ts(49,1): error TS2322: Type '[number, {}]' is not assignable to type 'number[]'.
Types of property 'pop' are incompatible.
@@ -90,8 +90,8 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n
~
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]'.
!!! error TS2322: Types of property 'pop' are incompatible.
!!! error TS2322: Type '() => string | number' is not assignable to type '() => number'.
!!! error TS2322: Type 'string | number' is not assignable to type 'number'.
!!! error TS2322: Type '() => number | string' is not assignable to type '() => number'.
!!! error TS2322: Type 'number | string' is not assignable to type 'number'.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
a = a2;
a = a3; // Error

View File

@@ -4,7 +4,7 @@ declare module m {
// type alias declaration here shouldnt make the module declaration instantiated
type Selector = string| string[] |Function;
>Selector : string | Function | string[]
>Selector : string | string[] | Function
>Function : Function
export interface IStatic {

View File

@@ -216,7 +216,7 @@ acceptingTypeGuardFunction(isA);
// Binary expressions
let union2: C | B;
>union2 : B | C
>union2 : C | B
>C : C
>B : B
@@ -226,6 +226,6 @@ let union3: boolean | B = isA(union2) || union2;
>isA(union2) || union2 : boolean | B
>isA(union2) : boolean
>isA : (p1: any) => boolean
>union2 : B | C
>union2 : C | B
>union2 : B

View File

@@ -26,7 +26,7 @@ var c: C;
>C : C
var cOrBool: C| boolean;
>cOrBool : boolean | C
>cOrBool : C | boolean
>C : C
var strOrNumOrBoolOrC: string | number | boolean | C;
@@ -108,7 +108,7 @@ if (typeof strOrNumOrBoolOrC !== "string" && typeof strOrNumOrBoolOrC !== "numbe
cOrBool = strOrNumOrBoolOrC; // C | boolean
>cOrBool = strOrNumOrBoolOrC : boolean | C
>cOrBool : boolean | C
>cOrBool : C | boolean
>strOrNumOrBoolOrC : boolean | C
bool = strOrNumOrBool; // boolean

View File

@@ -26,7 +26,7 @@ var c: C;
>C : C
var cOrBool: C| boolean;
>cOrBool : boolean | C
>cOrBool : C | boolean
>C : C
var strOrNumOrBoolOrC: string | number | boolean | C;
@@ -118,7 +118,7 @@ if (typeof strOrNumOrBoolOrC === "string" || typeof strOrNumOrBoolOrC === "numbe
else {
cOrBool = strOrNumOrBoolOrC; // C | boolean
>cOrBool = strOrNumOrBoolOrC : boolean | C
>cOrBool : boolean | C
>cOrBool : C | boolean
>strOrNumOrBoolOrC : boolean | C
bool = strOrNumOrBool; // boolean

View File

@@ -121,7 +121,7 @@ str = c2Ord1 instanceof D1 && c2Ord1.p1; // D1
>p1 : string
var r2: D1 | C2 = c2Ord1 instanceof C1 && c2Ord1; // C2 | D1
>r2 : C2 | D1
>r2 : D1 | C2
>D1 : D1
>C2 : C2
>c2Ord1 instanceof C1 && c2Ord1 : D1

View File

@@ -151,7 +151,7 @@ str = c2Ord1 instanceof d1 && c2Ord1.p1; // D1
>p1 : string
var r2: D1 | C2 = c2Ord1 instanceof c1 && c2Ord1; // C2 | D1
>r2 : C2 | D1
>r2 : D1 | C2
>D1 : D1
>C2 : C2
>c2Ord1 instanceof c1 && c2Ord1 : D1

View File

@@ -2,21 +2,21 @@
// Also note that it is possible to defeat a type guard by calling a function that changes the
// type of the guarded variable.
function foo(x: number | string) {
>foo : (x: string | number) => number
>x : string | number
>foo : (x: number | string) => number
>x : number | string
function f() {
>f : () => void
x = 10;
>x = 10 : number
>x : string | number
>x : number | string
>10 : number
}
if (typeof x === "string") {
>typeof x === "string" : boolean
>typeof x : string
>x : string | number
>x : number | string
>"string" : string
f();
@@ -35,13 +35,13 @@ function foo(x: number | string) {
}
}
function foo2(x: number | string) {
>foo2 : (x: string | number) => number
>x : string | number
>foo2 : (x: number | string) => number
>x : number | string
if (typeof x === "string") {
>typeof x === "string" : boolean
>typeof x : string
>x : string | number
>x : number | string
>"string" : string
return x.length; // string
@@ -63,7 +63,7 @@ function foo2(x: number | string) {
}
x = "hello";
>x = "hello" : string
>x : string | number
>x : number | string
>"hello" : string
f();
@@ -71,13 +71,13 @@ function foo2(x: number | string) {
>f : () => number
}
function foo3(x: number | string) {
>foo3 : (x: string | number) => number
>x : string | number
>foo3 : (x: number | string) => number
>x : number | string
if (typeof x === "string") {
>typeof x === "string" : boolean
>typeof x : string
>x : string | number
>x : number | string
>"string" : string
return x.length; // string
@@ -95,7 +95,7 @@ function foo3(x: number | string) {
}
x = "hello";
>x = "hello" : string
>x : string | number
>x : number | string
>"hello" : string
f();

View File

@@ -2,14 +2,14 @@
// typeguards are scoped in function/module block
function foo(x: number | string | boolean) {
>foo : (x: string | number | boolean) => string
>x : string | number | boolean
>foo : (x: number | string | boolean) => string
>x : number | string | boolean
return typeof x === "string"
>typeof x === "string" ? x : function f() { var b = x; // number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } () : string
>typeof x === "string" : boolean
>typeof x : string
>x : string | number | boolean
>x : number | string | boolean
>"string" : string
? x
@@ -46,14 +46,14 @@ function foo(x: number | string | boolean) {
} ();
}
function foo2(x: number | string | boolean) {
>foo2 : (x: string | number | boolean) => string
>x : string | number | boolean
>foo2 : (x: number | string | boolean) => string
>x : number | string | boolean
return typeof x === "string"
>typeof x === "string" ? x : function f(a: number | boolean) { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number } (x) : string
>typeof x === "string" : boolean
>typeof x : string
>x : string | number | boolean
>x : number | string | boolean
>"string" : string
? x
@@ -92,14 +92,14 @@ function foo2(x: number | string | boolean) {
>x : number | boolean
}
function foo3(x: number | string | boolean) {
>foo3 : (x: string | number | boolean) => string
>x : string | number | boolean
>foo3 : (x: number | string | boolean) => string
>x : number | string | boolean
return typeof x === "string"
>typeof x === "string" ? x : (() => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number })() : string
>typeof x === "string" : boolean
>typeof x : string
>x : string | number | boolean
>x : number | string | boolean
>"string" : string
? x
@@ -136,14 +136,14 @@ function foo3(x: number | string | boolean) {
})();
}
function foo4(x: number | string | boolean) {
>foo4 : (x: string | number | boolean) => string
>x : string | number | boolean
>foo4 : (x: number | string | boolean) => string
>x : number | string | boolean
return typeof x === "string"
>typeof x === "string" ? x : ((a: number | boolean) => { var b = x; // new scope - number | boolean return typeof x === "boolean" ? x.toString() // boolean : x.toString(); // number })(x) : string
>typeof x === "string" : boolean
>typeof x : string
>x : string | number | boolean
>x : number | string | boolean
>"string" : string
? x
@@ -183,13 +183,13 @@ function foo4(x: number | string | boolean) {
}
// Type guards affect nested function expressions, but not nested function declarations
function foo5(x: number | string | boolean) {
>foo5 : (x: string | number | boolean) => void
>x : string | number | boolean
>foo5 : (x: number | string | boolean) => void
>x : number | string | boolean
if (typeof x === "string") {
>typeof x === "string" : boolean
>typeof x : string
>x : string | number | boolean
>x : number | string | boolean
>"string" : string
var y = x; // string;
@@ -200,8 +200,8 @@ function foo5(x: number | string | boolean) {
>foo : () => void
var z = x; // number | string | boolean, type guard has no effect
>z : string | number | boolean
>x : string | number | boolean
>z : number | string | boolean
>x : number | string | boolean
}
}
}
@@ -209,14 +209,14 @@ module m {
>m : typeof m
var x: number | string | boolean;
>x : string | number | boolean
>x : number | string | boolean
module m2 {
>m2 : typeof m2
var b = x; // new scope - number | boolean | string
>b : string | number | boolean
>x : string | number | boolean
>b : number | string | boolean
>x : number | string | boolean
var y: string;
>y : string
@@ -224,7 +224,7 @@ module m {
if (typeof x === "string") {
>typeof x === "string" : boolean
>typeof x : string
>x : string | number | boolean
>x : number | string | boolean
>"string" : string
y = x // string;
@@ -260,15 +260,15 @@ module m1 {
>m1 : typeof m1
var x: number | string | boolean;
>x : string | number | boolean
>x : number | string | boolean
module m2.m3 {
>m2 : typeof m2
>m3 : typeof m3
var b = x; // new scope - number | boolean | string
>b : string | number | boolean
>x : string | number | boolean
>b : number | string | boolean
>x : number | string | boolean
var y: string;
>y : string
@@ -276,7 +276,7 @@ module m1 {
if (typeof x === "string") {
>typeof x === "string" : boolean
>typeof x : string
>x : string | number | boolean
>x : number | string | boolean
>"string" : string
y = x // string;

View File

@@ -1,5 +1,5 @@
tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(14,70): error TS2339: Property 'join' does not exist on type 'string | string[]'.
tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,44): error TS2339: Property 'toLowerCase' does not exist on type 'string | number'.
tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,44): error TS2339: Property 'toLowerCase' does not exist on type 'number | string'.
==== tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts (2 errors) ====
@@ -32,6 +32,6 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsOnClassProperty.ts(26,4
if (typeof o.prop1 === "string" && o.prop1.toLowerCase()) {}
~~~~~~~~~~~
!!! error TS2339: Property 'toLowerCase' does not exist on type 'string | number'.
!!! error TS2339: Property 'toLowerCase' does not exist on type 'number | string'.
var prop1 = o.prop1;
if (typeof prop1 === "string" && prop1.toLocaleLowerCase()) { }

View File

@@ -6,8 +6,8 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(85,10): error TS2339: Property 'bar' does not exist on type 'D'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(111,10): error TS2339: Property 'bar1' does not exist on type 'E1 | E2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(112,10): error TS2339: Property 'bar2' does not exist on type 'E1 | E2'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(134,11): error TS2339: Property 'foo' does not exist on type 'string | F'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(135,11): error TS2339: Property 'bar' does not exist on type 'string | F'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(134,11): error TS2339: Property 'foo' does not exist on type 'F | string'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(135,11): error TS2339: Property 'bar' does not exist on type 'F | string'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(160,11): error TS2339: Property 'foo2' does not exist on type 'G1'.
tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts(182,11): error TS2339: Property 'bar' does not exist on type 'H'.
@@ -164,10 +164,10 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru
if (obj11 instanceof F) { // can't type narrowing, construct signature returns any.
obj11.foo;
~~~
!!! error TS2339: Property 'foo' does not exist on type 'string | F'.
!!! error TS2339: Property 'foo' does not exist on type 'F | string'.
obj11.bar;
~~~
!!! error TS2339: Property 'bar' does not exist on type 'string | F'.
!!! error TS2339: Property 'bar' does not exist on type 'F | string'.
}
var obj12: any;

View File

@@ -8,8 +8,8 @@ function fee<T>() {
>T : T
var arr = [t, ""];
>arr : (string | T)[]
>[t, ""] : (string | T)[]
>arr : (T | string)[]
>[t, ""] : (T | string)[]
>t : T
>"" : string
}

View File

@@ -235,7 +235,7 @@ _.all([true, 1, null, 'yes'], _.identity);
>_.all : { <T>(list: T[], iterator?: Iterator<T, boolean>, context?: any): boolean; <T>(list: Dictionary<T>, iterator?: Iterator<T, boolean>, context?: any): boolean; }
>_ : Underscore.Static
>all : { <T>(list: T[], iterator?: Iterator<T, boolean>, context?: any): boolean; <T>(list: Dictionary<T>, iterator?: Iterator<T, boolean>, context?: any): boolean; }
>[true, 1, null, 'yes'] : (string | number | boolean)[]
>[true, 1, null, 'yes'] : (boolean | number | string)[]
>true : boolean
>1 : number
>null : null
@@ -249,7 +249,7 @@ _.any([null, 0, 'yes', false]);
>_.any : { <T>(list: T[], iterator?: Iterator<T, boolean>, context?: any): boolean; <T>(list: Dictionary<T>, iterator?: Iterator<T, boolean>, context?: any): boolean; }
>_ : Underscore.Static
>any : { <T>(list: T[], iterator?: Iterator<T, boolean>, context?: any): boolean; <T>(list: Dictionary<T>, iterator?: Iterator<T, boolean>, context?: any): boolean; }
>[null, 0, 'yes', false] : (string | number | boolean)[]
>[null, 0, 'yes', false] : (number | string | boolean)[]
>null : null
>0 : number
>'yes' : string
@@ -508,11 +508,11 @@ _.rest([5, 4, 3, 2, 1]);
>1 : number
_.compact([0, 1, false, 2, '', 3]);
>_.compact([0, 1, false, 2, '', 3]) : (string | number | boolean)[]
>_.compact([0, 1, false, 2, '', 3]) : (number | boolean | string)[]
>_.compact : <T>(list: T[]) => T[]
>_ : Underscore.Static
>compact : <T>(list: T[]) => T[]
>[0, 1, false, 2, '', 3] : (string | number | boolean)[]
>[0, 1, false, 2, '', 3] : (number | boolean | string)[]
>0 : number
>1 : number
>false : boolean

View File

@@ -1,34 +1,34 @@
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(15,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(21,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'string'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(22,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'string'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(22,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'string'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(28,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'boolean'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(29,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'boolean'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(29,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'boolean'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(35,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'Date'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(36,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'Date'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(36,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'Date'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(42,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'RegExp'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(43,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'RegExp'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(43,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'RegExp'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(49,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type '{ bar: number; }'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(50,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type '{ bar: number; }'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(50,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type '{ bar: number; }'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(56,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'number[]'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(57,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'number[]'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(57,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'number[]'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(63,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'I8'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(64,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'I8'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(64,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'I8'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(70,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'A'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(71,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'A'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(71,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'A'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(77,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'A2<number>'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(78,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'A2<number>'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(78,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'A2<number>'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(84,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type '(x: any) => number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(85,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type '(x: any) => number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(85,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type '(x: any) => number'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(91,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type '<T>(x: T) => T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(92,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type '<T>(x: T) => T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(92,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type '<T>(x: T) => T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(99,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'E2'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(100,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'E2'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(100,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'E2'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(110,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'typeof f'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(111,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'typeof f'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(111,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'typeof f'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(121,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'typeof c'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(122,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'typeof c'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(122,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'typeof c'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(128,5): error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(129,5): error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'T'.
tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts(129,5): error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'T'.
==== tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubtypeIfEveryConstituentTypeIsSubtype.ts (31 errors) ====
@@ -59,7 +59,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'string'.
foo2: e | number; // error e and number both not subtype of string
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'string'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'string'.
}
// error cases
@@ -70,7 +70,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'boolean'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'boolean'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'boolean'.
}
@@ -81,7 +81,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'Date'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'Date'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'Date'.
}
@@ -92,7 +92,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'RegExp'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'RegExp'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'RegExp'.
}
@@ -103,7 +103,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type '{ bar: number; }'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type '{ bar: number; }'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type '{ bar: number; }'.
}
@@ -114,7 +114,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'number[]'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'number[]'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'number[]'.
}
@@ -125,7 +125,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'I8'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'I8'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'I8'.
}
class A { foo: number; }
@@ -136,7 +136,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'A'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'A'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'A'.
}
class A2<T> { foo: T; }
@@ -147,7 +147,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'A2<number>'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'A2<number>'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'A2<number>'.
}
@@ -158,7 +158,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type '(x: any) => number'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type '(x: any) => number'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type '(x: any) => number'.
}
@@ -169,7 +169,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type '<T>(x: T) => T'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type '<T>(x: T) => T'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type '<T>(x: T) => T'.
}
@@ -181,7 +181,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'E2'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'E2'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'E2'.
}
@@ -196,7 +196,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'typeof f'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'typeof f'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'typeof f'.
}
@@ -211,7 +211,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'typeof c'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'typeof c'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'typeof c'.
}
@@ -222,7 +222,7 @@ tests/cases/conformance/types/typeRelationships/subtypesAndSuperTypes/unionSubty
!!! error TS2411: Property 'foo' of type 'string | number' is not assignable to string index type 'T'.
foo2: e | number;
~~~~~~~~~~~~~~~~~
!!! error TS2411: Property 'foo2' of type 'number | e' is not assignable to string index type 'T'.
!!! error TS2411: Property 'foo2' of type 'e | number' is not assignable to string index type 'T'.
}
interface I19 {

Some files were not shown because too many files have changed in this diff Show More