-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Remove flag and turn on --enable-assert-initializers by default #30977
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
Comments
@munificent Does this work need to be coordinated with anything else, or is it reasonable to do it now? |
If you remove the flag entirely such that it's an error to pass it, then you'll want to check with the Flutter folks to make sure any scripts they have that drive the analyzer stop passing that flag. If you simply default assert initializers on and allow but ignore the flag, then you should be able to flip it on whenever you like. |
CL is out for review. |
https://dart-review.googlesource.com/c/sdk/+/10740 There was no command-line flag, only an option in the analysis options file. Analyzer will now produce a hint that the option is not valid and will ignore it. |
Are you sure? In analyzer_cli, I see: enableAssertInitializer = args['enable-assert-initializers'], |
No, I somehow managed to miss that when I looked. I did manage to remove the code that makes use of the argument, so it's now a no-op to include it, but I should at least mark the option as being deprecated. |
I left the flag so that it won't break existing clients, but cleaned up the references to it (https://dart-review.googlesource.com/c/sdk/+/11260). |
Asserts in initializers will be a fully-supported feature in 2.0 (#30968), so the analyzer should enable it by default and remove the flag.
The text was updated successfully, but these errors were encountered: