CQ. Enable avoid_redundant_argument_values in analyzer/
Change-Id: I8e5f5f6629249d1fdfddcfe87d20680b37198765
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353804
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
diff --git a/pkg/analyzer/analysis_options.yaml b/pkg/analyzer/analysis_options.yaml
index 6ad5dea..08181aa 100644
--- a/pkg/analyzer/analysis_options.yaml
+++ b/pkg/analyzer/analysis_options.yaml
@@ -39,6 +39,7 @@
rules:
- always_use_package_imports
- avoid_dynamic_calls
+ - avoid_redundant_argument_values
- avoid_unused_constructor_parameters
- enable_null_safety
- flutter_style_todos
diff --git a/pkg/analyzer/lib/error/listener.dart b/pkg/analyzer/lib/error/listener.dart
index 6613bca..a72480c 100644
--- a/pkg/analyzer/lib/error/listener.dart
+++ b/pkg/analyzer/lib/error/listener.dart
@@ -185,8 +185,6 @@
length: constructor.name!.end - offset,
errorCode: code,
arguments: arguments,
- contextMessages: null,
- data: null,
);
} else {
atNode(
@@ -246,8 +244,6 @@
length: span.length,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
}
@@ -287,8 +283,6 @@
length: node.length,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
}
diff --git a/pkg/analyzer/lib/file_system/physical_file_system.dart b/pkg/analyzer/lib/file_system/physical_file_system.dart
index 423ea93..7e6d50c 100644
--- a/pkg/analyzer/lib/file_system/physical_file_system.dart
+++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
@@ -283,7 +283,7 @@
try {
List<Resource> children = <Resource>[];
io.Directory directory = _entry as io.Directory;
- List<io.FileSystemEntity> entries = directory.listSync(recursive: false);
+ List<io.FileSystemEntity> entries = directory.listSync();
int numEntries = entries.length;
for (int i = 0; i < numEntries; i++) {
io.FileSystemEntity entity = entries[i];
diff --git a/pkg/analyzer/lib/src/dart/analysis/index.dart b/pkg/analyzer/lib/src/dart/analysis/index.dart
index ea31b7f..ec173e2 100644
--- a/pkg/analyzer/lib/src/dart/analysis/index.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/index.dart
@@ -1160,7 +1160,7 @@
assembler.addPrefixForElement(element, prefix: prefixElement);
}
} else {
- assembler.addPrefixForElement(element, prefix: null);
+ assembler.addPrefixForElement(element);
}
recordRelationToken(
diff --git a/pkg/analyzer/lib/src/dart/ast/extensions.dart b/pkg/analyzer/lib/src/dart/ast/extensions.dart
index 4faa717..f1f636f 100644
--- a/pkg/analyzer/lib/src/dart/ast/extensions.dart
+++ b/pkg/analyzer/lib/src/dart/ast/extensions.dart
@@ -218,7 +218,7 @@
extension IdentifierImplExtension on IdentifierImpl {
NamedTypeImpl toNamedType({
required TypeArgumentListImpl? typeArguments,
- Token? question,
+ required Token? question,
}) {
final self = this;
if (self is PrefixedIdentifierImpl) {
diff --git a/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart b/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
index cb8da4d..a3dd783 100644
--- a/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
+++ b/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart
@@ -282,7 +282,6 @@
errorCode: result.errorCode,
arguments: result.arguments,
contextMessages: result.contextMessages,
- data: null,
);
}
case DartObjectImpl():
diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
index 2958f19..5f33261 100644
--- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart
+++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
@@ -587,7 +587,6 @@
errorCode: result.errorCode,
arguments: result.arguments,
contextMessages: result.contextMessages,
- data: null,
);
}
return result;
@@ -1953,7 +1952,6 @@
errorCode: expressionValue.errorCode,
arguments: expressionValue.arguments,
contextMessages: expressionValue.contextMessages,
- data: null,
);
}
return ConstantEvaluationEngine._unresolvedObject(
diff --git a/pkg/analyzer/lib/src/dart/element/type.dart b/pkg/analyzer/lib/src/dart/element/type.dart
index ca34bd6..2402154 100644
--- a/pkg/analyzer/lib/src/dart/element/type.dart
+++ b/pkg/analyzer/lib/src/dart/element/type.dart
@@ -21,11 +21,11 @@
/// Returns a [List] of fixed length with given types.
List<DartType> fixedTypeList(DartType e1, [DartType? e2]) {
if (e2 != null) {
- final result = List<DartType>.filled(2, e1, growable: false);
+ final result = List<DartType>.filled(2, e1);
result[1] = e2;
return result;
} else {
- return List<DartType>.filled(1, e1, growable: false);
+ return List<DartType>.filled(1, e1);
}
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart
index 9133efa..69722c7 100644
--- a/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart
@@ -129,9 +129,6 @@
offset: offset,
length: end.end - offset,
errorCode: errorCode,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
index 9bf1ac3..d7455b7 100644
--- a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart
@@ -121,8 +121,6 @@
return "unnamed extension on '$type'";
}).commaSeparatedWithAnd,
],
- contextMessages: null,
- data: null,
);
return ResolutionResult.ambiguous;
},
diff --git a/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart
index 2feb377..f1dc2a3 100644
--- a/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart
@@ -137,8 +137,7 @@
CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS,
arguments: [node.name2.lexeme, parameterCount, argumentCount],
);
- return List.filled(parameterCount, InvalidTypeImpl.instance,
- growable: false);
+ return List.filled(parameterCount, InvalidTypeImpl.instance);
}
if (parameterCount == 0) {
@@ -361,8 +360,6 @@
length: nameToken.end - importPrefix.offset,
errorCode: CompileTimeErrorCode.NOT_A_TYPE,
arguments: ['${importPrefix.name.lexeme}.${nameToken.lexeme}'],
- contextMessages: null,
- data: null,
);
}
}
@@ -420,9 +417,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode
.INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER,
- arguments: null,
- contextMessages: null,
- data: null,
);
} else if (constructorUsage is ConstructorDeclaration &&
constructorUsage.redirectedConstructor == parent) {
@@ -431,9 +425,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode
.REDIRECT_TO_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER,
- arguments: null,
- contextMessages: null,
- data: null,
);
} else {
throw UnimplementedError('${constructorUsage.runtimeType}');
@@ -462,9 +453,6 @@
offset: errorRange.offset,
length: errorRange.length,
errorCode: errorCode,
- arguments: null,
- contextMessages: null,
- data: null,
);
hasErrorReported = true;
return InvalidTypeImpl.instance;
@@ -503,8 +491,6 @@
? CompileTimeErrorCode.CONST_WITH_NON_TYPE
: CompileTimeErrorCode.NEW_WITH_NON_TYPE,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
return true;
}
@@ -524,8 +510,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
return;
}
@@ -537,8 +521,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
return;
}
@@ -550,8 +532,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.CAST_TO_NON_TYPE,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
return;
}
@@ -564,8 +544,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.TYPE_TEST_WITH_NON_TYPE,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
} else {
errorReporter.atOffset(
@@ -573,8 +551,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
}
return;
@@ -587,8 +563,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.REDIRECT_TO_NON_CLASS,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
return;
}
@@ -600,8 +574,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
return;
}
@@ -639,8 +611,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.NOT_A_TYPE,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
return;
}
@@ -659,8 +629,6 @@
length: errorRange.length,
errorCode: CompileTimeErrorCode.UNDEFINED_CLASS,
arguments: [node.name2.lexeme],
- contextMessages: null,
- data: null,
);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart
index 2c39d6c..d43c685 100644
--- a/pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart
@@ -377,8 +377,6 @@
length: length,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
}
@@ -780,9 +778,7 @@
return PropertyElementResolverResult(
readElementRequested: readElement,
- readElementRecovery: null,
writeElementRequested: writeElement,
- writeElementRecovery: null,
getType: getType,
);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
index 5a64bd8..e7f3fad 100644
--- a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
@@ -1718,9 +1718,6 @@
offset: offset,
length: length,
errorCode: errorCode,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
index fa98571..fddde04 100644
--- a/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
@@ -193,9 +193,7 @@
if (receiverTypeResolved is FunctionType &&
_name == FunctionElement.CALL_METHOD_NAME) {
return ResolutionResult(
- getter: null,
needsGetterError: false,
- setter: null,
needsSetterError: false,
callFunctionType: receiverTypeResolved,
);
diff --git a/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
index 0f0c0dd..90cfc5d 100644
--- a/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
@@ -334,7 +334,8 @@
CollectionElement? element) {
if (element is Expression) {
return _InferredCollectionElementTypeInformation(
- elementType: element.typeOrThrow, keyType: null, valueType: null);
+ elementType: element.typeOrThrow,
+ );
} else if (element is ForElement) {
return _inferCollectionElementType(element.body);
} else if (element is IfElement) {
@@ -349,9 +350,9 @@
_typeSystem, thenType, elseType);
} else if (element is MapLiteralEntry) {
return _InferredCollectionElementTypeInformation(
- elementType: null,
- keyType: element.key.staticType,
- valueType: element.value.staticType);
+ keyType: element.key.staticType,
+ valueType: element.value.staticType,
+ );
} else if (element is SpreadElement) {
var expressionType = element.expression.typeOrThrow;
@@ -361,8 +362,6 @@
if (iterableType != null) {
return _InferredCollectionElementTypeInformation(
elementType: iterableType.typeArguments[0],
- keyType: null,
- valueType: null,
);
}
@@ -371,7 +370,6 @@
);
if (mapType != null) {
return _InferredCollectionElementTypeInformation(
- elementType: null,
keyType: mapType.typeArguments[0],
valueType: mapType.typeArguments[1],
);
@@ -403,11 +401,7 @@
}
}
- return _InferredCollectionElementTypeInformation(
- elementType: null,
- keyType: null,
- valueType: null,
- );
+ return _InferredCollectionElementTypeInformation();
} else {
throw StateError('Unknown element type ${element.runtimeType}');
}
diff --git a/pkg/analyzer/lib/src/error/best_practices_verifier.dart b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
index 0e107ef..76c3032 100644
--- a/pkg/analyzer/lib/src/error/best_practices_verifier.dart
+++ b/pkg/analyzer/lib/src/error/best_practices_verifier.dart
@@ -1087,9 +1087,6 @@
offset: offset,
length: endEntity.end - offset,
errorCode: errorCode,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
@@ -1119,9 +1116,6 @@
offset: offset,
length: endEntity.end - offset,
errorCode: errorCode,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
@@ -1758,8 +1752,6 @@
length: errorEntity.length,
errorCode: WarningCode.INVALID_USE_OF_INTERNAL_MEMBER,
arguments: [element.displayName],
- contextMessages: null,
- data: null,
);
}
@@ -1807,8 +1799,6 @@
length: node.length,
errorCode: WarningCode.INVALID_USE_OF_INTERNAL_MEMBER,
arguments: [name],
- contextMessages: null,
- data: null,
);
}
}
@@ -1879,8 +1869,6 @@
length: errorEntity.length,
errorCode: WarningCode.INVALID_USE_OF_PROTECTED_MEMBER,
arguments: [name, definingClass.source!.uri],
- contextMessages: null,
- data: null,
);
}
if (isVisibleForTemplateApplied) {
@@ -1889,8 +1877,6 @@
length: errorEntity.length,
errorCode: WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER,
arguments: [name, definingClass.source!.uri],
- contextMessages: null,
- data: null,
);
}
@@ -1900,8 +1886,6 @@
length: errorEntity.length,
errorCode: WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER,
arguments: [name, definingClass.source!.uri],
- contextMessages: null,
- data: null,
);
}
@@ -1922,8 +1906,6 @@
length: errorEntity.length,
errorCode: WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER,
arguments: [name],
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/error/correct_override.dart b/pkg/analyzer/lib/src/error/correct_override.dart
index 5f385fb..1dc0643 100644
--- a/pkg/analyzer/lib/src/error/correct_override.dart
+++ b/pkg/analyzer/lib/src/error/correct_override.dart
@@ -136,8 +136,6 @@
superMember.enclosingElement.name!,
superMember.type,
],
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/error/dead_code_verifier.dart b/pkg/analyzer/lib/src/error/dead_code_verifier.dart
index b5c805d..6b28876 100644
--- a/pkg/analyzer/lib/src/error/dead_code_verifier.dart
+++ b/pkg/analyzer/lib/src/error/dead_code_verifier.dart
@@ -238,17 +238,11 @@
offset: doOffset,
length: doEnd - doOffset,
errorCode: WarningCode.DEAD_CODE,
- arguments: null,
- contextMessages: null,
- data: null,
);
_errorReporter.atOffset(
offset: whileOffset,
length: whileEnd - whileOffset,
errorCode: WarningCode.DEAD_CODE,
- arguments: null,
- contextMessages: null,
- data: null,
);
offset = parent.semicolon.next!.offset;
if (parent.hasBreakStatement) {
@@ -273,9 +267,6 @@
offset: offset,
length: length,
errorCode: WarningCode.DEAD_CODE,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
}
@@ -295,8 +286,6 @@
length: length,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
_deadCatchClauseRanges.add(SourceRange(offset, length));
},
@@ -386,9 +375,6 @@
offset: beginToken.offset,
length: endToken.end - beginToken.offset,
errorCode: WarningCode.DEAD_CODE,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart b/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart
index df58dba..cd6f32f 100644
--- a/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart
+++ b/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart
@@ -352,8 +352,6 @@
? HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE
: HintCode.DEPRECATED_MEMBER_USE,
arguments: [displayName],
- contextMessages: null,
- data: null,
);
} else {
if (!message.endsWith('.') &&
@@ -368,8 +366,6 @@
? HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE
: HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE,
arguments: [displayName, message],
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/error/doc_comment_verifier.dart b/pkg/analyzer/lib/src/error/doc_comment_verifier.dart
index a9fb851..2ecdff3 100644
--- a/pkg/analyzer/lib/src/error/doc_comment_verifier.dart
+++ b/pkg/analyzer/lib/src/error/doc_comment_verifier.dart
@@ -46,9 +46,6 @@
offset: configurations.first.offset,
length: configurations.last.end - configurations.first.offset,
errorCode: WarningCode.DOC_IMPORT_CANNOT_HAVE_CONFIGURATIONS,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
}
@@ -66,8 +63,6 @@
length: tag.end - tag.offset,
errorCode: WarningCode.DOC_DIRECTIVE_MISSING_ONE_ARGUMENT,
arguments: [tag.type.name, required.last.name],
- contextMessages: null,
- data: null,
);
} else if (gap == 2) {
var missingArguments = [
@@ -79,8 +74,6 @@
length: tag.end - tag.offset,
errorCode: WarningCode.DOC_DIRECTIVE_MISSING_TWO_ARGUMENTS,
arguments: [tag.type.name, ...missingArguments],
- contextMessages: null,
- data: null,
);
} else if (gap == 3) {
var missingArguments = [
@@ -93,8 +86,6 @@
length: tag.end - tag.offset,
errorCode: WarningCode.DOC_DIRECTIVE_MISSING_THREE_ARGUMENTS,
arguments: [tag.type.name, ...missingArguments],
- contextMessages: null,
- data: null,
);
}
}
@@ -113,8 +104,6 @@
length: errorLength,
errorCode: WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS,
arguments: [tag.type.name, positionalArgumentCount, requiredCount],
- contextMessages: null,
- data: null,
);
}
@@ -125,8 +114,6 @@
length: namedArgument.end - namedArgument.offset,
errorCode: WarningCode.DOC_DIRECTIVE_HAS_UNEXPECTED_NAMED_ARGUMENT,
arguments: [tag.type.name, namedArgument.name],
- contextMessages: null,
- data: null,
);
}
}
@@ -146,8 +133,6 @@
length: argument.end - argument.offset,
errorCode: WarningCode.DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT,
arguments: [parameter.name, parameter.expectedFormat.displayString],
- contextMessages: null,
- data: null,
);
}
diff --git a/pkg/analyzer/lib/src/error/ignore_validator.dart b/pkg/analyzer/lib/src/error/ignore_validator.dart
index 1fc844e..050f23b 100644
--- a/pkg/analyzer/lib/src/error/ignore_validator.dart
+++ b/pkg/analyzer/lib/src/error/ignore_validator.dart
@@ -131,8 +131,6 @@
length: name.length,
errorCode: WarningCode.DUPLICATE_IGNORE,
arguments: [name],
- contextMessages: null,
- data: null,
);
list.remove(ignoredElement);
} else if (ignoredElement is DiagnosticType) {
@@ -141,8 +139,6 @@
length: ignoredElement.length,
errorCode: WarningCode.DUPLICATE_IGNORE,
arguments: [ignoredElement.type],
- contextMessages: null,
- data: null,
);
list.remove(ignoredElement);
}
diff --git a/pkg/analyzer/lib/src/error/language_version_override_verifier.dart b/pkg/analyzer/lib/src/error/language_version_override_verifier.dart
index aee08be..3a673c9 100644
--- a/pkg/analyzer/lib/src/error/language_version_override_verifier.dart
+++ b/pkg/analyzer/lib/src/error/language_version_override_verifier.dart
@@ -190,9 +190,6 @@
offset: offset,
length: length,
errorCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TWO_SLASHES,
- arguments: null,
- contextMessages: null,
- data: null,
);
return false;
}
@@ -202,9 +199,6 @@
offset: offset,
length: length,
errorCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN,
- arguments: null,
- contextMessages: null,
- data: null,
);
return false;
}
@@ -215,9 +209,6 @@
offset: offset,
length: length,
errorCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE,
- arguments: null,
- contextMessages: null,
- data: null,
);
return false;
}
@@ -230,9 +221,6 @@
offset: offset,
length: length,
errorCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS,
- arguments: null,
- contextMessages: null,
- data: null,
);
return false;
}
@@ -242,9 +230,6 @@
offset: offset,
length: length,
errorCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX,
- arguments: null,
- contextMessages: null,
- data: null,
);
return false;
}
@@ -254,9 +239,6 @@
offset: offset,
length: length,
errorCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
@@ -294,9 +276,6 @@
length: length,
errorCode:
WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS,
- arguments: null,
- contextMessages: null,
- data: null,
);
return false;
}
@@ -326,9 +305,6 @@
offset: commentToken.offset + atDartStart,
length: match.end - atDartStart,
errorCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/error/required_parameters_verifier.dart b/pkg/analyzer/lib/src/error/required_parameters_verifier.dart
index 984f19a..b044766 100644
--- a/pkg/analyzer/lib/src/error/required_parameters_verifier.dart
+++ b/pkg/analyzer/lib/src/error/required_parameters_verifier.dart
@@ -128,8 +128,6 @@
length: errorNode.length,
errorCode: CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT,
arguments: [parameterName],
- contextMessages: null,
- data: null,
);
}
}
@@ -146,8 +144,6 @@
length: errorNode.length,
errorCode: WarningCode.MISSING_REQUIRED_PARAM_WITH_DETAILS,
arguments: [parameterName, reason],
- contextMessages: null,
- data: null,
);
} else {
_errorReporter.atOffset(
@@ -155,8 +151,6 @@
length: errorNode.length,
errorCode: WarningCode.MISSING_REQUIRED_PARAM,
arguments: [parameterName],
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/error/todo_finder.dart b/pkg/analyzer/lib/src/error/todo_finder.dart
index 9f90ab5..8958c66 100644
--- a/pkg/analyzer/lib/src/error/todo_finder.dart
+++ b/pkg/analyzer/lib/src/error/todo_finder.dart
@@ -133,8 +133,6 @@
length: end - offset,
errorCode: Todo.forKind(todoKind),
arguments: [todoText],
- contextMessages: null,
- data: null,
);
}
diff --git a/pkg/analyzer/lib/src/error/type_arguments_verifier.dart b/pkg/analyzer/lib/src/error/type_arguments_verifier.dart
index 67ca586..f8002a1 100644
--- a/pkg/analyzer/lib/src/error/type_arguments_verifier.dart
+++ b/pkg/analyzer/lib/src/error/type_arguments_verifier.dart
@@ -136,8 +136,6 @@
length: errorTarget.length,
errorCode: CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
arguments: [typeArgument, typeParameter.name, bound],
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/error/unicode_text_verifier.dart b/pkg/analyzer/lib/src/error/unicode_text_verifier.dart
index 16b5454..ffd851d 100644
--- a/pkg/analyzer/lib/src/error/unicode_text_verifier.dart
+++ b/pkg/analyzer/lib/src/error/unicode_text_verifier.dart
@@ -35,8 +35,6 @@
length: 1,
errorCode: errorCode,
arguments: [code],
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 0d1b59a..329f4dd 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -3185,7 +3185,6 @@
members[index] = updateSwitchMember(
member: member,
labels: labels,
- statements: null,
);
}
assert(labelCount == 0);
@@ -3195,7 +3194,6 @@
if (members2.isNotEmpty) {
members2.last = updateSwitchMember(
member: members2.last,
- labels: null,
statements: statements,
);
}
diff --git a/pkg/analyzer/lib/src/fasta/doc_comment_builder.dart b/pkg/analyzer/lib/src/fasta/doc_comment_builder.dart
index 1a3d74e..ef902f7 100644
--- a/pkg/analyzer/lib/src/fasta/doc_comment_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/doc_comment_builder.dart
@@ -190,8 +190,6 @@
length: openingTag.end - openingTag.offset,
errorCode: WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG,
arguments: [openingTag.type.opposingName!],
- contextMessages: null,
- data: null,
);
}
higherDirective.push(builder.build());
@@ -209,8 +207,6 @@
length: closingTag.end - closingTag.offset,
errorCode: WarningCode.DOC_DIRECTIVE_MISSING_OPENING_TAG,
arguments: [closingTag.type.name],
- contextMessages: null,
- data: null,
);
_pushDocDirective(SimpleDocDirective(closingTag));
}
@@ -291,8 +287,6 @@
length: openingTag.end - openingTag.offset,
errorCode: WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG,
arguments: [openingTag.type.opposingName!],
- contextMessages: null,
- data: null,
);
}
_pushBlockDocDirectiveAndInnerDirectives(builder);
@@ -439,8 +433,6 @@
length: nameEnd - nameIndex,
errorCode: WarningCode.DOC_DIRECTIVE_UNKNOWN,
arguments: [name],
- contextMessages: null,
- data: null,
);
return false;
}
@@ -1174,9 +1166,6 @@
offset: _offset + index - 1,
length: 1,
errorCode: WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE,
- arguments: null,
- contextMessages: null,
- data: null,
);
return (positionalArguments, namedArguments);
}
@@ -1212,9 +1201,6 @@
offset: _offset + index - 1,
length: 1,
errorCode: WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE,
- arguments: null,
- contextMessages: null,
- data: null,
);
break;
}
@@ -1225,9 +1211,6 @@
offset: extraArgumentsOffset,
length: errorLength,
errorCode: WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS,
- arguments: null,
- contextMessages: null,
- data: null,
);
_end = _offset + index;
}
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 4f4a462..d014d6b 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -3897,8 +3897,6 @@
length: end - offset,
errorCode: StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
arguments: [constantName],
- contextMessages: null,
- data: null,
);
}
@@ -3910,8 +3908,6 @@
length: end - offset,
errorCode: StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
arguments: ['null'],
- contextMessages: null,
- data: null,
);
}
}
@@ -4770,9 +4766,6 @@
offset: errorEntity.offset,
length: errorEntity.end - errorEntity.offset,
errorCode: CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
}
@@ -5148,8 +5141,6 @@
length: length,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
}
@@ -5254,8 +5245,6 @@
length: endToken.end - operator.offset,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
}
}
@@ -5281,8 +5270,6 @@
length: endToken.end - operator.offset,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
}
}
@@ -5634,8 +5621,6 @@
typeParameterImpl.name,
variance.toKeywordString()
],
- contextMessages: null,
- data: null,
);
}
}
@@ -5797,9 +5782,6 @@
length: errorTarget.length,
errorCode:
CompileTimeErrorCode.DEFAULT_VALUE_ON_REQUIRED_PARAMETER,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
} else if (defaultValuesAreExpected) {
@@ -5827,8 +5809,6 @@
length: errorTarget.length,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/generated/ffi_verifier.dart b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
index 924ab21..70d7454 100644
--- a/pkg/analyzer/lib/src/generated/ffi_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/ffi_verifier.dart
@@ -726,14 +726,13 @@
return false;
}
if (!_isValidFfiNativeType(nativeType.returnType,
- allowVoid: true, allowEmptyStruct: false, allowHandle: true)) {
+ allowVoid: true, allowHandle: true)) {
return false;
}
for (final DartType typeArg
in nativeType.normalParameterTypes.flattenVarArgs()) {
- if (!_isValidFfiNativeType(typeArg,
- allowVoid: false, allowEmptyStruct: false, allowHandle: true)) {
+ if (!_isValidFfiNativeType(typeArg, allowHandle: true)) {
return false;
}
}
@@ -802,8 +801,7 @@
return true;
}
if (allowArray && nativeType.isArray) {
- return _isValidFfiNativeType(nativeType.typeArguments.single,
- allowVoid: false, allowEmptyStruct: false);
+ return _isValidFfiNativeType(nativeType.typeArguments.single);
}
} else if (nativeType is FunctionType) {
return _isValidFfiNativeFunctionType(nativeType);
@@ -1726,7 +1724,7 @@
void _validateRefIndexed(IndexExpression node) {
var targetType = node.realTarget.staticType;
if (!_isValidFfiNativeType(targetType,
- allowVoid: false, allowEmptyStruct: true, allowArray: true)) {
+ allowEmptyStruct: true, allowArray: true)) {
final AstNode errorNode = node;
_errorReporter.atNode(
errorNode,
@@ -1740,8 +1738,7 @@
/// `Pointer<T extends Struct>.ref`.
void _validateRefPrefixedIdentifier(PrefixedIdentifier node) {
var targetType = node.prefix.staticType;
- if (!_isValidFfiNativeType(targetType,
- allowVoid: false, allowEmptyStruct: true)) {
+ if (!_isValidFfiNativeType(targetType, allowEmptyStruct: true)) {
final AstNode errorNode = node;
_errorReporter.atNode(
errorNode,
@@ -1753,8 +1750,7 @@
void _validateRefPropertyAccess(PropertyAccess node) {
var targetType = node.realTarget.staticType;
- if (!_isValidFfiNativeType(targetType,
- allowVoid: false, allowEmptyStruct: true)) {
+ if (!_isValidFfiNativeType(targetType, allowEmptyStruct: true)) {
final AstNode errorNode = node;
_errorReporter.atNode(
errorNode,
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 73ea22e..5e50461 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -966,7 +966,6 @@
return CaseHeadOrDefaultInfo(
pattern: member.expression,
variables: {},
- guard: null,
);
} else if (member is SwitchPatternCaseImpl) {
var guardedPattern = member.guardedPattern;
@@ -979,7 +978,6 @@
return CaseHeadOrDefaultInfo(
pattern: null,
variables: {},
- guard: null,
);
}
}
@@ -2244,9 +2242,6 @@
length: errorTarget.length,
errorCode:
CompileTimeErrorCode.ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR,
- arguments: null,
- contextMessages: null,
- data: null,
);
}
} else {
diff --git a/pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart b/pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart
index a8257d1..2225bcb4 100644
--- a/pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart
+++ b/pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart
@@ -31,28 +31,22 @@
SdkConstraintVerifier(this._errorReporter, this._versionConstraint);
/// Return a range covering every version up to, but not including, 2.14.0.
- VersionRange get before_2_14_0 =>
- VersionRange(max: Version.parse('2.14.0'), includeMax: false);
+ VersionRange get before_2_14_0 => VersionRange(max: Version.parse('2.14.0'));
/// Return a range covering every version up to, but not including, 2.1.0.
- VersionRange get before_2_1_0 =>
- VersionRange(max: Version.parse('2.1.0'), includeMax: false);
+ VersionRange get before_2_1_0 => VersionRange(max: Version.parse('2.1.0'));
/// Return a range covering every version up to, but not including, 2.2.0.
- VersionRange get before_2_2_0 =>
- VersionRange(max: Version.parse('2.2.0'), includeMax: false);
+ VersionRange get before_2_2_0 => VersionRange(max: Version.parse('2.2.0'));
/// Return a range covering every version up to, but not including, 2.2.2.
- VersionRange get before_2_2_2 =>
- VersionRange(max: Version.parse('2.2.2'), includeMax: false);
+ VersionRange get before_2_2_2 => VersionRange(max: Version.parse('2.2.2'));
/// Return a range covering every version up to, but not including, 2.5.0.
- VersionRange get before_2_5_0 =>
- VersionRange(max: Version.parse('2.5.0'), includeMax: false);
+ VersionRange get before_2_5_0 => VersionRange(max: Version.parse('2.5.0'));
/// Return a range covering every version up to, but not including, 2.6.0.
- VersionRange get before_2_6_0 =>
- VersionRange(max: Version.parse('2.6.0'), includeMax: false);
+ VersionRange get before_2_6_0 => VersionRange(max: Version.parse('2.6.0'));
/// Return `true` if references to the constant-update-2018 features need to
/// be checked.
@@ -211,8 +205,6 @@
sinceSdkVersion.toString(),
_versionConstraint.toString(),
],
- contextMessages: null,
- data: null,
);
}
}
diff --git a/pkg/analyzer/lib/src/lint/linter.dart b/pkg/analyzer/lib/src/lint/linter.dart
index acfde04..814ba15 100644
--- a/pkg/analyzer/lib/src/lint/linter.dart
+++ b/pkg/analyzer/lib/src/lint/linter.dart
@@ -757,7 +757,6 @@
errorCode: errorCode ?? lintCode,
arguments: arguments,
contextMessages: contextMessages,
- data: null,
);
}
diff --git a/pkg/analyzer/lib/src/manifest/manifest_validator.dart b/pkg/analyzer/lib/src/manifest/manifest_validator.dart
index ce066d9..4fc0bb4 100644
--- a/pkg/analyzer/lib/src/manifest/manifest_validator.dart
+++ b/pkg/analyzer/lib/src/manifest/manifest_validator.dart
@@ -465,8 +465,6 @@
length: span.length,
errorCode: errorCode,
arguments: arguments,
- contextMessages: null,
- data: null,
);
}
diff --git a/pkg/analyzer/lib/src/pubspec/validators/name_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/name_validator.dart
index 9f06e18..a0db55b 100644
--- a/pkg/analyzer/lib/src/pubspec/validators/name_validator.dart
+++ b/pkg/analyzer/lib/src/pubspec/validators/name_validator.dart
@@ -14,9 +14,6 @@
offset: 0,
length: 0,
errorCode: PubspecWarningCode.MISSING_NAME,
- arguments: null,
- contextMessages: null,
- data: null,
);
return;
}
@@ -26,9 +23,6 @@
offset: 0,
length: 0,
errorCode: PubspecWarningCode.MISSING_NAME,
- arguments: null,
- contextMessages: null,
- data: null,
);
} else if (nameField is! YamlScalar || nameField.value is! String) {
ctx.reportErrorForNode(nameField, PubspecWarningCode.NAME_NOT_STRING);
diff --git a/pkg/analyzer/lib/src/source/path_filter.dart b/pkg/analyzer/lib/src/source/path_filter.dart
index 83a8983..8698749 100644
--- a/pkg/analyzer/lib/src/source/path_filter.dart
+++ b/pkg/analyzer/lib/src/source/path_filter.dart
@@ -55,7 +55,7 @@
for (Glob pattern in _ignorePatterns) {
sb.write('$pattern ');
}
- sb.writeln('');
+ sb.writeln();
return sb.toString();
}
diff --git a/pkg/analyzer/lib/src/summary2/data_reader.dart b/pkg/analyzer/lib/src/summary2/data_reader.dart
index a524c19..b9d820d 100644
--- a/pkg/analyzer/lib/src/summary2/data_reader.dart
+++ b/pkg/analyzer/lib/src/summary2/data_reader.dart
@@ -218,7 +218,7 @@
}
_offsets[length] = offset;
- _strings = List.filled(length, null, growable: false);
+ _strings = List.filled(length, null);
}
String operator [](int index) {
diff --git a/pkg/analyzer/lib/src/summary2/macro_application.dart b/pkg/analyzer/lib/src/summary2/macro_application.dart
index 514e0bb..0f4da7c 100644
--- a/pkg/analyzer/lib/src/summary2/macro_application.dart
+++ b/pkg/analyzer/lib/src/summary2/macro_application.dart
@@ -891,7 +891,7 @@
return macro.StringArgument(node.strings
.map((e) => evaluate(contextType, e))
.map((arg) => arg.value)
- .join(''));
+ .join());
} else if (node is ast.BooleanLiteral) {
return macro.BoolArgument(node.value);
} else if (node is ast.DoubleLiteral) {
diff --git a/pkg/analyzer/lib/src/summary2/named_type_builder.dart b/pkg/analyzer/lib/src/summary2/named_type_builder.dart
index 6fde7b3..3599077 100644
--- a/pkg/analyzer/lib/src/summary2/named_type_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/named_type_builder.dart
@@ -299,7 +299,7 @@
}
static List<DartType> _listOfDynamic(int length) {
- return List<DartType>.filled(length, _dynamicType, growable: false);
+ return List<DartType>.filled(length, _dynamicType);
}
static void _setAliasedType(AstNode node, DartType type) {
diff --git a/pkg/analyzer/lib/src/wolf/ir/interpreter.dart b/pkg/analyzer/lib/src/wolf/ir/interpreter.dart
index 7761d29..901483a 100644
--- a/pkg/analyzer/lib/src/wolf/ir/interpreter.dart
+++ b/pkg/analyzer/lib/src/wolf/ir/interpreter.dart
@@ -311,7 +311,7 @@
case Opcode.concat:
var count = Opcode.concat.decodeCount(ir, address);
var newStackLength = stack.length - count;
- var result = stack.sublist(newStackLength).join('');
+ var result = stack.sublist(newStackLength).join();
stack.length = newStackLength;
stack.add(result);
case Opcode.drop:
diff --git a/pkg/analyzer/test/generated/formal_parameter_parser_test.dart b/pkg/analyzer/test/generated/formal_parameter_parser_test.dart
index 30628f3..a6e157d 100644
--- a/pkg/analyzer/test/generated/formal_parameter_parser_test.dart
+++ b/pkg/analyzer/test/generated/formal_parameter_parser_test.dart
@@ -36,8 +36,7 @@
fail('$kind');
}
createParser(parametersCode);
- FormalParameterList list =
- parserProxy.parseFormalParameterList(inFunctionType: false);
+ FormalParameterList list = parserProxy.parseFormalParameterList();
assertErrors(errors: errors);
return list.parameters.single;
}
diff --git a/pkg/analyzer/test/generated/parser_test_base.dart b/pkg/analyzer/test/generated/parser_test_base.dart
index bec1e82..ca69cac 100644
--- a/pkg/analyzer/test/generated/parser_test_base.dart
+++ b/pkg/analyzer/test/generated/parser_test_base.dart
@@ -354,7 +354,7 @@
{List<ErrorCode>? codes,
List<ExpectedError>? errors,
FeatureSet? featureSet}) {
- GatheringErrorListener listener = GatheringErrorListener(checkRanges: true);
+ GatheringErrorListener listener = GatheringErrorListener();
var unit = parseCompilationUnit2(content, listener, featureSet: featureSet);
@@ -488,7 +488,7 @@
fail('$kind');
}
FormalParameterList list = parseFormalParameterList(parametersCode,
- inFunctionType: false, errorCodes: errorCodes, featureSet: featureSet);
+ errorCodes: errorCodes, featureSet: featureSet);
return list.parameters.single;
}
@@ -610,7 +610,7 @@
{int? expectedEndOffset, List<ExpectedError>? errors}) {
createParser(code, expectedEndOffset: expectedEndOffset);
Expression result = parserProxy.parsePrimaryExpression();
- assertErrors(codes: null, errors: errors);
+ assertErrors(errors: errors);
return result;
}
@@ -725,7 +725,7 @@
int? expectedEndOffset,
required LineInfo lineInfo}) {
TestSource source = TestSource();
- var errorListener = GatheringErrorListener(checkRanges: true);
+ var errorListener = GatheringErrorListener();
return ParserProxy._(firstToken, source, errorListener, featureSet,
allowNativeClause: allowNativeClause,
expectedEndOffset: expectedEndOffset,
@@ -1230,8 +1230,8 @@
} else {
fail('$kind');
}
- FormalParameterList list = parseFormalParameterList(parametersCode,
- inFunctionType: false, errorCodes: errorCodes);
+ FormalParameterList list =
+ parseFormalParameterList(parametersCode, errorCodes: errorCodes);
return list.parameters.single;
}
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart
index ded76e2..f9fbea2 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart
@@ -50,9 +50,7 @@
// Configure `strict-casts: false`.
writeTestPackageAnalysisOptionsFile(
- AnalysisOptionsFileConfig(
- strictCasts: false,
- ),
+ AnalysisOptionsFileConfig(),
);
addTestFile(r'''
diff --git a/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart b/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
index 8847d1c..81994d4 100644
--- a/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
+++ b/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
@@ -165,7 +165,7 @@
);
// class B extends A<B> {}
- var B = class_(name: 'B', superType: null);
+ var B = class_(name: 'B');
B.supertype = interfaceTypeNone(A, typeArguments: [interfaceTypeNone(B)]);
var typeB = interfaceTypeNone(B);
diff --git a/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart b/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart
index 5f4092b..a083b21 100644
--- a/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart
+++ b/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart
@@ -2753,7 +2753,6 @@
className: className,
name: name,
expected: expected,
- concrete: false,
);
_assertGetMember(
diff --git a/pkg/analyzer/test/src/dart/element/nullable_test.dart b/pkg/analyzer/test/src/dart/element/nullable_test.dart
index c626f83..9d4c0df 100644
--- a/pkg/analyzer/test/src/dart/element/nullable_test.dart
+++ b/pkg/analyzer/test/src/dart/element/nullable_test.dart
@@ -655,7 +655,7 @@
}
test_typeParameter_bound_null() {
- var element = typeParameter('T', bound: null);
+ var element = typeParameter('T');
_checkTypeParameter(
typeParameterTypeNone(element),
element: element,
diff --git a/pkg/analyzer/test/src/dart/element/subtype_test.dart b/pkg/analyzer/test/src/dart/element/subtype_test.dart
index 143b3c0..668821d 100644
--- a/pkg/analyzer/test/src/dart/element/subtype_test.dart
+++ b/pkg/analyzer/test/src/dart/element/subtype_test.dart
@@ -2283,12 +2283,10 @@
test_futureOr_21() {
isSubtype(
functionTypeStar(
- parameters: const [],
returnType: stringStar,
),
futureOrStar(
functionTypeStar(
- parameters: const [],
returnType: voidNone,
),
),
@@ -2300,12 +2298,10 @@
test_futureOr_22() {
isNotSubtype(
functionTypeStar(
- parameters: const [],
returnType: voidNone,
),
futureOrStar(
functionTypeStar(
- parameters: const [],
returnType: stringStar,
),
),
diff --git a/pkg/analyzer/test/src/dart/element/upper_lower_bound_test.dart b/pkg/analyzer/test/src/dart/element/upper_lower_bound_test.dart
index c364e40..7917efd 100644
--- a/pkg/analyzer/test/src/dart/element/upper_lower_bound_test.dart
+++ b/pkg/analyzer/test/src/dart/element/upper_lower_bound_test.dart
@@ -1508,10 +1508,9 @@
}
check(
- bound: null,
T2: functionTypeNone(returnType: voidNone),
);
- check(bound: null, T2: intNone);
+ check(T2: intNone);
check(bound: numNone, T2: intNone);
}
diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/partial_code_support.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/partial_code_support.dart
index cf41ea2..c1b8439 100644
--- a/pkg/analyzer/test/src/fasta/recovery/partial_code/partial_code_support.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/partial_code_support.dart
@@ -166,8 +166,7 @@
// Determine the existing errors in the code without either valid or
// invalid code.
//
- GatheringErrorListener listener =
- GatheringErrorListener(checkRanges: true);
+ GatheringErrorListener listener = GatheringErrorListener();
parseCompilationUnit2(base.toString(), listener, featureSet: featureSet);
var baseErrorCodes = <ErrorCode>[];
for (var error in listener.errors) {
diff --git a/pkg/analyzer/test/src/fasta/recovery/recovery_test_support.dart b/pkg/analyzer/test/src/fasta/recovery/recovery_test_support.dart
index 01e1907..33500c8 100644
--- a/pkg/analyzer/test/src/fasta/recovery/recovery_test_support.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/recovery_test_support.dart
@@ -38,7 +38,7 @@
}
// Compare the structures before asserting valid errors.
- GatheringErrorListener listener = GatheringErrorListener(checkRanges: true);
+ GatheringErrorListener listener = GatheringErrorListener();
var invalidUnit =
parseCompilationUnit2(invalidCode, listener, featureSet: featureSet);
validateTokenStream(invalidUnit.beginToken);
diff --git a/pkg/analyzer/test/src/options/options_rule_validator_test.dart b/pkg/analyzer/test/src/options/options_rule_validator_test.dart
index 7cc4791..02324e1 100644
--- a/pkg/analyzer/test/src/options/options_rule_validator_test.dart
+++ b/pkg/analyzer/test/src/options/options_rule_validator_test.dart
@@ -152,7 +152,6 @@
''',
// No error
[],
- sdk: null,
);
}
diff --git a/pkg/analyzer/test/src/services/available_declarations_test.dart b/pkg/analyzer/test/src/services/available_declarations_test.dart
index 1c873e5..cc3f8ff 100644
--- a/pkg/analyzer/test/src/services/available_declarations_test.dart
+++ b/pkg/analyzer/test/src/services/available_declarations_test.dart
@@ -2643,24 +2643,14 @@
_getDeclaration(library.declarations, 'A'),
'A',
DeclarationKind.TYPE_ALIAS,
- parameters: null,
- parameterNames: null,
- parameterTypes: null,
relevanceTags: ['ElementKind.TYPE_ALIAS', 'package:test/test.dart::A'],
- requiredParameterCount: null,
- returnType: null,
);
_assertDeclaration(
_getDeclaration(library.declarations, 'B'),
'B',
DeclarationKind.TYPE_ALIAS,
isDeprecated: true,
- parameters: null,
- parameterNames: null,
- parameterTypes: null,
relevanceTags: ['ElementKind.TYPE_ALIAS', 'package:test/test.dart::B'],
- requiredParameterCount: null,
- returnType: null,
);
_assertDeclaration(
_getDeclaration(library.declarations, 'C'),
@@ -2668,12 +2658,7 @@
DeclarationKind.TYPE_ALIAS,
docSummary: 'aaa',
docComplete: 'aaa\n\nbbb bbb',
- parameters: null,
- parameterNames: null,
- parameterTypes: null,
relevanceTags: ['ElementKind.TYPE_ALIAS', 'package:test/test.dart::C'],
- requiredParameterCount: null,
- returnType: null,
);
}
diff --git a/pkg/analyzer/test/src/summary/macro_test.dart b/pkg/analyzer/test/src/summary/macro_test.dart
index 09d8c55..85ed497 100644
--- a/pkg/analyzer/test/src/summary/macro_test.dart
+++ b/pkg/analyzer/test/src/summary/macro_test.dart
@@ -1235,7 +1235,7 @@
}) async {
final dumpCode = fields.keys.map((name) {
return "$name: \${$name.runtimeType} \$$name\\\\n";
- }).join('');
+ }).join();
newFile('$testPackageLibPath/arguments_text.dart', '''
import 'dart:async';
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 7b2f487..ca5cdbb 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -2359,8 +2359,7 @@
}
''';
- await assertErrorsInCode(
- build(downwards: "Future", upwards: "Future", expectedInfo: ''), [
+ await assertErrorsInCode(build(downwards: "Future", upwards: "Future"), [
error(CompileTimeErrorCode.INVALID_OVERRIDE, 185, 4,
contextMessages: [message(dartAsyncFile, 506, 4)]),
error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 223, 7),
@@ -2417,7 +2416,6 @@
declared: "MyFuture",
downwards: "Future",
upwards: "Future",
- expectedError: '',
),
[
error(CompileTimeErrorCode.INVALID_OVERRIDE, 187, 4,
@@ -2453,7 +2451,6 @@
declared: "Future",
downwards: "Future",
upwards: "Future",
- expectedError: '',
),
[
error(CompileTimeErrorCode.INVALID_OVERRIDE, 187, 4,
diff --git a/pkg/analyzer/test/src/utilities/fuzzy_matcher_test.dart b/pkg/analyzer/test/src/utilities/fuzzy_matcher_test.dart
index 698cbde..58da121 100644
--- a/pkg/analyzer/test/src/utilities/fuzzy_matcher_test.dart
+++ b/pkg/analyzer/test/src/utilities/fuzzy_matcher_test.dart
@@ -102,18 +102,18 @@
}
void test_ranksActions() {
- var matcher = FuzzyMatcher('jade', matchStyle: MatchStyle.TEXT);
+ var matcher = FuzzyMatcher('jade');
// Full word matches score higher than subsequence matches.
expect(
matcher.score('jump to a directory in tree'),
lessThan(matcher
.score('fix imports and dependencies using jade (java only)')));
- matcher = FuzzyMatcher('unedit', matchStyle: MatchStyle.TEXT);
+ matcher = FuzzyMatcher('unedit');
expect(matcher.score('Undo an edit'),
lessThan(matcher.score('Close unedited tabs')));
- matcher = FuzzyMatcher('fix', matchStyle: MatchStyle.TEXT);
+ matcher = FuzzyMatcher('fix');
expect(
matcher.score('find next match'),
lessThan(
diff --git a/pkg/analyzer/test/src/wolf/ir/validator_test.dart b/pkg/analyzer/test/src/wolf/ir/validator_test.dart
index 7870402..591ddf6 100644
--- a/pkg/analyzer/test/src/wolf/ir/validator_test.dart
+++ b/pkg/analyzer/test/src/wolf/ir/validator_test.dart
@@ -43,8 +43,7 @@
test_await_inSynchronousFunction() {
_analyze((ir) => ir
- ..function(
- ir.encodeFunctionType(parameterCount: 1), FunctionFlags(async: false))
+ ..function(ir.encodeFunctionType(parameterCount: 1), FunctionFlags())
..label('bad')
..await_()
..end());
@@ -657,7 +656,7 @@
test_is_underflow() {
_analyze((ir) => ir
- ..ordinaryFunction(parameterCount: 0)
+ ..ordinaryFunction()
..label('bad')
..is_(ir.encodeFunctionType(parameterCount: 0))
..end());
@@ -915,8 +914,7 @@
test_yield_inNonGeneratorFunction() {
_analyze((ir) => ir
- ..function(ir.encodeFunctionType(parameterCount: 1),
- FunctionFlags(generator: false))
+ ..function(ir.encodeFunctionType(parameterCount: 1), FunctionFlags())
..label('bad')
..yield_()
..end());
diff --git a/pkg/analyzer/test/src/workspace/blaze_test.dart b/pkg/analyzer/test/src/workspace/blaze_test.dart
index e9467a1..d179999 100644
--- a/pkg/analyzer/test/src/workspace/blaze_test.dart
+++ b/pkg/analyzer/test/src/workspace/blaze_test.dart
@@ -229,9 +229,8 @@
'/workspace/my/foo/lib/foo1.dart',
'/workspace/blaze-bin/my/foo/lib/foo1.dart'
]);
- _assertResolve(
- 'package:my.foo/foo1.dart', '/workspace/blaze-bin/my/foo/lib/foo1.dart',
- exists: true);
+ _assertResolve('package:my.foo/foo1.dart',
+ '/workspace/blaze-bin/my/foo/lib/foo1.dart');
}
void test_resolveAbsolute_bin_notInWorkspace() {
@@ -240,9 +239,8 @@
'/workspace/blaze-genfiles/',
'/workspace/blaze-bin/my/foo/lib/foo1.dart'
]);
- _assertResolve(
- 'package:my.foo/foo1.dart', '/workspace/blaze-bin/my/foo/lib/foo1.dart',
- exists: true);
+ _assertResolve('package:my.foo/foo1.dart',
+ '/workspace/blaze-bin/my/foo/lib/foo1.dart');
}
void test_resolveAbsolute_file_bin_pathHasSpace() {
@@ -304,8 +302,7 @@
'/workspace/blaze-genfiles/my/foo/lib/foo1.dart'
]);
_assertResolve('package:my.foo/foo1.dart',
- '/workspace/blaze-genfiles/my/foo/lib/foo1.dart',
- exists: true);
+ '/workspace/blaze-genfiles/my/foo/lib/foo1.dart');
}
void test_resolveAbsolute_genfiles_notInWorkspace() {
@@ -315,8 +312,7 @@
'/workspace/blaze-genfiles/my/foo/lib/foo1.dart'
]);
_assertResolve('package:my.foo/foo1.dart',
- '/workspace/blaze-genfiles/my/foo/lib/foo1.dart',
- exists: true);
+ '/workspace/blaze-genfiles/my/foo/lib/foo1.dart');
}
void test_resolveAbsolute_null_doubleDot() {
@@ -384,8 +380,7 @@
'/workspace/blaze-bin/third_party/dart/foo/lib/foo1.dart',
]);
_assertResolve('package:foo/foo1.dart',
- '/workspace/blaze-bin/third_party/dart/foo/lib/foo1.dart',
- exists: true);
+ '/workspace/blaze-bin/third_party/dart/foo/lib/foo1.dart');
}
void test_resolveAbsolute_thirdParty_bin_notInWorkspace() {
@@ -395,8 +390,7 @@
'/workspace/blaze-bin/third_party/dart/foo/lib/foo1.dart',
]);
_assertResolve('package:foo/foo1.dart',
- '/workspace/blaze-bin/third_party/dart/foo/lib/foo1.dart',
- exists: true);
+ '/workspace/blaze-bin/third_party/dart/foo/lib/foo1.dart');
}
void test_resolveAbsolute_thirdParty_doesNotExist() {
@@ -417,8 +411,7 @@
'/workspace/third_party/dart/foo/lib/foo1.dart',
]);
_assertResolve('package:foo/foo1.dart',
- '/workspace/third_party/dart/foo/lib/foo1.dart',
- exists: true);
+ '/workspace/third_party/dart/foo/lib/foo1.dart');
}
void test_resolveAbsolute_thirdParty_genfiles() {
@@ -429,8 +422,7 @@
'/workspace/blaze-genfiles/third_party/dart/foo/lib/foo1.dart',
]);
_assertResolve('package:foo/foo1.dart',
- '/workspace/blaze-genfiles/third_party/dart/foo/lib/foo1.dart',
- exists: true);
+ '/workspace/blaze-genfiles/third_party/dart/foo/lib/foo1.dart');
}
void test_resolveAbsolute_thirdParty_genfiles_notInWorkspace() {
@@ -440,8 +432,7 @@
'/workspace/blaze-genfiles/third_party/dart/foo/lib/foo1.dart',
]);
_assertResolve('package:foo/foo1.dart',
- '/workspace/blaze-genfiles/third_party/dart/foo/lib/foo1.dart',
- exists: true);
+ '/workspace/blaze-genfiles/third_party/dart/foo/lib/foo1.dart');
}
void test_resolveAbsolute_workspace_doesNotExist() {
@@ -461,8 +452,7 @@
'/workspace/my/foo/lib/foo1.dart',
]);
_assertResolve(
- 'package:my.foo/foo1.dart', '/workspace/my/foo/lib/foo1.dart',
- exists: true);
+ 'package:my.foo/foo1.dart', '/workspace/my/foo/lib/foo1.dart');
}
void test_resolveAbsolute_workspace_exists_hasSpace() {
@@ -473,7 +463,7 @@
]);
_assertResolve(
'package:my.foo/foo .dart', '/workspace/my/foo/lib/foo .dart',
- exists: true, restore: false);
+ restore: false);
}
void test_restoreAbsolute_noPackageName_workspace() {
diff --git a/pkg/analyzer/test/src/workspace/pub_test.dart b/pkg/analyzer/test/src/workspace/pub_test.dart
index ca1106a..1273a09 100644
--- a/pkg/analyzer/test/src/workspace/pub_test.dart
+++ b/pkg/analyzer/test/src/workspace/pub_test.dart
@@ -172,8 +172,7 @@
'package:project/generated_file.dart',
create: false);
_assertResolveUri(sourceUri,
- '/workspace/.dart_tool/build/generated/project/lib/generated_file.dart',
- exists: true);
+ '/workspace/.dart_tool/build/generated/project/lib/generated_file.dart');
}
void test_resolveAbsolute_null_notPackage() {
@@ -198,8 +197,7 @@
]);
final Uri sourceUri = addPackageSource(
'/workspace/lib/source_file.dart', 'package:project/source_file.dart');
- _assertResolveUri(sourceUri, '/workspace/lib/source_file.dart',
- exists: true);
+ _assertResolveUri(sourceUri, '/workspace/lib/source_file.dart');
}
void test_resolveAbsolute_workspace_doesNotExist() {
diff --git a/pkg/analyzer/test/util/element_printer.dart b/pkg/analyzer/test/util/element_printer.dart
index 664e467..2b3ea3e 100644
--- a/pkg/analyzer/test/util/element_printer.dart
+++ b/pkg/analyzer/test/util/element_printer.dart
@@ -172,7 +172,7 @@
'[',
element.variables.map(_elementToReferenceString).join(', '),
']',
- ].join('');
+ ].join();
} else {
return '${element.name}@${element.nameOffset}';
}
diff --git a/pkg/analyzer/tool/summary/generate.dart b/pkg/analyzer/tool/summary/generate.dart
index 8280d13..452f9ba 100644
--- a/pkg/analyzer/tool/summary/generate.dart
+++ b/pkg/analyzer/tool/summary/generate.dart
@@ -152,7 +152,7 @@
/// appropriate.
void out([String s = '']) {
if (s == '') {
- _outBuffer.writeln('');
+ _outBuffer.writeln();
} else {
_outBuffer.writeln('$_indentation$s');
}
diff --git a/pkg/analyzer/tool/wolf/generate.dart b/pkg/analyzer/tool/wolf/generate.dart
index f5e93bc..48b835c 100644
--- a/pkg/analyzer/tool/wolf/generate.dart
+++ b/pkg/analyzer/tool/wolf/generate.dart
@@ -265,7 +265,7 @@
outputIRToStringMixin();
outputParameterShapes();
outputOpcode();
- return _substringsToOutput.join('');
+ return _substringsToOutput.join();
}
}