Skip to content

Confusing Analyzer output when package language version is too old for null safety #42321

@natebosch

Description

@natebosch

In a package where the language version in package_config.json is < 2.9 and a library with a // @dart = 2.9 comment, running dartanalyzer --enable-experiment=non-nullable . prints:

  error • This requires the 'non-nullable' language feature to be enabled. • foo.dart:10:20 • experiment_not_enabled
1 error found.

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.

Metadata

Metadata

Assignees

Labels

NNBDIssues related to NNBD Releaselegacy-area-analyzerUse area-devexp instead.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions