TypeScript/tests/baselines/reference/constructorArgWithGenericCallSignature.types
2015-04-15 16:44:20 -07:00

47 lines
940 B
Plaintext

=== tests/cases/compiler/constructorArgWithGenericCallSignature.ts ===
module Test {
>Test : typeof Test
export interface MyFunc {
>MyFunc : MyFunc
<T>(value1: T): T;
>T : T
>value1 : T
>T : T
>T : T
}
export class MyClass {
>MyClass : MyClass
constructor(func: MyFunc) { }
>func : MyFunc
>MyFunc : MyFunc
}
export function F(func: MyFunc) { }
>F : (func: MyFunc) => void
>func : MyFunc
>MyFunc : MyFunc
}
var func: Test.MyFunc;
>func : Test.MyFunc
>Test : any
>MyFunc : Test.MyFunc
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
var test = new Test.MyClass(func); // Should be OK
>test : Test.MyClass
>new Test.MyClass(func) : Test.MyClass
>Test.MyClass : typeof Test.MyClass
>Test : typeof Test
>MyClass : typeof Test.MyClass
>func : Test.MyFunc