Skip to content

Analyzer complains about assert statement. #12289

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

Closed
johnniwinther opened this issue Aug 7, 2013 · 4 comments
Closed

Analyzer complains about assert statement. #12289

johnniwinther opened this issue Aug 7, 2013 · 4 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@johnniwinther
Copy link
Member

The analyzer complains about this assert statement in language/type_error_test.dart:

assert(assertionsEnabled = true);

If = is changed to == the test is accepted (but has the wrong semantics!).

@bwilkerson
Copy link
Member

Correct. According to the specification:

assertStatement:
   assert '(' conditionalExpression ')' ';'
      ;

and an assignment is not a conditional expression.

Gilad, do we want to allow an arbitrary expression in asserts?


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

@gbracha
Copy link
Contributor

gbracha commented Aug 7, 2013

We might look into this in the future, but not any time soon.


Removed Type-Defect label.
Added Type-Enhancement, Accepted labels.

@DartBot
Copy link

DartBot commented Apr 26, 2014

This comment was originally written by @chalin


Related: https://code.google.com/p/dart/issues/detail?id=17682

@johnniwinther johnniwinther added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Apr 26, 2014
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Feb 29, 2016
@munificent
Copy link
Member

Duplicate of #17682.

@munificent munificent added the closed-duplicate Closed in favor of an existing report label Dec 16, 2016
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). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants