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

Key: RSRP-33427
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Eugene Pasynkov
Reporter: Vladimir Reshetnikov
Votes: 0
Watchers: 1
Operations

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

error CS0120: An object reference is required for the nonstatic field, method, or property 'object.GetHashCode()'

Created: 14 Dec 06 14:04   Updated: 07 Aug 08 13:03
Component/s: Code Analysis
Fix Version/s: 4.1
Security Level: Everybody (All jira users)

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

Build: 326
Fixed in build: 920


 Description  « Hide
internal struct Stuff
{
	private delegate void F();
	private void Foo()
	{
		F f = delegate { GetHashCode(); }; // error CS0120: An object reference is required for the nonstatic field, method, or property 'object.GetHashCode()'
	}
}


 All   Comments   Work Log   Change History      Sort Order:
Vladimir Reshetnikov - 14 Dec 06 15:36
The reason is that 'this' and 'base' cannot be used in anonymouses inside structs. Neither explicitly nor implicitly.