TypeScript/tests/cases/conformance/types/stringLiteral/stringLiteralTypesInUnionTypes04.ts
Anders Hejlsberg 7c45c7ba9f Fixing tests
2016-03-22 10:50:06 -07:00

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;
}