{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/21","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/21/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/21/events","html_url":"https://github.com/dotnet/roslyn/issues/21","id":54663242,"number":21,"title":"CCRewrite unhappy with Toolset Compilers 1.0.0-rc1-20150113-03","user":{"login":"codespare","id":4658087,"avatar_url":"https://avatars.githubusercontent.com/u/4658087?v=3","gravatar_id":"","url":"https://api.github.com/users/codespare","html_url":"https://github.com/codespare","followers_url":"https://api.github.com/users/codespare/followers","following_url":"https://api.github.com/users/codespare/following{/other_user}","gists_url":"https://api.github.com/users/codespare/gists{/gist_id}","starred_url":"https://api.github.com/users/codespare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codespare/subscriptions","organizations_url":"https://api.github.com/users/codespare/orgs","repos_url":"https://api.github.com/users/codespare/repos","events_url":"https://api.github.com/users/codespare/events{/privacy}","received_events_url":"https://api.github.com/users/codespare/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-17T14:28:34Z","updated_at":"2015-01-17T18:59:20Z","closed_at":null,"body":"After upgrading from to Microsoft.Net.ToolsetCompilers.1.0.0-beta2-20141216-04, CodeContract ccrewrite.exe (latest, v1.7.11202.10) starts to fail during build with:\r\nerror CC1099: Contract extraction failed: Found field <>8__1 in contract that shouldn't be here: In method ns.type.member.\r\nExact same code had no issue with Microsoft.Net.ToolsetCompilers.1.0.0-beta2-20141223-03.\r\nFunction exhibiting error is in a static class, along the lines of:\r\n\r\n    public static IEnumerable<tuple<object, MemberInfo, LinkArity, int, LinkDirection, object, LinkOutput>> BreadthFirstTraversal(\r\n            object fromObject,\r\n            Func<object, IEnumerable<Tuple<MemberInfo, LinkArity>>> getSubjectRelations,\r\n            Func<object, MemberInfo, LinkArity, IEnumerable<Tuple<int, object, LinkOutput>>> getRelatedObjects,\r\n            IEqualityComparer<object> nodeComparer = null\r\n            )\r\n        {\r\n            Contract.Requires<ArgumentNullException>(getSubjectRelations != null);\r\n            Contract.Requires<ArgumentNullException>(getRelatedObjects != null);\r\n        ...\r\n\r\nso with only 2 simple preconditions. Function body uses yield return after that.\r\nCommenting out the contracts removes the build error.\r\nThis only occurs in a few instances overall, the majority of contracts are unaffected, but I haven't identified the exact pattern causing that issue yet.\r\nIn another instance, ccrewrite goes through, but runtime behavior becomes faulty with a precondition asserting systematically.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/70379401","html_url":"https://github.com/dotnet/roslyn/issues/21#issuecomment-70379401","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/21","id":70379401,"user":{"login":"tmat","id":41759,"avatar_url":"https://avatars.githubusercontent.com/u/41759?v=3","gravatar_id":"","url":"https://api.github.com/users/tmat","html_url":"https://github.com/tmat","followers_url":"https://api.github.com/users/tmat/followers","following_url":"https://api.github.com/users/tmat/following{/other_user}","gists_url":"https://api.github.com/users/tmat/gists{/gist_id}","starred_url":"https://api.github.com/users/tmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmat/subscriptions","organizations_url":"https://api.github.com/users/tmat/orgs","repos_url":"https://api.github.com/users/tmat/repos","events_url":"https://api.github.com/users/tmat/events{/privacy}","received_events_url":"https://api.github.com/users/tmat/received_events","type":"User","site_admin":false},"created_at":"2015-01-17T18:59:20Z","updated_at":"2015-01-17T18:59:20Z","body":"I think I found what the problem is in Code Contracts. I have contacted the owners to see how CC can be fixed."}}