TypeScript/tests/baselines/reference/mismatchedGenericArguments1.types

44 lines
599 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/mismatchedGenericArguments1.ts ===
interface IFoo<T> {
>IFoo : IFoo<T>
>T : T
2014-08-15 23:33:16 +02:00
foo<T>(x: T): T;
>foo : <T>(x: T) => T
>T : T
>x : T
>T : T
>T : T
2014-08-15 23:33:16 +02:00
}
class C<T> implements IFoo<T> {
>C : C<T>
>T : T
>IFoo : IFoo<T>
>T : T
2014-08-15 23:33:16 +02:00
foo(x: string): number {
>foo : (x: string) => number
>x : string
2014-08-15 23:33:16 +02:00
return null;
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
}
}
class C2<T> implements IFoo<T> {
>C2 : C2<T>
>T : T
>IFoo : IFoo<T>
>T : T
2014-08-15 23:33:16 +02:00
foo<U>(x: string): number {
>foo : <U>(x: string) => number
>U : U
>x : string
2014-08-15 23:33:16 +02:00
return null;
2015-04-13 21:36:11 +02:00
>null : null
2014-08-15 23:33:16 +02:00
}
}