2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/genericWithCallSignatures_1.ts ===
|
|
|
|
///<reference path="genericWithCallSignatures_0.ts"/>
|
|
|
|
class MyClass {
|
|
|
|
>MyClass : MyClass
|
|
|
|
|
|
|
|
public callableThing: CallableExtention<string>;
|
|
|
|
>callableThing : CallableExtention<string>
|
2014-08-19 04:56:03 +02:00
|
|
|
>CallableExtention : CallableExtention<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
public myMethod() {
|
|
|
|
>myMethod : () => void
|
|
|
|
|
|
|
|
var x = <string> this.callableThing();
|
|
|
|
>x : string
|
|
|
|
><string> this.callableThing() : string
|
|
|
|
>this.callableThing() : string
|
|
|
|
>this.callableThing : CallableExtention<string>
|
|
|
|
>this : MyClass
|
|
|
|
>callableThing : CallableExtention<string>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
=== tests/cases/compiler/genericWithCallSignatures_0.ts ===
|
|
|
|
interface Callable<T> {
|
|
|
|
>Callable : Callable<T>
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
(): T;
|
|
|
|
>T : T
|
|
|
|
|
|
|
|
(value: T): void;
|
|
|
|
>value : T
|
|
|
|
>T : T
|
|
|
|
}
|
|
|
|
|
|
|
|
interface CallableExtention<T> extends Callable<T> { }
|
|
|
|
>CallableExtention : CallableExtention<T>
|
|
|
|
>T : T
|
2014-08-19 04:56:03 +02:00
|
|
|
>Callable : Callable<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
>T : T
|
|
|
|
|