Open IPWright83 opened 8 years ago
This looks very similar to #191.
@fedotovalex Looking at it yeah, the result is certainly the same. I'll leave it open for now in-case the circumstances that trigger the issue are different at all. If not I imagine @SergeyTeplyakov should be able to verify and close.
I've just found an issue which seems to be originating from CodeContracts after upgrading to Visual Studio 2015. I'm getting a runtime error during execution (NullReferenceException), which appears to be from some incorrectly compiled code. The code however compiles fine with VS2013 (both are targetting .NET 4.5). The issue also goes away in VS2015 if I turn off the
Perform Runtime Contract Checking
. Here's an example of the error in action:Notice the really strange this in there is that
this
is throwing a NullReferenceException. So here's the code that's been compiled, where the first constructor has been called, feeding through to the 2nd one:You'll probably need to know some of the internals of
Option<BusinessFilter>
which seems to be the main problem so here's a copy/paste of that entire class:So I've taken a look at the compiled output using Reflector and noticed an obvious difference in the
DisplayClass
, namely that in VS2015 output it hasn't been initialized - explaining why we're encountering the error.Here is the working VS2013 output:
and here is the broken VS2015 output: