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

support assert in initializer list #27809

Closed
jmesserly opened this issue Nov 11, 2016 · 9 comments
Closed

support assert in initializer list #27809

jmesserly opened this issue Nov 11, 2016 · 9 comments
Assignees
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures web-dev-compiler

Comments

@jmesserly
Copy link

Main issue: #27141
Analyzer change was here: https://codereview.chromium.org/2492633002/

it looks like we need to support the AssertInitializer node.

@jmesserly jmesserly added web-dev-compiler P2 A bug or feature request we're likely to work on labels Nov 11, 2016
@vsmenon vsmenon added this to the 1.50 milestone Dec 12, 2016
@munificent
Copy link
Member

This is not a 1.50 feature, so kicking out of the milestone. (I think we accidentally got it confused with assert messages, which are in 1.50).

@munificent munificent removed this from the 1.50 milestone Dec 12, 2016
@jmesserly
Copy link
Author

yeah. fwiw it's probably super easy to implement tho

@bwilkerson
Copy link
Member

For analyzer it would just be a matter of removing the flag and enabling it by default.

@munificent
Copy link
Member

Yeah, but it's not clear if this is a feature we actually want to commit to. The request is from Flutter and, last I heard, we aren't sure if they are still even interested in it. I don't want to push it forward unless we on the team think it's important and/or a customer really cares about it.

@jmesserly
Copy link
Author

it's kind of useful for const objects. There's no other way to add invariant checks for them. That said one can usually just avoid const.

@lrhn
Copy link
Member

lrhn commented Dec 13, 2016

The checks you can do on const objects is also limited to what can be checked by a potentially const expression, which can be quite limiting.

@munificent
Copy link
Member

There's no other way to add invariant checks for them.

The workaround I've seen is to lazily check the invariant in the properties and methods on the object when it's used. That delays the error, which is a drag, but const is kind of a drag many times.

You're right that the feature is definitely potentially useful. It's just not clear if it's useful enough.

@jmesserly
Copy link
Author

I may pick this up as part of #29346

@jmesserly jmesserly removed their assignment Apr 21, 2017
@vsmenon vsmenon added P1 A high priority bug; for example, a single project is unusable or has many test failures and removed P2 A bug or feature request we're likely to work on labels Jan 29, 2018
@vsmenon vsmenon added this to the 2.0-alpha2 milestone Jan 29, 2018
@jmesserly
Copy link
Author

@whesse whesse closed this as completed in 68ea543 Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures web-dev-compiler
Projects
None yet
Development

No branches or pull requests

5 participants