{"action":"created","issue":{"url":"https://api.github.com/repos/castleproject/Core/issues/309","repository_url":"https://api.github.com/repos/castleproject/Core","labels_url":"https://api.github.com/repos/castleproject/Core/issues/309/labels{/name}","comments_url":"https://api.github.com/repos/castleproject/Core/issues/309/comments","events_url":"https://api.github.com/repos/castleproject/Core/issues/309/events","html_url":"https://github.com/castleproject/Core/issues/309","id":262738203,"number":309,"title":"Regression in 4.2.0 related to `MethodSignatureComparer`","user":{"login":"stakx","id":104481,"avatar_url":"https://avatars1.githubusercontent.com/u/104481?v=4","gravatar_id":"","url":"https://api.github.com/users/stakx","html_url":"https://github.com/stakx","followers_url":"https://api.github.com/users/stakx/followers","following_url":"https://api.github.com/users/stakx/following{/other_user}","gists_url":"https://api.github.com/users/stakx/gists{/gist_id}","starred_url":"https://api.github.com/users/stakx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stakx/subscriptions","organizations_url":"https://api.github.com/users/stakx/orgs","repos_url":"https://api.github.com/users/stakx/repos","events_url":"https://api.github.com/users/stakx/events{/privacy}","received_events_url":"https://api.github.com/users/stakx/received_events","type":"User","site_admin":false},"labels":[{"id":332238400,"url":"https://api.github.com/repos/castleproject/Core/labels/bug","name":"bug","color":"e11d21","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/castleproject/Core/milestones/6","html_url":"https://github.com/castleproject/Core/milestone/6","labels_url":"https://api.github.com/repos/castleproject/Core/milestones/6/labels","id":2800258,"number":6,"title":"vNext","description":"","creator":{"login":"jonorossi","id":126297,"avatar_url":"https://avatars1.githubusercontent.com/u/126297?v=4","gravatar_id":"","url":"https://api.github.com/users/jonorossi","html_url":"https://github.com/jonorossi","followers_url":"https://api.github.com/users/jonorossi/followers","following_url":"https://api.github.com/users/jonorossi/following{/other_user}","gists_url":"https://api.github.com/users/jonorossi/gists{/gist_id}","starred_url":"https://api.github.com/users/jonorossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonorossi/subscriptions","organizations_url":"https://api.github.com/users/jonorossi/orgs","repos_url":"https://api.github.com/users/jonorossi/repos","events_url":"https://api.github.com/users/jonorossi/events{/privacy}","received_events_url":"https://api.github.com/users/jonorossi/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":4,"state":"open","created_at":"2017-09-28T12:23:32Z","updated_at":"2017-10-09T16:20:04Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2017-10-04T10:28:26Z","updated_at":"2017-10-10T14:49:40Z","closed_at":"2017-10-09T15:46:20Z","author_association":"CONTRIBUTOR","body":"@cbruun just reported a regression in Moq (https://github.com/moq/moq4/issues/469) that looks like it's a regression in Castle Core 4.2.0, caused by #303 (commit 0fe612951276d73f8fe789ebc11478b5a42b7046).\r\n\r\n### Repro code:\r\n\r\n```csharp\r\npublic interface IBreak\r\n{\r\n\tvoid DoStuff<T>(Implementation1<T> a);\r\n\tvoid DoStuff<T>(Implementation2<T> a);\r\n}\r\n\r\npublic abstract class BaseType<T> { }\r\npublic class Implementation1<T> : BaseType<T> { }\r\npublic class Implementation2<T> : BaseType<T> { }\r\n\r\n// The following call to `CreateClassProxy` worked in 4.1.1, but throws in 4.2.0:\r\nvar generator = new ProxyGenerator();\r\ngenerator.CreateClassProxy(typeof(object), new[] { typeof(IBreak) } /* , someInterceptor */);\r\n```\r\n\r\n```\r\nSystem.TypeLoadException: Method 'DoStuff' in type 'Castle.Proxies.ObjectProxy' from assembly 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.\r\n   at System.Reflection.Emit.TypeBuilder.TermCreateClass(RuntimeModule module, Int32 tk, ObjectHandleOnStack type)\r\n   at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()\r\n   at System.Reflection.Emit.TypeBuilder.CreateTypeInfo()\r\n   at Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.CreateType(TypeBuilder type)\r\n   at Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType()\r\n   at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope)\r\n   at Castle.DynamicProxy.Generators.ClassProxyGenerator.<>c__DisplayClass1_0.<GenerateCode>b__0(String n, INamingScope s)\r\n   at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory)\r\n   at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options)\r\n   at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)\r\n   at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)\r\n   at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, IInterceptor[] interceptors)\r\n   at Program.Main() in …\r\n```\r\n\r\n### Probable cause of the regression:\r\n\r\n`MethodSignatureComparer.EqualSignatureTypes(x: typeof(Implementation1<T>), y: typeof(Implementation2<T>))` no longer returns `false`. It now returns `true` because it only checks the type arguments for equality, not the actual generic type definition itself.\r\n\r\n### Possible solution:\r\n\r\nSee the PR referenced below.\r\n\r\n/cc @BitWizJason"},"comment":{"url":"https://api.github.com/repos/castleproject/Core/issues/comments/335498129","html_url":"https://github.com/castleproject/Core/issues/309#issuecomment-335498129","issue_url":"https://api.github.com/repos/castleproject/Core/issues/309","id":335498129,"user":{"login":"jonorossi","id":126297,"avatar_url":"https://avatars1.githubusercontent.com/u/126297?v=4","gravatar_id":"","url":"https://api.github.com/users/jonorossi","html_url":"https://github.com/jonorossi","followers_url":"https://api.github.com/users/jonorossi/followers","following_url":"https://api.github.com/users/jonorossi/following{/other_user}","gists_url":"https://api.github.com/users/jonorossi/gists{/gist_id}","starred_url":"https://api.github.com/users/jonorossi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonorossi/subscriptions","organizations_url":"https://api.github.com/users/jonorossi/orgs","repos_url":"https://api.github.com/users/jonorossi/repos","events_url":"https://api.github.com/users/jonorossi/events{/privacy}","received_events_url":"https://api.github.com/users/jonorossi/received_events","type":"User","site_admin":false},"created_at":"2017-10-10T14:49:40Z","updated_at":"2017-10-10T14:49:40Z","author_association":"OWNER","body":"@stakx would a 4.2.1 release right now with just this fix be welcomed, it sounds like this might affect quite a lot of people.\r\n\r\n/cc @fir3pho3nixx"}}
{"actor":{"display_login":"jonorossi"}}