145 lines
4.9 KiB
Plaintext
145 lines
4.9 KiB
Plaintext
=== tests/cases/compiler/arrayLiteralTypeInference.ts ===
|
|
class Action {
|
|
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
|
|
|
|
id: number;
|
|
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 0, 14))
|
|
}
|
|
|
|
class ActionA extends Action {
|
|
>ActionA : ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
|
|
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
|
|
|
|
value: string;
|
|
>value : string, Symbol(value, Decl(arrayLiteralTypeInference.ts, 4, 30))
|
|
}
|
|
|
|
class ActionB extends Action {
|
|
>ActionB : ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
|
|
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
|
|
|
|
trueNess: boolean;
|
|
>trueNess : boolean, Symbol(trueNess, Decl(arrayLiteralTypeInference.ts, 8, 30))
|
|
}
|
|
|
|
var x1: Action[] = [
|
|
>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; })[]
|
|
|
|
{ id: 2, trueness: false },
|
|
>{ id: 2, trueness: false } : { id: number; trueness: boolean; }
|
|
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 13, 5))
|
|
>2 : number
|
|
>trueness : boolean, Symbol(trueness, Decl(arrayLiteralTypeInference.ts, 13, 12))
|
|
>false : boolean
|
|
|
|
{ id: 3, name: "three" }
|
|
>{ id: 3, name: "three" } : { id: number; name: string; }
|
|
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 14, 5))
|
|
>3 : number
|
|
>name : string, Symbol(name, Decl(arrayLiteralTypeInference.ts, 14, 12))
|
|
>"three" : string
|
|
|
|
]
|
|
|
|
var x2: Action[] = [
|
|
>x2 : Action[], Symbol(x2, Decl(arrayLiteralTypeInference.ts, 17, 3))
|
|
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
|
|
>[ new ActionA(), new ActionB()] : (ActionA | ActionB)[]
|
|
|
|
new ActionA(),
|
|
>new ActionA() : ActionA
|
|
>ActionA : typeof ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
|
|
|
|
new ActionB()
|
|
>new ActionB() : ActionB
|
|
>ActionB : typeof ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
|
|
|
|
]
|
|
|
|
var x3: Action[] = [
|
|
>x3 : Action[], Symbol(x3, Decl(arrayLiteralTypeInference.ts, 22, 3))
|
|
>Action : Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
|
|
>[ new Action(), new ActionA(), new ActionB()] : Action[]
|
|
|
|
new Action(),
|
|
>new Action() : Action
|
|
>Action : typeof Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
|
|
|
|
new ActionA(),
|
|
>new ActionA() : ActionA
|
|
>ActionA : typeof ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
|
|
|
|
new ActionB()
|
|
>new ActionB() : ActionB
|
|
>ActionB : typeof ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
|
|
|
|
]
|
|
|
|
var z1: { id: number }[] =
|
|
>z1 : { id: number; }[], Symbol(z1, Decl(arrayLiteralTypeInference.ts, 28, 3))
|
|
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 28, 9))
|
|
|
|
[
|
|
>[ { id: 2, trueness: false }, { id: 3, name: "three" } ] : ({ id: number; trueness: boolean; } | { id: number; name: string; })[]
|
|
|
|
{ id: 2, trueness: false },
|
|
>{ id: 2, trueness: false } : { id: number; trueness: boolean; }
|
|
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 30, 9))
|
|
>2 : number
|
|
>trueness : boolean, Symbol(trueness, Decl(arrayLiteralTypeInference.ts, 30, 16))
|
|
>false : boolean
|
|
|
|
{ id: 3, name: "three" }
|
|
>{ id: 3, name: "three" } : { id: number; name: string; }
|
|
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 31, 9))
|
|
>3 : number
|
|
>name : string, Symbol(name, Decl(arrayLiteralTypeInference.ts, 31, 16))
|
|
>"three" : string
|
|
|
|
]
|
|
|
|
var z2: { id: number }[] =
|
|
>z2 : { id: number; }[], Symbol(z2, Decl(arrayLiteralTypeInference.ts, 34, 3))
|
|
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 34, 9))
|
|
|
|
[
|
|
>[ new ActionA(), new ActionB() ] : (ActionA | ActionB)[]
|
|
|
|
new ActionA(),
|
|
>new ActionA() : ActionA
|
|
>ActionA : typeof ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
|
|
|
|
new ActionB()
|
|
>new ActionB() : ActionB
|
|
>ActionB : typeof ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
|
|
|
|
]
|
|
|
|
var z3: { id: number }[] =
|
|
>z3 : { id: number; }[], Symbol(z3, Decl(arrayLiteralTypeInference.ts, 40, 3))
|
|
>id : number, Symbol(id, Decl(arrayLiteralTypeInference.ts, 40, 9))
|
|
|
|
[
|
|
>[ new Action(), new ActionA(), new ActionB() ] : Action[]
|
|
|
|
new Action(),
|
|
>new Action() : Action
|
|
>Action : typeof Action, Symbol(Action, Decl(arrayLiteralTypeInference.ts, 0, 0))
|
|
|
|
new ActionA(),
|
|
>new ActionA() : ActionA
|
|
>ActionA : typeof ActionA, Symbol(ActionA, Decl(arrayLiteralTypeInference.ts, 2, 1))
|
|
|
|
new ActionB()
|
|
>new ActionB() : ActionB
|
|
>ActionB : typeof ActionB, Symbol(ActionB, Decl(arrayLiteralTypeInference.ts, 6, 1))
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|