44 lines
403 B
Text
44 lines
403 B
Text
|
=== 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
|
||
|
|
||
|
return null;
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
class d extends c {
|
||
|
>d : d
|
||
|
>c : c
|
||
|
|
||
|
foo(): B<number> {
|
||
|
>foo : () => B<number>
|
||
|
>B : B
|
||
|
|
||
|
return null;
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|