46 lines
437 B
Plaintext
46 lines
437 B
Plaintext
=== 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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|