Skip to content

Commit ba8310a

Browse files
committed
Add regression test
1 parent 6fbd2a5 commit ba8310a

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

tests/cases/compiler/narrowingOfDottedNames.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
// @strict: true
2+
13
// Repro from #8383
24

35
class A {
4-
prop: { a: string; };
6+
prop!: { a: string; };
57
}
68

79
class B {
8-
prop: { b: string; }
10+
prop!: { b: string; }
911
}
1012

1113
function isA(x: any): x is A {
@@ -37,3 +39,21 @@ function f2(x: A | B) {
3739
}
3840
}
3941
}
42+
43+
// Repro from #28100
44+
45+
class Foo1
46+
{
47+
x: number; // Error
48+
constructor() {
49+
if (this instanceof Boolean) {
50+
}
51+
}
52+
}
53+
54+
class Foo2
55+
{
56+
x: number; // Error
57+
constructor() {
58+
}
59+
}

0 commit comments

Comments
 (0)