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