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
Comments
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). |
yeah. fwiw it's probably super easy to implement tho |
For analyzer it would just be a matter of removing the flag and enabling it by default. |
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. |
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. |
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. |
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. |
I may pick this up as part of #29346 |
Main issue: #27141
Analyzer change was here: https://codereview.chromium.org/2492633002/
it looks like we need to support the AssertInitializer node.
The text was updated successfully, but these errors were encountered: