44 lines
2 KiB
Text
44 lines
2 KiB
Text
=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithArrayLiteralArgs.ts ===
|
|
function foo<T>(t: T) {
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
>T : Symbol(T, Decl(genericCallWithArrayLiteralArgs.ts, 0, 13))
|
|
>t : Symbol(t, Decl(genericCallWithArrayLiteralArgs.ts, 0, 16))
|
|
>T : Symbol(T, Decl(genericCallWithArrayLiteralArgs.ts, 0, 13))
|
|
|
|
return t;
|
|
>t : Symbol(t, Decl(genericCallWithArrayLiteralArgs.ts, 0, 16))
|
|
}
|
|
|
|
var r = foo([1, 2]); // number[]
|
|
>r : Symbol(r, Decl(genericCallWithArrayLiteralArgs.ts, 4, 3), Decl(genericCallWithArrayLiteralArgs.ts, 5, 3))
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
|
|
var r = foo<number[]>([1, 2]); // number[]
|
|
>r : Symbol(r, Decl(genericCallWithArrayLiteralArgs.ts, 4, 3), Decl(genericCallWithArrayLiteralArgs.ts, 5, 3))
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
|
|
var ra = foo<any[]>([1, 2]); // any[]
|
|
>ra : Symbol(ra, Decl(genericCallWithArrayLiteralArgs.ts, 6, 3))
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
|
|
var r2 = foo([]); // any[]
|
|
>r2 : Symbol(r2, Decl(genericCallWithArrayLiteralArgs.ts, 7, 3))
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
|
|
var r3 = foo<number[]>([]); // number[]
|
|
>r3 : Symbol(r3, Decl(genericCallWithArrayLiteralArgs.ts, 8, 3))
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
|
|
var r4 = foo([1, '']); // {}[]
|
|
>r4 : Symbol(r4, Decl(genericCallWithArrayLiteralArgs.ts, 9, 3))
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
|
|
var r5 = foo<any[]>([1, '']); // any[]
|
|
>r5 : Symbol(r5, Decl(genericCallWithArrayLiteralArgs.ts, 10, 3))
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
|
|
var r6 = foo<Object[]>([1, '']); // Object[]
|
|
>r6 : Symbol(r6, Decl(genericCallWithArrayLiteralArgs.ts, 11, 3))
|
|
>foo : Symbol(foo, Decl(genericCallWithArrayLiteralArgs.ts, 0, 0))
|
|
>Object : Symbol(Object, Decl(lib.d.ts, 92, 1), Decl(lib.d.ts, 223, 11))
|
|
|