State of Code Contracts support?

KirkKlobeKirkKlobe USMember, Beta

I noticed that System.Diagnostics.Contracts seems pretty complete, but the cccheck and ccrewrite command-line tools in Mono 3.4.0 (stable channel) suggest that they are somewhat lacking in feature support, and I can't even get assembly resolution working properly (via MONO_PATH) with a simple iOS app. Looking at the mono repo, it doesn't look like there's been much activity there lately.

What is the intended current level of support, and, are there any near-future plans in that area?

Posts

  • MatthewDuckerMatthewDucker NZMember, Beta
    edited November 2014

    I tried to use this recently (today, actually), too.
    I can get the ccrewrite tool working (using "--level=3 --debug" parameters), but for some reason it chokes on the IDisposable implementation on one of my classes (a stream decorator) and dies.

    This is on OSX Yosemite using the latest Mono (3.10) in Xamarin Studio.

    If the ccrewrite tool is run on Windows (native version, not Mono), then the resulting assembly runs without incident on Mono.

    From what I understand or read, only Requires is fully implemented in Mono. I'm not sure if that's true though.

    It would be great if Xamarin could more properly implement Code Contracts, as they're a great way to improve code quality. Maybe that could be one of the next parts of Core that Microsoft could release as OSS ;-) .

  • GeoffreyHuntleyGeoffreyHuntley AUInsider, University ✭✭
Sign In or Register to comment.