This Question is Not Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
3 Replies Last post: Sep 27, 2013 5:39 PM by Hugh Moran  
Hugh Moran Newbie 5 posts since
Jul 12, 2013
Currently Being Moderated

Sep 26, 2013 6:59 PM

C# Compiler Errors - Nothing less than 100% conformance with the language should be tolerated.

I'm just exploring Resharper for the first time and ran an analysis on some high performance code here.This code builds and runs fine under Visual C# (in VS 2010).Under "C# Compiler Errors" are reports about the use of unsafe pointers:"Cannot declare pointer to non-unmanaged type"and´╗┐"Cannot take the address of a variable of a managed type"The code though is legal and valid C# - the Visual C# compiler does not report compiler errors or warnings either.Resharper appears to be in error - the code would be invalid if the pointers where not "fixed" (at the CLR level) but the code explicitly uses the "fixed" keyword - this is entirely valid.Also the terminology "non-unmanaged" is poor I think and could be changed to "managed".So unless I'm missing something these particular reports are false alarms and Resharper should not complain about this valid C# in this case.Also why does Resharper have a section named "C# Compiler Errors" unless this matches EXACTLY what the actual C# compiler reports?Opinions welcome!ThanksHugh     
Alex Berezoutsky JetBrains 580 posts since
Feb 18, 2011
Currently Being Moderated
Jul 31, 2013 4:56 PM in response to: Hugh Moran
Re: C# Compiler Errors - are they reliable?

Hello Hugh,


ReSharper does analyze the source code and provides its own Code Suggestions, which are not binded to the VS warnings. If you think that ReSharper has a false positive warning in your case, please:

1. Feel free to lower the Inspection Severity of the particular Code Inspection in the "ReSharper | Options | Code Inspection | Inspection Severity" dialog to not be bothered by it.

2. Provide us a small sample solution, which will demonstrate the issue. We will check it out and, if it is a false positive there, provide a bugfix for this in the next ReSharper version.


We apologize for the inconveneince.

Thank you!

More Like This

  • Retrieving data ...