TypeScript/tests/baselines/reference/constructorArgWithGenericCallSignature.types

47 lines
2.6 KiB
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/constructorArgWithGenericCallSignature.ts ===
module Test {
2015-04-13 23:01:57 +02:00
>Test : typeof Test, Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0))
2014-08-15 23:33:16 +02:00
export interface MyFunc {
2015-04-13 23:01:57 +02:00
>MyFunc : MyFunc, Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13))
2014-08-15 23:33:16 +02:00
<T>(value1: T): T;
2015-04-13 23:01:57 +02:00
>T : T, Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9))
>value1 : T, Symbol(value1, Decl(constructorArgWithGenericCallSignature.ts, 2, 12))
>T : T, Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9))
>T : T, Symbol(T, Decl(constructorArgWithGenericCallSignature.ts, 2, 9))
2014-08-15 23:33:16 +02:00
}
export class MyClass {
2015-04-13 23:01:57 +02:00
>MyClass : MyClass, Symbol(MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5))
2014-08-15 23:33:16 +02:00
constructor(func: MyFunc) { }
2015-04-13 23:01:57 +02:00
>func : MyFunc, Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 5, 20))
>MyFunc : MyFunc, Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13))
2014-08-15 23:33:16 +02:00
}
export function F(func: MyFunc) { }
2015-04-13 23:01:57 +02:00
>F : (func: MyFunc) => void, Symbol(F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5))
>func : MyFunc, Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 8, 19))
>MyFunc : MyFunc, Symbol(MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13))
2014-08-15 23:33:16 +02:00
}
var func: Test.MyFunc;
2015-04-13 23:01:57 +02:00
>func : Test.MyFunc, Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3))
>Test : any, Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0))
>MyFunc : Test.MyFunc, Symbol(Test.MyFunc, Decl(constructorArgWithGenericCallSignature.ts, 0, 13))
2014-08-15 23:33:16 +02:00
Test.F(func); // OK
>Test.F(func) : void
2015-04-13 23:01:57 +02:00
>Test.F : (func: Test.MyFunc) => void, Symbol(Test.F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5))
>Test : typeof Test, Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0))
>F : (func: Test.MyFunc) => void, Symbol(Test.F, Decl(constructorArgWithGenericCallSignature.ts, 6, 5))
>func : Test.MyFunc, Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3))
2014-08-15 23:33:16 +02:00
var test = new Test.MyClass(func); // Should be OK
2015-04-13 23:01:57 +02:00
>test : Test.MyClass, Symbol(test, Decl(constructorArgWithGenericCallSignature.ts, 12, 3))
2014-08-25 19:36:12 +02:00
>new Test.MyClass(func) : Test.MyClass
2015-04-13 23:01:57 +02:00
>Test.MyClass : typeof Test.MyClass, Symbol(Test.MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5))
>Test : typeof Test, Symbol(Test, Decl(constructorArgWithGenericCallSignature.ts, 0, 0))
>MyClass : typeof Test.MyClass, Symbol(Test.MyClass, Decl(constructorArgWithGenericCallSignature.ts, 3, 5))
>func : Test.MyFunc, Symbol(func, Decl(constructorArgWithGenericCallSignature.ts, 10, 3))
2014-08-15 23:33:16 +02:00