Skip to content

Some primary expressions cannot form statements #1489

Closed
@dgrove

Description

@dgrove

r3865 (cloned from issue #1228)

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

However, dartc 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"];
}

Metadata

Metadata

Assignees

Labels

P3A lower priority bug or feature requestlegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions