41 lines
930 B
Text
41 lines
930 B
Text
|
=== tests/cases/compiler/genericWithCallSignatures_1.ts ===
|
||
|
///<reference path="genericWithCallSignatures_0.ts"/>
|
||
|
class MyClass {
|
||
|
>MyClass : MyClass
|
||
|
|
||
|
public callableThing: CallableExtention<string>;
|
||
|
>callableThing : CallableExtention<string>
|
||
|
>CallableExtention : CallableExtention
|
||
|
|
||
|
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
|
||
|
>Callable : Callable
|
||
|
>T : T
|
||
|
|