-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Confusing Analyzer output when package language version is too old for null safety #42321
Comments
See also #42323 where the CFE/VM have an output which is also confusing. |
@leafpetersen Is behavior of Currently in analyzer we start with some set of language features, default, or with enabled experiments; and then this set passes through two phases of restricting - the first time based on the package config, and the second time based on the So, if we specify a higher language version than for the whole package, it is no-op, the features have already been removed from the set. It seems right from the perspective of migrating a package library by library. |
And more specifically here |
Great, thank you! |
#42274 #42321 Change-Id: I5551ecd2803f9d26e720e5cf5671b3be8236bce9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151423 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
One more related fix 60bb0d3. |
In a package where the language version in
package_config.json
is < 2.9 and a library with a// @dart = 2.9
comment, runningdartanalyzer --enable-experiment=non-nullable .
prints:It would be less confusing if the error message said something about not being able to opt in to a newer language version with a comment than what is in the
package_config.json
. Or potentially even better, if it let you use the experiment anyway. This is on a recent dev SDK.The text was updated successfully, but these errors were encountered: