TypeScript/tests/cases/conformance/expressions/typeGuards/typeGuardInClass.ts
2015-11-17 14:34:02 -08:00

16 lines
263 B
TypeScript

let x: string | number;
if (typeof x === "string") {
let n = class {
constructor() {
let y: string = x;
}
}
}
else {
let m = class {
constructor() {
let y: number = x;
}
}
}