16 lines
263 B
TypeScript
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;
|
|
}
|
|
}
|
|
}
|