Reporter |
|
---|---|
Created | Apr 4, 2018 11:00:44 PM |
Updated | Apr 9, 2018 7:36:53 PM |
Resolved | Apr 9, 2018 1:29:35 PM |
Subsystem | Quick Fixes |
Assignee | Andrew Karpov (andrew.karpov) |
Priority | Normal |
State | Fixed |
Type | Bug |
Fix version | 2018.1 |
Affected versions | No Affected versions |
Fixed In Version ReSharper | 2018.1 RTM |
VsVersion | All Versions |
When you type
float f = (float) new Random().NextDouble();
if (f!=float.NaN) {
Console.WriteLine("Valid random");
}
, Rider will suggest to "Fix floating point comparison" when you try to run that refactoring it will throw the following: "Unable to cast object of type 'JetBrains.ReSharper.Psi.CSharp.Impl.Tree.UnaryOperatorExpression' to type 'JetBrains.ReSharper.Psi.CSharp.Tree.IInvocationExpression'." And tells you "Unable to perform this action, most likely because of errors in the code". Log Attached (Private).