Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-183038: Create local variable: Fails to determine type for enum if if-condition exist that compares variable with 0.

$
0
0
Reporter Stefan (GreenMoose) Stefan (GreenMoose)
Created Jun 18, 2010 8:24:41 PM
Updated Apr 7, 2018 11:13:02 AM
Resolved Apr 7, 2018 11:13:02 AM
Subsystem Quick Fixes
Assignee Alisa Afonina (alisa.afonina)
Priority Normal
State Obsolete
Type Bug
Fix version No Fix versions
Affected versions 5.0
Fixed In Version ReSharper Undefined
VsVersion All Versions
[5.1.1712]
public class Foo
{
public enum enTest { One }
public void Bar(enTest value)
{
testValue = value;
if (testValue==0)
throw new ArgumentException();
}
}

Try create local variable 'testValue', this will suggest type "object".
If altering the if condition to...
if (testValue==enTest.One)
...the create local variable suggest proper type.
(Also works properly if removing the condition all together).

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>