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>
|
2014-08-19 04:56:03 +02:00
|
|
|
>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>
|
2014-08-19 04:56:03 +02:00
|
|
|
>B : B<T>
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|