57 lines
2.8 KiB
Plaintext
57 lines
2.8 KiB
Plaintext
=== tests/cases/conformance/expressions/typeGuards/typeGuardNesting.ts ===
|
|
let strOrBool: string|boolean;
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
if ((typeof strOrBool === 'boolean' && !strOrBool) || typeof strOrBool === 'string') {
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
let label: string = (typeof strOrBool === 'string') ? strOrBool : "string";
|
|
>label : Symbol(label, Decl(typeGuardNesting.ts, 2, 4))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false;
|
|
>bool : Symbol(bool, Decl(typeGuardNesting.ts, 3, 4))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string";
|
|
>label2 : Symbol(label2, Decl(typeGuardNesting.ts, 4, 4))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false;
|
|
>bool2 : Symbol(bool2, Decl(typeGuardNesting.ts, 5, 4))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
}
|
|
|
|
if ((typeof strOrBool !== 'string' && !strOrBool) || typeof strOrBool !== 'boolean') {
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
let label: string = (typeof strOrBool === 'string') ? strOrBool : "string";
|
|
>label : Symbol(label, Decl(typeGuardNesting.ts, 9, 4))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
let bool: boolean = (typeof strOrBool === 'boolean') ? strOrBool : false;
|
|
>bool : Symbol(bool, Decl(typeGuardNesting.ts, 10, 4))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
let label2: string = (typeof strOrBool !== 'boolean') ? strOrBool : "string";
|
|
>label2 : Symbol(label2, Decl(typeGuardNesting.ts, 11, 4))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
|
|
let bool2: boolean = (typeof strOrBool !== 'string') ? strOrBool : false;
|
|
>bool2 : Symbol(bool2, Decl(typeGuardNesting.ts, 12, 4))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
>strOrBool : Symbol(strOrBool, Decl(typeGuardNesting.ts, 0, 3))
|
|
}
|
|
|