-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-CompilersResolution-By DesignThe behavior reported in the issue matches the current designThe behavior reported in the issue matches the current design
Milestone
Description
Version Used:
Microsoft Visual Studio Community 2017
Version 15.2 (26430.16) Release
VisualStudio.15.Release/15.2.0+26430.16
Microsoft .NET Framework
Version 4.6.01586
Steps to Reproduce:
This produces "Use of unassigned local variable" but it should not.
if ((variable is Type x) == false) {
return;
}
x.Function();
This should be logically equivalent to code above and it works fine.
if (!(variable is Type x)) {
return;
}
x.Function();
We like to use == flase instead of ! in our code base for added readability. Unfortunately this does not work with above statement :/ Would it be possible to add it?
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-CompilersResolution-By DesignThe behavior reported in the issue matches the current designThe behavior reported in the issue matches the current design