2014-08-15 23:33:16 +02:00
|
|
|
=== 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) { }
|
2014-08-22 03:39:46 +02:00
|
|
|
>F : typeof F
|
2014-08-15 23:33:16 +02:00
|
|
|
>func : MyFunc
|
|
|
|
>MyFunc : MyFunc
|
|
|
|
}
|
|
|
|
var func: Test.MyFunc;
|
|
|
|
>func : MyFunc
|
|
|
|
>Test : Test
|
|
|
|
>MyFunc : MyFunc
|
|
|
|
|
|
|
|
Test.F(func); // OK
|
|
|
|
>Test.F(func) : void
|
2014-08-22 03:39:46 +02:00
|
|
|
>Test.F : typeof F
|
2014-08-15 23:33:16 +02:00
|
|
|
>Test : typeof Test
|
2014-08-22 03:39:46 +02:00
|
|
|
>F : typeof F
|
2014-08-15 23:33:16 +02:00
|
|
|
>func : MyFunc
|
|
|
|
|
|
|
|
var test = new Test.MyClass(func); // Should be OK
|
|
|
|
>test : MyClass
|
|
|
|
>new Test.MyClass(func) : MyClass
|
|
|
|
>Test.MyClass : typeof MyClass
|
|
|
|
>Test : typeof Test
|
|
|
|
>MyClass : typeof MyClass
|
|
|
|
>func : MyFunc
|
|
|
|
|