-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Unreachable "else block" code isn't reported as such, when "is var" is used #15489
Comments
As currently specified, an unreachable code warning is only produced when the if expression is the constant |
@MadsTorgersen Does this belong on the LDM agenda? |
I think there was a proposal for disallowing |
The LDM met yesterday and confirmed that the current behavior is intended. We do not make any reachability accommodation for an is-pattern-matching operation that is irrefutable. |
Version Used: VS2017 RC
Steps to Reproduce:
Expected Behavior:
As
s is var x
will always be true, an "Unreachable code detected" warning should be reported for the contents of theelse
block.Actual Behavior:
No warning is reported.
The text was updated successfully, but these errors were encountered: