{"action":"opened","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/2735","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/2735/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/2735/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/2735/events","html_url":"https://github.com/dotnet/roslyn/issues/2735","id":76155715,"number":2735,"title":"Incorrect compiler error for method with async/non-async delegate overloads","user":{"login":"svick","id":287848,"avatar_url":"https://avatars.githubusercontent.com/u/287848?v=3","gravatar_id":"","url":"https://api.github.com/users/svick","html_url":"https://github.com/svick","followers_url":"https://api.github.com/users/svick/followers","following_url":"https://api.github.com/users/svick/following{/other_user}","gists_url":"https://api.github.com/users/svick/gists{/gist_id}","starred_url":"https://api.github.com/users/svick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svick/subscriptions","organizations_url":"https://api.github.com/users/svick/orgs","repos_url":"https://api.github.com/users/svick/repos","events_url":"https://api.github.com/users/svick/events{/privacy}","received_events_url":"https://api.github.com/users/svick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-13T23:10:01Z","updated_at":"2015-05-13T23:10:01Z","closed_at":null,"body":"Assuming the following two declarations:\r\n\r\n```c#\r\nstatic void M(Func<Task<int>> f, int i)\r\n{}\r\n\r\nstatic void M(Func<int> f, int i)\r\n{}\r\n```\r\n\r\nThe code:\r\n\r\n```c#\r\nM(() => 42, \"\");\r\n```\r\n\r\nCauses the errors:\r\n\r\n> CS0029 Cannot implicitly convert type '`int`' to '`System.Threading.Tasks.Task<int>`'\r\n> CS1662 Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type\r\n\r\nWhile the code:\r\n\r\n```c#\r\nM(async () => 42, \"\");\r\n```\r\n\r\nCauses the error:\r\n\r\n> CS4010 Cannot convert async lambda expression to delegate type '`Func<int>`'. An async lambda expression may return `void`, `Task` or `Task<T>`, none of which are convertible to '`Func<int>`'.\r\n\r\nIn both cases, the code is wrong, but the reported error is bogus: the lambda parameter is okay, it's the second parameter that causes the compilation to fail (`string` passed in instead of `int`), so that's what should be reported.\r\n\r\nI'm using VS 2015 RC and the latest version of Roslyn from NuGet (1.0.0-rc2) behaves the same. [Full repro code for reference.](https://gist.github.com/svick/08a665153ac9b8567195)\r\n\r\nThis report is based on dotnet/corefx#1738 by @tucaz."}}