mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
test, first pass at a fix
This commit is contained in:
@@ -200,6 +200,10 @@ namespace ts {
|
||||
"symbol": {
|
||||
type: esSymbolType,
|
||||
flags: TypeFlags.ESSymbol
|
||||
},
|
||||
"undefined": {
|
||||
type: undefinedType,
|
||||
flags: TypeFlags.ContainsUndefinedOrNull
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// undefined type guard adds no new type information
|
||||
function test1(a: any) {
|
||||
if (typeof a !== "undefined") {
|
||||
if (typeof a === "boolean") {
|
||||
a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function test2(a: any) {
|
||||
if (typeof a === "undefined") {
|
||||
if (typeof a === "boolean") {
|
||||
a;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function test3(a: any) {
|
||||
if (typeof a === "undefined" || typeof a === "boolean") {
|
||||
a;
|
||||
}
|
||||
}
|
||||
|
||||
function test4(a: any) {
|
||||
if (typeof a !== "undefined" && typeof a === "boolean") {
|
||||
a;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user