60 lines
1.4 KiB
Text
60 lines
1.4 KiB
Text
=== tests/cases/compiler/genericInterfaceTypeCall.ts ===
|
|
interface Foo<T> {
|
|
>Foo : Foo<T>
|
|
>T : T
|
|
|
|
reject(arg: T): void;
|
|
>reject : (arg: T) => void
|
|
>arg : T
|
|
>T : T
|
|
}
|
|
var foo: Foo<string>
|
|
>foo : Foo<string>
|
|
>Foo : Foo<T>
|
|
|
|
interface bar<T> {
|
|
>bar : bar<T>
|
|
>T : T
|
|
|
|
fail(func: (arg: T) => void ): void;
|
|
>fail : (func: (arg: T) => void) => void
|
|
>func : (arg: T) => void
|
|
>arg : T
|
|
>T : T
|
|
|
|
fail2(func2: { (arg: T): void; }): void;
|
|
>fail2 : (func2: (arg: T) => void) => void
|
|
>func2 : (arg: T) => void
|
|
>arg : T
|
|
>T : T
|
|
}
|
|
var test: bar<string>;
|
|
>test : bar<string>
|
|
>bar : bar<T>
|
|
|
|
test.fail(arg => foo.reject(arg));
|
|
>test.fail(arg => foo.reject(arg)) : void
|
|
>test.fail : (func: (arg: string) => void) => void
|
|
>test : bar<string>
|
|
>fail : (func: (arg: string) => void) => void
|
|
>arg => foo.reject(arg) : (arg: string) => void
|
|
>arg : string
|
|
>foo.reject(arg) : void
|
|
>foo.reject : (arg: string) => void
|
|
>foo : Foo<string>
|
|
>reject : (arg: string) => void
|
|
>arg : string
|
|
|
|
test.fail2(arg => foo.reject(arg)); // Error: Supplied parameters do not match any signature of call target
|
|
>test.fail2(arg => foo.reject(arg)) : void
|
|
>test.fail2 : (func2: (arg: string) => void) => void
|
|
>test : bar<string>
|
|
>fail2 : (func2: (arg: string) => void) => void
|
|
>arg => foo.reject(arg) : (arg: string) => void
|
|
>arg : string
|
|
>foo.reject(arg) : void
|
|
>foo.reject : (arg: string) => void
|
|
>foo : Foo<string>
|
|
>reject : (arg: string) => void
|
|
>arg : string
|
|
|