{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/4082","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/4082/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/4082/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/4082/events","html_url":"https://github.com/dotnet/roslyn/pull/4082","id":96841178,"number":4082,"title":"Local functions update: By-ref struct closures","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/cla-already-signed","name":"cla-already-signed","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-23T15:32:34Z","updated_at":"2015-07-27T16:54:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn/pulls/4082","html_url":"https://github.com/dotnet/roslyn/pull/4082","diff_url":"https://github.com/dotnet/roslyn/pull/4082.diff","patch_url":"https://github.com/dotnet/roslyn/pull/4082.patch"},"body":"I already have half-implemented struct closures, but they were being passed as the this parameter and any nested struct closures were disallowed.\r\n\r\nThe basic algorithm is:\r\n\r\nIf a lambda frame is never used in a delegate construction, and is not used in an async/iterator function, then we are free to turn it into a struct.\r\n\r\nWhile any local function's primary frame is a struct, make the frame be a by-ref parameter on the end of the argument list and make the primary frame be the parent frame of the previous primary frame (then continue the while).\r\n\r\nWhen calling a local function, rewrite the BoundCall with the appropriate frames retrieved from FrameOfType. Generics makes things difficult.\r\n\r\nFYI @jaredpar @VSadov @agocke @gafter"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/125270687","html_url":"https://github.com/dotnet/roslyn/pull/4082#issuecomment-125270687","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/4082","id":125270687,"user":{"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},"created_at":"2015-07-27T16:54:38Z","updated_at":"2015-07-27T16:54:38Z","body":":+1:"}}