{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/24543","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/24543/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/24543/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/24543/events","html_url":"https://github.com/dart-lang/sdk/issues/24543","id":110732100,"number":24543,"title":"Strong mode gives warning about { return 1 } but not => 1","user":{"login":"Hixie","id":551196,"avatar_url":"https://avatars.githubusercontent.com/u/551196?v=3","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Analyzer-StrongMode","name":"Analyzer-StrongMode","color":"eeeeee"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Area-Analyzer","name":"Area-Analyzer","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-10-09T20:39:07Z","updated_at":"2015-10-10T05:58:20Z","closed_at":null,"body":"```dart\r\ntypedef int Callback();\r\nCallback c;\r\nvoid main() {\r\n  c = () => 1; // no warning \r\n  c = () { return 1; }; // warning\r\n}\r\n```\r\n\r\ngives this message:\r\n\r\n```\r\n[warning] () {return 1;} (() → dynamic) will need runtime check to cast to type () → int (.../test.dart, line 5, col 7)\r\n```\r\n\r\nNote how this only applies to one of the lines, not both."},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/147042427","html_url":"https://github.com/dart-lang/sdk/issues/24543#issuecomment-147042427","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/24543","id":147042427,"user":{"login":"Hixie","id":551196,"avatar_url":"https://avatars.githubusercontent.com/u/551196?v=3","gravatar_id":"","url":"https://api.github.com/users/Hixie","html_url":"https://github.com/Hixie","followers_url":"https://api.github.com/users/Hixie/followers","following_url":"https://api.github.com/users/Hixie/following{/other_user}","gists_url":"https://api.github.com/users/Hixie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hixie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hixie/subscriptions","organizations_url":"https://api.github.com/users/Hixie/orgs","repos_url":"https://api.github.com/users/Hixie/repos","events_url":"https://api.github.com/users/Hixie/events{/privacy}","received_events_url":"https://api.github.com/users/Hixie/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T05:58:20Z","updated_at":"2015-10-10T05:58:20Z","body":"FWIW I would want all warnings that might indicate a bug, I just wish I could have a way to say (on an expression-by-expression basis) that in this instance the analyzer is wrong, and it's not a bug.\r\n\r\nThis bug, though, was specifically about the fact that the two lines of code which are semantically identical don't both get the message (or both not get the message). As far as I can tell, usage of => vs {} should just be a syntactic choice, not a semantic one.\r\n\r\nThe issue about this warning not being useful for non-DDC users is https://github.com/dart-lang/sdk/issues/24542 ."}}