mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
28 lines
454 B
TypeScript
28 lines
454 B
TypeScript
//// [tests/cases/compiler/genericInstanceOf.ts] ////
|
|
|
|
//// [genericInstanceOf.ts]
|
|
interface F {
|
|
(): number;
|
|
}
|
|
|
|
class C<T> {
|
|
constructor(public a: T, public b: F) {}
|
|
foo() {
|
|
if (this.a instanceof this.b) {
|
|
}
|
|
}
|
|
}
|
|
|
|
//// [genericInstanceOf.js]
|
|
"use strict";
|
|
class C {
|
|
constructor(a, b) {
|
|
this.a = a;
|
|
this.b = b;
|
|
}
|
|
foo() {
|
|
if (this.a instanceof this.b) {
|
|
}
|
|
}
|
|
}
|