2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/constructorArgWithGenericCallSignature.ts ===
|
|
|
|
module Test {
|
2014-08-28 21:40:58 +02:00
|
|
|
>Test : typeof Test
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
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-28 21:52:44 +02:00
|
|
|
>F : (func: MyFunc) => void
|
2014-08-15 23:33:16 +02:00
|
|
|
>func : MyFunc
|
|
|
|
>MyFunc : MyFunc
|
|
|
|
}
|
|
|
|
var func: Test.MyFunc;
|
2014-08-25 19:36:12 +02:00
|
|
|
>func : Test.MyFunc
|
2014-08-28 21:40:58 +02:00
|
|
|
>Test : unknown
|
2014-08-25 19:36:12 +02:00
|
|
|
>MyFunc : Test.MyFunc
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
Test.F(func); // OK
|
|
|
|
>Test.F(func) : void
|
2014-08-28 21:52:44 +02:00
|
|
|
>Test.F : (func: Test.MyFunc) => void
|
2014-08-15 23:33:16 +02:00
|
|
|
>Test : typeof Test
|
2014-08-28 21:52:44 +02:00
|
|
|
>F : (func: Test.MyFunc) => void
|
2014-08-25 19:36:12 +02:00
|
|
|
>func : Test.MyFunc
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var test = new Test.MyClass(func); // Should be OK
|
2014-08-25 19:36:12 +02:00
|
|
|
>test : Test.MyClass
|
|
|
|
>new Test.MyClass(func) : Test.MyClass
|
|
|
|
>Test.MyClass : typeof Test.MyClass
|
2014-08-15 23:33:16 +02:00
|
|
|
>Test : typeof Test
|
2014-08-25 19:36:12 +02:00
|
|
|
>MyClass : typeof Test.MyClass
|
|
|
|
>func : Test.MyFunc
|
2014-08-15 23:33:16 +02:00
|
|
|
|