TypeScript/tests/baselines/reference/objectTypeWithCallSignatureAppearsToBeFunctionType.types

47 lines
2.3 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/conformance/types/members/objectTypeWithCallSignatureAppearsToBeFunctionType.ts ===
// objects with call signatures should be permitted where function types are expected
// no errors expected below
interface I {
2015-04-13 23:01:57 +02:00
>I : I, Symbol(I, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 0, 0))
2014-08-15 23:33:16 +02:00
(): void;
}
var i: I;
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3))
>I : I, Symbol(I, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 0, 0))
2014-08-15 23:33:16 +02:00
var r2: void = i();
2015-04-13 23:01:57 +02:00
>r2 : void, Symbol(r2, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 8, 3))
2014-08-15 23:33:16 +02:00
>i() : void
2015-04-13 23:01:57 +02:00
>i : I, Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3))
2014-08-15 23:33:16 +02:00
var r2b: (x: any, y?: any) => any = i.apply;
2015-04-13 23:01:57 +02:00
>r2b : (x: any, y?: any) => any, Symbol(r2b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 3))
>x : any, Symbol(x, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 10))
>y : any, Symbol(y, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 9, 17))
>i.apply : (thisArg: any, argArray?: any) => any, Symbol(Function.apply, Decl(lib.d.ts, 228, 20))
>i : I, Symbol(i, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 7, 3))
>apply : (thisArg: any, argArray?: any) => any, Symbol(Function.apply, Decl(lib.d.ts, 228, 20))
2014-08-15 23:33:16 +02:00
var b: {
2015-04-13 23:01:57 +02:00
>b : () => void, Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3))
2014-08-15 23:33:16 +02:00
(): void;
}
var r4: void = b();
2015-04-13 23:01:57 +02:00
>r4 : void, Symbol(r4, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 15, 3))
2014-08-15 23:33:16 +02:00
>b() : void
2015-04-13 23:01:57 +02:00
>b : () => void, Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3))
2014-08-15 23:33:16 +02:00
var rb4: (x: any, y?: any) => any = b.apply;
2015-04-13 23:01:57 +02:00
>rb4 : (x: any, y?: any) => any, Symbol(rb4, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 3))
>x : any, Symbol(x, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 10))
>y : any, Symbol(y, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 16, 17))
>b.apply : (thisArg: any, argArray?: any) => any, Symbol(Function.apply, Decl(lib.d.ts, 228, 20))
>b : () => void, Symbol(b, Decl(objectTypeWithCallSignatureAppearsToBeFunctionType.ts, 11, 3))
>apply : (thisArg: any, argArray?: any) => any, Symbol(Function.apply, Decl(lib.d.ts, 228, 20))
2014-08-15 23:33:16 +02:00