Skip to content

Commit be5d09e

Browse files
committed
Accept new baselines
1 parent ec80302 commit be5d09e

4 files changed

+88
-0
lines changed

tests/baselines/reference/exhaustiveSwitchStatements1.errors.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,4 +212,17 @@ tests/cases/conformance/controlFlow/exhaustiveSwitchStatements1.ts(7,9): error T
212212
case Animal.CAT: return Animal.CAT
213213
}
214214
}
215+
216+
// Repro from #34840
217+
218+
function foo() {
219+
const foo: number | undefined = 0;
220+
while (true) {
221+
const stats = foo;
222+
switch (stats) {
223+
case 1: break;
224+
case 2: break;
225+
}
226+
}
227+
}
215228

tests/baselines/reference/exhaustiveSwitchStatements1.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,19 @@ function expression(): Animal {
207207
case Animal.CAT: return Animal.CAT
208208
}
209209
}
210+
211+
// Repro from #34840
212+
213+
function foo() {
214+
const foo: number | undefined = 0;
215+
while (true) {
216+
const stats = foo;
217+
switch (stats) {
218+
case 1: break;
219+
case 2: break;
220+
}
221+
}
222+
}
210223

211224

212225
//// [exhaustiveSwitchStatements1.js]
@@ -405,6 +418,17 @@ function expression() {
405418
case Animal.CAT: return Animal.CAT;
406419
}
407420
}
421+
// Repro from #34840
422+
function foo() {
423+
var foo = 0;
424+
while (true) {
425+
var stats = foo;
426+
switch (stats) {
427+
case 1: break;
428+
case 2: break;
429+
}
430+
}
431+
}
408432

409433

410434
//// [exhaustiveSwitchStatements1.d.ts]
@@ -469,3 +493,4 @@ declare const zoo: {
469493
animal: Animal;
470494
} | undefined;
471495
declare function expression(): Animal;
496+
declare function foo(): void;

tests/baselines/reference/exhaustiveSwitchStatements1.symbols

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,3 +543,25 @@ function expression(): Animal {
543543
}
544544
}
545545

546+
// Repro from #34840
547+
548+
function foo() {
549+
>foo : Symbol(foo, Decl(exhaustiveSwitchStatements1.ts, 207, 1))
550+
551+
const foo: number | undefined = 0;
552+
>foo : Symbol(foo, Decl(exhaustiveSwitchStatements1.ts, 212, 9))
553+
554+
while (true) {
555+
const stats = foo;
556+
>stats : Symbol(stats, Decl(exhaustiveSwitchStatements1.ts, 214, 13))
557+
>foo : Symbol(foo, Decl(exhaustiveSwitchStatements1.ts, 212, 9))
558+
559+
switch (stats) {
560+
>stats : Symbol(stats, Decl(exhaustiveSwitchStatements1.ts, 214, 13))
561+
562+
case 1: break;
563+
case 2: break;
564+
}
565+
}
566+
}
567+

tests/baselines/reference/exhaustiveSwitchStatements1.types

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,3 +634,31 @@ function expression(): Animal {
634634
}
635635
}
636636

637+
// Repro from #34840
638+
639+
function foo() {
640+
>foo : () => void
641+
642+
const foo: number | undefined = 0;
643+
>foo : number | undefined
644+
>0 : 0
645+
646+
while (true) {
647+
>true : true
648+
649+
const stats = foo;
650+
>stats : number
651+
>foo : number
652+
653+
switch (stats) {
654+
>stats : number
655+
656+
case 1: break;
657+
>1 : 1
658+
659+
case 2: break;
660+
>2 : 2
661+
}
662+
}
663+
}
664+

0 commit comments

Comments
 (0)