TypeScript/tests/baselines/reference/instantiatedReturnTypeContravariance.types

44 lines
409 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/instantiatedReturnTypeContravariance.ts ===
interface B<T> {
>B : B<T>
>T : T
name: string;
>name : string
x(): T;
>x : () => T
>T : T
}
class c {
>c : c
foo(): B<void> {
>foo : () => B<void>
>B : B<T>
2014-08-15 23:33:16 +02:00
return null;
}
}
class d extends c {
>d : d
>c : c
foo(): B<number> {
>foo : () => B<number>
>B : B<T>
2014-08-15 23:33:16 +02:00
return null;
}
}