{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/2298","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/2298/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/2298/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/2298/events","html_url":"https://github.com/dotnet/roslyn/issues/2298","id":71397069,"number":2298,"title":"Ambiguous call error with VS2015 compiler","user":{"login":"AlekseyTs","id":10522107,"avatar_url":"https://avatars.githubusercontent.com/u/10522107?v=3","gravatar_id":"","url":"https://api.github.com/users/AlekseyTs","html_url":"https://github.com/AlekseyTs","followers_url":"https://api.github.com/users/AlekseyTs/followers","following_url":"https://api.github.com/users/AlekseyTs/following{/other_user}","gists_url":"https://api.github.com/users/AlekseyTs/gists{/gist_id}","starred_url":"https://api.github.com/users/AlekseyTs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlekseyTs/subscriptions","organizations_url":"https://api.github.com/users/AlekseyTs/orgs","repos_url":"https://api.github.com/users/AlekseyTs/repos","events_url":"https://api.github.com/users/AlekseyTs/events{/privacy}","received_events_url":"https://api.github.com/users/AlekseyTs/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/Bug","name":"Bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"AlekseyTs","id":10522107,"avatar_url":"https://avatars.githubusercontent.com/u/10522107?v=3","gravatar_id":"","url":"https://api.github.com/users/AlekseyTs","html_url":"https://github.com/AlekseyTs","followers_url":"https://api.github.com/users/AlekseyTs/followers","following_url":"https://api.github.com/users/AlekseyTs/following{/other_user}","gists_url":"https://api.github.com/users/AlekseyTs/gists{/gist_id}","starred_url":"https://api.github.com/users/AlekseyTs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlekseyTs/subscriptions","organizations_url":"https://api.github.com/users/AlekseyTs/orgs","repos_url":"https://api.github.com/users/AlekseyTs/repos","events_url":"https://api.github.com/users/AlekseyTs/events{/privacy}","received_events_url":"https://api.github.com/users/AlekseyTs/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/1","html_url":"https://github.com/dotnet/roslyn/milestones/1.0%20(stable)","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/1/labels","id":937397,"number":1,"title":"1.0 (stable)","description":"This is our 1.0 Milestone. ","creator":{"login":"jaredpar","id":146967,"avatar_url":"https://avatars.githubusercontent.com/u/146967?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredpar","html_url":"https://github.com/jaredpar","followers_url":"https://api.github.com/users/jaredpar/followers","following_url":"https://api.github.com/users/jaredpar/following{/other_user}","gists_url":"https://api.github.com/users/jaredpar/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredpar/subscriptions","organizations_url":"https://api.github.com/users/jaredpar/orgs","repos_url":"https://api.github.com/users/jaredpar/repos","events_url":"https://api.github.com/users/jaredpar/events{/privacy}","received_events_url":"https://api.github.com/users/jaredpar/received_events","type":"User","site_admin":false},"open_issues":190,"closed_issues":225,"state":"open","created_at":"2015-01-15T20:45:24Z","updated_at":"2015-04-27T20:44:43Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-04-27T20:44:43Z","updated_at":"2015-04-27T20:44:43Z","closed_at":null,"body":"Two extension methods with the same name are implemented on different interfaces. Both interfaces are grouped together on one single interface called e.g. “IFinalInterface”, so that this interface contains two extension methods with the same name. \r\n\r\nThe first extension method has a “params int[]” as parameter: \r\n```\r\npublic static int Properties(this IFirstInterface source, params int[] x) \r\n{ \r\n    return 0; \r\n}\r\n```\r\n \r\nThe second extension method has an additional optional parameter: \r\n```\r\npublic static bool Properties(this ISecondInterface source, int x = 0, params int[] y) \r\n{ \r\nreturn true; \r\n} \r\n```\r\n\r\nNow, the following call will cause an ambiguous call error: \r\nIFinalInterface x = default(IFinalInterface); \r\nvar properties = x.Properties(); //with params key word, the call is ambiguous \r\nIt seems that only this special scenario causes an ambiguous call error. If you don’t implement the “params” parameter, the compiler can resolve the call. \r\nAlso if you implement the two extension methods on one single Interface, the compiler can resolve the call. \r\nWith VS2010 compiler the mentioned scenario works also. \r\nHere is a code snippet that will show the issue: \r\n```\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing VS2015CompilerBug;\r\n\r\n\r\npublic static class Extensions\r\n{\r\n    //extension with params keyword\r\n    public static int Properties(this IFirstInterface source, params int[] x)\r\n    {\r\n        return 0;\r\n    }\r\n    public static bool Properties(this ISecondInterface source, int x = 0, params int[] y)\r\n    {\r\n        return true;\r\n    }\r\n\r\n    //extension without params keyword\r\n    public static int Properties2(this IFirstInterface source)\r\n    {\r\n        return 0;\r\n    }\r\n    public static bool Properties2(this ISecondInterface source, int x = 0)\r\n    {\r\n        return true;\r\n    }\r\n}\r\n\r\nnamespace VS2015CompilerBug\r\n{\r\n    public interface IFirstInterface\r\n    {\r\n\r\n    }\r\n    public interface ISecondInterface\r\n    {\r\n\r\n    }\r\n\r\n    public interface IFinalInterface : ISecondInterface, IFirstInterface\r\n    {\r\n\r\n    }\r\n    public class VS2015CompilerBug\r\n    {\r\n        public void Test()\r\n        {\r\n            IFinalInterface x = default(IFinalInterface);\r\n            var properties = x.Properties();    //with params key word, the call is ambiguous\r\n            var properties2 = x.Properties2();    //without params key word, the call can be resolved; the method with the \"int\" return type will be called\r\n\r\n\r\n            this.Test2();   //for member methods the call can also be resolved\r\n        }\r\n\r\n        private void Test2(int x = 5, params int[] y)\r\n        {\r\n\r\n        }\r\n        private void Test2(params int[] x)\r\n        {\r\n\r\n        }\r\n    }\r\n}\r\n```\r\n"}}