Reporter | Roman Royter (rroyter) |
---|---|
Created | Mar 29, 2012 8:53:51 PM |
Updated | Mar 29, 2012 8:53:51 PM |
Priority | Normal |
Type | Unspecified |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Unassigned |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
R# gives a false positive on the following code:
private readonly Rect rect;
...
if (rect.Contains(point))
{
...
}
"Impure Method is called for readonly field of value type."
read only structs are passed by copy, so the Contains method cannot modify the original struct and therefore it is pure.
See http://stackoverflow.com/q/9927434/71263 for reference.
private readonly Rect rect;
...
if (rect.Contains(point))
{
...
}
"Impure Method is called for readonly field of value type."
read only structs are passed by copy, so the Contains method cannot modify the original struct and therefore it is pure.
See http://stackoverflow.com/q/9927434/71263 for reference.