Reporter |
|
---|---|
Created | Sep 3, 2010 8:52:39 PM |
Updated | Apr 7, 2018 2:54:46 PM |
Resolved | Apr 7, 2018 2:54:46 PM |
Subsystem | Quick Fixes |
Assignee | Alisa Afonina (alisa.afonina) |
Priority | Major |
State | Obsolete |
Type | Bug |
Fix version | No Fix versions |
Affected versions | No Affected versions |
Fixed In Version ReSharper | Undefined |
VsVersion | All Versions |
void X()
{
bool f = bool.Parse(Console.ReadLine());
int? x = null;
if(f)
x = 5;
int n = f ? (x ?? 6) : 7;
}
?? 6 is highlighted as redundant.
The QFix removes it without adding any cast, which changes the expression type from int to int?, which breaks the assignment.