mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
//// [tests/cases/conformance/types/any/anyAsGenericFunctionCall.ts] ////
|
|
|
|
=== 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))
|
|
|