History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-24966
Type: Bug Bug
Status: Closed Closed
Resolution: Incomplete
Priority: Blocker Blocker
Assignee: Eugene Pasynkov
Reporter: Mark Wilden
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ReSharper

"Private field x is never assigned" diagnostic when properties can set

Created: 06 Aug 06 17:13   Updated: 09 Sep 06 13:33
Component/s: None
Fix Version/s: 2.0.1
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 240
Old URL: http://www.intellij.net/tracker/resharper/viewSCR?publicId=24966


 Description  « Hide
private Location _rateTag;

public string RateTag
{
get { return _rateTag.ItemName; }
set { _rateTag.ItemName = value; }
}



 All   Comments   Work Log   Change History      Sort Order:
James Hebben - 09 Aug 06 14:39
Re: #24966- "Private field x is never assigned" diagnostic when properties can set
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.


Mark Wilden - 09 Aug 06 14:39
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.


Mark Wilden - 09 Aug 06 14:39
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.