{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/33218","repository_url":"https://api.github.com/repos/dart-lang/sdk","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/33218/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/33218/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/33218/events","html_url":"https://github.com/dart-lang/sdk/issues/33218","id":325885011,"node_id":"MDU6SXNzdWUzMjU4ODUwMTE=","number":33218,"title":"Meta issue for returns in functions with void related return types","user":{"login":"leafpetersen","id":8484504,"node_id":"MDQ6VXNlcjg0ODQ1MDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8484504?v=4","gravatar_id":"","url":"https://api.github.com/users/leafpetersen","html_url":"https://github.com/leafpetersen","followers_url":"https://api.github.com/users/leafpetersen/followers","following_url":"https://api.github.com/users/leafpetersen/following{/other_user}","gists_url":"https://api.github.com/users/leafpetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/leafpetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leafpetersen/subscriptions","organizations_url":"https://api.github.com/users/leafpetersen/orgs","repos_url":"https://api.github.com/users/leafpetersen/repos","events_url":"https://api.github.com/users/leafpetersen/events{/privacy}","received_events_url":"https://api.github.com/users/leafpetersen/received_events","type":"User","site_admin":false},"labels":[{"id":219928175,"node_id":"MDU6TGFiZWwyMTk5MjgxNzU=","url":"https://api.github.com/repos/dart-lang/sdk/labels/area-language","name":"area-language","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":{"login":"leafpetersen","id":8484504,"node_id":"MDQ6VXNlcjg0ODQ1MDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8484504?v=4","gravatar_id":"","url":"https://api.github.com/users/leafpetersen","html_url":"https://github.com/leafpetersen","followers_url":"https://api.github.com/users/leafpetersen/followers","following_url":"https://api.github.com/users/leafpetersen/following{/other_user}","gists_url":"https://api.github.com/users/leafpetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/leafpetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leafpetersen/subscriptions","organizations_url":"https://api.github.com/users/leafpetersen/orgs","repos_url":"https://api.github.com/users/leafpetersen/repos","events_url":"https://api.github.com/users/leafpetersen/events{/privacy}","received_events_url":"https://api.github.com/users/leafpetersen/received_events","type":"User","site_admin":false},"assignees":[{"login":"leafpetersen","id":8484504,"node_id":"MDQ6VXNlcjg0ODQ1MDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/8484504?v=4","gravatar_id":"","url":"https://api.github.com/users/leafpetersen","html_url":"https://github.com/leafpetersen","followers_url":"https://api.github.com/users/leafpetersen/followers","following_url":"https://api.github.com/users/leafpetersen/following{/other_user}","gists_url":"https://api.github.com/users/leafpetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/leafpetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leafpetersen/subscriptions","organizations_url":"https://api.github.com/users/leafpetersen/orgs","repos_url":"https://api.github.com/users/leafpetersen/repos","events_url":"https://api.github.com/users/leafpetersen/events{/privacy}","received_events_url":"https://api.github.com/users/leafpetersen/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2018-05-23T21:46:05Z","updated_at":"2018-06-14T11:58:35Z","closed_at":null,"author_association":"MEMBER","body":"This is a meta-issue for tracking errors associated with returns in block bodied sync and async functions whose return type is `void`, `Future<void>`, or `FutureOr<void>`.\r\n\r\nTests are here: https://dart-review.googlesource.com/c/sdk/+/52742\r\n\r\nWe say that a type T contains `void` if `T` is `void`, or if `T` is `FutureOr<S>` and `S` is `void`.\r\n\r\nMy understanding of the intended rules are as follows:\r\n  - In an asynchronous function with return type `T`:\r\n    - `return;` is an error unless `flatten(T)` is `void`\r\n    - `return exp;` is an error if `exp` has static type `S` and `flatten(S)` is not assignable to `flatten(T)`\r\n    - `return exp;` is an error if `exp` has static type `S` and `flatten(T)` is `void` and `flatten(S)` is not `void`\r\n  - In a synchronous function with return type `T`\r\n    - `return;` is an error unless `T` contains `void`\r\n    - `return exp;` is an error if `exp` has static type `S` and `S` is not assignable to `T`\r\n    - `return exp;` is an error if `exp` has static type `S` and `T` is `void` and `S` is not `void`\r\n    - `return exp;` is an error if `exp` has static type `S` and `T` is `FutureOr<void>` and `flatten(S)` is not `void`\r\n\r\ncc @lrhn @eernstg @munificent \r\n\r\n@lrhn I'm not sure which side of the argument around `return 3` in a `void` function you came down on.  The last rule from the `async` clause and the last two rules from the `sync` clause are intended to address those cases.  Let me know what you think."},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/397268969","html_url":"https://github.com/dart-lang/sdk/issues/33218#issuecomment-397268969","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/33218","id":397268969,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzI2ODk2OQ==","user":{"login":"eernstg","id":9606994,"node_id":"MDQ6VXNlcjk2MDY5OTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/9606994?v=4","gravatar_id":"","url":"https://api.github.com/users/eernstg","html_url":"https://github.com/eernstg","followers_url":"https://api.github.com/users/eernstg/followers","following_url":"https://api.github.com/users/eernstg/following{/other_user}","gists_url":"https://api.github.com/users/eernstg/gists{/gist_id}","starred_url":"https://api.github.com/users/eernstg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eernstg/subscriptions","organizations_url":"https://api.github.com/users/eernstg/orgs","repos_url":"https://api.github.com/users/eernstg/repos","events_url":"https://api.github.com/users/eernstg/events{/privacy}","received_events_url":"https://api.github.com/users/eernstg/received_events","type":"User","site_admin":false},"created_at":"2018-06-14T11:58:35Z","updated_at":"2018-06-14T11:58:35Z","author_association":"MEMBER","body":"I've created [this CL](https://dart-review.googlesource.com/c/sdk/+/60240), which is aimed at handling funny combinations like \"return type `Future<int>`, got a `Future<Object>`\" and `MyFuture<C>` above) in a meaningful manner."}}
{"actor":{"display_login":"eernstg"}}