TypeScript/tests/baselines/reference/constructorArgWithGenericCallSignature.types

47 lines
940 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/constructorArgWithGenericCallSignature.ts ===
module Test {
>Test : typeof Test
2014-08-15 23:33:16 +02:00
export interface MyFunc {
>MyFunc : MyFunc
2014-08-15 23:33:16 +02:00
<T>(value1: T): T;
>T : T
>value1 : T
>T : T
>T : T
2014-08-15 23:33:16 +02:00
}
export class MyClass {
>MyClass : MyClass
2014-08-15 23:33:16 +02:00
constructor(func: MyFunc) { }
>func : MyFunc
>MyFunc : MyFunc
2014-08-15 23:33:16 +02:00
}
export function F(func: MyFunc) { }
>F : (func: MyFunc) => void
>func : MyFunc
>MyFunc : MyFunc
2014-08-15 23:33:16 +02:00
}
var func: Test.MyFunc;
>func : Test.MyFunc
>Test : any
>MyFunc : Test.MyFunc
2014-08-15 23:33:16 +02:00
Test.F(func); // OK
>Test.F(func) : void
>Test.F : (func: Test.MyFunc) => void
>Test : typeof Test
>F : (func: Test.MyFunc) => void
>func : Test.MyFunc
2014-08-15 23:33:16 +02:00
var test = new Test.MyClass(func); // Should be OK
>test : Test.MyClass
2014-08-25 19:36:12 +02:00
>new Test.MyClass(func) : Test.MyClass
>Test.MyClass : typeof Test.MyClass
>Test : typeof Test
>MyClass : typeof Test.MyClass
>func : Test.MyFunc
2014-08-15 23:33:16 +02:00