44class A {
55>A : Symbol(A, Decl(narrowingOfDottedNames.ts, 0, 0))
66
7- prop: { a: string; };
7+ prop! : { a: string; };
88>prop : Symbol(A.prop, Decl(narrowingOfDottedNames.ts, 2, 9))
9- >a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 11 ))
9+ >a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 12 ))
1010}
1111
1212class B {
1313>B : Symbol(B, Decl(narrowingOfDottedNames.ts, 4, 1))
1414
15- prop: { b: string; }
15+ prop! : { b: string; }
1616>prop : Symbol(B.prop, Decl(narrowingOfDottedNames.ts, 6, 9))
17- >b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 11 ))
17+ >b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 12 ))
1818}
1919
2020function isA(x: any): x is A {
@@ -51,22 +51,22 @@ function f1(x: A | B) {
5151>A : Symbol(A, Decl(narrowingOfDottedNames.ts, 0, 0))
5252
5353 x.prop.a;
54- >x.prop.a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 11 ))
54+ >x.prop.a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 12 ))
5555>x.prop : Symbol(A.prop, Decl(narrowingOfDottedNames.ts, 2, 9))
5656>x : Symbol(x, Decl(narrowingOfDottedNames.ts, 18, 12))
5757>prop : Symbol(A.prop, Decl(narrowingOfDottedNames.ts, 2, 9))
58- >a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 11 ))
58+ >a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 12 ))
5959 }
6060 else if (x instanceof B) {
6161>x : Symbol(x, Decl(narrowingOfDottedNames.ts, 18, 12))
6262>B : Symbol(B, Decl(narrowingOfDottedNames.ts, 4, 1))
6363
6464 x.prop.b;
65- >x.prop.b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 11 ))
65+ >x.prop.b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 12 ))
6666>x.prop : Symbol(B.prop, Decl(narrowingOfDottedNames.ts, 6, 9))
6767>x : Symbol(x, Decl(narrowingOfDottedNames.ts, 18, 12))
6868>prop : Symbol(B.prop, Decl(narrowingOfDottedNames.ts, 6, 9))
69- >b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 11 ))
69+ >b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 12 ))
7070 }
7171 }
7272}
@@ -83,23 +83,49 @@ function f2(x: A | B) {
8383>x : Symbol(x, Decl(narrowingOfDottedNames.ts, 29, 12))
8484
8585 x.prop.a;
86- >x.prop.a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 11 ))
86+ >x.prop.a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 12 ))
8787>x.prop : Symbol(A.prop, Decl(narrowingOfDottedNames.ts, 2, 9))
8888>x : Symbol(x, Decl(narrowingOfDottedNames.ts, 29, 12))
8989>prop : Symbol(A.prop, Decl(narrowingOfDottedNames.ts, 2, 9))
90- >a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 11 ))
90+ >a : Symbol(a, Decl(narrowingOfDottedNames.ts, 3, 12 ))
9191 }
9292 else if (isB(x)) {
9393>isB : Symbol(isB, Decl(narrowingOfDottedNames.ts, 12, 1))
9494>x : Symbol(x, Decl(narrowingOfDottedNames.ts, 29, 12))
9595
9696 x.prop.b;
97- >x.prop.b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 11 ))
97+ >x.prop.b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 12 ))
9898>x.prop : Symbol(B.prop, Decl(narrowingOfDottedNames.ts, 6, 9))
9999>x : Symbol(x, Decl(narrowingOfDottedNames.ts, 29, 12))
100100>prop : Symbol(B.prop, Decl(narrowingOfDottedNames.ts, 6, 9))
101- >b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 11 ))
101+ >b : Symbol(b, Decl(narrowingOfDottedNames.ts, 7, 12 ))
102102 }
103103 }
104104}
105105
106+ // Repro from #28100
107+
108+ class Foo1
109+ >Foo1 : Symbol(Foo1, Decl(narrowingOfDottedNames.ts, 38, 1))
110+ {
111+ x: number; // Error
112+ >x : Symbol(Foo1.x, Decl(narrowingOfDottedNames.ts, 43, 1))
113+
114+ constructor() {
115+ if (this instanceof Boolean) {
116+ >this : Symbol(Foo1, Decl(narrowingOfDottedNames.ts, 38, 1))
117+ >Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
118+ }
119+ }
120+ }
121+
122+ class Foo2
123+ >Foo2 : Symbol(Foo2, Decl(narrowingOfDottedNames.ts, 49, 1))
124+ {
125+ x: number; // Error
126+ >x : Symbol(Foo2.x, Decl(narrowingOfDottedNames.ts, 52, 1))
127+
128+ constructor() {
129+ }
130+ }
131+
0 commit comments