Reporter | William Dean (willdean) |
---|---|
Created | Feb 19, 2011 2:00:39 AM |
Updated | Feb 9, 2012 9:11:38 PM |
Priority | Normal |
Type | Bug |
Fix versions | Mirabile Futurum |
State | Submitted |
Assignee | Alexey Kuptsov (alexey.kuptsov) |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
The following code:
Contains an error at "val & TestEnum.a"
R# offers a quick-fix "Compare with default value", which converts the if to:
The (TestEnum) cast is redundant and so, after a short pause, is marked as dead code, requiring a reposition and another quick-fix to get a clean line.
It would be better if the first quick-fix could insert the clean code to start with.
class Test { [Flags] enum TestEnum { a = 0x01, b = 0x02, } void MyMethod() { TestEnum val = TestEnum.a; if(val & TestEnum.a) { ; } } }
Contains an error at "val & TestEnum.a"
R# offers a quick-fix "Compare with default value", which converts the if to:
if((val & TestEnum.a) != (TestEnum)0)
The (TestEnum) cast is redundant and so, after a short pause, is marked as dead code, requiring a reposition and another quick-fix to get a clean line.
It would be better if the first quick-fix could insert the clean code to start with.