Closed
Description
About 1 weak ago, this sample below would transpile flawlessly under --strictNullChecks:
let sinOrCos = Math.random() < .5;
let choice = sinOrCos && Math.sin || Math.cos;
//let choice = sinOrCos? Math.sin : Math.cos;
alert(choice(Math.PI));
But to my surprise today, under typescript@1.9.0-dev.20160612-1.0, only the statement using the ternary conditional operator works now!
Somehow TS thinks that choice could be boolean
as well when using &&
+ ||
expression. =(
Is that intentional from now on? I miss when it was smarter just 1 week ago. :-(
tsc --pretty --newLine LF --removeComments --experimentalDecorators --strictNullChecks -d -t ES6 sinCos