1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
=== tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts ===
// any is considered an untyped function call
// can be called except with type arguments which is an error
var x: any;
>x : Symbol(x, Decl(anyAsGenericFunctionCall.ts, 3, 3))
var a = x<number>();
>a : Symbol(a, Decl(anyAsGenericFunctionCall.ts, 4, 3))
>x : Symbol(x, Decl(anyAsGenericFunctionCall.ts, 3, 3))
var b = x<string>('hello');
>b : Symbol(b, Decl(anyAsGenericFunctionCall.ts, 5, 3))
>x : Symbol(x, Decl(anyAsGenericFunctionCall.ts, 3, 3))
class C { foo: string; }
>C : Symbol(C, Decl(anyAsGenericFunctionCall.ts, 5, 27))
>foo : Symbol(C.foo, Decl(anyAsGenericFunctionCall.ts, 7, 9))
var c = x<C>(x);
>c : Symbol(c, Decl(anyAsGenericFunctionCall.ts, 8, 3))
>x : Symbol(x, Decl(anyAsGenericFunctionCall.ts, 3, 3))
>C : Symbol(C, Decl(anyAsGenericFunctionCall.ts, 5, 27))
>x : Symbol(x, Decl(anyAsGenericFunctionCall.ts, 3, 3))
var d = x<any>(x);
>d : Symbol(d, Decl(anyAsGenericFunctionCall.ts, 9, 3))
>x : Symbol(x, Decl(anyAsGenericFunctionCall.ts, 3, 3))
>x : Symbol(x, Decl(anyAsGenericFunctionCall.ts, 3, 3))
|