Reporter | Evgeny Gavrin (Evgeny.Gavrin) |
---|---|
Created | Feb 3, 2012 5:34:34 PM |
Updated | Feb 3, 2012 5:36:23 PM |
Priority | Critical |
Type | Bug |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Evgeny Pasynkov (pasynkov) |
Subsystem | Code Analysis |
Affected versions | 6.1.1 |
Fixed in build | No Fixed in build |
If you press Alt-Enter over "(double)" and accept the "Compute constant value" transformation - "(double)" disappears, the resulting code becomes incorrect and the constant will not be calculated.
double doubleValue; int intValue1 = 985; int intValue2 = 7000; // Correct code before transformation doubleValue = intValue2 * ((double)1 / intValue1) - 0.01; Console.WriteLine(doubleValue); // 7.... // after (incorrect) doubleValue = intValue2 * (1 / intValue1) - 0.01; Console.WriteLine(doubleValue); // -0.0..