50 lines
2 KiB
Text
50 lines
2 KiB
Text
=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignatureWithoutAnnotationsOrBody.ts ===
|
|
// Call signatures without a return type annotation and function body return 'any'
|
|
|
|
function foo(x) { }
|
|
>foo : Symbol(foo, Decl(callSignatureWithoutAnnotationsOrBody.ts, 0, 0))
|
|
>x : Symbol(x, Decl(callSignatureWithoutAnnotationsOrBody.ts, 2, 13))
|
|
|
|
var r = foo(1); // void since there's a body
|
|
>r : Symbol(r, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 3))
|
|
>foo : Symbol(foo, Decl(callSignatureWithoutAnnotationsOrBody.ts, 0, 0))
|
|
|
|
interface I {
|
|
>I : Symbol(I, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 15))
|
|
|
|
();
|
|
f();
|
|
>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7))
|
|
}
|
|
var i: I;
|
|
>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3))
|
|
>I : Symbol(I, Decl(callSignatureWithoutAnnotationsOrBody.ts, 3, 15))
|
|
|
|
var r2 = i();
|
|
>r2 : Symbol(r2, Decl(callSignatureWithoutAnnotationsOrBody.ts, 10, 3))
|
|
>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3))
|
|
|
|
var r3 = i.f();
|
|
>r3 : Symbol(r3, Decl(callSignatureWithoutAnnotationsOrBody.ts, 11, 3))
|
|
>i.f : Symbol(I.f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7))
|
|
>i : Symbol(i, Decl(callSignatureWithoutAnnotationsOrBody.ts, 9, 3))
|
|
>f : Symbol(I.f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 6, 7))
|
|
|
|
var a: {
|
|
>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3))
|
|
|
|
();
|
|
f();
|
|
>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7))
|
|
|
|
};
|
|
var r4 = a();
|
|
>r4 : Symbol(r4, Decl(callSignatureWithoutAnnotationsOrBody.ts, 17, 3))
|
|
>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3))
|
|
|
|
var r5 = a.f();
|
|
>r5 : Symbol(r5, Decl(callSignatureWithoutAnnotationsOrBody.ts, 18, 3))
|
|
>a.f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7))
|
|
>a : Symbol(a, Decl(callSignatureWithoutAnnotationsOrBody.ts, 13, 3))
|
|
>f : Symbol(f, Decl(callSignatureWithoutAnnotationsOrBody.ts, 14, 7))
|
|
|