-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 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
Reactions are currently unavailable
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