{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/26997","repository_url":"https://api.github.com/repos/dotnet/roslyn","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/26997/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/26997/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/26997/events","html_url":"https://github.com/dotnet/roslyn/pull/26997","id":324702809,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5MjMwMTYz","number":26997,"title":"Infer type in get accessor declarations, expression bodied local functions and local functions inside lambda expressions","user":{"login":"rik-smeets","id":30838294,"node_id":"MDQ6VXNlcjMwODM4Mjk0","avatar_url":"https://avatars1.githubusercontent.com/u/30838294?v=4","gravatar_id":"","url":"https://api.github.com/users/rik-smeets","html_url":"https://github.com/rik-smeets","followers_url":"https://api.github.com/users/rik-smeets/followers","following_url":"https://api.github.com/users/rik-smeets/following{/other_user}","gists_url":"https://api.github.com/users/rik-smeets/gists{/gist_id}","starred_url":"https://api.github.com/users/rik-smeets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rik-smeets/subscriptions","organizations_url":"https://api.github.com/users/rik-smeets/orgs","repos_url":"https://api.github.com/users/rik-smeets/repos","events_url":"https://api.github.com/users/rik-smeets/events{/privacy}","received_events_url":"https://api.github.com/users/rik-smeets/received_events","type":"User","site_admin":false},"labels":[{"id":188683308,"node_id":"MDU6TGFiZWwxODg2ODMzMDg=","url":"https://api.github.com/repos/dotnet/roslyn/labels/Approved%20to%20merge","name":"Approved to merge","color":"fbca04","default":false},{"id":166377917,"node_id":"MDU6TGFiZWwxNjYzNzc5MTc=","url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-IDE","name":"Area-IDE","color":"5319e7","default":false},{"id":288147422,"node_id":"MDU6TGFiZWwyODgxNDc0MjI=","url":"https://api.github.com/repos/dotnet/roslyn/labels/Community","name":"Community","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":{"login":"tmat","id":41759,"node_id":"MDQ6VXNlcjQxNzU5","avatar_url":"https://avatars0.githubusercontent.com/u/41759?v=4","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},"assignees":[{"login":"tmat","id":41759,"node_id":"MDQ6VXNlcjQxNzU5","avatar_url":"https://avatars0.githubusercontent.com/u/41759?v=4","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},{"login":"jcouv","id":12466233,"node_id":"MDQ6VXNlcjEyNDY2MjMz","avatar_url":"https://avatars2.githubusercontent.com/u/12466233?v=4","gravatar_id":"","url":"https://api.github.com/users/jcouv","html_url":"https://github.com/jcouv","followers_url":"https://api.github.com/users/jcouv/followers","following_url":"https://api.github.com/users/jcouv/following{/other_user}","gists_url":"https://api.github.com/users/jcouv/gists{/gist_id}","starred_url":"https://api.github.com/users/jcouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcouv/subscriptions","organizations_url":"https://api.github.com/users/jcouv/orgs","repos_url":"https://api.github.com/users/jcouv/repos","events_url":"https://api.github.com/users/jcouv/events{/privacy}","received_events_url":"https://api.github.com/users/jcouv/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/roslyn/milestones/33","html_url":"https://github.com/dotnet/roslyn/milestone/33","labels_url":"https://api.github.com/repos/dotnet/roslyn/milestones/33/labels","id":3020805,"node_id":"MDk6TWlsZXN0b25lMzAyMDgwNQ==","number":33,"title":"15.8","description":null,"creator":{"login":"sharwell","id":1408396,"node_id":"MDQ6VXNlcjE0MDgzOTY=","avatar_url":"https://avatars1.githubusercontent.com/u/1408396?v=4","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"open_issues":283,"closed_issues":293,"state":"open","created_at":"2018-01-08T19:35:57Z","updated_at":"2018-06-04T19:55:29Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-05-20T11:39:30Z","updated_at":"2018-06-04T20:48:53Z","closed_at":"2018-06-04T16:24:11Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/26997","html_url":"https://github.com/dotnet/roslyn/pull/26997","diff_url":"https://github.com/dotnet/roslyn/pull/26997.diff","patch_url":"https://github.com/dotnet/roslyn/pull/26997.patch"},"body":"### Customer scenario\r\n\r\nCustomer generates a variable or method from within:\r\n- an expression bodied getter\r\n- an expression bodied local function/\r\n- a block bodied location function inside a lambda expression \r\n\r\nand notices type inferences does not work. See the bug below for a code example, or refer to the newly added unit tests.\r\n\r\n### Bugs this fixes\r\n\r\n#26993 \r\n\r\n### Workarounds, if any\r\n\r\nManually fix the type of the generated variable / the return type of the generated method.\r\n\r\n### Risk\r\n\r\nRisk is limited: this fix is basically an extension to the way similar scenarios (like expression bodies properties) are handled in the same file.\r\n\r\n### Performance impact\r\n\r\nLow, there's been some minor changes when inferring types in arrow expression clauses and return statements.\r\n\r\n### Is this a regression from a previous update?\r\nNot that I know of.\r\n\r\n### Root cause analysis\r\n\r\nThese situations were not covered by unit tests yet. I added these tests now, including some extra unit tests validating situations which were already working as expected to prevent possible regressions in the future.\r\n\r\n### How was the bug found?\r\n\r\nCustomer reported, see #26993.\r\n\r\n### Test documentation updated?\r\n\r\nNo impact on test documentation.\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/394494373","html_url":"https://github.com/dotnet/roslyn/pull/26997#issuecomment-394494373","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/26997","id":394494373,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDQ5NDM3Mw==","user":{"login":"Neme12","id":11444821,"node_id":"MDQ6VXNlcjExNDQ0ODIx","avatar_url":"https://avatars3.githubusercontent.com/u/11444821?v=4","gravatar_id":"","url":"https://api.github.com/users/Neme12","html_url":"https://github.com/Neme12","followers_url":"https://api.github.com/users/Neme12/followers","following_url":"https://api.github.com/users/Neme12/following{/other_user}","gists_url":"https://api.github.com/users/Neme12/gists{/gist_id}","starred_url":"https://api.github.com/users/Neme12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Neme12/subscriptions","organizations_url":"https://api.github.com/users/Neme12/orgs","repos_url":"https://api.github.com/users/Neme12/repos","events_url":"https://api.github.com/users/Neme12/events{/privacy}","received_events_url":"https://api.github.com/users/Neme12/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T20:48:53Z","updated_at":"2018-06-04T20:48:53Z","author_association":"CONTRIBUTOR","body":"> Customer generates a variable or method from within:\r\n>\r\n> an expression bodied getter\r\n> an expression bodied local function/\r\n> a block bodied location function inside a lambda expression\r\n\r\nNote: you actually fixed even more cases than that.\r\nFor example generating from an anonymous method inside a lambda\r\nor generating from an async *simple* lambda - it didn't use to unwrap the task, now it does (in the code it looked like someone assumed they cannot be async)\r\n\r\nOne thing that still isn't fixed though is unwrapping the Task from an expression bodied method/function:\r\n```c#\r\nusing System.Threading.Tasks;\r\n\r\nclass C\r\n{\r\n    async Task<int> M1()\r\n    {\r\n        return foo; // correctly generates int\r\n    }\r\n\r\n    async Task<int> M2() => foo; // generates Task<int>\r\n}\r\n```\r\n\r\nPlease create an issue for that too. Thanks."}}
{"actor":{"display_login":"Neme12"}}