I'm using Resharper 5.x to do compile-time analysis and it's usually pretty good about it, but it doesn't seem to be applying code contracts to its logic. I have something like the following, but I'm getting an issue on the marked line.
public void Method(int arg)
{
Contract.Requires(this.NullableValueType != null);
this.Method2(
arg,
this.NullableValueType.Value, // [1]
this.ReferenceType);
}
[1] ends up getting highlighted with "Possible 'System.InvalidOperationException'". Is there a way to get rid of this error without turning off the check?