Always pass --default-language-version=2.7 to analyzer for legacy tests.

Change-Id: I2adca91ce34a343a6dd21aeb891ec041283f3365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135529
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
Robert Nystrom 2020-02-12 23:38:37 +00:00 committed by commit-bot@chromium.org
parent 0a57671f90
commit ca6cb6ce75

View file

@ -962,12 +962,9 @@ class AnalyzerCompilerConfiguration extends CompilerConfiguration {
// If we are running a legacy test with NNBD enabled, tell analyzer to use
// a pre-NNBD language version for the test.
var setLegacyVersion = false;
if (_configuration.experiments.contains("non-nullable")) {
var testPath = arguments.last;
var segments = Path(testPath).relativeTo(Repository.dir).segments();
setLegacyVersion = segments.any(legacyTestDirectories.contains);
}
var testPath = arguments.last;
var segments = Path(testPath).relativeTo(Repository.dir).segments();
var setLegacyVersion = segments.any(legacyTestDirectories.contains);
var args = [
...arguments,