64 lines
3.8 KiB
Text
64 lines
3.8 KiB
Text
=== tests/cases/conformance/types/typeRelationships/bestCommonType/arrayLiteralWithMultipleBestCommonTypes.ts ===
|
|
// when multiple best common types exist we will choose the first candidate
|
|
|
|
var a: { x: number; y?: number };
|
|
>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 8))
|
|
>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 19))
|
|
|
|
var b: { x: number; z?: number };
|
|
>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 8))
|
|
>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 19))
|
|
|
|
var c: { x: number; a?: number };
|
|
>c : Symbol(c, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 3))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 8))
|
|
>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 19))
|
|
|
|
var as = [a, b]; // { x: number; y?: number };[]
|
|
>as : Symbol(as, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 6, 3))
|
|
>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3))
|
|
>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3))
|
|
|
|
var bs = [b, a]; // { x: number; z?: number };[]
|
|
>bs : Symbol(bs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 7, 3))
|
|
>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3))
|
|
>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3))
|
|
|
|
var cs = [a, b, c]; // { x: number; y?: number };[]
|
|
>cs : Symbol(cs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 8, 3))
|
|
>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 2, 3))
|
|
>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 3, 3))
|
|
>c : Symbol(c, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 4, 3))
|
|
|
|
var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[]
|
|
>ds : Symbol(ds, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 3))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 11))
|
|
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 10, 29))
|
|
|
|
var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[]
|
|
>es : Symbol(es, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 3))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 11))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 11, 29))
|
|
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
|
|
|
var fs = [(a: { x: number; y?: number }) => 1, (b: { x: number; z?: number }) => 2]; // (a: { x: number; y?: number }) => number[]
|
|
>fs : Symbol(fs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 3))
|
|
>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 11))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 15))
|
|
>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 26))
|
|
>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 48))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 52))
|
|
>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 12, 63))
|
|
|
|
var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => 1]; // (b: { x: number; z?: number }) => number[]
|
|
>gs : Symbol(gs, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 3))
|
|
>b : Symbol(b, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 11))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 15))
|
|
>z : Symbol(z, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 26))
|
|
>a : Symbol(a, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 48))
|
|
>x : Symbol(x, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 52))
|
|
>y : Symbol(y, Decl(arrayLiteralWithMultipleBestCommonTypes.ts, 13, 63))
|
|
|