Skip to content

Commit 3173cfe

Browse files
committed
Update narrowing baseline
1 parent 911c59f commit 3173cfe

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

tests/baselines/reference/narrowingByTypeofInSwitch.types

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ function assertSymbol(x: symbol) {
4242
function assertFunction(x: Function) {
4343
>assertFunction : (x: Function) => Function
4444
>x : Function
45-
>Function : Function
4645

4746
return x;
4847
>x : Function
@@ -67,7 +66,6 @@ function assertUndefined(x: undefined) {
6766
function assertAll(x: Basic) {
6867
>assertAll : (x: Basic) => Basic
6968
>x : Basic
70-
>Basic : Basic
7169

7270
return x;
7371
>x : Basic
@@ -91,12 +89,10 @@ function assertBooleanOrObject(x: boolean | object) {
9189

9290
type Basic = number | boolean | string | symbol | object | Function | undefined;
9391
>Basic : Basic
94-
>Function : Function
9592

9693
function testUnion(x: Basic) {
9794
>testUnion : (x: Basic) => void
9895
>x : Basic
99-
>Basic : Basic
10096

10197
switch (typeof x) {
10298
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -152,10 +148,7 @@ function testUnion(x: Basic) {
152148

153149
function testExtendsUnion<T extends Basic>(x: T) {
154150
>testExtendsUnion : <T extends Basic>(x: T) => void
155-
>T : T
156-
>Basic : Basic
157151
>x : T
158-
>T : T
159152

160153
switch (typeof x) {
161154
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -276,7 +269,6 @@ function a1(x: string | object | undefined) {
276269
function testUnionExplicitDefault(x: Basic) {
277270
>testUnionExplicitDefault : (x: Basic) => void
278271
>x : Basic
279-
>Basic : Basic
280272

281273
switch (typeof x) {
282274
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -316,7 +308,6 @@ function testUnionExplicitDefault(x: Basic) {
316308
function testUnionImplicitDefault(x: Basic) {
317309
>testUnionImplicitDefault : (x: Basic) => string | object | undefined
318310
>x : Basic
319-
>Basic : Basic
320311

321312
switch (typeof x) {
322313
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -354,10 +345,7 @@ function testUnionImplicitDefault(x: Basic) {
354345

355346
function testExtendsExplicitDefault<T extends Basic>(x: T) {
356347
>testExtendsExplicitDefault : <T extends Basic>(x: T) => void
357-
>T : T
358-
>Basic : Basic
359348
>x : T
360-
>T : T
361349

362350
switch (typeof x) {
363351
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -397,10 +385,7 @@ function testExtendsExplicitDefault<T extends Basic>(x: T) {
397385

398386
function testExtendsImplicitDefault<T extends Basic>(x: T) {
399387
>testExtendsImplicitDefault : <T extends Basic>(x: T) => string | number | boolean | symbol | object | undefined
400-
>T : T
401-
>Basic : Basic
402388
>x : T
403-
>T : T
404389

405390
switch (typeof x) {
406391
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -448,8 +433,6 @@ type R = { x: string, y: number }
448433
function exhaustiveChecks(x: number | string | L | R): string {
449434
>exhaustiveChecks : (x: string | number | R | L) => string
450435
>x : string | number | R | L
451-
>L : L
452-
>R : R
453436

454437
switch (typeof x) {
455438
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -483,11 +466,7 @@ function exhaustiveChecks(x: number | string | L | R): string {
483466

484467
function exhaustiveChecksGenerics<T extends L | R | number | string>(x: T): string {
485468
>exhaustiveChecksGenerics : <T extends string | number | R | L>(x: T) => string
486-
>T : T
487-
>L : L
488-
>R : R
489469
>x : T
490-
>T : T
491470

492471
switch (typeof x) {
493472
>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -511,7 +490,6 @@ function exhaustiveChecksGenerics<T extends L | R | number | string>(x: T): stri
511490
>(x as L) : L
512491
>x as L : L
513492
>x : T
514-
>L : L
515493
>42 : 42
516494

517495
case 'object': return (x as R).x; // Can't narrow generic
@@ -520,22 +498,13 @@ function exhaustiveChecksGenerics<T extends L | R | number | string>(x: T): stri
520498
>(x as R) : R
521499
>x as R : R
522500
>x : T
523-
>R : R
524501
>x : string
525502
}
526503
}
527504

528505
function multipleGeneric<X extends L, Y extends R>(xy: X | Y): [X, string] | [Y, number] {
529506
>multipleGeneric : <X extends L, Y extends R>(xy: X | Y) => [X, string] | [Y, number]
530-
>X : X
531-
>L : L
532-
>Y : Y
533-
>R : R
534507
>xy : X | Y
535-
>X : X
536-
>Y : Y
537-
>X : X
538-
>Y : Y
539508

540509
switch (typeof xy) {
541510
>typeof xy : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -566,17 +535,7 @@ function multipleGeneric<X extends L, Y extends R>(xy: X | Y): [X, string] | [Y,
566535

567536
function multipleGenericFuse<X extends L | number, Y extends R | number>(xy: X | Y): [X, number] | [Y, string] | [(X | Y)] {
568537
>multipleGenericFuse : <X extends number | L, Y extends number | R>(xy: X | Y) => [X, number] | [Y, string] | [X | Y]
569-
>X : X
570-
>L : L
571-
>Y : Y
572-
>R : R
573538
>xy : X | Y
574-
>X : X
575-
>Y : Y
576-
>X : X
577-
>Y : Y
578-
>X : X
579-
>Y : Y
580539

581540
switch (typeof xy) {
582541
>typeof xy : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
@@ -603,15 +562,7 @@ function multipleGenericFuse<X extends L | number, Y extends R | number>(xy: X |
603562

604563
function multipleGenericExhaustive<X extends L, Y extends R>(xy: X | Y): [X, string] | [Y, number] {
605564
>multipleGenericExhaustive : <X extends L, Y extends R>(xy: X | Y) => [X, string] | [Y, number]
606-
>X : X
607-
>L : L
608-
>Y : Y
609-
>R : R
610565
>xy : X | Y
611-
>X : X
612-
>Y : Y
613-
>X : X
614-
>Y : Y
615566

616567
switch (typeof xy) {
617568
>typeof xy : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"

0 commit comments

Comments
 (0)