Skip to content

Confusing error message from dart2js on 'e || throw x'. #22926

Closed
@lrhn

Description

@lrhn

Code like:
  (41 == 42) || throw "x";
gives an error saying:

Error: Expected an expression, but got 'throw'.
  41 == 42 || throw "not";
              ^^^^^

That makes it sound like "throw" is not an expression, where the problem is that it's not a LogicalAndExpression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requesttype-enhancementA request for a change that isn't a bugweb-dart2js

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions