{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/24232","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/24232/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/24232/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/24232/events","html_url":"https://github.com/dart-lang/sdk/issues/24232","id":103797575,"number":24232,"title":"dart2js: broken app should not compile","user":{"login":"sigmundch","id":2049220,"avatar_url":"https://avatars.githubusercontent.com/u/2049220?v=3","gravatar_id":"","url":"https://api.github.com/users/sigmundch","html_url":"https://github.com/sigmundch","followers_url":"https://api.github.com/users/sigmundch/followers","following_url":"https://api.github.com/users/sigmundch/following{/other_user}","gists_url":"https://api.github.com/users/sigmundch/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmundch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmundch/subscriptions","organizations_url":"https://api.github.com/users/sigmundch/orgs","repos_url":"https://api.github.com/users/sigmundch/repos","events_url":"https://api.github.com/users/sigmundch/events{/privacy}","received_events_url":"https://api.github.com/users/sigmundch/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Area-Dart2JS","name":"Area-Dart2JS","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Priority-High","name":"Priority-High","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"sigmundch","id":2049220,"avatar_url":"https://avatars.githubusercontent.com/u/2049220?v=3","gravatar_id":"","url":"https://api.github.com/users/sigmundch","html_url":"https://github.com/sigmundch","followers_url":"https://api.github.com/users/sigmundch/followers","following_url":"https://api.github.com/users/sigmundch/following{/other_user}","gists_url":"https://api.github.com/users/sigmundch/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmundch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmundch/subscriptions","organizations_url":"https://api.github.com/users/sigmundch/orgs","repos_url":"https://api.github.com/users/sigmundch/repos","events_url":"https://api.github.com/users/sigmundch/events{/privacy}","received_events_url":"https://api.github.com/users/sigmundch/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/dart-lang/sdk/milestones/30","html_url":"https://github.com/dart-lang/sdk/milestones/1.13","labels_url":"https://api.github.com/repos/dart-lang/sdk/milestones/30/labels","id":1171621,"number":30,"title":"1.13","description":null,"creator":{"login":"kwalrath","id":2164483,"avatar_url":"https://avatars.githubusercontent.com/u/2164483?v=3","gravatar_id":"","url":"https://api.github.com/users/kwalrath","html_url":"https://github.com/kwalrath","followers_url":"https://api.github.com/users/kwalrath/followers","following_url":"https://api.github.com/users/kwalrath/following{/other_user}","gists_url":"https://api.github.com/users/kwalrath/gists{/gist_id}","starred_url":"https://api.github.com/users/kwalrath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwalrath/subscriptions","organizations_url":"https://api.github.com/users/kwalrath/orgs","repos_url":"https://api.github.com/users/kwalrath/repos","events_url":"https://api.github.com/users/kwalrath/events{/privacy}","received_events_url":"https://api.github.com/users/kwalrath/received_events","type":"User","site_admin":false},"open_issues":44,"closed_issues":9,"state":"open","created_at":"2015-06-18T23:05:19Z","updated_at":"2015-09-24T16:40:08Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-08-28T21:22:06Z","updated_at":"2015-09-24T16:57:33Z","closed_at":null,"body":"```dart\r\nconst a = 1\r\nconst b = 2;\r\n\r\nmain() => b;\r\n```\r\n\r\nNote the missing semicolon after `1`. Today dart2js compiles this and produces this output:\r\n```\r\n> dart2js syn_err.dart\r\nsyn_err.dart:4:11:\r\nWarning: Cannot resolve 'b'.\r\nmain() => b;\r\n          ^\r\nDart file (syn_err.dart) compiled to JavaScript: out.js\r\n```\r\n\r\nThis should be a compile-time error."},"comment":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/comments/142988162","html_url":"https://github.com/dart-lang/sdk/issues/24232#issuecomment-142988162","issue_url":"https://api.github.com/repos/dart-lang/sdk/issues/24232","id":142988162,"user":{"login":"sigmundch","id":2049220,"avatar_url":"https://avatars.githubusercontent.com/u/2049220?v=3","gravatar_id":"","url":"https://api.github.com/users/sigmundch","html_url":"https://github.com/sigmundch","followers_url":"https://api.github.com/users/sigmundch/followers","following_url":"https://api.github.com/users/sigmundch/following{/other_user}","gists_url":"https://api.github.com/users/sigmundch/gists{/gist_id}","starred_url":"https://api.github.com/users/sigmundch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sigmundch/subscriptions","organizations_url":"https://api.github.com/users/sigmundch/orgs","repos_url":"https://api.github.com/users/sigmundch/repos","events_url":"https://api.github.com/users/sigmundch/events{/privacy}","received_events_url":"https://api.github.com/users/sigmundch/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T16:57:33Z","updated_at":"2015-09-24T16:57:33Z","body":"FWIW, the issue here relates to diet parsing - the code is treated like:\r\n\r\n```dart\r\nconst a = #; // when needed, parse the rhs from \"1 const b = 2\".\r\nmain() => b;\r\n```\r\n\r\nIf you for example change the code and use `a` instead of `b` in the main function:\r\n\r\n```dart\r\nconst a = 1 b = 2;\r\nmain() => a;\r\n```\r\n\r\n, you'll get the expected error:\r\n```\r\ndebug.dart:1:9:\r\nError: Expected ';' after this.\r\nvar a = 1 b = 2;\r\n        ^\r\n```\r\n\r\n@johnniwinther @peter-ahe-google - you are probably more familiar with this, so I got a few questions for you:\r\n* Is there something that can be done for this, or is it a limitation of diet parsing we need to live with?\r\n\r\n* The warning is a good hint, but the context where I discovered this was in a large app were we were omitting warnings from dependent packages, so the hint `cannot resolve 'b'` was not visible by default. Maybe we need some levels of warnings and show some important warnings regardless?\r\n\r\n* Is diet-parsing of initializers worth it? I'm guessing we gain a lot from skipping classes and top-level functions, but how much are we gaining from skipping top-levels initializers like the one above?"}}