|
|
|
Re: #24966- "Private field x is never assigned" diagnostic when properties can set
Sorry, I should have mentioned that Location is indeed a struct. I'll try this code with build 241. Re: #24966- "Private field x is never assigned" diagnostic when properties can set
I see the same result with 241. Unfortunately, I'm not able to dupe with a simple program. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
From your code snippet, the variable _rateTag is never assigned (I.E. the instance _rateTage of type Location is never created).
If the Location type is a class, calling the property getter or setter will result in a NullReferenceException. In this case R# is correct in its diagnostic.
If the Location is a struct, calling the property getter or setter is valid and R# (build 241) correctly parses the file as containing no errors.