31 lines
416 B
Text
31 lines
416 B
Text
=== tests/cases/compiler/genericInstanceOf.ts ===
|
|
interface F {
|
|
>F : F
|
|
|
|
(): number;
|
|
}
|
|
|
|
class C<T> {
|
|
>C : C<T>
|
|
>T : T
|
|
|
|
constructor(public a: T, public b: F) {}
|
|
>a : T
|
|
>T : T
|
|
>b : F
|
|
>F : F
|
|
|
|
foo() {
|
|
>foo : () => void
|
|
|
|
if (this.a instanceof this.b) {
|
|
>this.a instanceof this.b : boolean
|
|
>this.a : T
|
|
>this : this
|
|
>a : T
|
|
>this.b : F
|
|
>this : this
|
|
>b : F
|
|
}
|
|
}
|
|
}
|