-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
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 [email protected], 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
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue