38 lines
No EOL
373 B
TypeScript
38 lines
No EOL
373 B
TypeScript
// @declaration: true
|
|
|
|
type T = "" | "foo";
|
|
|
|
let x: T = undefined;
|
|
let y: T = undefined;
|
|
|
|
if (x === "") {
|
|
let a = x;
|
|
}
|
|
|
|
if (x !== "") {
|
|
let b = x;
|
|
}
|
|
|
|
if (x == "") {
|
|
let c = x;
|
|
}
|
|
|
|
if (x != "") {
|
|
let d = x;
|
|
}
|
|
|
|
if (x) {
|
|
let e = x;
|
|
}
|
|
|
|
if (!x) {
|
|
let f = x;
|
|
}
|
|
|
|
if (!!x) {
|
|
let g = x;
|
|
}
|
|
|
|
if (!!!x) {
|
|
let h = x;
|
|
} |