TypeScript/tests/baselines/reference/arrayLiteralTypeInference.types

145 lines
4.9 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/arrayLiteralTypeInference.ts ===
class Action {
2015-04-13 23:01:57 +02:00
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
2014-08-15 23:33:16 +02:00
id: number;
2015-04-13 23:01:57 +02:00
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 0, 14))
2014-08-15 23:33:16 +02:00
}
class ActionA extends Action {
2015-04-13 23:01:57 +02:00
>ActionA : ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
2014-08-15 23:33:16 +02:00
value: string;
2015-04-13 23:01:57 +02:00
>value : string, Symbol(value, Decl(arrayLiteralTypeInference.ts, 4, 30))
2014-08-15 23:33:16 +02:00
}
class ActionB extends Action {
2015-04-13 23:01:57 +02:00
>ActionB : ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
2014-08-15 23:33:16 +02:00
trueNess: boolean;
2015-04-13 23:01:57 +02:00
>trueNess : boolean, Symbol(trueNess, Decl(arrayLiteralTypeInference.ts, 8, 30))
2014-08-15 23:33:16 +02:00
}
var x1: Action[] = [
2015-04-13 23:01:57 +02:00
>x1 : Action[], Symbol(x1, Decl(arrayLiteralTypeInference.ts, 12, 3))
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
>[ { id: 2, trueness: false }, { id: 3, name: "three" }] : ({ id: number; trueness: boolean; } | { id: number; name: string; })[]
2014-08-15 23:33:16 +02:00
{ id: 2, trueness: false },
>{ id: 2, trueness: false } : { id: number; trueness: boolean; }
2015-04-13 23:01:57 +02:00
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 13, 5))
2015-04-13 21:36:11 +02:00
>2 : number
2015-04-13 23:01:57 +02:00
>trueness : boolean, Symbol(trueness, Decl(arrayLiteralTypeInference.ts, 13, 12))
2015-04-13 21:36:11 +02:00
>false : boolean
2014-08-15 23:33:16 +02:00
{ id: 3, name: "three" }
>{ id: 3, name: "three" } : { id: number; name: string; }
2015-04-13 23:01:57 +02:00
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 14, 5))
2015-04-13 21:36:11 +02:00
>3 : number
2015-04-13 23:01:57 +02:00
>name : string, Symbol(name, Decl(arrayLiteralTypeInference.ts, 14, 12))
2015-04-13 21:36:11 +02:00
>"three" : string
2014-08-15 23:33:16 +02:00
]
var x2: Action[] = [
2015-04-13 23:01:57 +02:00
>x2 : Action[], Symbol(x2, Decl(arrayLiteralTypeInference.ts, 17, 3))
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
>[ new ActionA(), new ActionB()] : (ActionA | ActionB)[]
2014-08-15 23:33:16 +02:00
new ActionA(),
>new ActionA() : ActionA
2015-04-13 23:01:57 +02:00
>ActionA : typeof ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
2014-08-15 23:33:16 +02:00
new ActionB()
>new ActionB() : ActionB
2015-04-13 23:01:57 +02:00
>ActionB : typeof ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
2014-08-15 23:33:16 +02:00
]
var x3: Action[] = [
2015-04-13 23:01:57 +02:00
>x3 : Action[], Symbol(x3, Decl(arrayLiteralTypeInference.ts, 22, 3))
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
2014-08-22 03:39:46 +02:00
>[ new Action(), new ActionA(), new ActionB()] : Action[]
2014-08-15 23:33:16 +02:00
new Action(),
>new Action() : Action
2015-04-13 23:01:57 +02:00
>Action : typeof Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
2014-08-15 23:33:16 +02:00
new ActionA(),
>new ActionA() : ActionA
2015-04-13 23:01:57 +02:00
>ActionA : typeof ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
2014-08-15 23:33:16 +02:00
new ActionB()
>new ActionB() : ActionB
2015-04-13 23:01:57 +02:00
>ActionB : typeof ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
2014-08-15 23:33:16 +02:00
]
var z1: { id: number }[] =
2015-04-13 23:01:57 +02:00
>z1 : { id: number; }[], Symbol(z1, Decl(arrayLiteralTypeInference.ts, 28, 3))
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 28, 9))
2014-08-15 23:33:16 +02:00
[
>[ { id: 2, trueness: false }, { id: 3, name: "three" } ] : ({ id: number; trueness: boolean; } | { id: number; name: string; })[]
2014-08-15 23:33:16 +02:00
{ id: 2, trueness: false },
>{ id: 2, trueness: false } : { id: number; trueness: boolean; }
2015-04-13 23:01:57 +02:00
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 30, 9))
2015-04-13 21:36:11 +02:00
>2 : number
2015-04-13 23:01:57 +02:00
>trueness : boolean, Symbol(trueness, Decl(arrayLiteralTypeInference.ts, 30, 16))
2015-04-13 21:36:11 +02:00
>false : boolean
2014-08-15 23:33:16 +02:00
{ id: 3, name: "three" }
>{ id: 3, name: "three" } : { id: number; name: string; }
2015-04-13 23:01:57 +02:00
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 31, 9))
2015-04-13 21:36:11 +02:00
>3 : number
2015-04-13 23:01:57 +02:00
>name : string, Symbol(name, Decl(arrayLiteralTypeInference.ts, 31, 16))
2015-04-13 21:36:11 +02:00
>"three" : string
2014-08-15 23:33:16 +02:00
]
var z2: { id: number }[] =
2015-04-13 23:01:57 +02:00
>z2 : { id: number; }[], Symbol(z2, Decl(arrayLiteralTypeInference.ts, 34, 3))
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 34, 9))
2014-08-15 23:33:16 +02:00
[
>[ new ActionA(), new ActionB() ] : (ActionA | ActionB)[]
2014-08-15 23:33:16 +02:00
new ActionA(),
>new ActionA() : ActionA
2015-04-13 23:01:57 +02:00
>ActionA : typeof ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
2014-08-15 23:33:16 +02:00
new ActionB()
>new ActionB() : ActionB
2015-04-13 23:01:57 +02:00
>ActionB : typeof ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
2014-08-15 23:33:16 +02:00
]
var z3: { id: number }[] =
2015-04-13 23:01:57 +02:00
>z3 : { id: number; }[], Symbol(z3, Decl(arrayLiteralTypeInference.ts, 40, 3))
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 40, 9))
2014-08-15 23:33:16 +02:00
[
2014-10-13 15:56:58 +02:00
>[ new Action(), new ActionA(), new ActionB() ] : Action[]
2014-08-15 23:33:16 +02:00
new Action(),
>new Action() : Action
2015-04-13 23:01:57 +02:00
>Action : typeof Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
2014-08-15 23:33:16 +02:00
new ActionA(),
>new ActionA() : ActionA
2015-04-13 23:01:57 +02:00
>ActionA : typeof ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
2014-08-15 23:33:16 +02:00
new ActionB()
>new ActionB() : ActionB
2015-04-13 23:01:57 +02:00
>ActionB : typeof ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
2014-08-15 23:33:16 +02:00
]