{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/dart_style/issues/725","repository_url":"https://api.github.com/repos/dart-lang/dart_style","labels_url":"https://api.github.com/repos/dart-lang/dart_style/issues/725/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/dart_style/issues/725/comments","events_url":"https://api.github.com/repos/dart-lang/dart_style/issues/725/events","html_url":"https://github.com/dart-lang/dart_style/pull/725","id":351364842,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4OTgxNzQy","number":725,"title":"Update map literal formatting test","user":{"login":"danrubel","id":2891888,"node_id":"MDQ6VXNlcjI4OTE4ODg=","avatar_url":"https://avatars0.githubusercontent.com/u/2891888?v=4","gravatar_id":"","url":"https://api.github.com/users/danrubel","html_url":"https://github.com/danrubel","followers_url":"https://api.github.com/users/danrubel/followers","following_url":"https://api.github.com/users/danrubel/following{/other_user}","gists_url":"https://api.github.com/users/danrubel/gists{/gist_id}","starred_url":"https://api.github.com/users/danrubel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danrubel/subscriptions","organizations_url":"https://api.github.com/users/danrubel/orgs","repos_url":"https://api.github.com/users/danrubel/repos","events_url":"https://api.github.com/users/danrubel/events{/privacy}","received_events_url":"https://api.github.com/users/danrubel/received_events","type":"User","site_admin":false},"labels":[{"id":442772507,"node_id":"MDU6TGFiZWw0NDI3NzI1MDc=","url":"https://api.github.com/repos/dart-lang/dart_style/labels/cla:%20yes","name":"cla: yes","color":"0052cc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-08-16T20:54:17Z","updated_at":"2018-08-21T05:03:59Z","closed_at":"2018-08-21T00:23:15Z","author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/dart-lang/dart_style/pulls/725","html_url":"https://github.com/dart-lang/dart_style/pull/725","diff_url":"https://github.com/dart-lang/dart_style/pull/725.diff","patch_url":"https://github.com/dart-lang/dart_style/pull/725.patch"},"body":"This test case is invalid Dart syntax that the old analyzer parser let slide by.\r\nFrom section 17.2 of the language spec...\r\n\r\n> An expression statement consists of an expression other than a non-constant map literal (16.8) that has no explicit type arguments. The restriction on maps is designed to resolve an ambiguity in the grammar, when a statement begins with {.\r\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/dart_style/issues/comments/414550737","html_url":"https://github.com/dart-lang/dart_style/pull/725#issuecomment-414550737","issue_url":"https://api.github.com/repos/dart-lang/dart_style/issues/725","id":414550737,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDU1MDczNw==","user":{"login":"lrhn","id":4865287,"node_id":"MDQ6VXNlcjQ4NjUyODc=","avatar_url":"https://avatars3.githubusercontent.com/u/4865287?v=4","gravatar_id":"","url":"https://api.github.com/users/lrhn","html_url":"https://github.com/lrhn","followers_url":"https://api.github.com/users/lrhn/followers","following_url":"https://api.github.com/users/lrhn/following{/other_user}","gists_url":"https://api.github.com/users/lrhn/gists{/gist_id}","starred_url":"https://api.github.com/users/lrhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrhn/subscriptions","organizations_url":"https://api.github.com/users/lrhn/orgs","repos_url":"https://api.github.com/users/lrhn/repos","events_url":"https://api.github.com/users/lrhn/events{/privacy}","received_events_url":"https://api.github.com/users/lrhn/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T05:03:59Z","updated_at":"2018-08-21T05:03:59Z","author_association":"MEMBER","body":"We should specify what the implementations do.\r\nThe grammar works either way - if a block ends with `}.foo();` then it's not a code block, so it must be a map, and the grammar is not ambiguous.  (It might not even be ambiguous without the trailing call, unless the block is empty, since any statement inside will be recursively distinguishable from an expression by, eventually, ending in a semicolon).\r\n\r\nAllowing leading maps does make parsing need arbitrary look-ahead to determine whether something starting with `{foo: verylargeexpression` is a map or a code block starting with a labeled statement. (If it's followed by ';' it's a statement, if it's followed by '}', it's a map.\r\n\r\nSo, let's just keep the current behavior and codify it in the spec.\r\n(The \"begins with *expression*\" is too vague for my part. I'd prefer to just say that an expression statement cannot start with a '{' character)."}}
{"actor":{"display_login":"lrhn"}}