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      

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!

Thanks for the reply but I have to say I'm dissapointed by this response.1. Lowering the inspection severity will not give me increased confidence - if the analyzer is fundamentally misunderstanding the C# language then I am going to be highly suspicious of anything it reports, why should it behave better at a lower severity level?2. I have explained the problem very clearly to you and have since uninstalled ReSharper - I have no sample solution handy.I also pointed out that the term "non-unmanaged" is poor and bad use of English - you don't need a sample solution to note that error and get it fixed.I don't expect ReSharper to mimick the Microsoft compiler in terms of either what it finds or how it reports those findings - however I do expect it to fully conform to the C# lanbguage grammar (that is understand the C# syntax) and semantics and the reported error about pointer use is a serious error in the analyzer I'm afraid.Now you said "which are not binded to the VS warnings" but I did not report a "warning" ReSharper reports this as an "Error" an error in the use of the C# language - in my persoanl view any tool that reports valid C# source as having errors is unusable in a serious development setting.You guys need to get back to work on this I'm afraid, I'm tired of third paty suppliers that pass off beta quality software as somehow ready for serious use, I cannot have a team getting misled by tools that are buggy like this - your analyzer does not understand the C# language and that needs to be 100% eliminated before you go any further I think.Now I've included enough infornation for you to reproduce this - its a basic C# langauge error - so I'd be more impressed if you told me it was being treated as a high priority bug and that a fix was being pursued with urgency.Out of interest - if I don't give you a sample solution - what will happen to this bug report? will it ever be fixed?RegardsHugh
There is also a deeper problem here - if I had not known that ReSharper was wrong about unsafe pointers then I'd assume it was correct and then I'd "fix" the error by changing and redesigning my logic.If ReSharper were used by an inexperienced C# developer then that developer would believe the warnings/errors that it reports and they'd alter their code in order to minimize the warnings/errors.If the workaround is to suppress the checks performed by the tool then we might as well not run the tool.I have to say I do not think ReSharper is in a fit state to be sold yet, it is still "beta" quality if it is reporting ANY errors that are not true errors - personally that would be my suggestion for moving from "beta" ensure that it never reports false errors.Warnings are something else, a false warning could be tolerated and treated as a bug in the relreased product but reporting false errors is unacceptable for a tool used on production source code.Hugh

Please sign in to leave a comment.