I'm writing in C# with ReSharper 8.0 and VS2012 for .NET 4.0.
ReSharper includes an attribute: JetBrains.Annotations.PureAttribute. This is used to provide the inspection "Return value of Pure method is not used".
Code Contracts includes an attribute: System.Diagnostics.Contracts.PureAttribute. This is used by the code contract checking to ensure that the call will produce no visible state changes, and therefore will not require re-checking the object's state.
Currently, to get the functionality of both of these tools, methods need to be annotated with attribute from each. Worse, because they both share the same type name, you need to qualify each attribute.
[Pure]
[Jetbrains.Annotations.Pure]
public bool isFinished() {
...
To avoid this situation, there should be three approaches:
- write a placeholder recognized by both ReSharper and Contracts
- get ReSharper to recognize the Contracts attribute
- get Contracts to recognize the ReSharper attribute
Are any of these possible?