Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some primary expressions cannot form statements #1228

Closed
DartBot opened this issue Jan 19, 2012 · 5 comments
Closed

Some primary expressions cannot form statements #1228

DartBot opened this issue Jan 19, 2012 · 5 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Milestone

Comments

@DartBot
Copy link

DartBot commented Jan 19, 2012

This issue was originally filed by alexei.kaigoro...@gmail.com


The Dart spec v0.006 states that any expression can form a statement.

However, Dart VM yields compile error if function expression, list literal, or map literal are used as statements:

main() {
  void() g{};
  {"1" : 1, "2": 2};
  [null, 0, "O"];
}

@dgrove
Copy link
Contributor

dgrove commented Feb 2, 2012

Added Area-VM, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Mar 20, 2012

This comment was originally written by @mhausner


This is still an error in the spec. The old grammar used to have a tie-braker rule that said that a { at the beginning of a statement opens a new block, never a map literal.


Set owner to @gbracha.
Removed Area-VM label.
Added Area-Language label.

@anders-sandholm
Copy link
Contributor

Added this to the M1 milestone.

@gbracha
Copy link
Contributor

gbracha commented May 18, 2012

Issue #1994 has been merged into this issue.

@gbracha
Copy link
Contributor

gbracha commented May 18, 2012

List literals are perfectly fine expression statements. The spec has been revised to disallow maps in version 0.10. The questions about function literals are still open, but covered under http://code.google.com/p/dart/issues/detail?can=2&q=1189


Added Done label.

@DartBot DartBot added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels May 18, 2012
@DartBot DartBot added this to the M1 milestone May 18, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language).
Projects
None yet
Development

No branches or pull requests

5 participants