-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Suggestion: errors based on control flow analysis #2176
Comments
As Cyrus notes, we're considering control flow analysis additions that would catch cases like this, but there are tradeoffs. I don't see an actual issue tracking this so I'll just rename this and Vlad's PR can be associated with it now. |
Lots of us would want that code to cause an error. I submitted #2316 which is more general than function borked() above, as a concrete sub-class of 'all errors that could be detected through control flow analysis'. |
We want to revisit all these control flow things after 2.0 ships. It's a high-value area we want to invest in, but there's no room left in the schedule for something as large in scope as this. |
This should be reported as an error now with |
What, all this business with union types, indeed a veritable managerie of type-related tricks, and we can't make the basics work?
I know this will be flagged with the dreaded "By Design", because of some silly JavaScript use case that I can't imagine, but it's such an obviously wrong feature of the language that I can't help raising as an issue. (Apologies if it's a duplicate.)
The text was updated successfully, but these errors were encountered: