@@ -556,3 +556,48 @@ function test2(foo: Foo): {value: {type: 'A'}; a?: number} {
556
556
>foo : Symbol(foo, Decl(strictSubtypeAndNarrowing.ts, 206, 15))
557
557
}
558
558
559
+ // Repro from #53063
560
+
561
+ interface Free {
562
+ >Free : Symbol(Free, Decl(strictSubtypeAndNarrowing.ts, 209, 1))
563
+
564
+ premium: false;
565
+ >premium : Symbol(Free.premium, Decl(strictSubtypeAndNarrowing.ts, 213, 16))
566
+ }
567
+
568
+ interface Premium {
569
+ >Premium : Symbol(Premium, Decl(strictSubtypeAndNarrowing.ts, 215, 1))
570
+
571
+ premium: true;
572
+ >premium : Symbol(Premium.premium, Decl(strictSubtypeAndNarrowing.ts, 217, 19))
573
+ }
574
+
575
+ type Union = { premium: false } | { premium: true };
576
+ >Union : Symbol(Union, Decl(strictSubtypeAndNarrowing.ts, 219, 1))
577
+ >premium : Symbol(premium, Decl(strictSubtypeAndNarrowing.ts, 221, 14))
578
+ >premium : Symbol(premium, Decl(strictSubtypeAndNarrowing.ts, 221, 35))
579
+
580
+ declare const checkIsPremium: (a: Union) => a is Union & Premium;
581
+ >checkIsPremium : Symbol(checkIsPremium, Decl(strictSubtypeAndNarrowing.ts, 223, 13))
582
+ >a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 223, 31))
583
+ >Union : Symbol(Union, Decl(strictSubtypeAndNarrowing.ts, 219, 1))
584
+ >a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 223, 31))
585
+ >Union : Symbol(Union, Decl(strictSubtypeAndNarrowing.ts, 219, 1))
586
+ >Premium : Symbol(Premium, Decl(strictSubtypeAndNarrowing.ts, 215, 1))
587
+
588
+ const f = (value: Union) => {
589
+ >f : Symbol(f, Decl(strictSubtypeAndNarrowing.ts, 225, 5))
590
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 225, 11))
591
+ >Union : Symbol(Union, Decl(strictSubtypeAndNarrowing.ts, 219, 1))
592
+
593
+ if (!checkIsPremium(value)) {
594
+ >checkIsPremium : Symbol(checkIsPremium, Decl(strictSubtypeAndNarrowing.ts, 223, 13))
595
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 225, 11))
596
+
597
+ value.premium;
598
+ >value.premium : Symbol(premium, Decl(strictSubtypeAndNarrowing.ts, 221, 14))
599
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 225, 11))
600
+ >premium : Symbol(premium, Decl(strictSubtypeAndNarrowing.ts, 221, 14))
601
+ }
602
+ };
603
+
0 commit comments