Version 2.14.0-1.0.dev
Merge commit '83ca0e87a0b6b06d114bf7d718584ada923dc074' into 'dev'
diff --git a/pkg/analysis_server/lib/src/analysis_server_abstract.dart b/pkg/analysis_server/lib/src/analysis_server_abstract.dart
index 3288d8b..40fcb0f 100644
--- a/pkg/analysis_server/lib/src/analysis_server_abstract.dart
+++ b/pkg/analysis_server/lib/src/analysis_server_abstract.dart
@@ -362,6 +362,7 @@
return driver
.getResult(path, sendCachedToStream: sendCachedToStream)
+ .then((value) => value.state == ResultState.VALID ? value : null)
.catchError((e, st) {
instrumentationService.logException(e, st);
return null;
diff --git a/pkg/analysis_server/lib/src/cider/assists.dart b/pkg/analysis_server/lib/src/cider/assists.dart
index c927a9e..ba46cce 100644
--- a/pkg/analysis_server/lib/src/cider/assists.dart
+++ b/pkg/analysis_server/lib/src/cider/assists.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
import 'package:analysis_server/src/services/correction/assist.dart';
import 'package:analysis_server/src/services/correction/assist_internal.dart';
diff --git a/pkg/analysis_server/lib/src/cider/fixes.dart b/pkg/analysis_server/lib/src/cider/fixes.dart
index ae971be..e17d1cc 100644
--- a/pkg/analysis_server/lib/src/cider/fixes.dart
+++ b/pkg/analysis_server/lib/src/cider/fixes.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
import 'package:analysis_server/src/services/correction/change_workspace.dart';
import 'package:analysis_server/src/services/correction/fix.dart';
@@ -13,7 +11,6 @@
import 'package:analyzer/source/line_info.dart';
import 'package:analyzer/src/dart/analysis/performance_logger.dart';
import 'package:analyzer/src/dart/micro/resolve_file.dart';
-import 'package:meta/meta.dart';
class CiderErrorFixes {
final AnalysisError error;
@@ -24,9 +21,9 @@
final LineInfo lineInfo;
CiderErrorFixes({
- @required this.error,
- @required this.fixes,
- @required this.lineInfo,
+ required this.error,
+ required this.fixes,
+ required this.lineInfo,
});
}
diff --git a/pkg/analysis_server/lib/src/computer/computer_outline.dart b/pkg/analysis_server/lib/src/computer/computer_outline.dart
index fedd848..deca868 100644
--- a/pkg/analysis_server/lib/src/computer/computer_outline.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_outline.dart
@@ -87,9 +87,6 @@
Location _getLocationOffsetLength(int offset, int length) {
var path = resolvedUnit.path;
- if (path == null) {
- throw StateError('DartUnitOutlineComputer called with invalid result');
- }
var startLocation = resolvedUnit.lineInfo.getLocation(offset);
var startLine = startLocation.lineNumber;
var startColumn = startLocation.columnNumber;
diff --git a/pkg/analysis_server/lib/src/computer/computer_signature.dart b/pkg/analysis_server/lib/src/computer/computer_signature.dart
index 20bc565..10354b5 100644
--- a/pkg/analysis_server/lib/src/computer/computer_signature.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_signature.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/computer/computer_hover.dart';
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -16,8 +14,8 @@
/// [CompilationUnit].
class DartUnitSignatureComputer {
final DartdocDirectiveInfo _dartdocInfo;
- final AstNode _node;
- ArgumentList _argumentList;
+ final AstNode? _node;
+ late ArgumentList _argumentList;
DartUnitSignatureComputer(
this._dartdocInfo, CompilationUnit _unit, int _offset)
: _node = NodeLocator(_offset).searchWithin(_unit);
@@ -27,48 +25,34 @@
bool get offsetIsValid => _node != null;
+ // Return the closest argument list surrounding the [_node].
/// Returns the computed signature information, maybe `null`.
- AnalysisGetSignatureResult compute() {
- if (_node == null) {
+ AnalysisGetSignatureResult? compute() {
+ var argumentList = _findArgumentList();
+ if (argumentList == null) {
return null;
}
-
- // Find the closest argument list.
- var argsNode = _node;
- while (argsNode != null && !(argsNode is ArgumentList)) {
- // Certain nodes don't make sense to search above for an argument list
- // (for example when inside a function epxression).
- if (argsNode is FunctionExpression) {
- return null;
- }
- argsNode = argsNode.parent;
- }
-
- if (argsNode == null) {
- return null;
- }
-
- final args = argsNode;
- String name;
- ExecutableElement execElement;
- final parent = args.parent;
+ String? name;
+ ExecutableElement? execElement;
+ final parent = argumentList.parent;
if (parent is MethodInvocation) {
name = parent.methodName.name;
var element = ElementLocator.locate(parent);
execElement = element is ExecutableElement ? element : null;
} else if (parent is InstanceCreationExpression) {
name = parent.constructorName.type.name.name;
- if (parent.constructorName.name != null) {
- name += '.${parent.constructorName.name.name}';
+ var constructorName = parent.constructorName.name;
+ if (constructorName != null) {
+ name += '.${constructorName.name}';
}
execElement = ElementLocator.locate(parent) as ExecutableElement;
}
- if (execElement == null) {
+ if (name == null || execElement == null) {
return null;
}
- _argumentList = args;
+ _argumentList = argumentList;
final parameters =
execElement.parameters.map((p) => _convertParam(p)).toList();
@@ -91,4 +75,17 @@
param.type.getDisplayString(withNullability: false),
defaultValue: param.defaultValueCode);
}
+
+ ArgumentList? _findArgumentList() {
+ var node = _node;
+ while (node != null && node is! ArgumentList) {
+ // Certain nodes don't make sense to search above for an argument list
+ // (for example when inside a function expression).
+ if (node is FunctionExpression) {
+ return null;
+ }
+ node = node.parent;
+ }
+ return node as ArgumentList?;
+ }
}
diff --git a/pkg/analysis_server/lib/src/computer/import_elements_computer.dart b/pkg/analysis_server/lib/src/computer/import_elements_computer.dart
index 3a2ec51..8ad83ca 100644
--- a/pkg/analysis_server/lib/src/computer/import_elements_computer.dart
+++ b/pkg/analysis_server/lib/src/computer/import_elements_computer.dart
@@ -33,7 +33,7 @@
List<ImportedElements> importedElementsList) async {
var unit = libraryResult.unit;
var path = libraryResult.path;
- if (unit == null || path == null) {
+ if (unit == null) {
// We should never reach this point because the libraryResult should be
// valid.
return SourceChange('');
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index 0cec373..c557341 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -61,7 +61,7 @@
// Prepare the resolved units.
var result = await server.getResolvedUnit(file);
- if (result.state != ResultState.VALID) {
+ if (result == null) {
server.sendResponse(Response.fileNotAnalyzed(request, file));
return;
}
diff --git a/pkg/analysis_server/lib/src/domains/completion/available_suggestions.dart b/pkg/analysis_server/lib/src/domains/completion/available_suggestions.dart
index 7c029d8..ee2cb5c 100644
--- a/pkg/analysis_server/lib/src/domains/completion/available_suggestions.dart
+++ b/pkg/analysis_server/lib/src/domains/completion/available_suggestions.dart
@@ -24,7 +24,7 @@
var context = tracker.getContext(analysisContext);
if (context == null) return;
- var librariesObject = context.getLibraries(resolvedUnit.path!);
+ var librariesObject = context.getLibraries(resolvedUnit.path);
var importedUriSet = resolvedUnit.libraryElement.importedLibraries
.map((importedLibrary) => importedLibrary.source.uri)
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
index 7c20027..87310e8 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
@@ -96,7 +96,7 @@
}) async {
request.checkAborted();
var pathContext = request.resourceProvider.pathContext;
- if (!file_paths.isDart(pathContext, request.result.path!)) {
+ if (!file_paths.isDart(pathContext, request.result.path)) {
return const <CompletionSuggestion>[];
}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
index d2ce0e3..9c530a8 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
@@ -700,7 +700,7 @@
ExecutableElement element, bool invokeSuper) async {
var displayTextBuffer = StringBuffer();
var builder = ChangeBuilder(session: request.result.session);
- await builder.addDartFileEdit(request.result.path!, (builder) {
+ await builder.addDartFileEdit(request.result.path, (builder) {
builder.addReplacement(range.node(targetId), (builder) {
builder.writeOverride(
element,
diff --git a/pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart b/pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart
index 8aa88e2..988a42d 100644
--- a/pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart
+++ b/pkg/analysis_server/lib/src/services/completion/postfix/postfix_completion.dart
@@ -264,7 +264,7 @@
String get eol => utils.endOfLine;
- String get file => completionContext.resolveResult.path!;
+ String get file => completionContext.resolveResult.path;
String get key => completionContext.key;
diff --git a/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart b/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart
index 9bd0039..e71629b 100644
--- a/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart
+++ b/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart
@@ -120,7 +120,7 @@
String get eol => utils.endOfLine;
- String get file => statementContext.resolveResult.path!;
+ String get file => statementContext.resolveResult.path;
LineInfo get lineInfo => statementContext.resolveResult.lineInfo;
diff --git a/pkg/analysis_server/lib/src/services/correction/base_processor.dart b/pkg/analysis_server/lib/src/services/correction/base_processor.dart
index 543d8c9..fb8a04f 100644
--- a/pkg/analysis_server/lib/src/services/correction/base_processor.dart
+++ b/pkg/analysis_server/lib/src/services/correction/base_processor.dart
@@ -33,7 +33,7 @@
this.selectionLength = 0,
required this.resolvedResult,
required this.workspace,
- }) : file = resolvedResult.path!,
+ }) : file = resolvedResult.path,
session = resolvedResult.session,
sessionHelper = AnalysisSessionHelper(resolvedResult.session),
typeProvider = resolvedResult.typeProvider,
diff --git a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
index 65467c5..50132d8 100644
--- a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
+++ b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
@@ -281,7 +281,7 @@
/// library associated with the analysis [result].
Future<void> _fixErrorsInLibrary(ResolvedLibraryResult result) async {
var analysisOptions = result.session.analysisContext.analysisOptions;
- for (var unitResult in result.units!) {
+ for (var unitResult in result.units) {
var overrideSet = _readOverrideSet(unitResult);
for (var error in unitResult.errors) {
var processor = ErrorProcessor.getProcessor(analysisOptions, error);
@@ -348,7 +348,7 @@
await compute(producer);
var newHash = computeChangeHash();
if (newHash != oldHash) {
- changeMap.add(result.path!, code);
+ changeMap.add(result.path, code);
}
}
@@ -398,7 +398,7 @@
if (useConfigFiles) {
var provider = result.session.resourceProvider;
var context = provider.pathContext;
- var dartFileName = result.path!;
+ var dartFileName = result.path;
var configFileName = '${context.withoutExtension(dartFileName)}.config';
var configFile = provider.getFile(configFileName);
try {
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart b/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
index a39cc31..7241c32 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
@@ -248,7 +248,7 @@
this.overrideSet,
this.selectionOffset = -1,
this.selectionLength = 0,
- }) : file = resolvedResult.path!,
+ }) : file = resolvedResult.path,
session = resolvedResult.session,
sessionHelper = AnalysisSessionHelper(resolvedResult.session),
typeProvider = resolvedResult.typeProvider,
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart b/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart
index 0f22239..c841c0f 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/convert_part_of_to_uri.dart
@@ -27,7 +27,7 @@
}
var libraryPath = resolvedResult.libraryElement.source.fullName;
- var partPath = resolvedResult.path!;
+ var partPath = resolvedResult.path;
var relativePath = relative(libraryPath, from: dirname(partPath));
var uri = Uri.file(relativePath).toString();
var replacementRange = range.node(libraryName);
diff --git a/pkg/analysis_server/lib/src/services/flutter/property.dart b/pkg/analysis_server/lib/src/services/flutter/property.dart
index 11af175..0d4f3e3 100644
--- a/pkg/analysis_server/lib/src/services/flutter/property.dart
+++ b/pkg/analysis_server/lib/src/services/flutter/property.dart
@@ -118,7 +118,7 @@
);
}
- await builder.addDartFileEdit(resolvedUnit.path!, (builder) {
+ await builder.addDartFileEdit(resolvedUnit.path, (builder) {
_changeCode(builder, (builder) {
var expression = value.expression;
if (expression != null) {
@@ -155,7 +155,7 @@
}
var beginOffset = argumentExpression.offset;
- await builder.addDartFileEdit(resolvedUnit.path!, (builder) {
+ await builder.addDartFileEdit(resolvedUnit.path, (builder) {
builder.addDeletion(
SourceRange(beginOffset, endOffset - beginOffset),
);
@@ -559,7 +559,7 @@
var builder = ChangeBuilder(session: property.resolvedUnit.session);
- await builder.addDartFileEdit(property.resolvedUnit.path!, (builder) {
+ await builder.addDartFileEdit(property.resolvedUnit.path, (builder) {
property._changeCode(builder, (builder) {
if (leftCode == rightCode && topCode == bottomCode) {
builder.writeReference(classEdgeInsets);
diff --git a/pkg/analysis_server/test/edit/organize_directives_test.dart b/pkg/analysis_server/test/edit/organize_directives_test.dart
index e81ca0e..822589b 100644
--- a/pkg/analysis_server/test/edit/organize_directives_test.dart
+++ b/pkg/analysis_server/test/edit/organize_directives_test.dart
@@ -30,7 +30,6 @@
handler = EditDomainHandler(server);
}
- @failingTest
Future test_BAD_doesNotExist() async {
// The analysis driver fails to return an error
var request =
diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index 850b29a..4320775 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -360,7 +360,7 @@
Map<String, FileResult> fileResults = {};
void addFileResult(FileResult result) {
- fileResults[result.path!] = result;
+ fileResults[result.path] = result;
}
@override
diff --git a/pkg/analysis_server/test/src/cider/assists_test.dart b/pkg/analysis_server/test/src/cider/assists_test.dart
index defbb80..0dfc1321 100644
--- a/pkg/analysis_server/test/src/cider/assists_test.dart
+++ b/pkg/analysis_server/test/src/cider/assists_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
import 'package:analysis_server/src/cider/assists.dart';
import 'package:analysis_server/src/services/correction/assist.dart';
@@ -24,8 +22,8 @@
@reflectiveTest
class CiderAssistsComputerTest extends CiderServiceTest {
- _CorrectionContext _correctionContext;
- List<Assist> _assists;
+ late _CorrectionContext _correctionContext;
+ late List<Assist> _assists;
void assertHasAssist(AssistKind kind, String expected) {
var assist = _getAssist(kind);
diff --git a/pkg/analysis_server/test/src/cider/fixes_test.dart b/pkg/analysis_server/test/src/cider/fixes_test.dart
index 590ae33..fa71e62 100644
--- a/pkg/analysis_server/test/src/cider/fixes_test.dart
+++ b/pkg/analysis_server/test/src/cider/fixes_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
import 'package:analysis_server/src/cider/fixes.dart';
import 'package:analysis_server/src/services/correction/fix.dart';
@@ -23,8 +21,8 @@
@reflectiveTest
class CiderFixesComputerTest extends CiderServiceTest {
- _CorrectionContext _correctionContext;
- List<CiderErrorFixes> _errorsFixes;
+ late _CorrectionContext _correctionContext;
+ late List<CiderErrorFixes> _errorsFixes;
void assertHasFix(FixKind kind, String expected) {
var fix = _getFix(kind);
@@ -50,7 +48,7 @@
''');
// The file was resolved only once, even though we have 2 errors.
- expect(fileResolver.testView.resolvedFiles, [convertPath(testPath)]);
+ expect(fileResolver.testView!.resolvedFiles, [convertPath(testPath)]);
}
Future<void> test_createMethod() async {
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_async_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_async_test.dart
index dad6767..bb382ff 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_async_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_async_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer/src/error/codes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_await_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_await_test.dart
index 45dbde2..31ce0c6 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_await_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_await_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_const_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_const_test.dart
index c38b96f..bcb2893 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_const_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_const_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_curly_braces_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_curly_braces_test.dart
index 8bf57b5..18da15e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_curly_braces_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_curly_braces_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_diagnostic_property_reference_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_diagnostic_property_reference_test.dart
index 671d48f..7df0970 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_diagnostic_property_reference_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_diagnostic_property_reference_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer/src/error/codes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_explicit_cast_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_explicit_cast_test.dart
index e15b3c6..797f097 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_explicit_cast_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_explicit_cast_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_field_formal_parameters_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_field_formal_parameters_test.dart
index 6c53168..b8dbde7 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_field_formal_parameters_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_field_formal_parameters_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_late_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_late_test.dart
index 4600c2d..039dd8d 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_late_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_late_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_missing_enum_case_clauses_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_missing_enum_case_clauses_test.dart
index 7bdcdb5..f23da1c 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_missing_enum_case_clauses_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_missing_enum_case_clauses_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/src/error/codes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_named_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_named_test.dart
index b870f80..d1572d6 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_named_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_named_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_positional_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_positional_test.dart
index 9176d52..532f7a1 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_positional_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_positional_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_required_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_required_test.dart
index 7649cf2..61a1371 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_required_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_required_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/change_workspace.dart';
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/change_builder/change_workspace.dart';
@@ -160,7 +158,7 @@
@reflectiveTest
class AddMissingParameterRequiredTest_Workspace
extends AddMissingParameterRequiredTest {
- ChangeWorkspace _workspace;
+ ChangeWorkspace? _workspace;
@override
ChangeWorkspace get workspace {
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_missing_required_argument_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_missing_required_argument_test.dart
index d0c172f..593c68c 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_missing_required_argument_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_missing_required_argument_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_ne_null_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_ne_null_test.dart
index 38912fd..0d52849 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_ne_null_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_ne_null_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart
index 44c8028..e516e85 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_null_check_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/src/error/codes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_override_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_override_test.dart
index 54e6983..7a33711 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_override_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_override_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_required_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_required_test.dart
index 237f0e0..d5b03dc 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_required_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_required_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_return_type_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_return_type_test.dart
index 33a21c1..75a8383 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_return_type_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_return_type_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_static_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_static_test.dart
index 1c18f09..7fd378a 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_static_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_static_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_super_constructor_invocation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_super_constructor_invocation_test.dart
index 73348d8..ce129cc 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_super_constructor_invocation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_super_constructor_invocation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_type_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_type_annotation_test.dart
index 338af4b..dd375be 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_type_annotation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_type_annotation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/analysis_options/remove_lint_test.dart b/pkg/analysis_server/test/src/services/correction/fix/analysis_options/remove_lint_test.dart
index f099050..deb6eb4 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/analysis_options/remove_lint_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/analysis_options/remove_lint_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:linter/src/rules.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/analysis_options/remove_setting_test.dart b/pkg/analysis_server/test/src/services/correction/fix/analysis_options/remove_setting_test.dart
index 87870a2..c378884 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/analysis_options/remove_setting_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/analysis_options/remove_setting_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'test_support.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_all.dart b/pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_all.dart
index 68e1ceb..6d61c19 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_all.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'remove_lint_test.dart' as remove_lint;
diff --git a/pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_support.dart b/pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_support.dart
index 8762e93..b9569d4 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_support.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/analysis_options/test_support.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
import 'package:analysis_server/src/protocol_server.dart' show SourceEdit;
import 'package:analysis_server/src/services/correction/fix/analysis_options/fix_generator.dart';
@@ -47,17 +45,10 @@
}
YamlMap _parseYaml(String content) {
- if (content == null) {
- return YamlMap();
+ var doc = loadYamlNode(content);
+ if (doc is YamlMap) {
+ return doc;
}
- try {
- var doc = loadYamlNode(content);
- if (doc is YamlMap) {
- return doc;
- }
- return YamlMap();
- } catch (exception) {
- return null;
- }
+ return YamlMap();
}
}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/change_argument_name_test.dart b/pkg/analysis_server/test/src/services/correction/fix/change_argument_name_test.dart
index 3fbed10..5bb073d 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/change_argument_name_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/change_argument_name_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/change_to_nearest_precise_value_test.dart b/pkg/analysis_server/test/src/services/correction/fix/change_to_nearest_precise_value_test.dart
index c4bf81b..419a6c1 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/change_to_nearest_precise_value_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/change_to_nearest_precise_value_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/change_to_static_access_test.dart b/pkg/analysis_server/test/src/services/correction/fix/change_to_static_access_test.dart
index a6720bf..dd985bb 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/change_to_static_access_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/change_to_static_access_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/change_to_test.dart b/pkg/analysis_server/test/src/services/correction/fix/change_to_test.dart
index 0131fcd..da9231f 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/change_to_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/change_to_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/change_type_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/change_type_annotation_test.dart
index 3d07b71..c848914 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/change_type_annotation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/change_type_annotation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_documentation_into_line_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_documentation_into_line_test.dart
index 51be47f..e68869f 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_documentation_into_line_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_documentation_into_line_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_flutter_child_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_flutter_child_test.dart
index c4602e4..7afc732 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_flutter_child_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_flutter_child_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_flutter_children_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_flutter_children_test.dart
index 46797c9..0d5ae48 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_flutter_children_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_flutter_children_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_into_expression_body_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_into_expression_body_test.dart
index 70c20334..5bcdd3e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_into_expression_body_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_into_expression_body_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_contains_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_contains_test.dart
index 6602062..f0edd0b 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_contains_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_contains_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_for_element_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_for_element_test.dart
index 1c35ea9..fafbb6e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_for_element_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_for_element_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_generic_function_syntax_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_generic_function_syntax_test.dart
index 634617b..6d1ed6b 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_generic_function_syntax_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_generic_function_syntax_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_if_element_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_if_element_test.dart
index 677f515..ed2c3aa 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_if_element_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_if_element_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_if_null_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_if_null_test.dart
index 749807a..1a641e7 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_if_null_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_if_null_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer/src/dart/error/lint_codes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_int_literal_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_int_literal_test.dart
index c70252a..154e215 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_int_literal_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_int_literal_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_list_literal_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_list_literal_test.dart
index c77702a..160c5f4 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_list_literal_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_list_literal_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_map_literal_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_map_literal_test.dart
index 4f1a80f..3407683 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_map_literal_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_map_literal_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_named_arguments_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_named_arguments_test.dart
index 18f9934..cf35cc7 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_named_arguments_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_named_arguments_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_null_aware_spread_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_null_aware_spread_test.dart
index 4901a63..8cdcb25 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_null_aware_spread_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_null_aware_spread_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_null_aware_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_null_aware_test.dart
index 4331faa..52e07bf 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_null_aware_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_null_aware_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_on_type_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_on_type_test.dart
index 9d765ab..f14cf3c 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_on_type_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_on_type_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_package_import_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_package_import_test.dart
index 3cc1704..e991423 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_package_import_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_package_import_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_relative_import_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_relative_import_test.dart
index b8bc8af..8e59b5f 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_relative_import_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_relative_import_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer/src/error/codes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_set_literal_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_set_literal_test.dart
index ef21709..28674cb 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_set_literal_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_set_literal_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_single_quoted_string_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_single_quoted_string_test.dart
index d615eb6..12f8212 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_single_quoted_string_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_single_quoted_string_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_spread_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_spread_test.dart
index a85080b..bb9b5c8 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_spread_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_spread_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_where_type_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_where_type_test.dart
index 891dec0..7768534 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_where_type_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_where_type_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_class_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_class_test.dart
index 69df2df..b81a200 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_class_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_class_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_constructor_for_final_fields_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_constructor_for_final_fields_test.dart
index 3e1e664..32efaed 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_constructor_for_final_fields_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_constructor_for_final_fields_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_constructor_super_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_constructor_super_test.dart
index efb4913..19af80e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_constructor_super_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_constructor_super_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_constructor_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_constructor_test.dart
index 62ef51fa..233fa51 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_constructor_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_constructor_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_field_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_field_test.dart
index bcd22c6..869bda5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_field_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_field_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_file_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_file_test.dart
index 7eef88f..0c156d3 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_file_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_file_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test/test.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_function_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_function_test.dart
index 42f5940..fd2fea7 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_function_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_function_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_getter_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_getter_test.dart
index dc573f5..af7db0e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_getter_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_getter_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_local_variable_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_local_variable_test.dart
index 78960df..2c1d827 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_local_variable_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_local_variable_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test/test.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_method_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_method_test.dart
index 52fec47..4549b21 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_method_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_method_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/protocol_server.dart';
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart
index e45d973..90701d4 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test/test.dart';
@@ -298,8 +296,7 @@
await assertHasFix(expectedCode);
{
// end position should be on "m1", not on "m2", "m3", etc.
- var endPosition = change.selection;
- expect(endPosition, isNotNull);
+ var endPosition = change.selection!;
expect(endPosition.file, testFile);
var endOffset = endPosition.offset;
var endString = expectedCode.substring(endOffset, endOffset + 25);
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_mixin_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_mixin_test.dart
index 0efaa4c..024eab8 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_mixin_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_mixin_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_no_such_method_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_no_such_method_test.dart
index 09e733a..19bfb81 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_no_such_method_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_no_such_method_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_setter_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_setter_test.dart
index 0c93281..610f7dc 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_setter_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_setter_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/code_fragment_parser_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/code_fragment_parser_test.dart
index 5117185..d20113b 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/code_fragment_parser_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/code_fragment_parser_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:_fe_analyzer_shared/src/base/errors.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/accessor.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/code_fragment_parser.dart';
@@ -25,7 +23,7 @@
}
abstract class AbstractCodeFragmentParserTest {
- List<Accessor> assertErrors(
+ List<Accessor>? assertErrors(
String content, List<ExpectedError> expectedErrors) {
var errorListener = GatheringErrorListener();
var accessors = _parser(errorListener).parseAccessors(content, 0);
@@ -36,31 +34,31 @@
Expression assertErrorsInCondition(String content, List<String> variables,
List<ExpectedError> expectedErrors) {
var errorListener = GatheringErrorListener();
- var expression =
- _parser(errorListener, variables: variables).parseCondition(content, 0);
+ var expression = _parser(errorListener, variables: variables)
+ .parseCondition(content, 0)!;
errorListener.assertErrors(expectedErrors);
return expression;
}
List<Accessor> assertNoErrors(String content) {
var errorListener = GatheringErrorListener();
- var accessors = _parser(errorListener).parseAccessors(content, 0);
+ var accessors = _parser(errorListener).parseAccessors(content, 0)!;
errorListener.assertNoErrors();
return accessors;
}
Expression assertNoErrorsInCondition(String content,
- {List<String> variables}) {
+ {List<String>? variables}) {
var errorListener = GatheringErrorListener();
- var expression =
- _parser(errorListener, variables: variables).parseCondition(content, 0);
+ var expression = _parser(errorListener, variables: variables)
+ .parseCondition(content, 0)!;
errorListener.assertNoErrors();
return expression;
}
ExpectedError error(ErrorCode code, int offset, int length,
- {String message,
- Pattern messageContains,
+ {String? message,
+ Pattern? messageContains,
List<ExpectedContextMessage> contextMessages =
const <ExpectedContextMessage>[]}) =>
ExpectedError(code, offset, length,
@@ -69,7 +67,7 @@
expectedContextMessages: contextMessages);
CodeFragmentParser _parser(GatheringErrorListener listener,
- {List<String> variables}) {
+ {List<String>? variables}) {
var errorReporter = ErrorReporter(listener, MockSource());
var map = <String, ValueGenerator>{};
if (variables != null) {
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/conflicting_key_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/conflicting_key_test.dart
index 876aec3..77d6de7 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/conflicting_key_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/conflicting_key_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/expected_primary_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/expected_primary_test.dart
index f9100e7..38c7e43 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/expected_primary_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/expected_primary_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_character_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_character_test.dart
index 1050f96..ab3ece6 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_character_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_character_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_key_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_key_test.dart
index ed9a783..0a7c158 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_key_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_key_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_parameter_style_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_parameter_style_test.dart
index f2869c9..0fe38db 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_parameter_style_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_parameter_style_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_required_if_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_required_if_test.dart
index 4f48576..5037a80 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_required_if_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_required_if_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_value_one_of_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_value_one_of_test.dart
index fd960eb..fa9beb5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_value_one_of_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_value_one_of_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_value_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_value_test.dart
index 4fe611d..1bd6446 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_value_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/invalid_value_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_key_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_key_test.dart
index 3efdb34..c4a2e75 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_key_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_key_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_one_of_multiple_keys_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_one_of_multiple_keys_test.dart
index 9a2ef98..002f2f5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_one_of_multiple_keys_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_one_of_multiple_keys_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_template_end_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_template_end_test.dart
index f9ed776..0301220 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_template_end_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_template_end_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_token_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_token_test.dart
index 549eac8..c1ee9bd 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_token_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_token_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_uri_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_uri_test.dart
index 8efa08b..ac21bfc 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_uri_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/missing_uri_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/test_all.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/test_all.dart
index 8a67f05..bb2464ae 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/test_all.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'conflicting_key_test.dart' as conflicting_key;
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/undefined_variable_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/undefined_variable_test.dart
index 5014984..db854a5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/undefined_variable_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/undefined_variable_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unexpected_token_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unexpected_token_test.dart
index f96685d..9f6213c 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unexpected_token_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unexpected_token_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unknown_accessor_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unknown_accessor_test.dart
index c877690..205ad42 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unknown_accessor_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unknown_accessor_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unsupported_key_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unsupported_key_test.dart
index 8e6df60..64d724e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unsupported_key_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unsupported_key_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unsupported_version_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unsupported_version_test.dart
index 7bd3c13..606341f 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unsupported_version_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/unsupported_version_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_parser.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/wrong_token_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/wrong_token_test.dart
index 9548a68..ed35ea9 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/wrong_token_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/wrong_token_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/yaml_syntax_error_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/yaml_syntax_error_test.dart
index a74c9d2..dfa3444 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/yaml_syntax_error_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/diagnostics/yaml_syntax_error_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_error_code.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_override_set_parser_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_override_set_parser_test.dart
index 99e8f93..af7b127 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_override_set_parser_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_override_set_parser_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:_fe_analyzer_shared/src/base/errors.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_override_set.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_override_set_parser.dart';
@@ -24,10 +22,10 @@
/// Utilities shared between tests of the [TransformOverrideSetParser].
abstract class AbstractTransformOverrideSetParserTest {
/// The listener to which errors will be reported.
- GatheringErrorListener errorListener;
+ late GatheringErrorListener errorListener;
/// The result of parsing the test file's content.
- TransformOverrideSet result;
+ TransformOverrideSet? result;
void assertErrors(String code, List<ExpectedError> expectedErrors) {
parse(code);
@@ -39,17 +37,16 @@
errorListener.assertNoErrors();
}
- void assertOverride(String title, {bool bulkApply}) {
- var override = result.overrideForTransform(title);
- expect(override, isNotNull);
+ void assertOverride(String title, {bool? bulkApply}) {
+ var override = result!.overrideForTransform(title)!;
if (bulkApply != null) {
expect(override.bulkApply, bulkApply);
}
}
ExpectedError error(ErrorCode code, int offset, int length,
- {String text,
- Pattern messageContains,
+ {String? text,
+ Pattern? messageContains,
List<ExpectedContextMessage> contextMessages =
const <ExpectedContextMessage>[]}) =>
ExpectedError(code, offset, length,
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_parser_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_parser_test.dart
index 73ce508..08c69d5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_parser_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_parser_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/accessor.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/add_type_parameter.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/change.dart';
@@ -67,7 +65,7 @@
expect(modification.name, 'p');
expect(modification.isRequired, false);
expect(modification.isPositional, false);
- var components = modification.argumentValue.components;
+ var components = modification.argumentValue!.components;
expect(components, hasLength(1));
var value = _accessor(components[0]) as ArgumentAccessor;
var parameter = value.parameter as PositionalParameterReference;
@@ -142,7 +140,7 @@
expect(modification.name, 'p');
expect(modification.isRequired, true);
expect(modification.isPositional, false);
- var components = modification.argumentValue.components;
+ var components = modification.argumentValue!.components;
expect(components, hasLength(1));
var value = _accessor(components[0]) as ArgumentAccessor;
var parameter = value.parameter as PositionalParameterReference;
@@ -184,7 +182,7 @@
expect(modification.name, 'p');
expect(modification.isRequired, true);
expect(modification.isPositional, true);
- var components = modification.argumentValue.components;
+ var components = modification.argumentValue!.components;
expect(components, hasLength(1));
var value = _accessor(components[0]) as ArgumentAccessor;
var parameter = value.parameter as PositionalParameterReference;
@@ -229,7 +227,7 @@
expect(modification.name, 'p');
expect(modification.isRequired, true);
expect(modification.isPositional, true);
- var components = modification.argumentValue.components;
+ var components = modification.argumentValue!.components;
expect(components, hasLength(4));
var extractorA = _accessor(components[0]) as ArgumentAccessor;
var parameterA = extractorA.parameter as PositionalParameterReference;
@@ -351,7 +349,7 @@
expect(change.index, 0);
expect(change.name, 'T');
- var extendsComponents = change.extendedType.components;
+ var extendsComponents = change.extendedType!.components;
expect(extendsComponents, hasLength(1));
expect((extendsComponents[0] as TemplateText).text, 'Object');
@@ -395,7 +393,7 @@
expect(change.index, 0);
expect(change.name, 'T');
- var extendsComponents = change.extendedType.components;
+ var extendsComponents = change.extendedType!.components;
expect(extendsComponents, hasLength(1));
expect((extendsComponents[0] as TemplateText).text, 'Object');
@@ -669,7 +667,7 @@
expect((condition.leftOperand as LiteralString).value, 'a');
expect(condition.operator, Operator.equal);
expect((condition.rightOperand as LiteralString).value, 'b');
- var changes = changeMap[condition];
+ var changes = changeMap[condition]!;
expect(changes, hasLength(1));
var rename = changes[0] as Rename;
expect(rename.newName, 'B');
@@ -711,7 +709,7 @@
expect(modification.name, 'p');
expect(modification.isRequired, false);
expect(modification.isPositional, false);
- var argumentValue = modification.argumentValue;
+ var argumentValue = modification.argumentValue!;
expect(argumentValue.requiredIfCondition, isNotNull);
var components = argumentValue.components;
expect(components, hasLength(1));
@@ -733,5 +731,5 @@
ElementMatcher(importedUris: uris, components: [name]);
List<Transform> _transforms(String name) =>
- result.transformsFor(_matcher(name), applyingBulkFixes: false);
+ result!.transformsFor(_matcher(name), applyingBulkFixes: false);
}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_parser_test_support.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_parser_test_support.dart
index 8a790402..66ddafd 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_parser_test_support.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_parser_test_support.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set.dart';
import 'package:analysis_server/src/services/correction/fix/data_driven/transform_set_parser.dart';
import 'package:analyzer/error/error.dart';
@@ -15,10 +13,10 @@
/// Utilities shared between tests of the [TransformSetParser].
abstract class AbstractTransformSetParserTest {
/// The listener to which errors will be reported.
- GatheringErrorListener errorListener;
+ GatheringErrorListener errorListener = GatheringErrorListener();
/// The result of parsing the test file's content.
- TransformSet result;
+ TransformSet? result;
void assertErrors(String code, List<ExpectedError> expectedErrors) {
parse(code);
@@ -31,8 +29,8 @@
}
ExpectedError error(ErrorCode code, int offset, int length,
- {String text,
- Pattern messageContains,
+ {String? text,
+ Pattern? messageContains,
List<ExpectedContextMessage> contextMessages =
const <ExpectedContextMessage>[]}) =>
ExpectedError(code, offset, length,
@@ -41,7 +39,6 @@
expectedContextMessages: contextMessages);
void parse(String content) {
- errorListener = GatheringErrorListener();
var errorReporter =
ErrorReporter(errorListener, MockSource(fullName: 'data.yaml'));
var parser = TransformSetParser(errorReporter, 'myPackage');
diff --git a/pkg/analysis_server/test/src/services/correction/fix/extend_class_for_mixin_test.dart b/pkg/analysis_server/test/src/services/correction/fix/extend_class_for_mixin_test.dart
index e534c03..1624c7f 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/extend_class_for_mixin_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/extend_class_for_mixin_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/fix_in_file_test.dart b/pkg/analysis_server/test/src/services/correction/fix/fix_in_file_test.dart
index 7545858..52438b8 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/fix_in_file_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/fix_in_file_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix_internal.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:test/test.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart b/pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart
index 4c8fc08..aab237e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/fix_processor.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
import 'package:analysis_server/src/services/correction/change_workspace.dart';
import 'package:analysis_server/src/services/correction/fix.dart';
@@ -28,43 +26,24 @@
export 'package:analyzer/src/test_utilities/package_config_file_builder.dart';
abstract class BaseFixProcessorTest extends AbstractSingleUnitTest {
- /// The errors in the file for which fixes are being computed.
- List<AnalysisError> _errors;
+ /// The source change associated with the fix that was found.
+ late SourceChange change;
- /// The source change associated with the fix that was found, or `null` if
- /// neither [assertHasFix] nor [assertHasFixAllFix] has been invoked.
- SourceChange change;
-
- /// The result of applying the [change] to the file content, or `null` if
- /// neither [assertHasFix] nor [assertHasFixAllFix] has been invoked.
- String resultCode;
+ /// The result of applying the [change] to the file content.
+ late String resultCode;
/// The workspace in which fixes contributor operates.
ChangeWorkspace get workspace {
return DartChangeWorkspace([session]);
}
- Future<List<AnalysisError>> _computeErrors() async {
- if (_errors == null) {
- if (testAnalysisResult != null) {
- _errors = testAnalysisResult.errors;
- }
- if (_errors == null) {
- var result = await session.getResolvedUnit(testFile);
- _errors = result.errors;
- }
- }
- return _errors;
- }
-
/// Find the error that is to be fixed by computing the errors in the file,
/// using the [errorFilter] to filter out errors that should be ignored, and
/// expecting that there is a single remaining error. The error filter should
/// return `true` if the error should not be ignored.
Future<AnalysisError> _findErrorToFix(
- bool Function(AnalysisError) errorFilter,
- {int length}) async {
- var errors = await _computeErrors();
+ {bool Function(AnalysisError)? errorFilter, int? length}) async {
+ var errors = testAnalysisResult.errors;
if (errorFilter != null) {
if (errors.length == 1) {
fail('Unnecessary error filter');
@@ -85,13 +64,13 @@
}
Future<AnalysisError> _findErrorToFixOfType(ErrorCode errorCode) async {
- var errors = await _computeErrors();
+ var errors = testAnalysisResult.errors;
for (var error in errors) {
if (error.errorCode == errorCode) {
return error;
}
}
- return null;
+ fail('Expected to find an error with the code: $errorCode');
}
}
@@ -111,9 +90,9 @@
}
Future<List<Fix>> getFixesForFirstError() async {
- var errors = await _computeErrors();
+ var errors = testAnalysisResult.errors;
expect(errors, isNotEmpty);
- String errorCode;
+ String? errorCode;
for (var error in errors) {
errorCode ??= error.errorCode.name;
if (errorCode != error.errorCode.name) {
@@ -164,9 +143,10 @@
/// Return the [LintCode] for the [lintCode] (which is actually a name).
Future<LintCode> lintCodeByName(String name) async {
- var errors = await _computeErrors();
+ var errors = testAnalysisResult.errors;
var lintCodeSet = errors
.map((error) => error.errorCode)
+ .whereType<LintCode>()
.where((errorCode) => errorCode.name == name)
.toSet();
if (lintCodeSet.length != 1) {
@@ -196,16 +176,19 @@
FixKind get kind;
Future<void> assertHasFix(String expected,
- {bool Function(AnalysisError) errorFilter,
- int length,
- String target,
- int expectedNumberOfFixesForKind,
- String matchFixMessage,
+ {bool Function(AnalysisError)? errorFilter,
+ int? length,
+ String? target,
+ int? expectedNumberOfFixesForKind,
+ String? matchFixMessage,
bool allowFixAllFixes = false}) async {
if (useLineEndingsForPlatform) {
expected = normalizeNewlinesForPlatform(expected);
}
- var error = await _findErrorToFix(errorFilter, length: length);
+ var error = await _findErrorToFix(
+ errorFilter: errorFilter,
+ length: length,
+ );
var fix = await _assertHasFix(error,
expectedNumberOfFixesForKind: expectedNumberOfFixesForKind,
matchFixMessage: matchFixMessage,
@@ -227,7 +210,7 @@
}
Future<void> assertHasFixAllFix(ErrorCode errorCode, String expected,
- {String target}) async {
+ {String? target}) async {
if (useLineEndingsForPlatform) {
expected = normalizeNewlinesForPlatform(expected);
}
@@ -250,14 +233,14 @@
}
Future<void> assertHasFixWithoutApplying(
- {bool Function(AnalysisError) errorFilter}) async {
- var error = await _findErrorToFix(errorFilter);
+ {bool Function(AnalysisError)? errorFilter}) async {
+ var error = await _findErrorToFix(errorFilter: errorFilter);
var fix = await _assertHasFix(error);
change = fix.change;
}
void assertLinkedGroup(LinkedEditGroup group, List<String> expectedStrings,
- [List<LinkedEditSuggestion> expectedSuggestions]) {
+ [List<LinkedEditSuggestion>? expectedSuggestions]) {
var expectedPositions = _findResultPositions(expectedStrings);
expect(group.positions, unorderedEquals(expectedPositions));
if (expectedSuggestions != null) {
@@ -268,7 +251,7 @@
/// Compute fixes for all of the errors in the test file to effectively assert
/// that no exceptions will be thrown by doing so.
Future<void> assertNoExceptions() async {
- var errors = await _computeErrors();
+ var errors = testAnalysisResult.errors;
for (var error in errors) {
await _computeFixes(error);
}
@@ -276,8 +259,8 @@
/// Compute fixes and ensure that there is no fix of the [kind] being tested by
/// this class.
- Future<void> assertNoFix({bool Function(AnalysisError) errorFilter}) async {
- var error = await _findErrorToFix(errorFilter);
+ Future<void> assertNoFix({bool Function(AnalysisError)? errorFilter}) async {
+ var error = await _findErrorToFix(errorFilter: errorFilter);
await _assertNoFix(error);
}
@@ -304,8 +287,8 @@
/// Optionally, if a [matchFixMessage] is passed, then the kind as well as the fix message must
/// match to be returned.
Future<Fix> _assertHasFix(AnalysisError error,
- {int expectedNumberOfFixesForKind,
- String matchFixMessage,
+ {int? expectedNumberOfFixesForKind,
+ String? matchFixMessage,
bool allowFixAllFixes = false}) async {
// Compute the fixes for this AnalysisError
var fixes = await _computeFixes(error);
@@ -326,7 +309,7 @@
// If a matchFixMessage was provided,
if (matchFixMessage != null) {
for (var fix in fixes) {
- if (matchFixMessage == fix?.change?.message) {
+ if (matchFixMessage == fix.change.message) {
return fix;
}
}
@@ -340,7 +323,7 @@
}
// Assert that none of the fixes are a fix-all fix.
- Fix foundFix;
+ Fix? foundFix;
for (var fix in fixes) {
if (!allowFixAllFixes && fix.isFixAllFix()) {
fail('A fix-all fix was found for the error: $error '
@@ -367,7 +350,7 @@
var fixes = await _computeFixes(error);
// Assert that there exists such a fix in the list.
- Fix foundFix;
+ Fix? foundFix;
for (var fix in fixes) {
if (fix.kind == kind && fix.isFixAllFix()) {
foundFix = fix;
diff --git a/pkg/analysis_server/test/src/services/correction/fix/fix_test.dart b/pkg/analysis_server/test/src/services/correction/fix/fix_test.dart
index c457918..b66fd12 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/fix_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/fix_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/import_async_test.dart b/pkg/analysis_server/test/src/services/correction/fix/import_async_test.dart
index 519e973..5fa217e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/import_async_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/import_async_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/import_library_prefix_test.dart b/pkg/analysis_server/test/src/services/correction/fix/import_library_prefix_test.dart
index 821600b..c1ffcce 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/import_library_prefix_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/import_library_prefix_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/import_library_project_test.dart b/pkg/analysis_server/test/src/services/correction/fix/import_library_project_test.dart
index 709dd4c..fcfed31 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/import_library_project_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/import_library_project_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/import_library_sdk_test.dart b/pkg/analysis_server/test/src/services/correction/fix/import_library_sdk_test.dart
index 54edaa4..8b0b7e5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/import_library_sdk_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/import_library_sdk_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/import_library_show_test.dart b/pkg/analysis_server/test/src/services/correction/fix/import_library_show_test.dart
index 57b95ad..e54adba 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/import_library_show_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/import_library_show_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/inline_invocation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/inline_invocation_test.dart
index c1562ba..bb8dc37 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/inline_invocation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/inline_invocation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/inline_typedef_test.dart b/pkg/analysis_server/test/src/services/correction/fix/inline_typedef_test.dart
index ff11196..39d4fdb 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/inline_typedef_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/inline_typedef_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/insert_semicolon_test.dart b/pkg/analysis_server/test/src/services/correction/fix/insert_semicolon_test.dart
index 1425260..937ff59 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/insert_semicolon_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/insert_semicolon_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/make_class_abstract_test.dart b/pkg/analysis_server/test/src/services/correction/fix/make_class_abstract_test.dart
index a9d04c6..f5927f9 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/make_class_abstract_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/make_class_abstract_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/make_field_not_final_test.dart b/pkg/analysis_server/test/src/services/correction/fix/make_field_not_final_test.dart
index c36b65d..941643a 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/make_field_not_final_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/make_field_not_final_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/make_final_test.dart b/pkg/analysis_server/test/src/services/correction/fix/make_final_test.dart
index d035112..fbee41d 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/make_final_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/make_final_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/make_return_type_nullable_test.dart b/pkg/analysis_server/test/src/services/correction/fix/make_return_type_nullable_test.dart
index 1e9cb8f..7e976e7 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/make_return_type_nullable_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/make_return_type_nullable_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/make_variable_not_final_test.dart b/pkg/analysis_server/test/src/services/correction/fix/make_variable_not_final_test.dart
index cf9a788..c87fde3 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/make_variable_not_final_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/make_variable_not_final_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/make_variable_nullable_test.dart b/pkg/analysis_server/test/src/services/correction/fix/make_variable_nullable_test.dart
index 488331c..f619f67 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/make_variable_nullable_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/make_variable_nullable_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/move_type_arguments_to_class_test.dart b/pkg/analysis_server/test/src/services/correction/fix/move_type_arguments_to_class_test.dart
index 6ff66ba..c3b99ff 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/move_type_arguments_to_class_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/move_type_arguments_to_class_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart b/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart
index 125a5d5..941bdf4 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/qualify_reference_test.dart b/pkg/analysis_server/test/src/services/correction/fix/qualify_reference_test.dart
index e44250d..5c92c08 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/qualify_reference_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/qualify_reference_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
index 36be9f6..b693ead 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_annotation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_argument_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_argument_test.dart
index c528f5b..cb1dc00 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_argument_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_argument_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_await_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_await_test.dart
index 29c0674..97d8bf8 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_await_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_await_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_comparison_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_comparison_test.dart
index 97608943..5494406 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_comparison_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_comparison_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_const_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_const_test.dart
index 7b6b001..3f347cc3 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_const_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_const_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_dead_code_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_dead_code_test.dart
index dd0e173..3fd394e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_dead_code_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_dead_code_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_duplicate_case_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_duplicate_case_test.dart
index c6243fd..0d8a6b1 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_duplicate_case_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_duplicate_case_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_empty_catch_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_empty_catch_test.dart
index 2321c20..ff75a69 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_empty_catch_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_empty_catch_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_empty_constructor_body_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_empty_constructor_body_test.dart
index 51b93c3..3f93785 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_empty_constructor_body_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_empty_constructor_body_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer/error/error.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_empty_else_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_empty_else_test.dart
index db6fb4b..b7521b3 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_empty_else_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_empty_else_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_empty_statement_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_empty_statement_test.dart
index 1622bea..0b28f0f 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_empty_statement_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_empty_statement_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_if_null_operator_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_if_null_operator_test.dart
index c92d731..3f86e17 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_if_null_operator_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_if_null_operator_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_initializer_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_initializer_test.dart
index 151ac34..7127fbd 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_initializer_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_initializer_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_interpolation_braces_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_interpolation_braces_test.dart
index 76179a9..eaf6bc0 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_interpolation_braces_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_interpolation_braces_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_method_declaration_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_method_declaration_test.dart
index 40b63e0..d7d5d74 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_method_declaration_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_method_declaration_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer/src/dart/analysis/experiments.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_combinator_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_combinator_test.dart
index 9280896..e833910 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_combinator_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_combinator_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_non_null_assertion_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_non_null_assertion_test.dart
index 643425b..d66f1b8 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_non_null_assertion_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_non_null_assertion_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_operator_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_operator_test.dart
index b71c545..22aa7e5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_operator_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_operator_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_parameters_in_getter_declaration_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_parameters_in_getter_declaration_test.dart
index b4c7466..8b96c68 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_parameters_in_getter_declaration_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_parameters_in_getter_declaration_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_parentheses_in_getter_invocation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_parentheses_in_getter_invocation_test.dart
index 203eae4..5f0d7e3 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_parentheses_in_getter_invocation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_parentheses_in_getter_invocation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_question_mark_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_question_mark_test.dart
index 3fcd7f9..286b5d3 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_question_mark_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_question_mark_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_this_expression_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_this_expression_test.dart
index 6efe653..aa1a132 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_this_expression_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_this_expression_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_type_annotation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_type_annotation_test.dart
index c26fe04..d4c97ab 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_type_annotation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_type_annotation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_type_arguments_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_type_arguments_test.dart
index e13eb07..62bf7e6 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_type_arguments_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_type_arguments_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_cast_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_cast_test.dart
index ea8217b..57bfd6c 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_cast_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_cast_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_const_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_const_test.dart
index 1969f3e..1f1e6f2 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_const_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_const_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_new_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_new_test.dart
index ee1a000..dc6b443 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_new_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_new_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_string_interpolation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_string_interpolation_test.dart
index d849c0e..cd6a3c4 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_string_interpolation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_string_interpolation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_catch_clause_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_catch_clause_test.dart
index 97e20b7..d18763d 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_catch_clause_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_catch_clause_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_catch_stack_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_catch_stack_test.dart
index 4d484d6..730f44e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_catch_stack_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_catch_stack_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_element_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_element_test.dart
index 9faaa3a..154a433 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_element_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_element_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/src/error/codes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_field_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_field_test.dart
index e8419fd..8bf054c 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_field_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_field_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart
index 44953fc..020945a 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_import_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_label_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_label_test.dart
index e5525f38..df57ba1 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_label_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_label_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_local_variable_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_local_variable_test.dart
index 45e17e3..dac33f8 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_local_variable_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_local_variable_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_parameter_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_parameter_test.dart
index d8e42b3..d32eb88 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_unused_parameter_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unused_parameter_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/rename_to_camel_case_test.dart b/pkg/analysis_server/test/src/services/correction/fix/rename_to_camel_case_test.dart
index 7fe7132..9ae1f64 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/rename_to_camel_case_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/rename_to_camel_case_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_boolean_with_bool_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_boolean_with_bool_test.dart
index 6931abc..2d35370 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_boolean_with_bool_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_boolean_with_bool_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_cascade_with_dot_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_cascade_with_dot_test.dart
index 26a4c84..8cf92ad 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_cascade_with_dot_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_cascade_with_dot_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_colon_with_equals_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_colon_with_equals_test.dart
index 006166c..852892b 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_colon_with_equals_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_colon_with_equals_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_final_with_const_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_final_with_const_test.dart
index 4855265..e1ffdad 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_final_with_const_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_final_with_const_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_new_with_const_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_new_with_const_test.dart
index 5c1dd65..a1607e5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_new_with_const_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_new_with_const_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_null_with_closure_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_null_with_closure_test.dart
index 0588184..8c6d3b3 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_null_with_closure_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_null_with_closure_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_future_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_future_test.dart
index 273fff5..0c42514 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_future_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_future_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_var_with_dynamic_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_var_with_dynamic_test.dart
index 444cd2d..02b4eae 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_var_with_dynamic_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_var_with_dynamic_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_brackets_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_brackets_test.dart
index 63fed72..21075fa 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_brackets_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_brackets_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_conditional_assignment_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_conditional_assignment_test.dart
index 7a1dbb4..8964e95 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_conditional_assignment_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_conditional_assignment_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_eight_digit_hex_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_eight_digit_hex_test.dart
index 9ec3529..bd4e2e1 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_eight_digit_hex_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_eight_digit_hex_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_extension_name_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_extension_name_test.dart
index 8d70db9..0bf4a84 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_extension_name_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_extension_name_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_filled_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_filled_test.dart
index d719d36..cdfb2bc 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_filled_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_filled_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_identifier_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_identifier_test.dart
index 99f9758..ce9487a 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_identifier_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_identifier_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_interpolation_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_interpolation_test.dart
index 4a552ee..0a2539b 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_interpolation_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_interpolation_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_is_empty_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_is_empty_test.dart
index 345ba29..ebff731 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_is_empty_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_is_empty_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_is_not_empty_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_is_not_empty_test.dart
index 57827f3..b7bdd71 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_is_not_empty_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_is_not_empty_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_not_null_aware_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_not_null_aware_test.dart
index cdce1b0..ccbc1cf 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_not_null_aware_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_not_null_aware_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_null_aware_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_null_aware_test.dart
index 05c60ac..226c4f7 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_null_aware_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_null_aware_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_tear_off_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_tear_off_test.dart
index 793d625..772ecd7 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_tear_off_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_tear_off_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_var_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_var_test.dart
index 3b57554..422034e 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_var_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_var_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/sort_child_property_last_test.dart b/pkg/analysis_server/test/src/services/correction/fix/sort_child_property_last_test.dart
index 7c46f06..686d8f2 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/sort_child_property_last_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/sort_child_property_last_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/update_sdk_constraints_test.dart b/pkg/analysis_server/test/src/services/correction/fix/update_sdk_constraints_test.dart
index 416be56..2d15f0a 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/update_sdk_constraints_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/update_sdk_constraints_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/dart/analysis/experiments.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
@@ -89,7 +87,7 @@
}
Future<void> testUpdate(
- {String content, String from = '^2.0.0', String to}) async {
+ {String? content, String from = '^2.0.0', required String to}) async {
updateTestPubspecFile('''
environment:
sdk: $from
diff --git a/pkg/analysis_server/test/src/services/correction/fix/use_const_test.dart b/pkg/analysis_server/test/src/services/correction/fix/use_const_test.dart
index 3476b67..62e0701 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/use_const_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/use_const_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/use_effective_integer_division_test.dart b/pkg/analysis_server/test/src/services/correction/fix/use_effective_integer_division_test.dart
index 5a861d5..d8a6c78 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/use_effective_integer_division_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/use_effective_integer_division_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/use_eq_eq_null_test.dart b/pkg/analysis_server/test/src/services/correction/fix/use_eq_eq_null_test.dart
index 9173967..2e53d54 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/use_eq_eq_null_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/use_eq_eq_null_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/use_is_not_empty_test.dart b/pkg/analysis_server/test/src/services/correction/fix/use_is_not_empty_test.dart
index 7142b2f..04a82ac 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/use_is_not_empty_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/use_is_not_empty_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/use_not_eq_null_test.dart b/pkg/analysis_server/test/src/services/correction/fix/use_not_eq_null_test.dart
index 768232f..fdd7d12 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/use_not_eq_null_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/use_not_eq_null_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/use_rethrow_test.dart b/pkg/analysis_server/test/src/services/correction/fix/use_rethrow_test.dart
index 1741227..6d78eb0 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/use_rethrow_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/use_rethrow_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/wrap_in_future_test.dart b/pkg/analysis_server/test/src/services/correction/fix/wrap_in_future_test.dart
index f7ff631..b86e482 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/wrap_in_future_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/wrap_in_future_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/linter/lint_names.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
diff --git a/pkg/analysis_server/test/src/services/correction/fix/wrap_in_text_test.dart b/pkg/analysis_server/test/src/services/correction/fix/wrap_in_text_test.dart
index 60f9b0d..bca0c26 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/wrap_in_text_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/wrap_in_text_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
diff --git a/pkg/analysis_server/tool/bulk_fix/supported_lints.dart b/pkg/analysis_server/tool/bulk_fix/supported_lints.dart
index 85a6eae..a9d4064 100644
--- a/pkg/analysis_server/tool/bulk_fix/supported_lints.dart
+++ b/pkg/analysis_server/tool/bulk_fix/supported_lints.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// @dart = 2.9
-
import 'package:analysis_server/src/services/correction/fix_internal.dart';
/// Print lints that are bulk-fixable in a format that can be included in
diff --git a/pkg/analyzer/lib/dart/analysis/results.dart b/pkg/analyzer/lib/dart/analysis/results.dart
index 4a17594..6c36a21 100644
--- a/pkg/analyzer/lib/dart/analysis/results.dart
+++ b/pkg/analyzer/lib/dart/analysis/results.dart
@@ -17,9 +17,7 @@
abstract class AnalysisResult {
/// The absolute and normalized path of the file that was analyzed.
/// If [state] is not [ResultState.VALID], throws [StateError].
- ///
- /// TODO(migration): should not be nullable
- String? get path;
+ String get path;
/// Return the session used to compute this result.
/// If [state] is not [ResultState.VALID], throws [StateError].
@@ -86,13 +84,13 @@
/// Clients may not extend, implement or mix-in this class.
abstract class ParsedLibraryResult implements AnalysisResult {
/// The parsed units of the library.
- ///
- /// TODO(migration): should not be null, probably empty list
- List<ParsedUnitResult>? get units;
+ /// If [state] is not [ResultState.VALID], throws [StateError].
+ List<ParsedUnitResult> get units;
/// Return the declaration of the [element], or `null` if the [element]
/// is synthetic. Throw [ArgumentError] if the [element] is not defined in
/// this library.
+ /// If [state] is not [ResultState.VALID], throws [StateError].
ElementDeclarationResult? getElementDeclaration(Element element);
}
@@ -134,17 +132,21 @@
/// Clients may not extend, implement or mix-in this class.
abstract class ResolvedLibraryResult implements AnalysisResult {
/// The element representing this library.
- LibraryElement? get element;
+ /// If [state] is not [ResultState.VALID], throws [StateError].
+ LibraryElement get element;
/// The type provider used when resolving the library.
+ /// If [state] is not [ResultState.VALID], throws [StateError].
TypeProvider get typeProvider;
/// The resolved units of the library.
- List<ResolvedUnitResult>? get units;
+ /// If [state] is not [ResultState.VALID], throws [StateError].
+ List<ResolvedUnitResult> get units;
/// Return the declaration of the [element], or `null` if the [element]
/// is synthetic. Throw [ArgumentError] if the [element] is not defined in
/// this library.
+ /// If [state] is not [ResultState.VALID], throws [StateError].
ElementDeclarationResult? getElementDeclaration(Element element);
}
@@ -171,6 +173,10 @@
/// An indication of whether an analysis result is valid, and if not why.
enum ResultState {
+ /// An indication that the analysis result cannot be provided because
+ /// the library is created from summary.
+ EXTERNAL_LIBRARY,
+
/// An indication that analysis could not be performed because the path
/// represents a file of a type that cannot be analyzed.
INVALID_FILE_TYPE,
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 8f17b48..75f297c 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -215,7 +215,7 @@
final _resultController = StreamController<ResolvedUnitResult>();
/// The stream that will be written to when analysis results are produced.
- late final Stream<ResolvedUnitResult> _onResults;
+ late final Stream<ResolvedUnitResult> _resultStream;
/// Resolution signatures of the most recently produced results for files.
final Map<String, String> _lastProducedSignatures = {};
@@ -282,7 +282,7 @@
_externalSummaries = externalSummaries,
testingData = retainDataForTesting ? TestingData() : null {
_createNewSession(null);
- _onResults = _resultController.stream.asBroadcastStream();
+ _resultStream = _resultController.stream.asBroadcastStream();
_testView = AnalysisDriverTestView(this);
_createFileTracker();
_scheduler.add(this);
@@ -361,7 +361,7 @@
///
/// Results might be produced even for files that have never been added
/// using [addFile], for example when [getResult] was called for a file.
- Stream<ResolvedUnitResult> get results => _onResults;
+ Stream<ResolvedUnitResult> get results => _resultStream;
/// Return the search support for the driver.
Search get search => _search;
@@ -649,7 +649,7 @@
FileState file = _fsState.getFileForPath(path);
if (file.isExternalLibrary) {
- return ParsedLibraryResultImpl.external(currentSession, file.uri);
+ return NotValidParsedLibraryResultImpl(ResultState.EXTERNAL_LIBRARY);
}
if (file.isPart) {
@@ -680,7 +680,7 @@
}
if (file.isExternalLibrary) {
- return ParsedLibraryResultImpl.external(currentSession, file.uri);
+ return NotValidParsedLibraryResultImpl(ResultState.EXTERNAL_LIBRARY);
}
if (file.isPart) {
@@ -718,7 +718,7 @@
if (file.isExternalLibrary) {
return Future.value(
- ResolvedLibraryResultImpl.external(currentSession, file.uri),
+ NotValidResolvedLibraryResultImpl(ResultState.EXTERNAL_LIBRARY),
);
}
@@ -756,7 +756,7 @@
if (file.isExternalLibrary) {
return Future.value(
- ResolvedLibraryResultImpl.external(currentSession, file.uri),
+ NotValidResolvedLibraryResultImpl(ResultState.EXTERNAL_LIBRARY),
);
}
@@ -1102,7 +1102,7 @@
// last time, so we don't need to produce it again now.
} else {
_resultController.add(result);
- _lastProducedSignatures[result.path!] = result._signature;
+ _lastProducedSignatures[result.path] = result._signature;
}
} catch (exception, stackTrace) {
_reportException(path, exception, stackTrace);
diff --git a/pkg/analyzer/lib/src/dart/analysis/results.dart b/pkg/analyzer/lib/src/dart/analysis/results.dart
index c2e5b28..1f4ded0 100644
--- a/pkg/analyzer/lib/src/dart/analysis/results.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/results.dart
@@ -18,7 +18,7 @@
final AnalysisSession session;
@override
- final String? path;
+ final String path;
@override
final Uri uri;
@@ -75,7 +75,7 @@
NotValidAnalysisResultImpl(this.state);
@override
- String? get path {
+ String get path {
throw StateError('This result is not valid');
}
@@ -117,6 +117,46 @@
}
}
+class NotValidParsedLibraryResultImpl extends NotValidAnalysisResultImpl
+ implements ParsedLibraryResult {
+ NotValidParsedLibraryResultImpl(ResultState state) : super(state);
+
+ @override
+ List<ParsedUnitResult> get units {
+ throw StateError('This result is not valid');
+ }
+
+ @override
+ ElementDeclarationResult? getElementDeclaration(Element element) {
+ throw StateError('This result is not valid');
+ }
+}
+
+class NotValidResolvedLibraryResultImpl extends NotValidAnalysisResultImpl
+ implements ResolvedLibraryResult {
+ NotValidResolvedLibraryResultImpl(ResultState state) : super(state);
+
+ @override
+ LibraryElement get element {
+ throw StateError('This result is not valid');
+ }
+
+ @override
+ TypeProvider get typeProvider {
+ throw StateError('This result is not valid');
+ }
+
+ @override
+ List<ResolvedUnitResult> get units {
+ throw StateError('This result is not valid');
+ }
+
+ @override
+ ElementDeclarationResult? getElementDeclaration(Element element) {
+ throw StateError('This result is not valid');
+ }
+}
+
/// The implementation of [ResolvedUnitResult] when not [ResultState.VALID].
class NotValidResolvedUnitResultImpl extends NotValidFileResultImpl
implements ResolvedUnitResult {
@@ -172,20 +212,14 @@
class ParsedLibraryResultImpl extends AnalysisResultImpl
implements ParsedLibraryResult {
@override
- final List<ParsedUnitResult>? units;
+ final List<ParsedUnitResult> units;
ParsedLibraryResultImpl(
- AnalysisSession session, String? path, Uri uri, this.units)
+ AnalysisSession session, String path, Uri uri, this.units)
: super(session, path, uri);
- ParsedLibraryResultImpl.external(AnalysisSession session, Uri uri)
- : this(session, null, uri, null);
-
@override
ResultState get state {
- if (path == null) {
- return ResultState.NOT_A_FILE;
- }
return ResultState.VALID;
}
@@ -203,7 +237,7 @@
}
var elementPath = element.source!.fullName;
- var unitResult = units!.firstWhere(
+ var unitResult = units.firstWhere(
(r) => r.path == elementPath,
orElse: () {
var elementStr = element.getDisplayString(withNullability: true);
@@ -261,28 +295,22 @@
class ResolvedLibraryResultImpl extends AnalysisResultImpl
implements ResolvedLibraryResult {
@override
- final LibraryElement? element;
+ final LibraryElement element;
@override
- final List<ResolvedUnitResult>? units;
+ final List<ResolvedUnitResult> units;
ResolvedLibraryResultImpl(
- AnalysisSession session, String? path, Uri uri, this.element, this.units)
+ AnalysisSession session, String path, Uri uri, this.element, this.units)
: super(session, path, uri);
- ResolvedLibraryResultImpl.external(AnalysisSession session, Uri uri)
- : this(session, null, uri, null, null);
-
@override
ResultState get state {
- if (path == null) {
- return ResultState.NOT_A_FILE;
- }
return ResultState.VALID;
}
@override
- TypeProvider get typeProvider => element!.typeProvider;
+ TypeProvider get typeProvider => element.typeProvider;
@override
ElementDeclarationResult? getElementDeclaration(Element element) {
@@ -298,7 +326,7 @@
}
var elementPath = element.source!.fullName;
- var unitResult = units!.firstWhere(
+ var unitResult = units.firstWhere(
(r) => r.path == elementPath,
orElse: () {
var elementStr = element.getDisplayString(withNullability: true);
@@ -307,7 +335,7 @@
buffer.writeln(' is not defined in this library.');
// TODO(scheglov) https://github.com/dart-lang/sdk/issues/45430
buffer.writeln('elementPath: $elementPath');
- buffer.writeln('unitPaths: ${units!.map((e) => e.path).toList()}');
+ buffer.writeln('unitPaths: ${units.map((e) => e.path).toList()}');
throw ArgumentError('$buffer');
},
);
diff --git a/pkg/analyzer/lib/src/dart/analysis/session_helper.dart b/pkg/analyzer/lib/src/dart/analysis/session_helper.dart
index 235e67d..d65da13 100644
--- a/pkg/analyzer/lib/src/dart/analysis/session_helper.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/session_helper.dart
@@ -54,7 +54,7 @@
var resolvedLibrary = await _getResolvedLibrary(libraryPath);
var unitPath = element.source!.fullName;
- return resolvedLibrary.units!.singleWhere((resolvedUnit) {
+ return resolvedLibrary.units.singleWhere((resolvedUnit) {
return resolvedUnit.path == unitPath;
});
}
diff --git a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
index e7dff9b..fb17e85 100644
--- a/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
+++ b/pkg/analyzer/lib/src/dart/micro/resolve_file.dart
@@ -398,7 +398,7 @@
performance: performance,
);
var result =
- libraryUnit.units!.firstWhere((element) => element.path == path);
+ libraryUnit.units.firstWhere((element) => element.path == path);
return result;
});
}
diff --git a/pkg/analyzer/test/generated/constant_test.dart b/pkg/analyzer/test/generated/constant_test.dart
index 5b8847d..c285f9b 100644
--- a/pkg/analyzer/test/generated/constant_test.dart
+++ b/pkg/analyzer/test/generated/constant_test.dart
@@ -497,7 +497,7 @@
var expression = findNode.variableDeclaration('x =').initializer!;
- var file = getFile(result.path!);
+ var file = getFile(result.path);
var evaluator = ConstantEvaluator(
file.createSource(result.uri),
result.libraryElement as LibraryElementImpl,
diff --git a/pkg/analyzer/test/src/dart/analysis/dependency/base.dart b/pkg/analyzer/test/src/dart/analysis/dependency/base.dart
index 3eec88f..978ea99 100644
--- a/pkg/analyzer/test/src/dart/analysis/dependency/base.dart
+++ b/pkg/analyzer/test/src/dart/analysis/dependency/base.dart
@@ -138,7 +138,7 @@
Future<List<CompilationUnit>> _resolveLibrary(String libraryPath) async {
var session = contextFor(libraryPath).currentSession;
var resolvedLibrary = await session.getResolvedLibrary(libraryPath);
- return resolvedLibrary.units!.map((ru) => ru.unit!).toList();
+ return resolvedLibrary.units.map((ru) => ru.unit!).toList();
}
}
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index 9ddda1e..6572ba2 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -3063,7 +3063,7 @@
driver.changeFile(b);
await waitForIdleWithoutExceptions();
- List<String> analyzedPaths = allResults.map((r) => r.path!).toList();
+ List<String> analyzedPaths = allResults.map((r) => r.path).toList();
// The changed file must be the first.
expect(analyzedPaths[0], b);
@@ -3105,7 +3105,7 @@
driver.changeFile(a);
await waitForIdleWithoutExceptions();
- List<String> analyzedPaths = allResults.map((r) => r.path!).toList();
+ List<String> analyzedPaths = allResults.map((r) => r.path).toList();
// The changed files must be the first.
expect(analyzedPaths[0], a);
diff --git a/pkg/analyzer/test/src/dart/analysis/session_test.dart b/pkg/analyzer/test/src/dart/analysis/session_test.dart
index f1235ca..c32728a 100644
--- a/pkg/analyzer/test/src/dart/analysis/session_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/session_test.dart
@@ -175,7 +175,7 @@
expect(parsedLibrary.units, hasLength(1));
{
- var parsedUnit = parsedLibrary.units![0];
+ var parsedUnit = parsedLibrary.units[0];
expect(parsedUnit.session, session);
expect(parsedUnit.path, testPath);
expect(parsedUnit.uri, Uri.parse('package:test/test.dart'));
@@ -249,15 +249,15 @@
expect(parsedLibrary.units, hasLength(3));
expect(
- parsedLibrary.units![0].path,
+ parsedLibrary.units[0].path,
convertPath('/home/test/lib/test.dart'),
);
expect(
- parsedLibrary.units![1].path,
+ parsedLibrary.units[1].path,
convertPath('/home/test/lib/a.dart'),
);
expect(
- parsedLibrary.units![2].path,
+ parsedLibrary.units[2].path,
convertPath('/home/test/lib/c.dart'),
);
}
@@ -307,21 +307,21 @@
expect(parsedLibrary.units, hasLength(3));
{
- var aUnit = parsedLibrary.units![0];
+ var aUnit = parsedLibrary.units[0];
expect(aUnit.path, a);
expect(aUnit.uri, Uri.parse('package:test/a.dart'));
expect(aUnit.unit.declarations, hasLength(1));
}
{
- var bUnit = parsedLibrary.units![1];
+ var bUnit = parsedLibrary.units[1];
expect(bUnit.path, b);
expect(bUnit.uri, Uri.parse('package:test/b.dart'));
expect(bUnit.unit.declarations, hasLength(2));
}
{
- var cUnit = parsedLibrary.units![2];
+ var cUnit = parsedLibrary.units[2];
expect(cUnit.path, c);
expect(cUnit.uri, Uri.parse('package:test/c.dart'));
expect(cUnit.unit.declarations, hasLength(3));
@@ -393,13 +393,13 @@
var typeProvider = resolvedLibrary.typeProvider;
expect(typeProvider.intType.element.name, 'int');
- var libraryElement = resolvedLibrary.element!;
+ var libraryElement = resolvedLibrary.element;
var aClass = libraryElement.getType('A')!;
var bClass = libraryElement.getType('B')!;
- var aUnitResult = resolvedLibrary.units![0];
+ var aUnitResult = resolvedLibrary.units[0];
expect(aUnitResult.path, a);
expect(aUnitResult.uri, Uri.parse('package:test/a.dart'));
expect(aUnitResult.content, aContent);
@@ -408,7 +408,7 @@
expect(aUnitResult.unit!.declarations, hasLength(1));
expect(aUnitResult.errors, isEmpty);
- var bUnitResult = resolvedLibrary.units![1];
+ var bUnitResult = resolvedLibrary.units[1];
expect(bUnitResult.path, b);
expect(bUnitResult.uri, Uri.parse('package:test/b.dart'));
expect(bUnitResult.content, bContent);
@@ -449,7 +449,7 @@
''');
var resolvedLibrary = await session.getResolvedLibrary(testPath);
- var unitElement = resolvedLibrary.element!.definingCompilationUnit;
+ var unitElement = resolvedLibrary.element.definingCompilationUnit;
var fooElement = unitElement.topLevelVariables[0];
expect(fooElement.name, 'foo');
@@ -478,15 +478,15 @@
expect(resolvedLibrary.units, hasLength(3));
expect(
- resolvedLibrary.units![0].path,
+ resolvedLibrary.units[0].path,
convertPath('/home/test/lib/test.dart'),
);
expect(
- resolvedLibrary.units![1].path,
+ resolvedLibrary.units[1].path,
convertPath('/home/test/lib/a.dart'),
);
expect(
- resolvedLibrary.units![2].path,
+ resolvedLibrary.units[2].path,
convertPath('/home/test/lib/c.dart'),
);
}
@@ -509,7 +509,7 @@
expect(resolvedLibrary.path, testPath);
expect(resolvedLibrary.uri, Uri.parse('package:test/test.dart'));
expect(resolvedLibrary.units, hasLength(1));
- expect(resolvedLibrary.units![0].unit!.declaredElement, isNotNull);
+ expect(resolvedLibrary.units[0].unit!.declaredElement, isNotNull);
}
test_getResolvedLibraryByElement_differentSession() async {
diff --git a/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart b/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
index aa6dfb3..54c65b5 100644
--- a/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
+++ b/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
@@ -700,7 +700,7 @@
var result = fileResolver.resolveLibrary(path: aPath);
expect(result.path, aPath);
- expect(result.units?.length, 2);
+ expect(result.units.length, 2);
}
test_reuse_compatibleOptions() async {
diff --git a/pkg/analyzer/test/verify_diagnostics_test.dart b/pkg/analyzer/test/verify_diagnostics_test.dart
index f99f600..8fdbc40 100644
--- a/pkg/analyzer/test/verify_diagnostics_test.dart
+++ b/pkg/analyzer/test/verify_diagnostics_test.dart
@@ -285,7 +285,7 @@
/// Extract documentation from the file that was parsed to produce the given
/// [result].
Future<void> _validateFile(ParsedUnitResult result) async {
- filePath = result.path!;
+ filePath = result.path;
hasWrittenFilePath = false;
CompilationUnit unit = result.unit;
for (CompilationUnitMember declaration in unit.declarations) {
diff --git a/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart b/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
index 443c711..dc60a78 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
@@ -1281,7 +1281,7 @@
/// the given [resolvedUnit] and [timeStamp].
DartFileEditBuilderImpl(ChangeBuilderImpl changeBuilder, this.resolvedUnit,
int timeStamp, this.libraryChangeBuilder)
- : super(changeBuilder, resolvedUnit.path!, timeStamp);
+ : super(changeBuilder, resolvedUnit.path, timeStamp);
@override
bool get hasEdits =>
diff --git a/pkg/analyzer_plugin/lib/src/utilities/folding/folding.dart b/pkg/analyzer_plugin/lib/src/utilities/folding/folding.dart
index a302a76..d424abf 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/folding/folding.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/folding/folding.dart
@@ -21,7 +21,7 @@
DartFoldingRequestImpl(this.resourceProvider, this.result);
@override
- String get path => result.path!;
+ String get path => result.path;
}
/// A concrete implementation of [FoldingCollector].
diff --git a/pkg/analyzer_plugin/lib/src/utilities/highlights/highlights.dart b/pkg/analyzer_plugin/lib/src/utilities/highlights/highlights.dart
index 5e55b48..95bd889 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/highlights/highlights.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/highlights/highlights.dart
@@ -21,7 +21,7 @@
DartHighlightsRequestImpl(this.resourceProvider, this.result);
@override
- String get path => result.path!;
+ String get path => result.path;
}
/// A concrete implementation of [HighlightsCollector].
diff --git a/pkg/analyzer_plugin/lib/src/utilities/kythe/entries.dart b/pkg/analyzer_plugin/lib/src/utilities/kythe/entries.dart
index 191101c..684e9e7 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/kythe/entries.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/kythe/entries.dart
@@ -19,7 +19,7 @@
DartEntryRequestImpl(this.resourceProvider, this.result);
@override
- String get path => result.path!;
+ String get path => result.path;
}
/// A concrete implementation of [EntryCollector].
diff --git a/pkg/analyzer_plugin/lib/src/utilities/navigation/navigation.dart b/pkg/analyzer_plugin/lib/src/utilities/navigation/navigation.dart
index 4e1850c..23709a3 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/navigation/navigation.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/navigation/navigation.dart
@@ -28,7 +28,7 @@
this.resourceProvider, this.offset, this.length, this.result);
@override
- String get path => result.path!;
+ String get path => result.path;
}
/// A concrete implementation of [NavigationCollector].
diff --git a/pkg/analyzer_plugin/lib/src/utilities/occurrences/occurrences.dart b/pkg/analyzer_plugin/lib/src/utilities/occurrences/occurrences.dart
index 6bd0592..f436774 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/occurrences/occurrences.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/occurrences/occurrences.dart
@@ -20,7 +20,7 @@
DartOccurrencesRequestImpl(this.resourceProvider, this.result);
@override
- String get path => result.path!;
+ String get path => result.path;
}
/// A concrete implementation of [OccurrencesCollector].
diff --git a/pkg/analyzer_plugin/lib/src/utilities/outline/outline.dart b/pkg/analyzer_plugin/lib/src/utilities/outline/outline.dart
index 44d4dd9..284f140 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/outline/outline.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/outline/outline.dart
@@ -20,7 +20,7 @@
DartOutlineRequestImpl(this.resourceProvider, this.result);
@override
- String get path => result.path!;
+ String get path => result.path;
}
/// A concrete implementation of [OutlineCollector].
diff --git a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
index bd6b554..495ae0c 100644
--- a/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/constant_evaluator.dart
@@ -1036,15 +1036,22 @@
return result;
}
- /// Execute the statement using the [StatementConstantEvaluator].
- Constant execute(Statement statement) {
+ /// Execute a function body using the [StatementConstantEvaluator].
+ Constant executeBody(Statement statement) {
StatementConstantEvaluator statementEvaluator =
new StatementConstantEvaluator(this);
ExecutionStatus status = statement.accept(statementEvaluator);
if (status is ReturnStatus) {
+ if (status.value == null) {
+ // Void return type from executing the function body.
+ return new NullConstant();
+ }
return status.value;
} else if (status is AbortStatus) {
return status.error;
+ } else if (status is ProceedStatus) {
+ // No return statement in function body with void return type.
+ return new NullConstant();
}
return createInvalidExpressionConstant(statement,
'No valid constant returned from the execution of $statement.');
@@ -2870,7 +2877,7 @@
if (value is AbortConstant) return value;
env.addVariableValue(parameter, value);
}
- return execute(function.body);
+ return executeBody(function.body);
}
if (functionEnvironment != null) {
diff --git a/pkg/front_end/lib/src/fasta/scope.dart b/pkg/front_end/lib/src/fasta/scope.dart
index 62852fb..68baf39 100644
--- a/pkg/front_end/lib/src/fasta/scope.dart
+++ b/pkg/front_end/lib/src/fasta/scope.dart
@@ -343,7 +343,9 @@
void recordUse(String name, int charOffset, Uri fileUri) {
if (isModifiable) {
usedNames ??= <String, int>{};
- usedNames.putIfAbsent(name, () => charOffset);
+ // Don't use putIfAbsent to avoid the context allocation needed
+ // for the closure.
+ usedNames[name] ??= charOffset;
}
}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_return.dart b/pkg/front_end/testcases/const_functions/const_functions_return.dart
new file mode 100644
index 0000000..6a2eb8d
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_return.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests function invocation return types.
+
+import "package:expect/expect.dart";
+
+const var1 = fn();
+void fn() {}
+
+const var2 = fn2();
+void fn2() {
+ return;
+}
+
+const var3 = fn3();
+int? fn3() => null;
+
+const var4 = fn4();
+int? fn4() {
+ return null;
+}
+
+void main() {
+ Expect.equals((var1 as dynamic), null);
+ Expect.equals((var2 as dynamic), null);
+ Expect.equals(var3, null);
+ Expect.equals(var4, null);
+}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_return.dart.strong.expect b/pkg/front_end/testcases/const_functions/const_functions_return.dart.strong.expect
new file mode 100644
index 0000000..3253656
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_return.dart.strong.expect
@@ -0,0 +1,30 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+import "package:expect/expect.dart";
+
+static const field void var1 = #C1;
+static const field void var2 = #C1;
+static const field core::int? var3 = #C1;
+static const field core::int? var4 = #C1;
+static method fn() → void {}
+static method fn2() → void {
+ return;
+}
+static method fn3() → core::int?
+ return null;
+static method fn4() → core::int? {
+ return null;
+}
+static method main() → void {
+ exp::Expect::equals((#C1) as{ForNonNullableByDefault} dynamic, null);
+ exp::Expect::equals((#C1) as{ForNonNullableByDefault} dynamic, null);
+ exp::Expect::equals(#C1, null);
+ exp::Expect::equals(#C1, null);
+}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_return.dart.strong.transformed.expect b/pkg/front_end/testcases/const_functions/const_functions_return.dart.strong.transformed.expect
new file mode 100644
index 0000000..59de3d1
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_return.dart.strong.transformed.expect
@@ -0,0 +1,35 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+import "package:expect/expect.dart";
+
+static const field void var1 = #C1;
+static const field void var2 = #C1;
+static const field core::int? var3 = #C1;
+static const field core::int? var4 = #C1;
+static method fn() → void {}
+static method fn2() → void {
+ return;
+}
+static method fn3() → core::int?
+ return null;
+static method fn4() → core::int? {
+ return null;
+}
+static method main() → void {
+ exp::Expect::equals((#C1) as{ForNonNullableByDefault} dynamic, null);
+ exp::Expect::equals((#C1) as{ForNonNullableByDefault} dynamic, null);
+ exp::Expect::equals(#C1, null);
+ exp::Expect::equals(#C1, null);
+}
+
+constants {
+ #C1 = null
+}
+
+Extra constant evaluation status:
+Evaluated: AsExpression @ org-dartlang-testcase:///const_functions_return.dart:26:23 -> NullConstant(null)
+Evaluated: AsExpression @ org-dartlang-testcase:///const_functions_return.dart:27:23 -> NullConstant(null)
+Extra constant evaluation: evaluated: 6, effectively constant: 2
diff --git a/pkg/front_end/testcases/const_functions/const_functions_return.dart.textual_outline.expect b/pkg/front_end/testcases/const_functions/const_functions_return.dart.textual_outline.expect
new file mode 100644
index 0000000..cf82ba3
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_return.dart.textual_outline.expect
@@ -0,0 +1,11 @@
+import "package:expect/expect.dart";
+
+const var1 = fn();
+void fn() {}
+const var2 = fn2();
+void fn2() {}
+const var3 = fn3();
+int? fn3() => null;
+const var4 = fn4();
+int? fn4() {}
+void main() {}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_return.dart.textual_outline_modelled.expect b/pkg/front_end/testcases/const_functions/const_functions_return.dart.textual_outline_modelled.expect
new file mode 100644
index 0000000..06ba06e
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_return.dart.textual_outline_modelled.expect
@@ -0,0 +1,11 @@
+import "package:expect/expect.dart";
+
+const var1 = fn();
+const var2 = fn2();
+const var3 = fn3();
+const var4 = fn4();
+int? fn3() => null;
+int? fn4() {}
+void fn() {}
+void fn2() {}
+void main() {}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.expect b/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.expect
new file mode 100644
index 0000000..3253656
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.expect
@@ -0,0 +1,30 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+import "package:expect/expect.dart";
+
+static const field void var1 = #C1;
+static const field void var2 = #C1;
+static const field core::int? var3 = #C1;
+static const field core::int? var4 = #C1;
+static method fn() → void {}
+static method fn2() → void {
+ return;
+}
+static method fn3() → core::int?
+ return null;
+static method fn4() → core::int? {
+ return null;
+}
+static method main() → void {
+ exp::Expect::equals((#C1) as{ForNonNullableByDefault} dynamic, null);
+ exp::Expect::equals((#C1) as{ForNonNullableByDefault} dynamic, null);
+ exp::Expect::equals(#C1, null);
+ exp::Expect::equals(#C1, null);
+}
+
+constants {
+ #C1 = null
+}
diff --git a/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.outline.expect b/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.outline.expect
new file mode 100644
index 0000000..1587dfd
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.outline.expect
@@ -0,0 +1,20 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+
+import "package:expect/expect.dart";
+
+static const field void var1 = self::fn();
+static const field void var2 = self::fn2();
+static const field core::int? var3 = self::fn3();
+static const field core::int? var4 = self::fn4();
+static method fn() → void
+ ;
+static method fn2() → void
+ ;
+static method fn3() → core::int?
+ ;
+static method fn4() → core::int?
+ ;
+static method main() → void
+ ;
diff --git a/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.transformed.expect b/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.transformed.expect
new file mode 100644
index 0000000..59de3d1
--- /dev/null
+++ b/pkg/front_end/testcases/const_functions/const_functions_return.dart.weak.transformed.expect
@@ -0,0 +1,35 @@
+library /*isNonNullableByDefault*/;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+import "package:expect/expect.dart";
+
+static const field void var1 = #C1;
+static const field void var2 = #C1;
+static const field core::int? var3 = #C1;
+static const field core::int? var4 = #C1;
+static method fn() → void {}
+static method fn2() → void {
+ return;
+}
+static method fn3() → core::int?
+ return null;
+static method fn4() → core::int? {
+ return null;
+}
+static method main() → void {
+ exp::Expect::equals((#C1) as{ForNonNullableByDefault} dynamic, null);
+ exp::Expect::equals((#C1) as{ForNonNullableByDefault} dynamic, null);
+ exp::Expect::equals(#C1, null);
+ exp::Expect::equals(#C1, null);
+}
+
+constants {
+ #C1 = null
+}
+
+Extra constant evaluation status:
+Evaluated: AsExpression @ org-dartlang-testcase:///const_functions_return.dart:26:23 -> NullConstant(null)
+Evaluated: AsExpression @ org-dartlang-testcase:///const_functions_return.dart:27:23 -> NullConstant(null)
+Extra constant evaluation: evaluated: 6, effectively constant: 2
diff --git a/pkg/vm/lib/transformations/pragma.dart b/pkg/vm/lib/transformations/pragma.dart
index d27f3d8..cde363a 100644
--- a/pkg/vm/lib/transformations/pragma.dart
+++ b/pkg/vm/lib/transformations/pragma.dart
@@ -13,6 +13,7 @@
const kResultTypeUsesPassedTypeArguments =
"result-type-uses-passed-type-arguments";
const kRecognizedPragmaName = "vm:recognized";
+const kDisableUnboxedParametetersPragmaName = "vm:disable-unboxed-parameters";
abstract class ParsedPragma {}
@@ -46,6 +47,10 @@
ParsedRecognized(this.type);
}
+class ParsedDisableUnboxedParameters extends ParsedPragma {
+ ParsedDisableUnboxedParameters();
+}
+
abstract class PragmaAnnotationParser {
/// May return 'null' if the annotation does not represent a recognized
/// @pragma.
@@ -142,6 +147,8 @@
"pragma: $options";
}
return new ParsedRecognized(type);
+ case kDisableUnboxedParametetersPragmaName:
+ return new ParsedDisableUnboxedParameters();
default:
return null;
}
diff --git a/pkg/vm/lib/transformations/type_flow/native_code.dart b/pkg/vm/lib/transformations/type_flow/native_code.dart
index 7375c51..e24408b 100644
--- a/pkg/vm/lib/transformations/type_flow/native_code.dart
+++ b/pkg/vm/lib/transformations/type_flow/native_code.dart
@@ -233,6 +233,19 @@
(expectedTypes == null || expectedTypes.contains(type));
}
+ bool hasDisableUnboxedParameters(Member member) {
+ for (var annotation in member.annotations) {
+ ParsedPragma pragma = _matcher.parsePragma(annotation);
+ if (pragma is ParsedDisableUnboxedParameters) {
+ if (member.enclosingLibrary.importUri.scheme != "dart") {
+ throw "ERROR: Cannot use @pragma(vm:disable-unboxed-parameters) outside core libraries.";
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
/// Simulate the execution of a native method by adding its entry points
/// using [entryPointsListener]. Returns result type of the native method.
TypeExpr handleNativeProcedure(
diff --git a/pkg/vm/lib/transformations/type_flow/unboxing_info.dart b/pkg/vm/lib/transformations/type_flow/unboxing_info.dart
index 792dc99..03f7ef2 100644
--- a/pkg/vm/lib/transformations/type_flow/unboxing_info.dart
+++ b/pkg/vm/lib/transformations/type_flow/unboxing_info.dart
@@ -203,7 +203,8 @@
_nativeCodeOracle.isRecognized(member, const [
PragmaRecognizedType.AsmIntrinsic,
PragmaRecognizedType.Other
- ]);
+ ]) ||
+ _nativeCodeOracle.hasDisableUnboxedParameters(member);
}
bool _isNative(Member member) => getExternalName(member) != null;
diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc
index ef05e6d..a0ee87a 100644
--- a/runtime/vm/compiler/backend/il_arm64.cc
+++ b/runtime/vm/compiler/backend/il_arm64.cc
@@ -5664,9 +5664,7 @@
// Handle modulo/division by zero exception on slow path.
if (slow_path->has_divide_by_zero()) {
__ CompareRegisters(right, ZR);
- __ b(compiler->intrinsic_mode() ? compiler->intrinsic_slow_path_label()
- : slow_path->entry_label(),
- EQ);
+ __ b(slow_path->entry_label(), EQ);
}
// Perform actual operation
@@ -5679,14 +5677,12 @@
// For the % operator, the sdiv instruction does not
// quite do what we want. Adjust for sign on slow path.
__ CompareRegisters(out, ZR);
- __ b(compiler->intrinsic_mode() ? compiler->intrinsic_slow_path_label()
- : slow_path->adjust_sign_label(),
- LT);
+ __ b(slow_path->adjust_sign_label(), LT);
} else {
__ sdiv(out, left, right);
}
- if (!compiler->intrinsic_mode() && slow_path->is_needed()) {
+ if (slow_path->is_needed()) {
__ Bind(slow_path->exit_label());
compiler->AddSlowPathCode(slow_path);
}
diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc
index 109b09e..9eaa60c 100644
--- a/runtime/vm/compiler/backend/il_x64.cc
+++ b/runtime/vm/compiler/backend/il_x64.cc
@@ -6117,18 +6117,14 @@
// Handle modulo/division by zero exception on slow path.
if (slow_path->has_divide_by_zero()) {
__ testq(right, right);
- __ j(EQUAL, compiler->intrinsic_mode()
- ? compiler->intrinsic_slow_path_label()
- : slow_path->entry_label());
+ __ j(EQUAL, slow_path->entry_label());
}
// Handle modulo/division by minus one explicitly on slow path
// (to avoid arithmetic exception on 0x8000000000000000 / -1).
if (slow_path->has_divide_by_minus_one()) {
__ cmpq(right, compiler::Immediate(-1));
- __ j(EQUAL, compiler->intrinsic_mode()
- ? compiler->intrinsic_slow_path_label()
- : slow_path->div_by_minus_one_label());
+ __ j(EQUAL, slow_path->div_by_minus_one_label());
}
// Perform actual operation
@@ -6167,15 +6163,13 @@
// For the % operator, again the idiv instruction does
// not quite do what we want. Adjust for sign on slow path.
__ testq(out, out);
- __ j(LESS, compiler->intrinsic_mode()
- ? compiler->intrinsic_slow_path_label()
- : slow_path->adjust_sign_label());
+ __ j(LESS, slow_path->adjust_sign_label());
} else {
ASSERT(out == RAX);
ASSERT(tmp == RDX);
}
- if (!compiler->intrinsic_mode() && slow_path->is_needed()) {
+ if (slow_path->is_needed()) {
__ Bind(slow_path->exit_label());
compiler->AddSlowPathCode(slow_path);
}
diff --git a/runtime/vm/compiler/graph_intrinsifier.cc b/runtime/vm/compiler/graph_intrinsifier.cc
index cfc5023..d0ca36b 100644
--- a/runtime/vm/compiler/graph_intrinsifier.cc
+++ b/runtime/vm/compiler/graph_intrinsifier.cc
@@ -201,19 +201,6 @@
}
}
-static Definition* CreateUnboxedParameterIfNeeded(BlockBuilder* builder,
- Definition* value,
- Representation representation,
- intptr_t arg_index) {
- const auto& function = builder->function();
- if (!function.is_unboxed_parameter_at(arg_index)) {
- return builder->AddUnboxInstr(representation, new Value(value),
- /* is_checked = */ false);
- } else {
- return value;
- }
-}
-
static Definition* CreateBoxedResultIfNeeded(BlockBuilder* builder,
Definition* value,
Representation representation) {
@@ -933,129 +920,96 @@
return true;
}
-static bool BuildUnaryIntegerOp(FlowGraph* flow_graph, Token::Kind op_kind) {
+static bool BuildUnarySmiOp(FlowGraph* flow_graph, Token::Kind op_kind) {
+ ASSERT(!flow_graph->function().has_unboxed_return());
+ ASSERT(!flow_graph->function().is_unboxed_parameter_at(0));
GraphEntryInstr* graph_entry = flow_graph->graph_entry();
auto normal_entry = graph_entry->normal_entry();
BlockBuilder builder(flow_graph, normal_entry);
Definition* left = builder.AddParameter(0, /*with_frame=*/false);
- Definition* result;
- if (flow_graph->function().HasUnboxedParameters() ||
- flow_graph->function().HasUnboxedReturnValue()) {
- left = CreateUnboxedParameterIfNeeded(&builder, left, kUnboxedInt64, 0);
- result = builder.AddDefinition(
- new UnaryInt64OpInstr(op_kind, new Value(left), DeoptId::kNone));
- result = CreateBoxedResultIfNeeded(&builder, result, kUnboxedInt64);
- } else {
- builder.AddInstruction(
- new CheckSmiInstr(new Value(left), DeoptId::kNone, builder.Source()));
- result = builder.AddDefinition(
- new UnarySmiOpInstr(op_kind, new Value(left), DeoptId::kNone));
- }
+ builder.AddInstruction(
+ new CheckSmiInstr(new Value(left), DeoptId::kNone, builder.Source()));
+ Definition* result = builder.AddDefinition(
+ new UnarySmiOpInstr(op_kind, new Value(left), DeoptId::kNone));
builder.AddReturn(new Value(result));
return true;
}
bool GraphIntrinsifier::Build_Smi_bitNegate(FlowGraph* flow_graph) {
- return BuildUnaryIntegerOp(flow_graph, Token::kBIT_NOT);
+ return BuildUnarySmiOp(flow_graph, Token::kBIT_NOT);
}
bool GraphIntrinsifier::Build_Integer_negate(FlowGraph* flow_graph) {
- return BuildUnaryIntegerOp(flow_graph, Token::kNEGATE);
+ return BuildUnarySmiOp(flow_graph, Token::kNEGATE);
}
-static bool BuildBinaryIntegerOp(FlowGraph* flow_graph,
- Token::Kind op_kind,
- bool force_boxed = false) {
+static bool BuildBinarySmiOp(FlowGraph* flow_graph, Token::Kind op_kind) {
+ ASSERT(!flow_graph->function().has_unboxed_return());
+ ASSERT(!flow_graph->function().is_unboxed_parameter_at(0));
+ ASSERT(!flow_graph->function().is_unboxed_parameter_at(1));
GraphEntryInstr* graph_entry = flow_graph->graph_entry();
auto normal_entry = graph_entry->normal_entry();
BlockBuilder builder(flow_graph, normal_entry);
Definition* left = builder.AddParameter(0, /*with_frame=*/false);
Definition* right = builder.AddParameter(1, /*with_frame=*/false);
- Definition* result;
- if (!force_boxed && (flow_graph->function().HasUnboxedParameters() ||
- flow_graph->function().HasUnboxedReturnValue())) {
- left = CreateUnboxedParameterIfNeeded(&builder, left, kUnboxedInt64, 0);
- right = CreateUnboxedParameterIfNeeded(&builder, right, kUnboxedInt64, 1);
- switch (op_kind) {
- case Token::kSHL:
- case Token::kSHR:
- case Token::kUSHR:
- result = builder.AddDefinition(new ShiftInt64OpInstr(
- op_kind, new Value(left), new Value(right), DeoptId::kNone));
- break;
- default:
- result = builder.AddDefinition(new BinaryInt64OpInstr(
- op_kind, new Value(left), new Value(right), DeoptId::kNone));
- break;
- }
- result = CreateBoxedResultIfNeeded(&builder, result, kUnboxedInt64);
- } else {
- left = CreateBoxedParameterIfNeeded(&builder, left, kUnboxedInt64, 0);
- right = CreateBoxedParameterIfNeeded(&builder, right, kUnboxedInt64, 1);
- builder.AddInstruction(
- new CheckSmiInstr(new Value(left), DeoptId::kNone, builder.Source()));
- builder.AddInstruction(
- new CheckSmiInstr(new Value(right), DeoptId::kNone, builder.Source()));
- result = builder.AddDefinition(new BinarySmiOpInstr(
- op_kind, new Value(left), new Value(right), DeoptId::kNone));
- result = CreateUnboxedResultIfNeeded(&builder, result);
- }
+ builder.AddInstruction(
+ new CheckSmiInstr(new Value(left), DeoptId::kNone, builder.Source()));
+ builder.AddInstruction(
+ new CheckSmiInstr(new Value(right), DeoptId::kNone, builder.Source()));
+ Definition* result = builder.AddDefinition(new BinarySmiOpInstr(
+ op_kind, new Value(left), new Value(right), DeoptId::kNone));
builder.AddReturn(new Value(result));
return true;
}
bool GraphIntrinsifier::Build_Integer_add(FlowGraph* flow_graph) {
- return BuildBinaryIntegerOp(flow_graph, Token::kADD);
+ return BuildBinarySmiOp(flow_graph, Token::kADD);
}
bool GraphIntrinsifier::Build_Integer_sub(FlowGraph* flow_graph) {
- return BuildBinaryIntegerOp(flow_graph, Token::kSUB);
+ return BuildBinarySmiOp(flow_graph, Token::kSUB);
}
bool GraphIntrinsifier::Build_Integer_mul(FlowGraph* flow_graph) {
- return BuildBinaryIntegerOp(flow_graph, Token::kMUL);
+ return BuildBinarySmiOp(flow_graph, Token::kMUL);
}
bool GraphIntrinsifier::Build_Integer_mod(FlowGraph* flow_graph) {
- bool force_boxed = false;
#if defined(TARGET_ARCH_ARM)
if (!TargetCPUFeatures::can_divide()) {
return false;
}
- force_boxed = true; // BinaryInt64Op(kMOD) not implemented
#endif
- return BuildBinaryIntegerOp(flow_graph, Token::kMOD, force_boxed);
+ return BuildBinarySmiOp(flow_graph, Token::kMOD);
}
bool GraphIntrinsifier::Build_Integer_truncDivide(FlowGraph* flow_graph) {
- bool force_boxed = false;
#if defined(TARGET_ARCH_ARM)
if (!TargetCPUFeatures::can_divide()) {
return false;
}
- force_boxed = true; // BinaryInt64Op(kTRUNCDIV) not implemented
#endif
- return BuildBinaryIntegerOp(flow_graph, Token::kTRUNCDIV, force_boxed);
+ return BuildBinarySmiOp(flow_graph, Token::kTRUNCDIV);
}
bool GraphIntrinsifier::Build_Integer_bitAnd(FlowGraph* flow_graph) {
- return BuildBinaryIntegerOp(flow_graph, Token::kBIT_AND);
+ return BuildBinarySmiOp(flow_graph, Token::kBIT_AND);
}
bool GraphIntrinsifier::Build_Integer_bitOr(FlowGraph* flow_graph) {
- return BuildBinaryIntegerOp(flow_graph, Token::kBIT_OR);
+ return BuildBinarySmiOp(flow_graph, Token::kBIT_OR);
}
bool GraphIntrinsifier::Build_Integer_bitXor(FlowGraph* flow_graph) {
- return BuildBinaryIntegerOp(flow_graph, Token::kBIT_XOR);
+ return BuildBinarySmiOp(flow_graph, Token::kBIT_XOR);
}
bool GraphIntrinsifier::Build_Integer_sar(FlowGraph* flow_graph) {
- return BuildBinaryIntegerOp(flow_graph, Token::kSHR);
+ return BuildBinarySmiOp(flow_graph, Token::kSHR);
}
bool GraphIntrinsifier::Build_Integer_shr(FlowGraph* flow_graph) {
- return BuildBinaryIntegerOp(flow_graph, Token::kUSHR);
+ return BuildBinarySmiOp(flow_graph, Token::kUSHR);
}
static Definition* ConvertOrUnboxDoubleParameter(BlockBuilder* builder,
diff --git a/runtime/vm/compiler/recognized_methods_list.h b/runtime/vm/compiler/recognized_methods_list.h
index 02acfb7..80308087 100644
--- a/runtime/vm/compiler/recognized_methods_list.h
+++ b/runtime/vm/compiler/recognized_methods_list.h
@@ -264,7 +264,7 @@
V(_IntegerImplementation, <, Integer_lessThan, 0x39643178) \
V(_IntegerImplementation, <=, Integer_lessEqualThan, 0x73d2a9f5) \
V(_IntegerImplementation, >=, Integer_greaterEqualThan, 0xbc280c13) \
- V(_IntegerImplementation, <<, Integer_shl, 0x766f00e5) \
+ V(_IntegerImplementation, <<, Integer_shl, 0x766f04a6) \
V(_Double, toInt, DoubleToInteger, 0x676f1ce8) \
#define MATH_LIB_INTRINSIC_LIST(V) \
@@ -352,18 +352,18 @@
0x17f90910) \
V(_ExternalTwoByteString, codeUnitAt, ExternalTwoByteStringCodeUnitAt, \
0x17f90910) \
- V(_Smi, ~, Smi_bitNegate, 0x8254f51b) \
- V(_IntegerImplementation, +, Integer_add, 0xd561008f) \
- V(_IntegerImplementation, -, Integer_sub, 0xc96a0f80) \
- V(_IntegerImplementation, *, Integer_mul, 0xacd9641d) \
- V(_IntegerImplementation, %, Integer_mod, 0xfcf7cc13) \
- V(_IntegerImplementation, ~/, Integer_truncDivide, 0xdda49e7f) \
- V(_IntegerImplementation, unary-, Integer_negate, 0xf7a9a696) \
- V(_IntegerImplementation, &, Integer_bitAnd, 0x8b9d7c33) \
- V(_IntegerImplementation, |, Integer_bitOr, 0x8f47f5eb) \
- V(_IntegerImplementation, ^, Integer_bitXor, 0xd838bef2) \
- V(_IntegerImplementation, >>, Integer_sar, 0x931fbb8a) \
- V(_IntegerImplementation, >>>, Integer_shr, 0x7495f7ec) \
+ V(_Smi, ~, Smi_bitNegate, 0x8254f8dc) \
+ V(_IntegerImplementation, +, Integer_add, 0xd5610450) \
+ V(_IntegerImplementation, -, Integer_sub, 0xc96a1341) \
+ V(_IntegerImplementation, *, Integer_mul, 0xacd967de) \
+ V(_IntegerImplementation, %, Integer_mod, 0xfcf7cfd4) \
+ V(_IntegerImplementation, ~/, Integer_truncDivide, 0xdda4a240) \
+ V(_IntegerImplementation, unary-, Integer_negate, 0xf7a9aa57) \
+ V(_IntegerImplementation, &, Integer_bitAnd, 0x8b9d7ff4) \
+ V(_IntegerImplementation, |, Integer_bitOr, 0x8f47f9ac) \
+ V(_IntegerImplementation, ^, Integer_bitXor, 0xd838c2b3) \
+ V(_IntegerImplementation, >>, Integer_sar, 0x931fbf4b) \
+ V(_IntegerImplementation, >>>, Integer_shr, 0x7495fbad) \
V(_Double, unary-, DoubleFlipSignBit, 0x3d39082b) \
V(_Double, truncateToDouble, DoubleTruncate, 0x62d48298) \
V(_Double, roundToDouble, DoubleRound, 0x5649c63f) \
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart
index d0e0ba2..041dfd5 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/io_patch.dart
@@ -220,14 +220,6 @@
}
@patch
-class OSError {
- @patch
- static int inProgressErrorCode() {
- throw new UnsupportedError("OSError.inProgressErrorCode");
- }
-}
-
-@patch
class _IOCrypto {
@patch
static Uint8List getRandomBytes(int count) {
diff --git a/sdk/lib/_internal/js_runtime/lib/io_patch.dart b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
index fb7052f..77a2530 100644
--- a/sdk/lib/_internal/js_runtime/lib/io_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
@@ -228,14 +228,6 @@
}
@patch
-class OSError {
- @patch
- static int inProgressErrorCode() {
- throw new UnsupportedError("OSError.inProgressErrorCode");
- }
-}
-
-@patch
class _Platform {
@patch
static int _numberOfProcessors() {
diff --git a/sdk/lib/_internal/vm/bin/socket_patch.dart b/sdk/lib/_internal/vm/bin/socket_patch.dart
index a20a0bb..6c3a77a 100644
--- a/sdk/lib/_internal/vm/bin/socket_patch.dart
+++ b/sdk/lib/_internal/vm/bin/socket_patch.dart
@@ -374,6 +374,9 @@
// implicit constructor.
class _NativeSocketNativeWrapper extends NativeFieldWrapperClass1 {}
+/// Returns error code that corresponds to EINPROGRESS OS error.
+int get _inProgressErrorCode native "OSError_inProgressErrorCode";
+
// The _NativeSocket class encapsulates an OS socket.
class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
// Bit flags used when communicating between the eventhandler and
@@ -802,7 +805,7 @@
try {
socket.port;
} catch (e) {
- if (e is OSError && e.errorCode == OSError.inProgressErrorCode()) {
+ if (e is OSError && e.errorCode == _inProgressErrorCode) {
// Ignore the error, proceed with waiting for a socket to become open.
// In non-blocking mode connect might not be established away, socket
// have to be waited for.
diff --git a/sdk/lib/_internal/vm/lib/integers.dart b/sdk/lib/_internal/vm/lib/integers.dart
index 8ca2964..95e3826 100644
--- a/sdk/lib/_internal/vm/lib/integers.dart
+++ b/sdk/lib/_internal/vm/lib/integers.dart
@@ -8,19 +8,23 @@
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
num operator +(num other) => other._addFromInteger(this);
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
num operator -(num other) => other._subFromInteger(this);
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
num operator *(num other) => other._mulFromInteger(this);
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
int operator ~/(num other) {
if ((other is int) && (other == 0)) {
throw const IntegerDivisionByZeroException();
@@ -35,6 +39,7 @@
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
num operator %(num other) {
if ((other is int) && (other == 0)) {
throw const IntegerDivisionByZeroException();
@@ -45,6 +50,7 @@
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
int operator -() {
// Issue(https://dartbug.com/39639): The analyzer incorrectly reports the
// result type as `num`.
@@ -54,14 +60,17 @@
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
int operator &(int other) => other._bitAndFromInteger(this);
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
int operator |(int other) => other._bitOrFromInteger(this);
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
int operator ^(int other) => other._bitXorFromInteger(this);
num remainder(num other) {
@@ -99,14 +108,17 @@
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
int operator >>(int other) => other._shrFromInteger(this);
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
int operator >>>(int other) => other._ushrFromInteger(this);
@pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:non-nullable-result-type")
@pragma("vm:never-inline")
+ @pragma("vm:disable-unboxed-parameters")
int operator <<(int other) => other._shlFromInteger(this);
@pragma("vm:recognized", "asm-intrinsic")
@@ -544,6 +556,7 @@
int get _identityHashCode => this;
@pragma("vm:recognized", "graph-intrinsic")
@pragma("vm:exact-result-type", "dart:core#_Smi")
+ @pragma("vm:disable-unboxed-parameters")
int operator ~() native "Smi_bitNegate";
@pragma("vm:recognized", "asm-intrinsic")
@pragma("vm:exact-result-type", "dart:core#_Smi")
diff --git a/sdk/lib/io/common.dart b/sdk/lib/io/common.dart
index a2d4d73..252d602 100644
--- a/sdk/lib/io/common.dart
+++ b/sdk/lib/io/common.dart
@@ -48,9 +48,6 @@
/// Constant used to indicate that no OS error code is available.
static const int noErrorCode = -1;
- /// Returns error code that corresponds to EINPROGRESS OS error.
- external static int inProgressErrorCode();
-
/// Error message supplied by the operating system. This will be empty if no
/// message is associated with the error.
final String message;
diff --git a/tests/co19/update.sh b/tests/co19/update.sh
index d06c153..85e8019 100755
--- a/tests/co19/update.sh
+++ b/tests/co19/update.sh
@@ -50,8 +50,8 @@
"$(printf "[co19] Roll co19 to $NEW\n\n" \
&& cd $CO19 \
&& git log --date='format:%Y-%m-%d' --pretty='format:%ad %ae %s' $OLD..$NEW \
- && printf "\nCq-Include-Trybots: dart/try:$BUILDERS\n" \
- | tr -d '#')"
+ | tr -d '#' \
+ && printf "\nCq-Include-Trybots: dart/try:$BUILDERS\n")"
rm -rf tests/co19/src.git
diff --git a/tests/language/const_functions/const_functions_return_test.dart b/tests/language/const_functions/const_functions_return_test.dart
new file mode 100644
index 0000000..793c629
--- /dev/null
+++ b/tests/language/const_functions/const_functions_return_test.dart
@@ -0,0 +1,40 @@
+// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Tests function invocation return types.
+
+// SharedOptions=--enable-experiment=const-functions
+
+import "package:expect/expect.dart";
+
+const var1 = fn();
+// ^^^^
+// [analyzer] COMPILE_TIME_ERROR.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+void fn() {}
+
+const var2 = fn2();
+// ^^^^^
+// [analyzer] COMPILE_TIME_ERROR.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+void fn2() {
+ return;
+}
+
+const var3 = fn3();
+// ^^^^^
+// [analyzer] COMPILE_TIME_ERROR.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+int? fn3() => null;
+
+const var4 = fn4();
+// ^^^^^
+// [analyzer] COMPILE_TIME_ERROR.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+int? fn4() {
+ return null;
+}
+
+void main() {
+ Expect.equals((var1 as dynamic), null);
+ Expect.equals((var2 as dynamic), null);
+ Expect.equals(var3, null);
+ Expect.equals(var4, null);
+}
diff --git a/tools/VERSION b/tools/VERSION
index b12f608..3999231 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 0
+PRERELEASE 1
PRERELEASE_PATCH 0
\ No newline at end of file