diff --git a/tests/baselines/reference/instanceOfAssignability.types b/tests/baselines/reference/instanceOfAssignability.types index 70d068fb0cc..44ec45e2069 100644 --- a/tests/baselines/reference/instanceOfAssignability.types +++ b/tests/baselines/reference/instanceOfAssignability.types @@ -133,8 +133,8 @@ function fn5(x: Derived1) { // 1.5: y: Derived1 // Want: ??? let y = x; ->y : never ->x : never +>y : Derived1 & Derived2 +>x : Derived1 & Derived2 } } diff --git a/tests/baselines/reference/stringLiteralTypesAsTags01.types b/tests/baselines/reference/stringLiteralTypesAsTags01.types index 7b8ac0a8c02..64b099b34f2 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags01.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags01.types @@ -116,6 +116,6 @@ if (!hasKind(x, "B")) { } else { let d = x; ->d : never ->x : never +>d : A & B +>x : A & B } diff --git a/tests/baselines/reference/stringLiteralTypesAsTags02.types b/tests/baselines/reference/stringLiteralTypesAsTags02.types index 290402cd299..92b294a2498 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags02.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags02.types @@ -110,6 +110,6 @@ if (!hasKind(x, "B")) { } else { let d = x; ->d : never ->x : never +>d : A & B +>x : A & B } diff --git a/tests/baselines/reference/stringLiteralTypesAsTags03.types b/tests/baselines/reference/stringLiteralTypesAsTags03.types index 9d004982dda..49ae3da4be0 100644 --- a/tests/baselines/reference/stringLiteralTypesAsTags03.types +++ b/tests/baselines/reference/stringLiteralTypesAsTags03.types @@ -113,6 +113,6 @@ if (!hasKind(x, "B")) { } else { let d = x; ->d : never ->x : never +>d : A & B +>x : A & B } diff --git a/tests/baselines/reference/typeGuardsWithInstanceOf.errors.txt b/tests/baselines/reference/typeGuardsWithInstanceOf.errors.txt deleted file mode 100644 index dfcb8a598da..00000000000 --- a/tests/baselines/reference/typeGuardsWithInstanceOf.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOf.ts(7,20): error TS2339: Property 'global' does not exist on type 'never'. - - -==== tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOf.ts (1 errors) ==== - interface I { global: string; } - var result: I; - var result2: I; - - if (!(result instanceof RegExp)) { - result = result2; - } else if (!result.global) { - ~~~~~~ -!!! error TS2339: Property 'global' does not exist on type 'never'. - } \ No newline at end of file diff --git a/tests/baselines/reference/typeGuardsWithInstanceOf.symbols b/tests/baselines/reference/typeGuardsWithInstanceOf.symbols new file mode 100644 index 00000000000..6d1667a6519 --- /dev/null +++ b/tests/baselines/reference/typeGuardsWithInstanceOf.symbols @@ -0,0 +1,26 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOf.ts === +interface I { global: string; } +>I : Symbol(I, Decl(typeGuardsWithInstanceOf.ts, 0, 0)) +>global : Symbol(I.global, Decl(typeGuardsWithInstanceOf.ts, 0, 13)) + +var result: I; +>result : Symbol(result, Decl(typeGuardsWithInstanceOf.ts, 1, 3)) +>I : Symbol(I, Decl(typeGuardsWithInstanceOf.ts, 0, 0)) + +var result2: I; +>result2 : Symbol(result2, Decl(typeGuardsWithInstanceOf.ts, 2, 3)) +>I : Symbol(I, Decl(typeGuardsWithInstanceOf.ts, 0, 0)) + +if (!(result instanceof RegExp)) { +>result : Symbol(result, Decl(typeGuardsWithInstanceOf.ts, 1, 3)) +>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) + + result = result2; +>result : Symbol(result, Decl(typeGuardsWithInstanceOf.ts, 1, 3)) +>result2 : Symbol(result2, Decl(typeGuardsWithInstanceOf.ts, 2, 3)) + +} else if (!result.global) { +>result.global : Symbol(global, Decl(typeGuardsWithInstanceOf.ts, 0, 13), Decl(lib.d.ts, --, --)) +>result : Symbol(result, Decl(typeGuardsWithInstanceOf.ts, 1, 3)) +>global : Symbol(global, Decl(typeGuardsWithInstanceOf.ts, 0, 13), Decl(lib.d.ts, --, --)) +} diff --git a/tests/baselines/reference/typeGuardsWithInstanceOf.types b/tests/baselines/reference/typeGuardsWithInstanceOf.types new file mode 100644 index 00000000000..f54498f93c8 --- /dev/null +++ b/tests/baselines/reference/typeGuardsWithInstanceOf.types @@ -0,0 +1,31 @@ +=== tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOf.ts === +interface I { global: string; } +>I : I +>global : string + +var result: I; +>result : I +>I : I + +var result2: I; +>result2 : I +>I : I + +if (!(result instanceof RegExp)) { +>!(result instanceof RegExp) : boolean +>(result instanceof RegExp) : boolean +>result instanceof RegExp : boolean +>result : I +>RegExp : RegExpConstructor + + result = result2; +>result = result2 : I +>result : I +>result2 : I + +} else if (!result.global) { +>!result.global : boolean +>result.global : string & boolean +>result : I & RegExp +>global : string & boolean +}