You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Ccrewrite fails with a NullReferenceException when a contract class contains a requires that has a lambda expression when compiled in Visual Studio 2015.
For example:
[ContractClass(typeof(FooContracts))]publicinterfaceIFoo{voidMethod(paramsstring[]strings);}[ContractClassFor(typeof(IFoo))]publicabstractclassFooContracts:IFoo{publicvoidMethod(paramsstring[]strings){Contract.Requires(Contract.ForAll(strings, s =>s.Length>0));}}publicclassFoo:IFoo{publicvoidMethod(paramsstring[]strings){Console.WriteLine(string.Join(", ",strings));}}
Perform Runtime Contract Checking has to be enabled and not None.
I believe it is due to a change in how lambdas and closures are compiled by Rosyln. Something that may be related is a Debug.Assert failing in Foxtrot\Foxtrot\Utility.cs line 2320