Skip to content

Commit 28b241e

Browse files
committed
Add regression test
1 parent 6366a6d commit 28b241e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @strictNullChecks: true
2+
3+
// Repro from #9113
4+
5+
let sinOrCos = Math.random() < .5;
6+
let choice = sinOrCos && Math.sin || Math.cos;
7+
8+
choice(Math.PI);
9+
10+
function sq(n?: number): number {
11+
const r = n !== undefined && n*n || 0;
12+
return r;
13+
}
14+
15+
sq(3);

0 commit comments

Comments
 (0)