Skip to content

Commit 6cd7db8

Browse files
committed
Adding regression test
1 parent ecc9361 commit 6cd7db8

4 files changed

Lines changed: 71 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//// [defaultOfAnyInStrictNullChecks.ts]
2+
3+
// Regression test for #8295
4+
5+
function foo() {
6+
try {
7+
}
8+
catch (e) {
9+
let s = e.message;
10+
}
11+
}
12+
13+
14+
//// [defaultOfAnyInStrictNullChecks.js]
15+
// Regression test for #8295
16+
function foo() {
17+
try {
18+
}
19+
catch (e) {
20+
var s = e.message;
21+
}
22+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
=== tests/cases/compiler/defaultOfAnyInStrictNullChecks.ts ===
2+
3+
// Regression test for #8295
4+
5+
function foo() {
6+
>foo : Symbol(foo, Decl(defaultOfAnyInStrictNullChecks.ts, 0, 0))
7+
8+
try {
9+
}
10+
catch (e) {
11+
>e : Symbol(e, Decl(defaultOfAnyInStrictNullChecks.ts, 6, 11))
12+
13+
let s = e.message;
14+
>s : Symbol(s, Decl(defaultOfAnyInStrictNullChecks.ts, 7, 11))
15+
>e : Symbol(e, Decl(defaultOfAnyInStrictNullChecks.ts, 6, 11))
16+
}
17+
}
18+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/compiler/defaultOfAnyInStrictNullChecks.ts ===
2+
3+
// Regression test for #8295
4+
5+
function foo() {
6+
>foo : () => void
7+
8+
try {
9+
}
10+
catch (e) {
11+
>e : any
12+
13+
let s = e.message;
14+
>s : any
15+
>e.message : any
16+
>e : any
17+
>message : any
18+
}
19+
}
20+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// @strictNullChecks: true
2+
3+
// Regression test for #8295
4+
5+
function foo() {
6+
try {
7+
}
8+
catch (e) {
9+
let s = e.message;
10+
}
11+
}

0 commit comments

Comments
 (0)