{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/12061","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/12061/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/12061/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/12061/events","html_url":"https://github.com/dotnet/roslyn/issues/12061","id":160778873,"number":12061,"title":"Stack overflow with delegate type that returns itself","user":{"login":"khyperia","id":953151,"avatar_url":"https://avatars.githubusercontent.com/u/953151?v=3","gravatar_id":"","url":"https://api.github.com/users/khyperia","html_url":"https://github.com/khyperia","followers_url":"https://api.github.com/users/khyperia/followers","following_url":"https://api.github.com/users/khyperia/following{/other_user}","gists_url":"https://api.github.com/users/khyperia/gists{/gist_id}","starred_url":"https://api.github.com/users/khyperia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khyperia/subscriptions","organizations_url":"https://api.github.com/users/khyperia/orgs","repos_url":"https://api.github.com/users/khyperia/repos","events_url":"https://api.github.com/users/khyperia/events{/privacy}","received_events_url":"https://api.github.com/users/khyperia/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Compilers","name":"Area-Compilers","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Bug","name":"Bug","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Language-C%23","name":"Language-C#","color":"207de5"}],"state":"open","locked":false,"assignee":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"assignees":[{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},{"login":"MadsTorgersen","id":6677272,"avatar_url":"https://avatars.githubusercontent.com/u/6677272?v=3","gravatar_id":"","url":"https://api.github.com/users/MadsTorgersen","html_url":"https://github.com/MadsTorgersen","followers_url":"https://api.github.com/users/MadsTorgersen/followers","following_url":"https://api.github.com/users/MadsTorgersen/following{/other_user}","gists_url":"https://api.github.com/users/MadsTorgersen/gists{/gist_id}","starred_url":"https://api.github.com/users/MadsTorgersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadsTorgersen/subscriptions","organizations_url":"https://api.github.com/users/MadsTorgersen/orgs","repos_url":"https://api.github.com/users/MadsTorgersen/repos","events_url":"https://api.github.com/users/MadsTorgersen/events{/privacy}","received_events_url":"https://api.github.com/users/MadsTorgersen/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/15","html_url":"https://github.com/dotnet/roslyn/milestones/2.0%20(RC)","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/15/labels","id":1571383,"number":15,"title":"2.0 (RC)","description":"","creator":{"login":"davkean","id":1103906,"avatar_url":"https://avatars.githubusercontent.com/u/1103906?v=3","gravatar_id":"","url":"https://api.github.com/users/davkean","html_url":"https://github.com/davkean","followers_url":"https://api.github.com/users/davkean/followers","following_url":"https://api.github.com/users/davkean/following{/other_user}","gists_url":"https://api.github.com/users/davkean/gists{/gist_id}","starred_url":"https://api.github.com/users/davkean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davkean/subscriptions","organizations_url":"https://api.github.com/users/davkean/orgs","repos_url":"https://api.github.com/users/davkean/repos","events_url":"https://api.github.com/users/davkean/events{/privacy}","received_events_url":"https://api.github.com/users/davkean/received_events","type":"User","site_admin":false},"open_issues":1101,"closed_issues":132,"state":"open","created_at":"2016-02-08T21:53:59Z","updated_at":"2016-07-01T23:34:02Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-06-16T22:53:31Z","updated_at":"2016-07-05T18:13:59Z","closed_at":null,"body":"**Reproduction steps**:\r\n\r\nCompile the following code on the command line (or paste it into VS, which hangs VS).\r\n\r\n```csharp\r\ndelegate Del1 Del1();\r\ndelegate Del2 Del2();\r\n\r\nclass Program\r\n{\r\n    static void Method(Del1 del1) { }\r\n    static void Method(Del2 del2) { }\r\n    static void Main()\r\n    {\r\n        Method(() => null);\r\n    }\r\n}\r\n```\r\n\r\n**Version Used**:\r\n\r\n1. master (ish): stack overflow\r\n1. 1.2.0.60325 (roslyn): stack overflow\r\n1. 4.6.1038.0 (native): test.cs(10,9): error CS0121: The call is ambiguous between the following methods or properties: 'Program.Method(Del1)' and 'Program.Method(Del2)'\r\n\r\nI think this is due to a recursive loop in `OverloadResolution.BetterConversionTarget` - we get into the case where both types are delegates, get their return types, and then recurse with `BetterConversionTarget(r1, r2, ref useSiteDiagnostics)` (r1/r2 are the return types of the delegates). They're the same type as the original delegates, so, *boom*."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/230558007","html_url":"https://github.com/dotnet/roslyn/issues/12061#issuecomment-230558007","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/12061","id":230558007,"user":{"login":"AnthonyDGreen","id":10539978,"avatar_url":"https://avatars.githubusercontent.com/u/10539978?v=3","gravatar_id":"","url":"https://api.github.com/users/AnthonyDGreen","html_url":"https://github.com/AnthonyDGreen","followers_url":"https://api.github.com/users/AnthonyDGreen/followers","following_url":"https://api.github.com/users/AnthonyDGreen/following{/other_user}","gists_url":"https://api.github.com/users/AnthonyDGreen/gists{/gist_id}","starred_url":"https://api.github.com/users/AnthonyDGreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnthonyDGreen/subscriptions","organizations_url":"https://api.github.com/users/AnthonyDGreen/orgs","repos_url":"https://api.github.com/users/AnthonyDGreen/repos","events_url":"https://api.github.com/users/AnthonyDGreen/events{/privacy}","received_events_url":"https://api.github.com/users/AnthonyDGreen/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T18:13:59Z","updated_at":"2016-07-05T18:13:59Z","body":"So many InProgress binders..."}}
{"actor":{"display_login":"AnthonyDGreen"}}