-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #22604: Make endsInNoReturn traverse the tree #22612
Conversation
Acceptable for now but the spec doesn't imply that type checking has to care about |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
Other languages have "never" types for this |
Well I know nothing of language design, just (trying to) solve interesting looking problems. You’re right though, never type looks pretty good compared to this. |
That doesn't improve the situation all that much, so you introduce weirdo types that do not compose and need special handling elsewhere. What is a |
* Rewrite endsInNoReturn * Handle `try` stmt again and add tests * Fix unreachable code warning * Remove unreachable code in semexprs again * Check `it.len` before skip * Move import of assertions --------- Co-authored-by: SirOlaf <> (cherry picked from commit 3b206ed)
* Rewrite endsInNoReturn * Handle `try` stmt again and add tests * Fix unreachable code warning * Remove unreachable code in semexprs again * Check `it.len` before skip * Move import of assertions --------- Co-authored-by: SirOlaf <> (cherry picked from commit 3b206ed)
* Rewrite endsInNoReturn * Handle `try` stmt again and add tests * Fix unreachable code warning * Remove unreachable code in semexprs again * Check `it.len` before skip * Move import of assertions --------- Co-authored-by: SirOlaf <> (cherry picked from commit 3b206ed)
* Rewrite endsInNoReturn * Handle `try` stmt again and add tests * Fix unreachable code warning * Remove unreachable code in semexprs again * Check `it.len` before skip * Move import of assertions --------- Co-authored-by: SirOlaf <> (cherry picked from commit 3b206ed)
* Rewrite endsInNoReturn * Handle `try` stmt again and add tests * Fix unreachable code warning * Remove unreachable code in semexprs again * Check `it.len` before skip * Move import of assertions --------- Co-authored-by: SirOlaf <> (cherry picked from commit 3b206ed)
Close #22604
endsInNoReturn
now traverses relevant nodes to determine if the block really doesn't return.Same story as in previous pr, improves type inference and unreachable code detection somewhat, iterator example also now not seen as a noreturn, so thanks for stopping the flag nonsense I was doing.
Alternative to #22608