diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/errors.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/errors.dart index dd32c8b0dd7..59e17778ae7 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/errors.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/errors.dart @@ -38,7 +38,7 @@ void translateErrorToken(ErrorToken token, ReportError reportError) { // TODO(paulberry,ahe): Fasta reports the error location as the entire // string; analyzer expects the end of the string. reportError( - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, + ScannerErrorCode.unterminatedStringLiteral, endOffset - 1, null, ); @@ -48,7 +48,7 @@ void translateErrorToken(ErrorToken token, ReportError reportError) { // TODO(paulberry,ahe): Fasta reports the error location as the entire // comment; analyzer expects the end of the comment. reportError( - ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, + ScannerErrorCode.unterminatedMultiLineComment, endOffset - 1, null, ); @@ -58,24 +58,24 @@ void translateErrorToken(ErrorToken token, ReportError reportError) { // TODO(paulberry,ahe): Fasta reports the error location as the entire // number; analyzer expects the end of the number. charOffset = endOffset - 1; - return _makeError(ScannerErrorCode.MISSING_DIGIT, null); + return _makeError(ScannerErrorCode.missingDigit, null); case "MISSING_HEX_DIGIT": // TODO(paulberry,ahe): Fasta reports the error location as the entire // number; analyzer expects the end of the number. charOffset = endOffset - 1; - return _makeError(ScannerErrorCode.MISSING_HEX_DIGIT, null); + return _makeError(ScannerErrorCode.missingHexDigit, null); case "ILLEGAL_CHARACTER": // We can safely assume `token.character` is non-`null` because this error // is only reported when there is a character associated with the token. - return _makeError(ScannerErrorCode.ILLEGAL_CHARACTER, [token.character!]); + return _makeError(ScannerErrorCode.illegalCharacter, [token.character!]); case "UNEXPECTED_SEPARATOR_IN_NUMBER": - return _makeError(ScannerErrorCode.UNEXPECTED_SEPARATOR_IN_NUMBER, null); + return _makeError(ScannerErrorCode.unexpectedSeparatorInNumber, null); case "UNSUPPORTED_OPERATOR": - return _makeError(ScannerErrorCode.UNSUPPORTED_OPERATOR, [ + return _makeError(ScannerErrorCode.unsupportedOperator, [ (token as UnsupportedOperator).token.lexeme, ]); @@ -85,19 +85,19 @@ void translateErrorToken(ErrorToken token, ReportError reportError) { TokenType type = token.begin!.type; if (type == TokenType.OPEN_CURLY_BRACKET || type == TokenType.STRING_INTERPOLATION_EXPRESSION) { - return _makeError(ScannerErrorCode.EXPECTED_TOKEN, ['}']); + return _makeError(ScannerErrorCode.expectedToken, ['}']); } if (type == TokenType.OPEN_SQUARE_BRACKET) { - return _makeError(ScannerErrorCode.EXPECTED_TOKEN, [']']); + return _makeError(ScannerErrorCode.expectedToken, [']']); } if (type == TokenType.OPEN_PAREN) { - return _makeError(ScannerErrorCode.EXPECTED_TOKEN, [')']); + return _makeError(ScannerErrorCode.expectedToken, [')']); } if (type == TokenType.LT) { - return _makeError(ScannerErrorCode.EXPECTED_TOKEN, ['>']); + return _makeError(ScannerErrorCode.expectedToken, ['>']); } } else if (errorCode == codeUnexpectedDollarInString) { - return _makeError(ScannerErrorCode.MISSING_IDENTIFIER, null); + return _makeError(ScannerErrorCode.missingIdentifier, null); } throw new UnimplementedError( '$errorCode "${errorCode.analyzerCodes?.first}"', diff --git a/pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart b/pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart index ed4d61da593..b1a3046e25e 100644 --- a/pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart +++ b/pkg/_fe_analyzer_shared/lib/src/scanner/errors.g.dart @@ -29,52 +29,52 @@ import "package:_fe_analyzer_shared/src/base/errors.dart"; class ScannerErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the token that was expected but not found - static const ScannerErrorCode EXPECTED_TOKEN = const ScannerErrorCode( + static const ScannerErrorCode expectedToken = const ScannerErrorCode( 'EXPECTED_TOKEN', "Expected to find '{0}'.", ); /// Parameters: /// Object p0: the illegal character - static const ScannerErrorCode ILLEGAL_CHARACTER = const ScannerErrorCode( + static const ScannerErrorCode illegalCharacter = const ScannerErrorCode( 'ILLEGAL_CHARACTER', "Illegal character '{0}'.", ); /// No parameters. - static const ScannerErrorCode MISSING_DIGIT = const ScannerErrorCode( + static const ScannerErrorCode missingDigit = const ScannerErrorCode( 'MISSING_DIGIT', "Decimal digit expected.", ); /// No parameters. - static const ScannerErrorCode MISSING_HEX_DIGIT = const ScannerErrorCode( + static const ScannerErrorCode missingHexDigit = const ScannerErrorCode( 'MISSING_HEX_DIGIT', "Hexadecimal digit expected.", ); /// No parameters. - static const ScannerErrorCode MISSING_IDENTIFIER = const ScannerErrorCode( + static const ScannerErrorCode missingIdentifier = const ScannerErrorCode( 'MISSING_IDENTIFIER', "Expected an identifier.", ); /// No parameters. - static const ScannerErrorCode MISSING_QUOTE = const ScannerErrorCode( + static const ScannerErrorCode missingQuote = const ScannerErrorCode( 'MISSING_QUOTE', "Expected quote (' or \").", ); /// Parameters: /// Object p0: the path of the file that cannot be read - static const ScannerErrorCode UNABLE_GET_CONTENT = const ScannerErrorCode( + static const ScannerErrorCode unableGetContent = const ScannerErrorCode( 'UNABLE_GET_CONTENT', "Unable to get content of '{0}'.", ); /// No parameters. static const ScannerErrorCode - UNEXPECTED_DOLLAR_IN_STRING = const ScannerErrorCode( + unexpectedDollarInString = const ScannerErrorCode( 'UNEXPECTED_DOLLAR_IN_STRING', "A '\$' has special meaning inside a string, and must be followed by an " "identifier or an expression in curly braces ({}).", @@ -83,7 +83,7 @@ class ScannerErrorCode extends DiagnosticCode { /// No parameters. static const ScannerErrorCode - UNEXPECTED_SEPARATOR_IN_NUMBER = const ScannerErrorCode( + unexpectedSeparatorInNumber = const ScannerErrorCode( 'UNEXPECTED_SEPARATOR_IN_NUMBER', "Digit separators ('_') in a number literal can only be placed between two " "digits.", @@ -92,13 +92,13 @@ class ScannerErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the unsupported operator - static const ScannerErrorCode UNSUPPORTED_OPERATOR = const ScannerErrorCode( + static const ScannerErrorCode unsupportedOperator = const ScannerErrorCode( 'UNSUPPORTED_OPERATOR', "The '{0}' operator is not supported.", ); /// No parameters. - static const ScannerErrorCode UNTERMINATED_MULTI_LINE_COMMENT = + static const ScannerErrorCode unterminatedMultiLineComment = const ScannerErrorCode( 'UNTERMINATED_MULTI_LINE_COMMENT', "Unterminated multi-line comment.", @@ -108,7 +108,7 @@ class ScannerErrorCode extends DiagnosticCode { ); /// No parameters. - static const ScannerErrorCode UNTERMINATED_STRING_LITERAL = + static const ScannerErrorCode unterminatedStringLiteral = const ScannerErrorCode( 'UNTERMINATED_STRING_LITERAL', "Unterminated string literal.", diff --git a/pkg/analysis_server/lib/src/lsp/mapping.dart b/pkg/analysis_server/lib/src/lsp/mapping.dart index 3aff705c976..af3da9d2489 100644 --- a/pkg/analysis_server/lib/src/lsp/mapping.dart +++ b/pkg/analysis_server/lib/src/lsp/mapping.dart @@ -52,21 +52,19 @@ final completionFilterTextSplitPattern = RegExp(r'=>|[\(]'); final completionSetterTypePattern = RegExp(r'^\((\S+)\s+\S+\)$'); final diagnosticTagsForErrorCode = >{ - _diagnosticCode(WarningCode.DEAD_CODE): [lsp.DiagnosticTag.Unnecessary], - _diagnosticCode(HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE): [ + _diagnosticCode(WarningCode.deadCode): [lsp.DiagnosticTag.Unnecessary], + _diagnosticCode(HintCode.deprecatedMemberUseFromSamePackage): [ lsp.DiagnosticTag.Deprecated, ], - _diagnosticCode( - HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE, - ): [lsp.DiagnosticTag.Deprecated], - _diagnosticCode(HintCode.DEPRECATED_MEMBER_USE): [ + _diagnosticCode(HintCode.deprecatedMemberUseFromSamePackageWithMessage): [ lsp.DiagnosticTag.Deprecated, ], + _diagnosticCode(HintCode.deprecatedMemberUse): [lsp.DiagnosticTag.Deprecated], 'deprecated_member_use_from_same_package': [lsp.DiagnosticTag.Deprecated], 'deprecated_member_use_from_same_package_with_message': [ lsp.DiagnosticTag.Deprecated, ], - _diagnosticCode(HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE): [ + _diagnosticCode(HintCode.deprecatedMemberUseWithMessage): [ lsp.DiagnosticTag.Deprecated, ], }; 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 023ca85b5d1..f04d8477390 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 @@ -313,7 +313,7 @@ class StatementCompletionProcessor { : null; } - var expr = diagnosticMatching(ScannerErrorCode.UNTERMINATED_STRING_LITERAL); + var expr = diagnosticMatching(ScannerErrorCode.unterminatedStringLiteral); if (expr != null) { var source = utils.getNodeText(expr); var content = source; @@ -339,18 +339,15 @@ class StatementCompletionProcessor { delimiter = content.substring(0, 1); loc = expr.offset + source.length; } - _removeError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL); + _removeError(ScannerErrorCode.unterminatedStringLiteral); _addInsertEdit(loc, delimiter); } expr = diagnosticMatching( - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, partialMatch: "']'", ) ?? - diagnosticMatching( - ScannerErrorCode.EXPECTED_TOKEN, - partialMatch: "']'", - ); + diagnosticMatching(ScannerErrorCode.expectedToken, partialMatch: "']'"); if (expr != null) { expr = expr.thisOrAncestorOfType(); if (expr is ListLiteral) { @@ -363,8 +360,8 @@ class StatementCompletionProcessor { } else { _addInsertEdit(loc, ']'); } - _removeError(ParserErrorCode.EXPECTED_TOKEN, partialMatch: "']'"); - _removeError(ScannerErrorCode.EXPECTED_TOKEN, partialMatch: "']'"); + _removeError(ParserErrorCode.expectedToken, partialMatch: "']'"); + _removeError(ScannerErrorCode.expectedToken, partialMatch: "']'"); } } } @@ -436,7 +433,7 @@ class StatementCompletionProcessor { var delta = 0; if (diagnostics.isNotEmpty) { var error = _findDiagnostic( - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, partialMatch: "';'", ); if (error != null) { @@ -752,9 +749,7 @@ class StatementCompletionProcessor { var needsParen = false; int computeExitPos(FormalParameterList parameters) { if (needsParen = parameters.rightParenthesis.isSynthetic) { - var error = _findDiagnostic( - ParserErrorCode.MISSING_CLOSING_PARENTHESIS, - ); + var error = _findDiagnostic(ParserErrorCode.missingClosingParenthesis); if (error != null) { return error.offset - 1; } @@ -794,7 +789,7 @@ class StatementCompletionProcessor { return false; } var error = _findDiagnostic( - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, partialMatch: "';'", ); if (error != null) { @@ -928,8 +923,8 @@ class StatementCompletionProcessor { bool _complete_methodCall(AstNode node) { var parenError = - _findDiagnostic(ParserErrorCode.EXPECTED_TOKEN, partialMatch: "')'") ?? - _findDiagnostic(ScannerErrorCode.EXPECTED_TOKEN, partialMatch: "')'"); + _findDiagnostic(ParserErrorCode.expectedToken, partialMatch: "')'") ?? + _findDiagnostic(ScannerErrorCode.expectedToken, partialMatch: "')'"); if (parenError == null) { return false; } @@ -947,7 +942,7 @@ class StatementCompletionProcessor { var loc = min(selectionOffset, argList.end); _addInsertEdit(loc, ')'); var semicolonError = _findDiagnostic( - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, partialMatch: "';'", ); if (semicolonError != null) { @@ -982,7 +977,7 @@ class StatementCompletionProcessor { return false; } var error = _findDiagnostic( - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, partialMatch: "';'", ); if (error != null) { @@ -1075,7 +1070,7 @@ class StatementCompletionProcessor { if (onKeyword != null && exceptionType != null) { if (exceptionType.length == 0 || _findDiagnostic( - CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE, + CompileTimeErrorCode.nonTypeInCatchClause, partialMatch: "name 'catch", ) != null) { 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 872d1321f0e..6780087ac86 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 @@ -90,9 +90,9 @@ class BulkFixProcessor { /// will almost certainly be invalid code. static const Map> nonLintMultiProducerMap = { - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE: [DataDriven.new], - CompileTimeErrorCode.CAST_TO_NON_TYPE: [DataDriven.new], - CompileTimeErrorCode.EXTENDS_NON_CLASS: [DataDriven.new], + CompileTimeErrorCode.argumentTypeNotAssignable: [DataDriven.new], + CompileTimeErrorCode.castToNonType: [DataDriven.new], + CompileTimeErrorCode.extendsNonClass: [DataDriven.new], // TODO(brianwilkerson): The following fix fails if an invocation of the // function is the argument that needs to be removed. // CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS: [ @@ -103,53 +103,41 @@ class BulkFixProcessor { // CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED: [ // DataDriven.newInstance, // ], - CompileTimeErrorCode.IMPLEMENTS_NON_CLASS: [DataDriven.new], - CompileTimeErrorCode.INVALID_OVERRIDE: [DataDriven.new], - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER: [DataDriven.new], - CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT: [DataDriven.new], - CompileTimeErrorCode.MIXIN_OF_NON_CLASS: [DataDriven.new], - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT: [ + CompileTimeErrorCode.implementsNonClass: [DataDriven.new], + CompileTimeErrorCode.invalidOverride: [DataDriven.new], + CompileTimeErrorCode.invalidOverrideSetter: [DataDriven.new], + CompileTimeErrorCode.missingRequiredArgument: [DataDriven.new], + CompileTimeErrorCode.mixinOfNonClass: [DataDriven.new], + CompileTimeErrorCode.newWithUndefinedConstructorDefault: [DataDriven.new], + CompileTimeErrorCode.nonTypeAsTypeArgument: [DataDriven.new], + CompileTimeErrorCode.notEnoughPositionalArgumentsNamePlural: [ DataDriven.new, ], - CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT: [DataDriven.new], - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL: [ + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular: [ DataDriven.new, ], - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR: [ + CompileTimeErrorCode.notEnoughPositionalArgumentsPlural: [DataDriven.new], + CompileTimeErrorCode.notEnoughPositionalArgumentsSingular: [DataDriven.new], + CompileTimeErrorCode.undefinedClass: [DataDriven.new], + CompileTimeErrorCode.undefinedExtensionGetter: [DataDriven.new], + CompileTimeErrorCode.undefinedFunction: [DataDriven.new], + CompileTimeErrorCode.undefinedGetter: [DataDriven.new], + CompileTimeErrorCode.undefinedIdentifier: [DataDriven.new], + CompileTimeErrorCode.undefinedMethod: [DataDriven.new], + CompileTimeErrorCode.undefinedNamedParameter: [DataDriven.new], + CompileTimeErrorCode.undefinedSetter: [DataDriven.new], + CompileTimeErrorCode.wrongNumberOfTypeArguments: [DataDriven.new], + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor: [ DataDriven.new, ], - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_PLURAL: [ - DataDriven.new, - ], - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_SINGULAR: [ - DataDriven.new, - ], - CompileTimeErrorCode.UNDEFINED_CLASS: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_FUNCTION: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_GETTER: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_IDENTIFIER: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_METHOD: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_SETTER: [DataDriven.new], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS: [DataDriven.new], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR: [ - DataDriven.new, - ], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION: [ - DataDriven.new, - ], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD: [ - DataDriven.new, - ], - HintCode.DEPRECATED_MEMBER_USE: [DataDriven.new], - HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE: [DataDriven.new], - HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE: [ - DataDriven.new, - ], - HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE: [DataDriven.new], - WarningCode.DEPRECATED_EXPORT_USE: [DataDriven.new], - WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD: [DataDriven.new], + CompileTimeErrorCode.wrongNumberOfTypeArgumentsExtension: [DataDriven.new], + CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod: [DataDriven.new], + HintCode.deprecatedMemberUse: [DataDriven.new], + HintCode.deprecatedMemberUseFromSamePackage: [DataDriven.new], + HintCode.deprecatedMemberUseFromSamePackageWithMessage: [DataDriven.new], + HintCode.deprecatedMemberUseWithMessage: [DataDriven.new], + WarningCode.deprecatedExportUse: [DataDriven.new], + WarningCode.overrideOnNonOverridingMethod: [DataDriven.new], }; /// Cached results of [_canBulkFix]. @@ -449,7 +437,7 @@ class BulkFixProcessor { details.add( BulkFix(pubspecFile.path, [ BulkFixDetail( - PubspecWarningCode.MISSING_DEPENDENCY.name.toLowerCase(), + PubspecWarningCode.missingDependency.name.toLowerCase(), 1, ), ]), @@ -662,9 +650,9 @@ class BulkFixProcessor { directivesOrderingError = diagnostic; break; } - } else if (diagnosticCode == WarningCode.DUPLICATE_IMPORT || - diagnosticCode == HintCode.UNNECESSARY_IMPORT || - diagnosticCode == WarningCode.UNUSED_IMPORT) { + } else if (diagnosticCode == WarningCode.duplicateImport || + diagnosticCode == HintCode.unnecessaryImport || + diagnosticCode == WarningCode.unusedImport) { unusedImportDiagnostics.add(diagnostic); } } @@ -1147,9 +1135,9 @@ extension on Diagnostic { bool get isFixable { // Special cases that can be bulk fixed by this class but not by // FixProcessor. - if (diagnosticCode == WarningCode.DUPLICATE_IMPORT || - diagnosticCode == HintCode.UNNECESSARY_IMPORT || - diagnosticCode == WarningCode.UNUSED_IMPORT || + if (diagnosticCode == WarningCode.duplicateImport || + diagnosticCode == HintCode.unnecessaryImport || + diagnosticCode == WarningCode.unusedImport || (DirectivesOrdering.allCodes.contains(diagnosticCode))) { return true; } diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart index 3ee887565d6..ceaf9f35f62 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_comparison.dart @@ -38,21 +38,20 @@ class RemoveComparison extends ResolvedCorrectionProducer { /// Whether the condition will always return `false`. bool get _conditionIsFalse { var diagnosticCode = (diagnostic as Diagnostic).diagnosticCode; - return diagnosticCode == WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE || + return diagnosticCode == WarningCode.unnecessaryNanComparisonFalse || diagnosticCode == - WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE || - diagnosticCode == - WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE || - diagnosticCode == WarningCode.UNNECESSARY_TYPE_CHECK_FALSE; + WarningCode.unnecessaryNullComparisonAlwaysNullFalse || + diagnosticCode == WarningCode.unnecessaryNullComparisonNeverNullFalse || + diagnosticCode == WarningCode.unnecessaryTypeCheckFalse; } /// Whether the condition will always return `true`. bool get _conditionIsTrue { var errorCode = (diagnostic as Diagnostic).diagnosticCode; - return errorCode == WarningCode.UNNECESSARY_NAN_COMPARISON_TRUE || - errorCode == WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE || - errorCode == WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE || - errorCode == WarningCode.UNNECESSARY_TYPE_CHECK_TRUE || + return errorCode == WarningCode.unnecessaryNanComparisonTrue || + errorCode == WarningCode.unnecessaryNullComparisonAlwaysNullTrue || + errorCode == WarningCode.unnecessaryNullComparisonNeverNullTrue || + errorCode == WarningCode.unnecessaryTypeCheckTrue || errorCode == LinterLintCode.avoid_null_checks_in_equality_operators; } diff --git a/pkg/analysis_server/lib/src/services/correction/fix/analysis_options/fix_generator.dart b/pkg/analysis_server/lib/src/services/correction/fix/analysis_options/fix_generator.dart index 8f6595145bf..d5bbd0dff86 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/analysis_options/fix_generator.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/analysis_options/fix_generator.dart @@ -31,12 +31,12 @@ import 'package:yaml_edit/yaml_edit.dart'; /// The generator used to generate fixes in analysis options files. class AnalysisOptionsFixGenerator { static const List codesWithFixes = [ - AnalysisOptionsWarningCode.DEPRECATED_LINT, - AnalysisOptionsWarningCode.ANALYSIS_OPTION_DEPRECATED_WITH_REPLACEMENT, - AnalysisOptionsWarningCode.DUPLICATE_RULE, - AnalysisOptionsWarningCode.REMOVED_LINT, - AnalysisOptionsWarningCode.UNDEFINED_LINT, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES, + AnalysisOptionsWarningCode.deprecatedLint, + AnalysisOptionsWarningCode.analysisOptionDeprecatedWithReplacement, + AnalysisOptionsWarningCode.duplicateRule, + AnalysisOptionsWarningCode.removedLint, + AnalysisOptionsWarningCode.undefinedLint, + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues, ]; /// The resource provider used to access the file system. @@ -91,8 +91,7 @@ class AnalysisOptionsFixGenerator { } if (diagnosticCode == - AnalysisOptionsWarningCode - .ANALYSIS_OPTION_DEPRECATED_WITH_REPLACEMENT) { + AnalysisOptionsWarningCode.analysisOptionDeprecatedWithReplacement) { var analyzerMap = options['analyzer']; if (analyzerMap is! YamlMap) { return fixes; @@ -116,13 +115,13 @@ class AnalysisOptionsFixGenerator { strongModeMap, ); } - } else if (diagnosticCode == AnalysisOptionsWarningCode.DEPRECATED_LINT || - diagnosticCode == AnalysisOptionsWarningCode.DUPLICATE_RULE || - diagnosticCode == AnalysisOptionsWarningCode.REMOVED_LINT || - diagnosticCode == AnalysisOptionsWarningCode.UNDEFINED_LINT) { + } else if (diagnosticCode == AnalysisOptionsWarningCode.deprecatedLint || + diagnosticCode == AnalysisOptionsWarningCode.duplicateRule || + diagnosticCode == AnalysisOptionsWarningCode.removedLint || + diagnosticCode == AnalysisOptionsWarningCode.undefinedLint) { await _addFix_removeLint(coveringNodePath); } else if (diagnosticCode == - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES) { + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues) { await _addFix_removeSetting(coveringNodePath); } return fixes; diff --git a/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart b/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart index 42c9399c2bf..e8155430c14 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix/pubspec/fix_generator.dart @@ -25,8 +25,8 @@ import 'package:yaml/yaml.dart'; /// The generator used to generate fixes in pubspec.yaml files. class PubspecFixGenerator { static const List codesWithFixes = [ - PubspecWarningCode.MISSING_DEPENDENCY, - PubspecWarningCode.MISSING_NAME, + PubspecWarningCode.missingDependency, + PubspecWarningCode.missingName, ]; /// The resource provider used to access the file system. @@ -93,40 +93,37 @@ class PubspecFixGenerator { return fixes; } - if (diagnosticCode == PubspecWarningCode.ASSET_DOES_NOT_EXIST) { + if (diagnosticCode == PubspecWarningCode.assetDoesNotExist) { // Consider replacing the path with a valid path. } else if (diagnosticCode == - PubspecWarningCode.ASSET_DIRECTORY_DOES_NOT_EXIST) { + PubspecWarningCode.assetDirectoryDoesNotExist) { // Consider replacing the path with a valid path. // Consider creating the directory. - } else if (diagnosticCode == PubspecWarningCode.ASSET_FIELD_NOT_LIST) { + } else if (diagnosticCode == PubspecWarningCode.assetFieldNotList) { // Not sure how to fix a structural issue. - } else if (diagnosticCode == PubspecWarningCode.ASSET_NOT_STRING) { + } else if (diagnosticCode == PubspecWarningCode.assetNotString) { // Not sure how to fix a structural issue. - } else if (diagnosticCode == - PubspecWarningCode.DEPENDENCIES_FIELD_NOT_MAP) { + } else if (diagnosticCode == PubspecWarningCode.dependenciesFieldNotMap) { // Not sure how to fix a structural issue. - } else if (diagnosticCode == PubspecWarningCode.DEPRECATED_FIELD) { + } else if (diagnosticCode == PubspecWarningCode.deprecatedField) { // Consider removing the field. - } else if (diagnosticCode == PubspecWarningCode.FLUTTER_FIELD_NOT_MAP) { + } else if (diagnosticCode == PubspecWarningCode.flutterFieldNotMap) { // Not sure how to fix a structural issue. - } else if (diagnosticCode == PubspecWarningCode.INVALID_DEPENDENCY) { + } else if (diagnosticCode == PubspecWarningCode.invalidDependency) { // Consider adding `publish_to: none`. - } else if (diagnosticCode == PubspecWarningCode.MISSING_NAME) { + } else if (diagnosticCode == PubspecWarningCode.missingName) { await _addNameEntry(); - } else if (diagnosticCode == PubspecWarningCode.NAME_NOT_STRING) { + } else if (diagnosticCode == PubspecWarningCode.nameNotString) { // Not sure how to fix a structural issue. - } else if (diagnosticCode == PubspecWarningCode.PATH_DOES_NOT_EXIST) { + } else if (diagnosticCode == PubspecWarningCode.pathDoesNotExist) { // Consider replacing the path with a valid path. - } else if (diagnosticCode == PubspecWarningCode.PATH_NOT_POSIX) { + } else if (diagnosticCode == PubspecWarningCode.pathNotPosix) { // Consider converting to a POSIX-style path. - } else if (diagnosticCode == - PubspecWarningCode.PATH_PUBSPEC_DOES_NOT_EXIST) { + } else if (diagnosticCode == PubspecWarningCode.pathPubspecDoesNotExist) { // Consider replacing the path with a valid path. - } else if (diagnosticCode == - PubspecWarningCode.UNNECESSARY_DEV_DEPENDENCY) { + } else if (diagnosticCode == PubspecWarningCode.unnecessaryDevDependency) { // Consider removing the dependency. - } else if (diagnosticCode == PubspecWarningCode.MISSING_DEPENDENCY) { + } else if (diagnosticCode == PubspecWarningCode.missingDependency) { await _addMissingDependency(diagnosticCode); } return fixes; diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart index 71baa637f91..8eb33d96e56 100644 --- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart +++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart @@ -579,418 +579,390 @@ final _builtInLintMultiGenerators = { }; final _builtInNonLintGenerators = >{ - CompileTimeErrorCode.ABSTRACT_FIELD_INITIALIZER: [ + CompileTimeErrorCode.abstractFieldInitializer: [ RemoveAbstract.new, RemoveInitializer.new, ], - CompileTimeErrorCode.ABSTRACT_FIELD_CONSTRUCTOR_INITIALIZER: [ + CompileTimeErrorCode.abstractFieldConstructorInitializer: [ RemoveAbstract.new, RemoveInitializer.new, ], - CompileTimeErrorCode.ASSERT_IN_REDIRECTING_CONSTRUCTOR: [RemoveAssertion.new], - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL: [ - MakeFieldNotFinal.new, - AddLate.new, - ], - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL: [MakeVariableNotFinal.new], - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE: [ + CompileTimeErrorCode.assertInRedirectingConstructor: [RemoveAssertion.new], + CompileTimeErrorCode.assignmentToFinal: [MakeFieldNotFinal.new, AddLate.new], + CompileTimeErrorCode.assignmentToFinalLocal: [MakeVariableNotFinal.new], + CompileTimeErrorCode.argumentTypeNotAssignable: [ AddExplicitCast.new, AddNullCheck.new, WrapInText.new, AddAwait.argumentType, ], - CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT: [AddAsync.new], - CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA: [RemoveLexeme.modifier], - CompileTimeErrorCode.AWAIT_IN_LATE_LOCAL_VARIABLE_INITIALIZER: [ - RemoveLate.new, - ], - CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT: [AddAsync.new], - CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY: [AddAsync.missingReturn], - CompileTimeErrorCode.CAST_TO_NON_TYPE: [ChangeTo.classOrMixin], - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_STATIC_MEMBER: [ + CompileTimeErrorCode.asyncForInWrongContext: [AddAsync.new], + CompileTimeErrorCode.augmentationModifierExtra: [RemoveLexeme.modifier], + CompileTimeErrorCode.awaitInLateLocalVariableInitializer: [RemoveLate.new], + CompileTimeErrorCode.awaitInWrongContext: [AddAsync.new], + CompileTimeErrorCode.bodyMightCompleteNormally: [AddAsync.missingReturn], + CompileTimeErrorCode.castToNonType: [ChangeTo.classOrMixin], + CompileTimeErrorCode.classInstantiationAccessToStaticMember: [ RemoveTypeArguments.new, ], - CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER: [ + CompileTimeErrorCode.concreteClassWithAbstractMember: [ ConvertIntoBlockBody.missingBody, CreateNoSuchMethod.new, MakeClassAbstract.new, ], - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE: [ + CompileTimeErrorCode.constInitializedWithNonConstantValue: [ RemoveConst.new, RemoveNew.new, ], - CompileTimeErrorCode.CONST_INSTANCE_FIELD: [AddStatic.new], - CompileTimeErrorCode.CONST_WITH_NON_CONST: [RemoveConst.new], - CompileTimeErrorCode.CONST_WITH_NON_TYPE: [ChangeTo.classOrMixin], - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION: [ - AddConst.new, - ], - CompileTimeErrorCode.DEFAULT_VALUE_ON_REQUIRED_PARAMETER: [ + CompileTimeErrorCode.constInstanceField: [AddStatic.new], + CompileTimeErrorCode.constWithNonConst: [RemoveConst.new], + CompileTimeErrorCode.constWithNonType: [ChangeTo.classOrMixin], + CompileTimeErrorCode.constantPatternWithNonConstantExpression: [AddConst.new], + CompileTimeErrorCode.defaultValueOnRequiredParameter: [ RemoveDefaultValue.new, RemoveRequired.new, ], - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_GETTER: [ + CompileTimeErrorCode.dotShorthandUndefinedGetter: [ AddEnumConstant.new, ChangeTo.getterOrSetter, CreateGetter.new, CreateField.new, ], - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION: [ + CompileTimeErrorCode.dotShorthandUndefinedInvocation: [ ChangeTo.method, CreateConstructor.new, CreateMethod.method, ], - CompileTimeErrorCode.EMPTY_MAP_PATTERN: [ + CompileTimeErrorCode.emptyMapPattern: [ ReplaceEmptyMapPattern.any, ReplaceEmptyMapPattern.empty, ], - CompileTimeErrorCode.ENUM_WITH_ABSTRACT_MEMBER: [ + CompileTimeErrorCode.enumWithAbstractMember: [ ConvertIntoBlockBody.missingBody, ], - CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS: [ + CompileTimeErrorCode.extendsDisallowedClass: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.EXTENDS_NON_CLASS: [ + CompileTimeErrorCode.extendsNonClass: [ ChangeTo.classOrMixin, RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.EXTENDS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER: [ + CompileTimeErrorCode.extendsTypeAliasExpandsToTypeParameter: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT: [ + CompileTimeErrorCode.extensionDeclaresMemberOfObject: [ RemoveMethodDeclaration.new, ], - CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD: [ - ConvertIntoGetter.new, - ], - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT: [ + CompileTimeErrorCode.extensionDeclaresInstanceField: [ConvertIntoGetter.new], + CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject: [ RemoveMethodDeclaration.new, ], - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD: [ + CompileTimeErrorCode.extensionTypeDeclaresInstanceField: [ ConvertIntoGetter.new, ], - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER: [ + CompileTimeErrorCode.extensionOverrideAccessToStaticMember: [ ReplaceWithExtensionName.new, ], - CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE: [ + CompileTimeErrorCode.extensionOverrideWithCascade: [ ReplaceCascadeWithDot.new, ], - CompileTimeErrorCode.EXTENSION_TYPE_WITH_ABSTRACT_MEMBER: [ + CompileTimeErrorCode.extensionTypeWithAbstractMember: [ ConvertIntoBlockBody.missingBody, ], - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS: [CreateConstructor.new], - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED: [ + CompileTimeErrorCode.extraPositionalArguments: [CreateConstructor.new], + CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed: [ CreateConstructor.new, ConvertToNamedArguments.new, ], - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY: [ + CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY: [ + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.FINAL_NOT_INITIALIZED: [ + CompileTimeErrorCode.finalNotInitialized: [ AddLate.new, CreateConstructorForFinalFields.requiredNamed, CreateConstructorForFinalFields.requiredPositional, ], - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1: [ + CompileTimeErrorCode.finalNotInitializedConstructor1: [ AddFieldFormalParameters.new, AddFieldFormalParameters.requiredNamed, ], - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2: [ + CompileTimeErrorCode.finalNotInitializedConstructor2: [ AddFieldFormalParameters.new, AddFieldFormalParameters.requiredNamed, ], - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS: [ + CompileTimeErrorCode.finalNotInitializedConstructor3Plus: [ AddFieldFormalParameters.new, AddFieldFormalParameters.requiredNamed, ], - CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE: [AddAwait.forIn], - CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE: [ + CompileTimeErrorCode.forInOfInvalidType: [AddAwait.forIn], + CompileTimeErrorCode.illegalAsyncGeneratorReturnType: [ ReplaceReturnTypeStream.new, ], - CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE: [ + CompileTimeErrorCode.illegalAsyncReturnType: [ ReplaceReturnTypeFuture.new, RemoveAsync.new, ], - CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE: [ + CompileTimeErrorCode.illegalSyncGeneratorReturnType: [ ReplaceReturnTypeIterable.new, ], - CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS: [ + CompileTimeErrorCode.implementsDisallowedClass: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.IMPLEMENTS_NON_CLASS: [ChangeTo.classOrMixin], - CompileTimeErrorCode.IMPLEMENTS_REPEATED: [ + CompileTimeErrorCode.implementsNonClass: [ChangeTo.classOrMixin], + CompileTimeErrorCode.implementsRepeated: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS: [ + CompileTimeErrorCode.implementsSuperClass: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER: [ + CompileTimeErrorCode.implementsTypeAliasExpandsToTypeParameter: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS: [ + CompileTimeErrorCode.implicitSuperInitializerMissingArguments: [ AddSuperParameter.new, ], - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER: [ + CompileTimeErrorCode.implicitThisReferenceInInitializer: [ ConvertIntoGetter.implicitThis, AddLate.implicitThis, ], - CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY: [RemoveUnusedImport.new], - CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY: [RemoveUnusedImport.new], - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD: [ + CompileTimeErrorCode.importOfNonLibrary: [RemoveUnusedImport.new], + CompileTimeErrorCode.importInternalLibrary: [RemoveUnusedImport.new], + CompileTimeErrorCode.initializingFormalForNonExistentField: [ ChangeTo.field, CreateField.new, ], - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER: [ - ChangeToStaticAccess.new, - ], - CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE: [ + CompileTimeErrorCode.instanceAccessToStaticMember: [ChangeToStaticAccess.new], + CompileTimeErrorCode.integerLiteralImpreciseAsDouble: [ ChangeToNearestPreciseValue.new, ], - CompileTimeErrorCode.INVALID_ANNOTATION: [ChangeTo.annotation], - CompileTimeErrorCode.INVALID_ASSIGNMENT: [ + CompileTimeErrorCode.invalidAnnotation: [ChangeTo.annotation], + CompileTimeErrorCode.invalidAssignment: [ AddExplicitCast.new, AddNullCheck.new, ChangeTypeAnnotation.new, MakeVariableNullable.new, AddAwait.assignment, ], - CompileTimeErrorCode.INVALID_CONSTANT: [RemoveConst.new], - CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR: [RemoveLexeme.modifier], - CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER: [RemoveLexeme.modifier], - CompileTimeErrorCode.INVALID_USE_OF_COVARIANT: [RemoveLexeme.keyword], - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION: [ + CompileTimeErrorCode.invalidConstant: [RemoveConst.new], + CompileTimeErrorCode.invalidModifierOnConstructor: [RemoveLexeme.modifier], + CompileTimeErrorCode.invalidModifierOnSetter: [RemoveLexeme.modifier], + CompileTimeErrorCode.invalidUseOfCovariant: [RemoveLexeme.keyword], + CompileTimeErrorCode.invocationOfNonFunctionExpression: [ RemoveParenthesesInGetterInvocation.new, ], - CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED: [ + CompileTimeErrorCode.lateFinalLocalAlreadyAssigned: [ MakeVariableNotFinal.new, ], - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY: [ + CompileTimeErrorCode.listElementTypeNotAssignableNullability: [ ConvertToNullAwareListElement.new, ], - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE_NULLABILITY: [ + CompileTimeErrorCode.mapKeyTypeNotAssignableNullability: [ ConvertToNullAwareMapEntryKey.new, ], - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE_NULLABILITY: [ + CompileTimeErrorCode.mapValueTypeNotAssignableNullability: [ ConvertToNullAwareMapEntryValue.new, ], - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER: [ + CompileTimeErrorCode.missingDefaultValueForParameter: [ AddRequiredKeyword.new, MakeVariableNullable.new, ], - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL: [ + CompileTimeErrorCode.missingDefaultValueForParameterPositional: [ MakeVariableNullable.new, ], - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_WITH_ANNOTATION: [ + CompileTimeErrorCode.missingDefaultValueForParameterWithAnnotation: [ AddRequiredKeyword.new, ], - CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT: [ + CompileTimeErrorCode.missingRequiredArgument: [ AddMissingRequiredArgument.new, ], - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE: [ + CompileTimeErrorCode.mixinApplicationNotImplementedInterface: [ ExtendClassForMixin.new, ], - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT: [ + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject: [ RemoveExtendsClause.new, ], - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE: [ + CompileTimeErrorCode.mixinSubtypeOfBaseIsNotBase: [ AddClassModifier.baseModifier, ], - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE: [ + CompileTimeErrorCode.mixinSubtypeOfFinalIsNotBase: [ AddClassModifier.baseModifier, ], - CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS: [ + CompileTimeErrorCode.mixinOfDisallowedClass: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.MIXIN_OF_NON_CLASS: [ChangeTo.classOrMixin], - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS: [ + CompileTimeErrorCode.mixinOfNonClass: [ChangeTo.classOrMixin], + CompileTimeErrorCode.mixinSuperClassConstraintDisallowedClass: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE: [ + CompileTimeErrorCode.mixinSuperClassConstraintNonInterface: [ RemoveNameFromDeclarationClause.new, ], - CompileTimeErrorCode.NEW_WITH_NON_TYPE: [ChangeTo.classOrMixin], - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR: [CreateConstructor.new], - CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS: [ + CompileTimeErrorCode.newWithNonType: [ChangeTo.classOrMixin], + CompileTimeErrorCode.newWithUndefinedConstructor: [CreateConstructor.new], + CompileTimeErrorCode.noAnnotationConstructorArguments: [ AddEmptyArgumentList.new, ], - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS: [ + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFivePlus: [ CreateMissingOverrides.new, CreateNoSuchMethod.new, MakeClassAbstract.new, ], - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR: [ + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFour: [ CreateMissingOverrides.new, CreateNoSuchMethod.new, MakeClassAbstract.new, ], - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE: [ + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne: [ CreateMissingOverrides.new, CreateNoSuchMethod.new, MakeClassAbstract.new, ], - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE: [ + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberThree: [ CreateMissingOverrides.new, CreateNoSuchMethod.new, MakeClassAbstract.new, ], - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO: [ + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberTwo: [ CreateMissingOverrides.new, CreateNoSuchMethod.new, MakeClassAbstract.new, ], - CompileTimeErrorCode.NON_BOOL_CONDITION: [AddNeNull.new, AddAwait.nonBool], - CompileTimeErrorCode.NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR: [AddConst.new], - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT: [RemoveConst.new], - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY: [ + CompileTimeErrorCode.nonBoolCondition: [AddNeNull.new, AddAwait.nonBool], + CompileTimeErrorCode.nonConstGenerativeEnumConstructor: [AddConst.new], + CompileTimeErrorCode.nonConstantListElement: [RemoveConst.new], + CompileTimeErrorCode.nonConstantListElementFromDeferredLibrary: [ RemoveConst.new, ], - CompileTimeErrorCode.NON_CONSTANT_MAP_ELEMENT: [RemoveConst.new], - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY: [RemoveConst.new], - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY: [ + CompileTimeErrorCode.nonConstantMapElement: [RemoveConst.new], + CompileTimeErrorCode.nonConstantMapKey: [RemoveConst.new], + CompileTimeErrorCode.nonConstantMapKeyFromDeferredLibrary: [RemoveConst.new], + CompileTimeErrorCode.nonConstantMapPatternKey: [AddConst.new], + CompileTimeErrorCode.nonConstantMapValue: [RemoveConst.new], + CompileTimeErrorCode.nonConstantMapValueFromDeferredLibrary: [ RemoveConst.new, ], - CompileTimeErrorCode.NON_CONSTANT_MAP_PATTERN_KEY: [AddConst.new], - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE: [RemoveConst.new], - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY: [ - RemoveConst.new, - ], - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION: [ - AddConst.new, - ], - CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT: [RemoveConst.new], - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION: [ + CompileTimeErrorCode.nonConstantRelationalPatternExpression: [AddConst.new], + CompileTimeErrorCode.nonConstantSetElement: [RemoveConst.new], + CompileTimeErrorCode.nonExhaustiveSwitchExpression: [ AddMissingSwitchCases.new, ], - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT: [ + CompileTimeErrorCode.nonExhaustiveSwitchStatement: [ AddMissingSwitchCases.new, ], - CompileTimeErrorCode.NON_FINAL_FIELD_IN_ENUM: [MakeFinal.new], - CompileTimeErrorCode.NOT_A_TYPE: [ChangeTo.classOrMixin], - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD: [ - AddLate.new, - ], - CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE: [ - RemoveQuestionMark.new, - ], - CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE: [ - RemoveQuestionMark.new, - ], - CompileTimeErrorCode.NULLABLE_TYPE_IN_ON_CLAUSE: [RemoveQuestionMark.new], - CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE: [RemoveQuestionMark.new], - CompileTimeErrorCode.OBSOLETE_COLON_FOR_DEFAULT_VALUE: [ + CompileTimeErrorCode.nonFinalFieldInEnum: [MakeFinal.new], + CompileTimeErrorCode.notAType: [ChangeTo.classOrMixin], + CompileTimeErrorCode.notInitializedNonNullableInstanceField: [AddLate.new], + CompileTimeErrorCode.nullableTypeInExtendsClause: [RemoveQuestionMark.new], + CompileTimeErrorCode.nullableTypeInImplementsClause: [RemoveQuestionMark.new], + CompileTimeErrorCode.nullableTypeInOnClause: [RemoveQuestionMark.new], + CompileTimeErrorCode.nullableTypeInWithClause: [RemoveQuestionMark.new], + CompileTimeErrorCode.obsoleteColonForDefaultValue: [ ReplaceColonWithEquals.new, ], - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA: [ + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma: [ AddTrailingComma.new, ], - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE: [ + CompileTimeErrorCode.returnOfInvalidTypeFromClosure: [ AddAsync.wrongReturnType, ], - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION: [ + CompileTimeErrorCode.returnOfInvalidTypeFromFunction: [ AddAsync.wrongReturnType, MakeReturnTypeNullable.new, ReplaceReturnType.new, ], - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD: [ + CompileTimeErrorCode.returnOfInvalidTypeFromMethod: [ AddAsync.wrongReturnType, MakeReturnTypeNullable.new, ReplaceReturnType.new, ], - CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY: [RemoveConst.new], - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY: [ + CompileTimeErrorCode.setElementFromDeferredLibrary: [RemoveConst.new], + CompileTimeErrorCode.setElementTypeNotAssignableNullability: [ ConvertToNullAwareSetElement.new, ], - CompileTimeErrorCode.SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY: [ - RemoveConst.new, - ], - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED: [ + CompileTimeErrorCode.spreadExpressionFromDeferredLibrary: [RemoveConst.new], + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed: [ AddClassModifier.baseModifier, AddClassModifier.finalModifier, AddClassModifier.sealedModifier, ], - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED: [ + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed: [ AddClassModifier.baseModifier, AddClassModifier.finalModifier, AddClassModifier.sealedModifier, ], - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED: - [RemoveTypeAnnotation.other], - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED: [ + CompileTimeErrorCode.superFormalParameterTypeIsNotSubtypeOfAssociated: [ + RemoveTypeAnnotation.other, + ], + CompileTimeErrorCode.superFormalParameterWithoutAssociatedNamed: [ ChangeTo.superFormalParameter, ], - CompileTimeErrorCode.SUPER_INVOCATION_NOT_LAST: [MakeSuperInvocationLast.new], - CompileTimeErrorCode.SWITCH_CASE_COMPLETES_NORMALLY: [AddSwitchCaseBreak.new], - CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME: [ChangeTo.classOrMixin], - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE: [ - AddNullCheck.new, - ], - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE: [ + CompileTimeErrorCode.superInvocationNotLast: [MakeSuperInvocationLast.new], + CompileTimeErrorCode.switchCaseCompletesNormally: [AddSwitchCaseBreak.new], + CompileTimeErrorCode.typeTestWithUndefinedName: [ChangeTo.classOrMixin], + CompileTimeErrorCode.uncheckedInvocationOfNullableValue: [AddNullCheck.new], + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue: [ AddNullCheck.new, ExtractLocalVariable.new, ReplaceWithNullAware.single, CreateExtensionMethod.new, ], - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE: [ + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue: [ AddNullCheck.new, CreateExtensionOperator.new, CreateOperator.new, ], - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE: [ + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue: [ AddNullCheck.new, ExtractLocalVariable.new, ReplaceWithNullAware.single, CreateExtensionGetter.new, CreateExtensionSetter.new, ], - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION: [ + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition: [ AddNullCheck.new, ], - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR: [ + CompileTimeErrorCode.uncheckedUseOfNullableValueAsIterator: [ AddNullCheck.new, ], - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD: [ + CompileTimeErrorCode.uncheckedUseOfNullableValueInSpread: [ AddNullCheck.new, ConvertToNullAwareSpread.new, ], - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH: [ + CompileTimeErrorCode.uncheckedUseOfNullableValueInYieldEach: [ AddNullCheck.new, ], - CompileTimeErrorCode.UNDEFINED_ANNOTATION: [ChangeTo.annotation], - CompileTimeErrorCode.UNDEFINED_CLASS: [ChangeTo.classOrMixin], - CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN: [ReplaceBooleanWithBool.new], - CompileTimeErrorCode.UNDEFINED_ENUM_CONSTANT: [ + CompileTimeErrorCode.undefinedAnnotation: [ChangeTo.annotation], + CompileTimeErrorCode.undefinedClass: [ChangeTo.classOrMixin], + CompileTimeErrorCode.undefinedClassBoolean: [ReplaceBooleanWithBool.new], + CompileTimeErrorCode.undefinedEnumConstant: [ AddEnumConstant.new, ChangeTo.getterOrSetter, CreateMethodOrFunction.new, ], - CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_NAMED: [ - CreateConstructor.new, - ], - CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_UNNAMED: [ - CreateConstructor.new, - ], - CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER: [ + CompileTimeErrorCode.undefinedEnumConstructorNamed: [CreateConstructor.new], + CompileTimeErrorCode.undefinedEnumConstructorUnnamed: [CreateConstructor.new], + CompileTimeErrorCode.undefinedExtensionGetter: [ ChangeTo.getterOrSetter, CreateExtensionGetter.new, CreateExtensionMethod.new, ], - CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD: [ + CompileTimeErrorCode.undefinedExtensionMethod: [ ChangeTo.method, CreateExtensionMethod.new, CreateMethod.method, ], - CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER: [ + CompileTimeErrorCode.undefinedExtensionSetter: [ ChangeTo.getterOrSetter, CreateSetter.new, ], - CompileTimeErrorCode.UNDEFINED_FUNCTION: [ + CompileTimeErrorCode.undefinedFunction: [ ChangeTo.function, CreateFunction.new, ], - CompileTimeErrorCode.UNDEFINED_GETTER: [ + CompileTimeErrorCode.undefinedGetter: [ ChangeTo.getterOrSetter, CreateExtensionGetter.new, CreateField.new, @@ -998,7 +970,7 @@ final _builtInNonLintGenerators = >{ CreateLocalVariable.new, CreateMethodOrFunction.new, ], - CompileTimeErrorCode.UNDEFINED_IDENTIFIER: [ + CompileTimeErrorCode.undefinedIdentifier: [ ChangeTo.getterOrSetter, CreateField.new, CreateGetter.new, @@ -1010,427 +982,387 @@ final _builtInNonLintGenerators = >{ CreateExtensionMethod.new, CreateExtensionSetter.new, ], - CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT: [AddAsync.new], - CompileTimeErrorCode.UNDEFINED_METHOD: [ + CompileTimeErrorCode.undefinedIdentifierAwait: [AddAsync.new], + CompileTimeErrorCode.undefinedMethod: [ ChangeTo.method, CreateExtensionMethod.new, CreateFunction.new, CreateMethod.method, ], - CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER: [ + CompileTimeErrorCode.undefinedNamedParameter: [ AddMissingParameterNamed.new, ConvertFlutterChild.new, ConvertFlutterChildren.new, ], - CompileTimeErrorCode.UNDEFINED_OPERATOR: [ + CompileTimeErrorCode.undefinedOperator: [ CreateExtensionOperator.new, CreateOperator.new, ], - CompileTimeErrorCode.UNDEFINED_SETTER: [ + CompileTimeErrorCode.undefinedSetter: [ ChangeTo.getterOrSetter, CreateExtensionSetter.new, CreateField.new, CreateSetter.new, ], - CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER: [ + CompileTimeErrorCode.unqualifiedReferenceToNonLocalStaticMember: [ // TODO(brianwilkerson): Consider adding fixes to create a field, getter, // method or setter. The existing _addFix methods would need to be // updated so that only the appropriate subset is generated. QualifyReference.new, ], - CompileTimeErrorCode - .UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE: [ + CompileTimeErrorCode.unqualifiedReferenceToStaticMemberOfExtendedType: [ // TODO(brianwilkerson): Consider adding fixes to create a field, getter, // method or setter. The existing producers would need to be updated so // that only the appropriate subset is generated. QualifyReference.new, ], - CompileTimeErrorCode.URI_DOES_NOT_EXIST: [CreateFile.new], - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT: [ - RemoveVar.new, - ], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR: [ + CompileTimeErrorCode.uriDoesNotExist: [CreateFile.new], + ParserErrorCode.variablePatternKeywordInDeclarationContext: [RemoveVar.new], + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor: [ MoveTypeArgumentsToClass.new, RemoveTypeArguments.new, ], - CompileTimeErrorCode.YIELD_OF_INVALID_TYPE: [MakeReturnTypeNullable.new], - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS: [ + CompileTimeErrorCode.yieldOfInvalidType: [MakeReturnTypeNullable.new], + FfiCode.subtypeOfStructClassInExtends: [RemoveNameFromDeclarationClause.new], + FfiCode.subtypeOfStructClassInImplements: [ RemoveNameFromDeclarationClause.new, ], - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS: [ - RemoveNameFromDeclarationClause.new, - ], - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH: [ - RemoveNameFromDeclarationClause.new, - ], - HintCode.DEPRECATED_COLON_FOR_DEFAULT_VALUE: [ReplaceColonWithEquals.new], - HintCode.UNNECESSARY_IMPORT: [RemoveUnusedImport.new], - ParserErrorCode.ABSTRACT_CLASS_MEMBER: [RemoveAbstract.bulkFixable], - ParserErrorCode.ABSTRACT_STATIC_FIELD: [RemoveLexeme.modifier], - ParserErrorCode.ABSTRACT_STATIC_METHOD: [RemoveLexeme.modifier], - ParserErrorCode.COLON_IN_PLACE_OF_IN: [ReplaceColonWithIn.new], - ParserErrorCode.CONST_CLASS: [RemoveConst.new], - ParserErrorCode.CONST_FACTORY: [RemoveConst.new], - ParserErrorCode.CONST_METHOD: [RemoveConst.new], - ParserErrorCode.COVARIANT_MEMBER: [RemoveLexeme.modifier], - ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION: [ReplaceWithWildcard.new], - ParserErrorCode.DUPLICATED_MODIFIER: [RemoveLexeme.modifier], - ParserErrorCode.EMPTY_RECORD_LITERAL_WITH_COMMA: [ - RemoveComma.emptyRecordLiteral, - ], - ParserErrorCode.EMPTY_RECORD_TYPE_WITH_COMMA: [RemoveComma.emptyRecordType], - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_CLASS_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_EXTENSION_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_EXTENSION_TYPE_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_FINALLY_CLAUSE_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_MIXIN_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_SWITCH_EXPRESSION_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_TRY_STATEMENT_BODY: [InsertBody.new], - ParserErrorCode.EXPECTED_TOKEN: [ + FfiCode.subtypeOfStructClassInWith: [RemoveNameFromDeclarationClause.new], + HintCode.deprecatedColonForDefaultValue: [ReplaceColonWithEquals.new], + HintCode.unnecessaryImport: [RemoveUnusedImport.new], + ParserErrorCode.abstractClassMember: [RemoveAbstract.bulkFixable], + ParserErrorCode.abstractStaticField: [RemoveLexeme.modifier], + ParserErrorCode.abstractStaticMethod: [RemoveLexeme.modifier], + ParserErrorCode.colonInPlaceOfIn: [ReplaceColonWithIn.new], + ParserErrorCode.constClass: [RemoveConst.new], + ParserErrorCode.constFactory: [RemoveConst.new], + ParserErrorCode.constMethod: [RemoveConst.new], + ParserErrorCode.covariantMember: [RemoveLexeme.modifier], + ParserErrorCode.defaultInSwitchExpression: [ReplaceWithWildcard.new], + ParserErrorCode.duplicatedModifier: [RemoveLexeme.modifier], + ParserErrorCode.emptyRecordLiteralWithComma: [RemoveComma.emptyRecordLiteral], + ParserErrorCode.emptyRecordTypeWithComma: [RemoveComma.emptyRecordType], + ParserErrorCode.expectedCatchClauseBody: [InsertBody.new], + ParserErrorCode.expectedClassBody: [InsertBody.new], + ParserErrorCode.expectedExtensionBody: [InsertBody.new], + ParserErrorCode.expectedExtensionTypeBody: [InsertBody.new], + ParserErrorCode.expectedFinallyClauseBody: [InsertBody.new], + ParserErrorCode.expectedMixinBody: [InsertBody.new], + ParserErrorCode.expectedSwitchExpressionBody: [InsertBody.new], + ParserErrorCode.expectedSwitchStatementBody: [InsertBody.new], + ParserErrorCode.expectedTryStatementBody: [InsertBody.new], + ParserErrorCode.expectedToken: [ InsertSemicolon.new, ReplaceWithArrow.new, InsertOnKeyword.new, ], - ParserErrorCode.EXTENSION_AUGMENTATION_HAS_ON_CLAUSE: [RemoveOnClause.new], - ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR: [RemoveConstructor.new], - ParserErrorCode.EXTERNAL_CLASS: [RemoveLexeme.modifier], - ParserErrorCode.EXTERNAL_ENUM: [RemoveLexeme.modifier], - ParserErrorCode.EXTERNAL_TYPEDEF: [RemoveLexeme.modifier], - ParserErrorCode.EXTRANEOUS_MODIFIER: [RemoveLexeme.modifier], - ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION: [RemoveLexeme.modifier], - ParserErrorCode.FINAL_ENUM: [RemoveLexeme.modifier], - ParserErrorCode.FINAL_CONSTRUCTOR: [RemoveLexeme.modifier], - ParserErrorCode.FINAL_METHOD: [RemoveLexeme.modifier], - ParserErrorCode.FINAL_MIXIN: [RemoveLexeme.modifier], - ParserErrorCode.FINAL_MIXIN_CLASS: [RemoveLexeme.modifier], - ParserErrorCode.GETTER_CONSTRUCTOR: [RemoveLexeme.keyword], - ParserErrorCode.GETTER_WITH_PARAMETERS: [ + ParserErrorCode.extensionAugmentationHasOnClause: [RemoveOnClause.new], + ParserErrorCode.extensionDeclaresConstructor: [RemoveConstructor.new], + ParserErrorCode.externalClass: [RemoveLexeme.modifier], + ParserErrorCode.externalEnum: [RemoveLexeme.modifier], + ParserErrorCode.externalTypedef: [RemoveLexeme.modifier], + ParserErrorCode.extraneousModifier: [RemoveLexeme.modifier], + ParserErrorCode.factoryTopLevelDeclaration: [RemoveLexeme.modifier], + ParserErrorCode.finalEnum: [RemoveLexeme.modifier], + ParserErrorCode.finalConstructor: [RemoveLexeme.modifier], + ParserErrorCode.finalMethod: [RemoveLexeme.modifier], + ParserErrorCode.finalMixin: [RemoveLexeme.modifier], + ParserErrorCode.finalMixinClass: [RemoveLexeme.modifier], + ParserErrorCode.getterConstructor: [RemoveLexeme.keyword], + ParserErrorCode.getterWithParameters: [ RemoveParametersInGetterDeclaration.new, ], - ParserErrorCode.INTERFACE_MIXIN: [RemoveLexeme.modifier], - ParserErrorCode.INTERFACE_MIXIN_CLASS: [RemoveLexeme.modifier], - ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY: [AddConst.new], - ParserErrorCode.INVALID_CONSTANT_PATTERN_GENERIC: [AddConst.new], - ParserErrorCode.INVALID_CONSTANT_PATTERN_NEGATION: [AddConst.new], - ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN: [SurroundWithParentheses.new], - ParserErrorCode.INVALID_USE_OF_COVARIANT_IN_EXTENSION: [ - RemoveLexeme.modifier, - ], - ParserErrorCode.LATE_PATTERN_VARIABLE_DECLARATION: [RemoveLate.new], - ParserErrorCode.LITERAL_WITH_NEW: [RemoveLexeme.keyword], - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE: [AddTypeAnnotation.new], - ParserErrorCode.MISSING_ENUM_BODY: [InsertBody.new], - ParserErrorCode.MISSING_FUNCTION_BODY: [ConvertIntoBlockBody.missingBody], - ParserErrorCode.MISSING_TYPEDEF_PARAMETERS: [AddEmptyArgumentList.new], - ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR: [RemoveConstructor.new], - ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE: [RemoveVarKeyword.new], - ParserErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA: [ + ParserErrorCode.interfaceMixin: [RemoveLexeme.modifier], + ParserErrorCode.interfaceMixinClass: [RemoveLexeme.modifier], + ParserErrorCode.invalidConstantPatternBinary: [AddConst.new], + ParserErrorCode.invalidConstantPatternGeneric: [AddConst.new], + ParserErrorCode.invalidConstantPatternNegation: [AddConst.new], + ParserErrorCode.invalidInsideUnaryPattern: [SurroundWithParentheses.new], + ParserErrorCode.invalidUseOfCovariantInExtension: [RemoveLexeme.modifier], + ParserErrorCode.latePatternVariableDeclaration: [RemoveLate.new], + ParserErrorCode.literalWithNew: [RemoveLexeme.keyword], + ParserErrorCode.missingConstFinalVarOrType: [AddTypeAnnotation.new], + ParserErrorCode.missingEnumBody: [InsertBody.new], + ParserErrorCode.missingFunctionBody: [ConvertIntoBlockBody.missingBody], + ParserErrorCode.missingTypedefParameters: [AddEmptyArgumentList.new], + ParserErrorCode.mixinDeclaresConstructor: [RemoveConstructor.new], + ParserErrorCode.patternAssignmentDeclaresVariable: [RemoveVarKeyword.new], + ParserErrorCode.recordLiteralOnePositionalNoTrailingComma: [ AddTrailingComma.new, ], - ParserErrorCode.RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA: [ + ParserErrorCode.recordTypeOnePositionalNoTrailingComma: [ AddTrailingComma.new, ], - ParserErrorCode.REPRESENTATION_FIELD_TRAILING_COMMA: [ + ParserErrorCode.representationFieldTrailingComma: [ RemoveComma.representationField, ], - ParserErrorCode.SEALED_MIXIN: [RemoveLexeme.modifier], - ParserErrorCode.SEALED_MIXIN_CLASS: [RemoveLexeme.modifier], - ParserErrorCode.SETTER_CONSTRUCTOR: [RemoveLexeme.keyword], - ParserErrorCode.STATIC_CONSTRUCTOR: [RemoveLexeme.keyword], - ParserErrorCode.STATIC_GETTER_WITHOUT_BODY: [ - ConvertIntoBlockBody.missingBody, - ], - ParserErrorCode.STATIC_SETTER_WITHOUT_BODY: [ - ConvertIntoBlockBody.missingBody, - ], - ParserErrorCode.STATIC_OPERATOR: [RemoveLexeme.keyword], - ParserErrorCode.VAR_AND_TYPE: [ + ParserErrorCode.sealedMixin: [RemoveLexeme.modifier], + ParserErrorCode.sealedMixinClass: [RemoveLexeme.modifier], + ParserErrorCode.setterConstructor: [RemoveLexeme.keyword], + ParserErrorCode.staticConstructor: [RemoveLexeme.keyword], + ParserErrorCode.staticGetterWithoutBody: [ConvertIntoBlockBody.missingBody], + ParserErrorCode.staticSetterWithoutBody: [ConvertIntoBlockBody.missingBody], + ParserErrorCode.staticOperator: [RemoveLexeme.keyword], + ParserErrorCode.varAndType: [ RemoveTypeAnnotation.fixVarAndType, RemoveVar.new, ], - ParserErrorCode.VAR_AS_TYPE_NAME: [ReplaceVarWithDynamic.new], - ParserErrorCode.VAR_RETURN_TYPE: [RemoveVar.new], - ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER: [ + ParserErrorCode.varAsTypeName: [ReplaceVarWithDynamic.new], + ParserErrorCode.varReturnType: [RemoveVar.new], + ParserErrorCode.wrongSeparatorForPositionalParameter: [ ReplaceColonWithEquals.new, ], - ScannerErrorCode.UNEXPECTED_SEPARATOR_IN_NUMBER: [ + ScannerErrorCode.unexpectedSeparatorInNumber: [ RemoveUnexpectedUnderscores.new, ], - StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION: [RemoveDeadIfNull.new], - StaticWarningCode.INVALID_NULL_AWARE_ELEMENT: [ + StaticWarningCode.deadNullAwareExpression: [RemoveDeadIfNull.new], + StaticWarningCode.invalidNullAwareElement: [ ReplaceWithNotNullAwareElementOrEntry.entry, ], - StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_KEY: [ + StaticWarningCode.invalidNullAwareMapEntryKey: [ ReplaceWithNotNullAwareElementOrEntry.mapKey, ], - StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_VALUE: [ + StaticWarningCode.invalidNullAwareMapEntryValue: [ ReplaceWithNotNullAwareElementOrEntry.mapValue, ], - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR: [ReplaceWithNotNullAware.new], - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT: [ + StaticWarningCode.invalidNullAwareOperator: [ReplaceWithNotNullAware.new], + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit: [ ReplaceWithNotNullAware.new, ], - StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH: [ + StaticWarningCode.missingEnumConstantInSwitch: [ AddMissingEnumCaseClauses.new, ], - StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION: [ - RemoveNonNullAssertion.new, - ], - StaticWarningCode.UNNECESSARY_NULL_CHECK_PATTERN: [RemoveQuestionMark.new], - StaticWarningCode.UNNECESSARY_NULL_ASSERT_PATTERN: [ - RemoveNonNullAssertion.new, - ], - WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE: [AddReturnNull.new], - WarningCode.DEAD_CODE: [RemoveDeadCode.new], - WarningCode.DEAD_CODE_CATCH_FOLLOWING_CATCH: [ + StaticWarningCode.unnecessaryNonNullAssertion: [RemoveNonNullAssertion.new], + StaticWarningCode.unnecessaryNullCheckPattern: [RemoveQuestionMark.new], + StaticWarningCode.unnecessaryNullAssertPattern: [RemoveNonNullAssertion.new], + WarningCode.bodyMightCompleteNormallyNullable: [AddReturnNull.new], + WarningCode.deadCode: [RemoveDeadCode.new], + WarningCode.deadCodeCatchFollowingCatch: [ // TODO(brianwilkerson): Add a fix to move the unreachable catch clause to // a place where it can be reached (when possible). RemoveDeadCode.new, ], - WarningCode.DEAD_CODE_LATE_WILDCARD_VARIABLE_INITIALIZER: [ + WarningCode.deadCodeLateWildcardVariableInitializer: [ RemoveInitializer.notLate, RemoveLate.new, ], - WarningCode.DEAD_CODE_ON_CATCH_SUBTYPE: [ + WarningCode.deadCodeOnCatchSubtype: [ // TODO(brianwilkerson): Add a fix to move the unreachable catch clause to // a place where it can be reached (when possible). RemoveDeadCode.new, ], - WarningCode.DEPRECATED_EXTEND: [RemoveExtendsClause.new], - WarningCode.DEPRECATED_IMPLEMENT: [RemoveNameFromDeclarationClause.new], - WarningCode.DEPRECATED_IMPLEMENTS_FUNCTION: [ + WarningCode.deprecatedExtend: [RemoveExtendsClause.new], + WarningCode.deprecatedImplement: [RemoveNameFromDeclarationClause.new], + WarningCode.deprecatedImplementsFunction: [ RemoveNameFromDeclarationClause.new, ], - WarningCode.DEPRECATED_NEW_IN_COMMENT_REFERENCE: [ + WarningCode.deprecatedNewInCommentReference: [ RemoveDeprecatedNewInCommentReference.new, ], - WarningCode.DEPRECATED_SUBCLASS: [RemoveNameFromDeclarationClause.new], - WarningCode.DUPLICATE_HIDDEN_NAME: [RemoveNameFromCombinator.new], - WarningCode.DUPLICATE_IMPORT: [RemoveUnusedImport.new], - WarningCode.DUPLICATE_SHOWN_NAME: [RemoveNameFromCombinator.new], - WarningCode.INVALID_ANNOTATION_TARGET: [RemoveAnnotation.new], - WarningCode.INVALID_INTERNAL_ANNOTATION: [RemoveAnnotation.new], - WarningCode.INVALID_LITERAL_ANNOTATION: [RemoveAnnotation.new], - WarningCode.INVALID_NON_VIRTUAL_ANNOTATION: [RemoveAnnotation.new], - WarningCode.INVALID_REOPEN_ANNOTATION: [RemoveAnnotation.new], - WarningCode.INVALID_REQUIRED_NAMED_PARAM: [RemoveAnnotation.new], - WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM: [ - RemoveAnnotation.new, - ], - WarningCode.INVALID_REQUIRED_POSITIONAL_PARAM: [RemoveAnnotation.new], - WarningCode.INVALID_VISIBILITY_ANNOTATION: [RemoveAnnotation.new], - WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION: [RemoveAnnotation.new], - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE: [ + WarningCode.deprecatedSubclass: [RemoveNameFromDeclarationClause.new], + WarningCode.duplicateHiddenName: [RemoveNameFromCombinator.new], + WarningCode.duplicateImport: [RemoveUnusedImport.new], + WarningCode.duplicateShownName: [RemoveNameFromCombinator.new], + WarningCode.invalidAnnotationTarget: [RemoveAnnotation.new], + WarningCode.invalidInternalAnnotation: [RemoveAnnotation.new], + WarningCode.invalidLiteralAnnotation: [RemoveAnnotation.new], + WarningCode.invalidNonVirtualAnnotation: [RemoveAnnotation.new], + WarningCode.invalidReopenAnnotation: [RemoveAnnotation.new], + WarningCode.invalidRequiredNamedParam: [RemoveAnnotation.new], + WarningCode.invalidRequiredOptionalPositionalParam: [RemoveAnnotation.new], + WarningCode.invalidRequiredPositionalParam: [RemoveAnnotation.new], + WarningCode.invalidVisibilityAnnotation: [RemoveAnnotation.new], + WarningCode.invalidVisibleForOverridingAnnotation: [RemoveAnnotation.new], + WarningCode.missingOverrideOfMustBeOverriddenOne: [ CreateMissingOverrides.new, ], - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO: [ + WarningCode.missingOverrideOfMustBeOverriddenTwo: [ CreateMissingOverrides.new, ], - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_THREE_PLUS: [ + WarningCode.missingOverrideOfMustBeOverriddenThreePlus: [ CreateMissingOverrides.new, ], - WarningCode.MISSING_REQUIRED_PARAM: [AddMissingRequiredArgument.new], - WarningCode.MISSING_REQUIRED_PARAM_WITH_DETAILS: [ - AddMissingRequiredArgument.new, - ], - WarningCode.MUST_CALL_SUPER: [AddCallSuper.new], - WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR_USING_NEW: [ + WarningCode.missingRequiredParam: [AddMissingRequiredArgument.new], + WarningCode.missingRequiredParamWithDetails: [AddMissingRequiredArgument.new], + WarningCode.mustCallSuper: [AddCallSuper.new], + WarningCode.nonConstCallToLiteralConstructorUsingNew: [ ReplaceNewWithConst.new, ], - WarningCode.NULL_CHECK_ALWAYS_FAILS: [RemoveNonNullAssertion.new], - WarningCode.NULLABLE_TYPE_IN_CATCH_CLAUSE: [RemoveQuestionMark.new], - WarningCode.OVERRIDE_ON_NON_OVERRIDING_FIELD: [RemoveAnnotation.new], - WarningCode.OVERRIDE_ON_NON_OVERRIDING_GETTER: [RemoveAnnotation.new], - WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD: [RemoveAnnotation.new], - WarningCode.OVERRIDE_ON_NON_OVERRIDING_SETTER: [RemoveAnnotation.new], - WarningCode.REDECLARE_ON_NON_REDECLARING_MEMBER: [RemoveAnnotation.new], - WarningCode.SDK_VERSION_GT_GT_GT_OPERATOR: [ - UpdateSdkConstraints.version_2_14_0, - ], - WarningCode.TEXT_DIRECTION_CODE_POINT_IN_COMMENT: [ + WarningCode.nullCheckAlwaysFails: [RemoveNonNullAssertion.new], + WarningCode.nullableTypeInCatchClause: [RemoveQuestionMark.new], + WarningCode.overrideOnNonOverridingField: [RemoveAnnotation.new], + WarningCode.overrideOnNonOverridingGetter: [RemoveAnnotation.new], + WarningCode.overrideOnNonOverridingMethod: [RemoveAnnotation.new], + WarningCode.overrideOnNonOverridingSetter: [RemoveAnnotation.new], + WarningCode.redeclareOnNonRedeclaringMember: [RemoveAnnotation.new], + WarningCode.sdkVersionGtGtGtOperator: [UpdateSdkConstraints.version_2_14_0], + WarningCode.textDirectionCodePointInComment: [ RemoveCharacter.new, ReplaceWithUnicodeEscape.new, ], - WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL: [ + WarningCode.textDirectionCodePointInLiteral: [ RemoveCharacter.new, ReplaceWithUnicodeEscape.new, ], - WarningCode.TYPE_CHECK_IS_NOT_NULL: [UseNotEqNull.new], - WarningCode.TYPE_CHECK_IS_NULL: [UseEqEqNull.new], - WarningCode.UNDEFINED_HIDDEN_NAME: [RemoveNameFromCombinator.new], - WarningCode.UNDEFINED_SHOWN_NAME: [RemoveNameFromCombinator.new], - WarningCode.UNNECESSARY_CAST: [RemoveUnnecessaryCast.new], - WarningCode.UNNECESSARY_FINAL: [RemoveUnnecessaryFinal.new], - WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE: [ + WarningCode.typeCheckIsNotNull: [UseNotEqNull.new], + WarningCode.typeCheckIsNull: [UseEqEqNull.new], + WarningCode.undefinedHiddenName: [RemoveNameFromCombinator.new], + WarningCode.undefinedShownName: [RemoveNameFromCombinator.new], + WarningCode.unnecessaryCast: [RemoveUnnecessaryCast.new], + WarningCode.unnecessaryFinal: [RemoveUnnecessaryFinal.new], + WarningCode.unnecessaryNanComparisonFalse: [ RemoveComparison.new, ReplaceWithIsNan.new, ], - WarningCode.UNNECESSARY_NAN_COMPARISON_TRUE: [ + WarningCode.unnecessaryNanComparisonTrue: [ RemoveComparison.new, ReplaceWithIsNan.new, ], - WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE: [ - RemoveComparison.new, - ], - WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE: [ - RemoveComparison.new, - ], - WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE: [ - RemoveComparison.new, - ], - WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE: [ - RemoveComparison.new, - ], - WarningCode.UNNECESSARY_QUESTION_MARK: [RemoveQuestionMark.new], - WarningCode.UNNECESSARY_SET_LITERAL: [ConvertIntoBlockBody.setLiteral], - WarningCode.UNNECESSARY_TYPE_CHECK_FALSE: [RemoveComparison.typeCheck], - WarningCode.UNNECESSARY_TYPE_CHECK_TRUE: [RemoveComparison.typeCheck], - WarningCode.UNNECESSARY_WILDCARD_PATTERN: [ + WarningCode.unnecessaryNullComparisonAlwaysNullFalse: [RemoveComparison.new], + WarningCode.unnecessaryNullComparisonAlwaysNullTrue: [RemoveComparison.new], + WarningCode.unnecessaryNullComparisonNeverNullFalse: [RemoveComparison.new], + WarningCode.unnecessaryNullComparisonNeverNullTrue: [RemoveComparison.new], + WarningCode.unnecessaryQuestionMark: [RemoveQuestionMark.new], + WarningCode.unnecessarySetLiteral: [ConvertIntoBlockBody.setLiteral], + WarningCode.unnecessaryTypeCheckFalse: [RemoveComparison.typeCheck], + WarningCode.unnecessaryTypeCheckTrue: [RemoveComparison.typeCheck], + WarningCode.unnecessaryWildcardPattern: [ RemoveUnnecessaryWildcardPattern.new, ], - WarningCode.UNREACHABLE_SWITCH_CASE: [RemoveDeadCode.new], - WarningCode.UNREACHABLE_SWITCH_DEFAULT: [RemoveDeadCode.new], - WarningCode.UNUSED_CATCH_CLAUSE: [RemoveUnusedCatchClause.new], - WarningCode.UNUSED_CATCH_STACK: [RemoveUnusedCatchStack.new], - WarningCode.UNUSED_ELEMENT: [RemoveUnusedElement.new], - WarningCode.UNUSED_ELEMENT_PARAMETER: [RemoveUnusedParameter.new], - WarningCode.UNUSED_FIELD: [RemoveUnusedField.new], - WarningCode.UNUSED_IMPORT: [RemoveUnusedImport.new], - WarningCode.UNUSED_LABEL: [RemoveUnusedLabel.new], - WarningCode.UNUSED_LOCAL_VARIABLE: [ + WarningCode.unreachableSwitchCase: [RemoveDeadCode.new], + WarningCode.unreachableSwitchDefault: [RemoveDeadCode.new], + WarningCode.unusedCatchClause: [RemoveUnusedCatchClause.new], + WarningCode.unusedCatchStack: [RemoveUnusedCatchStack.new], + WarningCode.unusedElement: [RemoveUnusedElement.new], + WarningCode.unusedElementParameter: [RemoveUnusedParameter.new], + WarningCode.unusedField: [RemoveUnusedField.new], + WarningCode.unusedImport: [RemoveUnusedImport.new], + WarningCode.unusedLabel: [RemoveUnusedLabel.new], + WarningCode.unusedLocalVariable: [ RemoveUnusedLocalVariable.new, ConvertToWildcardVariable.new, ], - WarningCode.UNUSED_SHOWN_NAME: [ + WarningCode.unusedShownName: [ OrganizeImports.new, RemoveNameFromCombinator.new, ], }; final _builtInNonLintMultiGenerators = { - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO: [ + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo: [ AddExtensionOverride.new, ], - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_THREE_OR_MORE: [ + CompileTimeErrorCode.ambiguousExtensionMemberAccessThreeOrMore: [ AddExtensionOverride.new, ], - CompileTimeErrorCode.AMBIGUOUS_IMPORT: [AmbiguousImportFix.new], - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE: [DataDriven.new], - CompileTimeErrorCode.CAST_TO_NON_TYPE: [ + CompileTimeErrorCode.ambiguousImport: [AmbiguousImportFix.new], + CompileTimeErrorCode.argumentTypeNotAssignable: [DataDriven.new], + CompileTimeErrorCode.castToNonType: [ CreateClass.new, CreateMixin.new, DataDriven.new, ImportLibrary.forType, ], - CompileTimeErrorCode.CONST_WITH_NON_TYPE: [ + CompileTimeErrorCode.constWithNonType: [ CreateClass.new, ImportLibrary.forType, ], - CompileTimeErrorCode.EXTENDS_NON_CLASS: [ + CompileTimeErrorCode.extendsNonClass: [ CreateClass.new, DataDriven.new, ImportLibrary.forType, ], - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS: [ + CompileTimeErrorCode.extraPositionalArguments: [ AddMissingParameter.new, DataDriven.new, ], - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED: [ + CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed: [ AddMissingParameter.new, DataDriven.new, ], - CompileTimeErrorCode.IMPLEMENTS_NON_CLASS: [ + CompileTimeErrorCode.implementsNonClass: [ CreateClass.new, DataDriven.new, ImportLibrary.forType, ], - CompileTimeErrorCode.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS: [ + CompileTimeErrorCode.implicitSuperInitializerMissingArguments: [ AddSuperConstructorInvocation.new, ], - CompileTimeErrorCode.INVALID_ANNOTATION: [ + CompileTimeErrorCode.invalidAnnotation: [ CreateClass.new, ImportLibrary.forTopLevelVariable, ImportLibrary.forType, ], - CompileTimeErrorCode.INVALID_OVERRIDE: [DataDriven.new], - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER: [DataDriven.new], - CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT: [DataDriven.new], - CompileTimeErrorCode.MIXIN_OF_NON_CLASS: [ + CompileTimeErrorCode.invalidOverride: [DataDriven.new], + CompileTimeErrorCode.invalidOverrideSetter: [DataDriven.new], + CompileTimeErrorCode.missingRequiredArgument: [DataDriven.new], + CompileTimeErrorCode.mixinOfNonClass: [ CreateClass.new, CreateMixin.new, DataDriven.new, ImportLibrary.forType, ], - CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS: [ + CompileTimeErrorCode.mixinWithNonClassSuperclass: [ CreateClass.new, ImportLibrary.forType, ], - CompileTimeErrorCode.NEW_WITH_NON_TYPE: [ - CreateClass.new, - ImportLibrary.forType, - ], - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT: [DataDriven.new], - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT: [ + CompileTimeErrorCode.newWithNonType: [CreateClass.new, ImportLibrary.forType], + CompileTimeErrorCode.newWithUndefinedConstructorDefault: [DataDriven.new], + CompileTimeErrorCode.noDefaultSuperConstructorExplicit: [ AddSuperConstructorInvocation.new, ], - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT: [ + CompileTimeErrorCode.noDefaultSuperConstructorImplicit: [ AddSuperConstructorInvocation.new, CreateConstructorSuper.new, ], - CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE: [ImportLibrary.forType], - CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT: [ + CompileTimeErrorCode.nonTypeInCatchClause: [ImportLibrary.forType], + CompileTimeErrorCode.nonTypeAsTypeArgument: [ CreateClass.new, CreateMixin.new, DataDriven.new, ImportLibrary.forType, ], - CompileTimeErrorCode.NOT_A_TYPE: [ + CompileTimeErrorCode.notAType: [ CreateClass.new, ImportLibrary.forType, CreateMixin.new, ], - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL: [ + CompileTimeErrorCode.notEnoughPositionalArgumentsNamePlural: [DataDriven.new], + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular: [ DataDriven.new, ], - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR: [ - DataDriven.new, - ], - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_PLURAL: [DataDriven.new], - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_SINGULAR: [ - DataDriven.new, - ], - CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME: [ + CompileTimeErrorCode.notEnoughPositionalArgumentsPlural: [DataDriven.new], + CompileTimeErrorCode.notEnoughPositionalArgumentsSingular: [DataDriven.new], + CompileTimeErrorCode.typeTestWithUndefinedName: [ CreateClass.new, CreateMixin.new, ImportLibrary.forType, ], - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE: [ + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue: [ ImportLibrary.forExtensionMember, ], - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE: [ + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue: [ ImportLibrary.forExtensionMember, ], - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE: [ + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue: [ ImportLibrary.forExtensionMember, ], - CompileTimeErrorCode.UNDEFINED_ANNOTATION: [ + CompileTimeErrorCode.undefinedAnnotation: [ CreateClass.new, ImportLibrary.forTopLevelVariable, ImportLibrary.forType, ], - CompileTimeErrorCode.UNDEFINED_CLASS: [ + CompileTimeErrorCode.undefinedClass: [ CreateClass.new, DataDriven.new, ImportLibrary.forType, CreateMixin.new, ], - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT: [ + CompileTimeErrorCode.undefinedConstructorInInitializerDefault: [ AddSuperConstructorInvocation.new, ], - CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_FUNCTION: [ + CompileTimeErrorCode.undefinedExtensionGetter: [DataDriven.new], + CompileTimeErrorCode.undefinedFunction: [ CreateClass.new, DataDriven.new, ImportLibrary.forExtension, @@ -1438,7 +1370,7 @@ final _builtInNonLintMultiGenerators = { ImportLibrary.forFunction, ImportLibrary.forType, ], - CompileTimeErrorCode.UNDEFINED_GETTER: [ + CompileTimeErrorCode.undefinedGetter: [ CreateClass.new, DataDriven.new, ImportLibrary.forExtensionMember, @@ -1446,7 +1378,7 @@ final _builtInNonLintMultiGenerators = { ImportLibrary.forType, CreateMixin.new, ], - CompileTimeErrorCode.UNDEFINED_IDENTIFIER: [ + CompileTimeErrorCode.undefinedIdentifier: [ CreateClass.new, DataDriven.new, ImportLibrary.forExtension, @@ -1456,40 +1388,36 @@ final _builtInNonLintMultiGenerators = { ImportLibrary.forType, CreateMixin.new, ], - CompileTimeErrorCode.UNDEFINED_METHOD: [ + CompileTimeErrorCode.undefinedMethod: [ CreateClass.new, DataDriven.new, ImportLibrary.forExtensionMember, ImportLibrary.forFunction, ImportLibrary.forType, ], - CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER: [ + CompileTimeErrorCode.undefinedNamedParameter: [ ChangeArgumentName.new, DataDriven.new, ], - CompileTimeErrorCode.UNDEFINED_OPERATOR: [ + CompileTimeErrorCode.undefinedOperator: [ ImportLibrary.forExtensionMember, UseDifferentDivisionOperator.new, ], - CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME: [DataDriven.new], - CompileTimeErrorCode.UNDEFINED_SETTER: [ + CompileTimeErrorCode.undefinedPrefixedName: [DataDriven.new], + CompileTimeErrorCode.undefinedSetter: [ DataDriven.new, // TODO(brianwilkerson): Support ImportLibrary for non-extension members. ImportLibrary.forExtensionMember, ], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS: [DataDriven.new], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR: [ - DataDriven.new, - ], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION: [ - DataDriven.new, - ], - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD: [DataDriven.new], - HintCode.DEPRECATED_MEMBER_USE: [DataDriven.new], - HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE: [DataDriven.new], - WarningCode.DEPRECATED_EXPORT_USE: [DataDriven.new], - WarningCode.MULTIPLE_COMBINATORS: [MergeCombinators.new], - WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD: [DataDriven.new], + CompileTimeErrorCode.wrongNumberOfTypeArguments: [DataDriven.new], + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor: [DataDriven.new], + CompileTimeErrorCode.wrongNumberOfTypeArgumentsExtension: [DataDriven.new], + CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod: [DataDriven.new], + HintCode.deprecatedMemberUse: [DataDriven.new], + HintCode.deprecatedMemberUseWithMessage: [DataDriven.new], + WarningCode.deprecatedExportUse: [DataDriven.new], + WarningCode.multipleCombinators: [MergeCombinators.new], + WarningCode.overrideOnNonOverridingMethod: [DataDriven.new], }; final _builtInParseLintGenerators = >{ diff --git a/pkg/analysis_server/lib/src/services/correction/organize_imports.dart b/pkg/analysis_server/lib/src/services/correction/organize_imports.dart index e3e45aacfab..5ea900d5e20 100644 --- a/pkg/analysis_server/lib/src/services/correction/organize_imports.dart +++ b/pkg/analysis_server/lib/src/services/correction/organize_imports.dart @@ -65,9 +65,9 @@ class ImportOrganizer { bool _isUnusedImport(UriBasedDirective directive) { for (var diagnostic in diagnostics) { - if ((diagnostic.diagnosticCode == WarningCode.DUPLICATE_IMPORT || - diagnostic.diagnosticCode == WarningCode.UNUSED_IMPORT || - diagnostic.diagnosticCode == HintCode.UNNECESSARY_IMPORT) && + if ((diagnostic.diagnosticCode == WarningCode.duplicateImport || + diagnostic.diagnosticCode == WarningCode.unusedImport || + diagnostic.diagnosticCode == HintCode.unnecessaryImport) && directive.uri.offset == diagnostic.offset) { return true; } @@ -77,7 +77,7 @@ class ImportOrganizer { bool _isUnusedShowName(SimpleIdentifier name) { for (var diagnostic in diagnostics) { - if ((diagnostic.diagnosticCode == WarningCode.UNUSED_SHOWN_NAME) && + if ((diagnostic.diagnosticCode == WarningCode.unusedShownName) && name.offset == diagnostic.offset) { return true; } diff --git a/pkg/analysis_server/test/abstract_single_unit.dart b/pkg/analysis_server/test/abstract_single_unit.dart index fa0d41efbda..05b4e9bfc08 100644 --- a/pkg/analysis_server/test/abstract_single_unit.dart +++ b/pkg/analysis_server/test/abstract_single_unit.dart @@ -84,13 +84,13 @@ class AbstractSingleUnitTest extends AbstractContextTest { if (verifyNoTestUnitErrors) { expect( unitResult.diagnostics.where((d) { - return d.diagnosticCode != WarningCode.DEAD_CODE && - d.diagnosticCode != WarningCode.UNUSED_CATCH_CLAUSE && - d.diagnosticCode != WarningCode.UNUSED_CATCH_STACK && - d.diagnosticCode != WarningCode.UNUSED_ELEMENT && - d.diagnosticCode != WarningCode.UNUSED_FIELD && - d.diagnosticCode != WarningCode.UNUSED_IMPORT && - d.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE; + return d.diagnosticCode != WarningCode.deadCode && + d.diagnosticCode != WarningCode.unusedCatchClause && + d.diagnosticCode != WarningCode.unusedCatchStack && + d.diagnosticCode != WarningCode.unusedElement && + d.diagnosticCode != WarningCode.unusedField && + d.diagnosticCode != WarningCode.unusedImport && + d.diagnosticCode != WarningCode.unusedLocalVariable; }), isEmpty, ); diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart index 60e946a8002..fb665898049 100644 --- a/pkg/analysis_server/test/protocol_server_test.dart +++ b/pkg/analysis_server/test/protocol_server_test.dart @@ -43,7 +43,7 @@ class AnalysisErrorTest { // prepare AnalysisError engineDiagnostic = MockDiagnostic( source: source, - diagnosticCode: engine.CompileTimeErrorCode.AMBIGUOUS_EXPORT, + diagnosticCode: engine.CompileTimeErrorCode.ambiguousExport, offset: 10, length: 20, message: 'my message', @@ -111,7 +111,7 @@ class AnalysisErrorTest { void test_fromEngine_hasCorrection() { engineDiagnostic = MockDiagnostic( source: source, - diagnosticCode: engine.CompileTimeErrorCode.AMBIGUOUS_EXPORT, + diagnosticCode: engine.CompileTimeErrorCode.ambiguousExport, offset: 10, length: 20, message: 'my message', @@ -202,7 +202,7 @@ class AnalysisErrorTest { void test_fromEngine_noCorrection() { engineDiagnostic = MockDiagnostic( source: source, - diagnosticCode: engine.CompileTimeErrorCode.AMBIGUOUS_EXPORT, + diagnosticCode: engine.CompileTimeErrorCode.ambiguousExport, offset: 10, length: 20, message: 'my message', diff --git a/pkg/analysis_server/test/services/linter/linter_test.dart b/pkg/analysis_server/test/services/linter/linter_test.dart index cac5aabd58b..e65090e5779 100644 --- a/pkg/analysis_server/test/services/linter/linter_test.dart +++ b/pkg/analysis_server/test/services/linter/linter_test.dart @@ -66,7 +66,7 @@ linter: rules: - undefined ''', - [AnalysisOptionsWarningCode.UNDEFINED_LINT], + [AnalysisOptionsWarningCode.undefinedLint], ); } 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 03a8270153e..fdad568e6a7 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 @@ -72,7 +72,7 @@ Future f() async { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT; + CompileTimeErrorCode.undefinedIdentifierAwait; }, ); } @@ -91,7 +91,7 @@ void doStuff() => takeFutureCallback(() async => await 1); ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT; + CompileTimeErrorCode.undefinedIdentifierAwait; }, ); } @@ -467,8 +467,7 @@ Future f() async { } ''', errorFilter: (error) { - return error.diagnosticCode == - CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT; + return error.diagnosticCode == CompileTimeErrorCode.awaitInWrongContext; }, ); } 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 d6f73b834a7..5a80a7f6293 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 @@ -163,7 +163,7 @@ void f() async { } ''', errorFilter: - (error) => error.diagnosticCode != ParserErrorCode.EXPECTED_TOKEN, + (error) => error.diagnosticCode != ParserErrorCode.expectedToken, ); } @@ -327,7 +327,7 @@ Future baz() async { ''', errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.INVALID_ASSIGNMENT, + error.diagnosticCode == CompileTimeErrorCode.invalidAssignment, ); } @@ -342,7 +342,7 @@ void baz() { await assertNoFix( errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.INVALID_ASSIGNMENT, + error.diagnosticCode == CompileTimeErrorCode.invalidAssignment, ); } @@ -364,7 +364,7 @@ Future baz() async { ''', errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.INVALID_ASSIGNMENT, + error.diagnosticCode == CompileTimeErrorCode.invalidAssignment, ); } } 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 793eb7ebfb5..7dbe546d0fa 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 @@ -660,7 +660,7 @@ class C extends Widget with Diagnosticable { ''', errorFilter: (error) => - error.diagnosticCode != CompileTimeErrorCode.UNDEFINED_CLASS, + error.diagnosticCode != CompileTimeErrorCode.undefinedClass, ); } @@ -695,7 +695,7 @@ class C extends Widget with Diagnosticable { ''', errorFilter: (error) => - error.diagnosticCode != CompileTimeErrorCode.UNDEFINED_CLASS, + error.diagnosticCode != CompileTimeErrorCode.undefinedClass, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_empty_argument_list_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_empty_argument_list_test.dart index 3e1a9b958b0..6503196ecd8 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_empty_argument_list_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_empty_argument_list_test.dart @@ -31,7 +31,7 @@ class A { main() {} '''); await assertHasFixAllFix( - CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, + CompileTimeErrorCode.noAnnotationConstructorArguments, ''' class A { const A(); diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_enum_constant_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_enum_constant_test.dart index cedb86c23ad..473c9b510e9 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_enum_constant_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_enum_constant_test.dart @@ -300,7 +300,7 @@ void f() { } ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.UNDEFINED_ENUM_CONSTANT; + return e.diagnosticCode == CompileTimeErrorCode.undefinedEnumConstant; }, ); } @@ -323,7 +323,7 @@ E e() { ''', errorFilter: (e) { return e.diagnosticCode == - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_GETTER; + CompileTimeErrorCode.dotShorthandUndefinedGetter; }, ); } 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 e2254e3880a..22226c15b96 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 @@ -31,7 +31,7 @@ f(A a) { class A {} class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(A a) { B b, b2; b = a as B; @@ -52,7 +52,7 @@ f(List a) { class A {} class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(List a) { List b, b2; b = a.where((e) => e is B).cast().toList(); @@ -73,7 +73,7 @@ f(Map a) { class A {} class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(Map a) { Map b, b2; b = a.cast(); @@ -96,7 +96,7 @@ class A { } class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(A a) { B b, b2; b = (a..m()) as B; @@ -119,7 +119,7 @@ f(Set a) { class A {} class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(Set a) { Set b, b2; b = a.cast(); @@ -139,7 +139,7 @@ f(A a) { class A {} class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(A a) { B b = a as B; B b2 = a as B; @@ -158,7 +158,7 @@ f(List a) { class A {} class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(List a) { List b = a.where((e) => e is B).cast().toList(); List b2 = a.where((e) => e is B).cast().toList(); @@ -177,7 +177,7 @@ f(Map a) { class A {} class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(Map a) { Map b = a.cast(); Map b2 = a.cast(); @@ -198,7 +198,7 @@ class A { } class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(A a) { B b = (a..m()) as B; B b2 = (a..m()) as B; @@ -219,7 +219,7 @@ f(Set a) { class A {} class B {} '''); - await assertHasFixAllFix(CompileTimeErrorCode.INVALID_ASSIGNMENT, ''' + await assertHasFixAllFix(CompileTimeErrorCode.invalidAssignment, ''' f(Set a) { Set b = a.cast(); Set b2 = a.cast(); @@ -645,7 +645,7 @@ void foo(int a) { '''); await assertNoFix( errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.INVALID_ASSIGNMENT; + return e.diagnosticCode == CompileTimeErrorCode.invalidAssignment; }, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_extension_override_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_extension_override_test.dart index 0bda075f787..844cf426500 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_extension_override_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_extension_override_test.dart @@ -52,7 +52,7 @@ void f(String str) { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, ); await assertHasFixesWithoutApplying( @@ -64,7 +64,7 @@ void f(String str) { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, ); } @@ -128,7 +128,7 @@ f() { expectedNumberOfFixesForKind: 1, errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO; + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo; }, ); } @@ -206,7 +206,7 @@ extension E2 on A { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, ); } @@ -242,7 +242,7 @@ extension E2 on A { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, ); } @@ -282,7 +282,7 @@ extension E2 on A { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, ); } @@ -391,7 +391,7 @@ void f(String str) { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, ); await assertHasFixesWithoutApplying( @@ -403,7 +403,7 @@ void f(String str) { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, ); } } 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 1688d55c1ea..2ab749cbe53 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 @@ -138,7 +138,7 @@ class C { ''', errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, + error.diagnosticCode == CompileTimeErrorCode.assignmentToFinal, ); } @@ -177,7 +177,7 @@ void f(C c) { ''', errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, + error.diagnosticCode == CompileTimeErrorCode.assignmentToFinal, ); } @@ -201,7 +201,7 @@ class C { ''', errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, + error.diagnosticCode == CompileTimeErrorCode.assignmentToFinal, ); } 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 6abf21a4595..8bdb6d18afd 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 @@ -32,7 +32,7 @@ class AddMissingEnumCaseClausesTest extends FixProcessorTest { return (error) { if (!hasError && error.diagnosticCode == - StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH) { + StaticWarningCode.missingEnumConstantInSwitch) { hasError = true; return true; } diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_missing_switch_cases_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_missing_switch_cases_test.dart index 91392782efc..2d9d34741fa 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_missing_switch_cases_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_missing_switch_cases_test.dart @@ -252,7 +252,7 @@ int f(E x) { errorFilter: (e) => e.diagnosticCode == - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, + CompileTimeErrorCode.nonExhaustiveSwitchExpression, ); } @@ -369,7 +369,7 @@ class AddMissingSwitchCasesTest_SwitchStatement extends FixProcessorTest { return (diagnostic) { if (!hasError && diagnostic.diagnosticCode == - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT) { + CompileTimeErrorCode.nonExhaustiveSwitchStatement) { hasError = true; return true; } @@ -522,7 +522,7 @@ void f(E e) { errorFilter: (e) => e.diagnosticCode == - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, + CompileTimeErrorCode.nonExhaustiveSwitchStatement, ); } 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 6207ad26f0b..5835b992a17 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 @@ -32,7 +32,7 @@ f(String p, String q) { } } '''); - await assertNoFixAllFix(CompileTimeErrorCode.NON_BOOL_CONDITION); + await assertNoFixAllFix(CompileTimeErrorCode.nonBoolCondition); } Future test_nonBoolCondition_all_nullable() async { @@ -46,7 +46,7 @@ f(String? p, String? q) { } } '''); - await assertHasFixAllFix(CompileTimeErrorCode.NON_BOOL_CONDITION, ''' + await assertHasFixAllFix(CompileTimeErrorCode.nonBoolCondition, ''' f(String? p, String? q) { if (p != null) { print(p); 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 03a05c46f32..1e9b7a8d55e 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 @@ -392,7 +392,7 @@ void g() { errorFilter: (diagnostic) => diagnostic.diagnosticCode == - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, ); } @@ -406,7 +406,7 @@ void g(int i) { await assertNoFix( errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE; + CompileTimeErrorCode.argumentTypeNotAssignable; }, ); } @@ -449,7 +449,7 @@ void g(int i, int? x) { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE; + CompileTimeErrorCode.argumentTypeNotAssignable; }, ); } @@ -464,7 +464,7 @@ void g(int i, int x) { await assertNoFix( errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE; + CompileTimeErrorCode.argumentTypeNotAssignable; }, ); } @@ -479,7 +479,7 @@ void g(int i, int? x) { await assertNoFix( errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE; + CompileTimeErrorCode.argumentTypeNotAssignable; }, ); } @@ -571,7 +571,7 @@ void f (List? args) { errorFilter: (diagnostic) => diagnostic.diagnosticCode != - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.listElementTypeNotAssignable, ); } @@ -622,7 +622,7 @@ f(List? args) { errorFilter: (diagnostic) => diagnostic.diagnosticCode != - CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, + CompileTimeErrorCode.yieldEachOfInvalidType, ); } @@ -645,8 +645,7 @@ g() { errorFilter: (diagnostic) => diagnostic.diagnosticCode == - CompileTimeErrorCode - .UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH, + CompileTimeErrorCode.uncheckedUseOfNullableValueInYieldEach, ); } @@ -669,7 +668,7 @@ class C { errorFilter: (diagnostic) => diagnostic.diagnosticCode != - CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, + CompileTimeErrorCode.yieldEachOfInvalidType, ); } @@ -688,7 +687,7 @@ Iterable f(List? args) sync* { errorFilter: (diagnostic) => diagnostic.diagnosticCode != - CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, + CompileTimeErrorCode.yieldEachOfInvalidType, ); } } diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_switch_case_break_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_switch_case_break_test.dart index 1bbc8cbe9b1..e0f741d11d1 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/add_switch_case_break_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/add_switch_case_break_test.dart @@ -38,7 +38,7 @@ void f(Object? x) { } '''); await assertHasFixAllFix( - CompileTimeErrorCode.SWITCH_CASE_COMPLETES_NORMALLY, + CompileTimeErrorCode.switchCaseCompletesNormally, ''' void f(Object? x) { switch (x) { diff --git a/pkg/analysis_server/test/src/services/correction/fix/ambiguous_import_fix_test.dart b/pkg/analysis_server/test/src/services/correction/fix/ambiguous_import_fix_test.dart index 032352f7d7d..2e80f866c72 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/ambiguous_import_fix_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/ambiguous_import_fix_test.dart @@ -145,7 +145,7 @@ class C with M {} ''', matchFixMessage: "Hide others to use 'M' from 'lib4.dart'", errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT; + return error.diagnosticCode == CompileTimeErrorCode.ambiguousImport; }, ); } @@ -195,7 +195,7 @@ class C with M {} ''', matchFixMessage: "Hide others to use 'M' from 'lib3.dart'", errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT; + return error.diagnosticCode == CompileTimeErrorCode.ambiguousImport; }, ); } @@ -228,7 +228,7 @@ void foo(int i) { ''', matchFixMessage: "Hide others to use 'E' from 'lib1.dart'", errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT; + return error.diagnosticCode == CompileTimeErrorCode.ambiguousImport; }, ); } @@ -276,7 +276,7 @@ class C with M {} ''', matchFixMessage: "Hide others to use 'M' from 'lib1.dart'", errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT; + return error.diagnosticCode == CompileTimeErrorCode.ambiguousImport; }, ); } @@ -566,7 +566,7 @@ void f() { matchFixMessage: "Hide others to use 'N' from 'lib2.dart'", errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT, + error.diagnosticCode == CompileTimeErrorCode.ambiguousImport, ); } @@ -595,7 +595,7 @@ void f() { matchFixMessage: "Hide others to use 'N' from 'lib2.dart' as l", errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT, + error.diagnosticCode == CompileTimeErrorCode.ambiguousImport, ); } @@ -623,7 +623,7 @@ class C with M {} ''', matchFixMessage: "Hide others to use 'M' from 'lib1.dart'", errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT; + return error.diagnosticCode == CompileTimeErrorCode.ambiguousImport; }, ); await assertHasFix( @@ -636,7 +636,7 @@ class C with M {} ''', matchFixMessage: "Hide others to use 'M' from 'lib2.dart'", errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT; + return error.diagnosticCode == CompileTimeErrorCode.ambiguousImport; }, ); await assertHasFix( @@ -649,7 +649,7 @@ class C with M {} ''', matchFixMessage: "Hide others to use 'M' from 'lib3.dart'", errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT; + return error.diagnosticCode == CompileTimeErrorCode.ambiguousImport; }, ); } @@ -865,7 +865,7 @@ void f(N? n, O? o) { ''', errorFilter: (error) => - error.diagnosticCode == CompileTimeErrorCode.AMBIGUOUS_IMPORT, + error.diagnosticCode == CompileTimeErrorCode.ambiguousImport, matchFixMessage: "Remove show to use 'N' from 'lib2.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 f37e60a4464..3b026549fae 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 @@ -494,7 +494,7 @@ void f(A a) { } ''', errorFilter: - (e) => e.diagnosticCode == CompileTimeErrorCode.UNDEFINED_GETTER, + (e) => e.diagnosticCode == CompileTimeErrorCode.undefinedGetter, ); } @@ -521,7 +521,7 @@ void f() { } ''', errorFilter: - (e) => e.diagnosticCode == CompileTimeErrorCode.UNDEFINED_GETTER, + (e) => e.diagnosticCode == CompileTimeErrorCode.undefinedGetter, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_into_block_body_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_into_block_body_test.dart index f3765255387..bde44348360 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/convert_into_block_body_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/convert_into_block_body_test.dart @@ -242,7 +242,7 @@ void f() { }); } '''); - await assertHasFixAllFix(WarningCode.UNNECESSARY_SET_LITERAL, ''' + await assertHasFixAllFix(WarningCode.unnecessarySetLiteral, ''' void g(void Function() fun) {} void f() { diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_into_getter_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_into_getter_test.dart index 6dfd53de01f..e8a05be623a 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/convert_into_getter_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/convert_into_getter_test.dart @@ -38,7 +38,7 @@ extension E on int { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, + CompileTimeErrorCode.extensionDeclaresInstanceField, ); } @@ -242,7 +242,7 @@ class A { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER; + CompileTimeErrorCode.implicitThisReferenceInInitializer; }, ); } @@ -266,7 +266,7 @@ class A { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER; + CompileTimeErrorCode.implicitThisReferenceInInitializer; }, ); } @@ -290,7 +290,7 @@ class A { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER; + CompileTimeErrorCode.implicitThisReferenceInInitializer; }, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_block_function_body_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_block_function_body_test.dart index badfd365eaf..3b5c7f0ee38 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_block_function_body_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_block_function_body_test.dart @@ -50,7 +50,7 @@ void f() { g(() => {g(() => {1})}); } '''); - await assertHasFixAllFix(WarningCode.UNNECESSARY_SET_LITERAL, ''' + await assertHasFixAllFix(WarningCode.unnecessarySetLiteral, ''' void g(void Function() fun) {} void f() { diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_flutter_style_todo_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_flutter_style_todo_test.dart index ffd0f0ca8ca..35539bb6b40 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_flutter_style_todo_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_flutter_style_todo_test.dart @@ -60,7 +60,7 @@ void f() { } /// Docs. // TODO(user): msg. void f() { } -''', errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); +''', errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } Future test_docCommentSolo() async { @@ -71,7 +71,7 @@ void f() { } await assertHasFix(''' // TODO(user): msg. void f() { } -''', errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); +''', errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } Future test_extraLeadingSpace() async { @@ -82,7 +82,7 @@ void f() { } await assertHasFix(''' // TODO(user): msg. void f() { } -''', errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); +''', errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } Future test_lowerCase() async { @@ -101,7 +101,7 @@ void f() { } // TODO(user msg. void f() { } '''); - await assertNoFix(errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); + await assertNoFix(errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } Future test_missingColon() async { @@ -112,7 +112,7 @@ void f() { } await assertHasFix(''' // TODO(user): msg. void f() { } -''', errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); +''', errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } Future test_missingColon_surroundingComments() async { @@ -127,7 +127,7 @@ void f() { } // TODO(user): msg. // Trailing comment. void f() { } -''', errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); +''', errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } Future test_missingColonAndMessage() async { @@ -135,7 +135,7 @@ void f() { } // TODO(user) void f() {} '''); - await assertNoFix(errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); + await assertNoFix(errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } Future test_missingLeadingSpace() async { @@ -146,7 +146,7 @@ void f() {} await assertHasFix(''' // TODO(user): msg. void f() {} -''', errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); +''', errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } Future test_unwantedSpaceBeforeUser() async { @@ -157,6 +157,6 @@ void f() {} await assertHasFix(''' // TODO(user): msg. void f() {} -''', errorFilter: (e) => e.diagnosticCode != TodoCode.TODO); +''', errorFilter: (e) => e.diagnosticCode != TodoCode.todo); } } 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 ce8f2404c17..ceadf159312 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 @@ -94,7 +94,7 @@ import 'foo'; ''', errorFilter: (error) => - error.diagnosticCode != CompileTimeErrorCode.URI_DOES_NOT_EXIST, + error.diagnosticCode != CompileTimeErrorCode.uriDoesNotExist, ); } 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 6536f6e72a3..d2c2471cf73 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 @@ -450,7 +450,7 @@ class Test { } ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.UNDEFINED_FUNCTION; + return e.diagnosticCode == CompileTimeErrorCode.undefinedFunction; }, ); } @@ -541,8 +541,7 @@ class Test { } ''', errorFilter: (error) { - return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER; + return error.diagnosticCode == CompileTimeErrorCode.undefinedIdentifier; }, ); assertLinkedGroup(change.linkedEditGroups[0], ['Test])', 'Test {']); 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 44ed0f73861..f590cc79be0 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 @@ -314,7 +314,7 @@ class Test { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.FINAL_NOT_INITIALIZED && + CompileTimeErrorCode.finalNotInitialized && error.message.contains("'_a'"); }, ); diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_extension_member_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_extension_member_test.dart index 580d3ee7d66..6221a2b9238 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/create_extension_member_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/create_extension_member_test.dart @@ -891,8 +891,7 @@ extension E on int { ''', errorFilter: (diagnostic) => - diagnostic.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_METHOD, + diagnostic.diagnosticCode == CompileTimeErrorCode.undefinedMethod, ); } @@ -911,14 +910,13 @@ extension E on A { await assertNoFix( errorFilter: (diagnostic) => - diagnostic.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_METHOD, + diagnostic.diagnosticCode == CompileTimeErrorCode.undefinedMethod, ); await assertNoFix( errorFilter: (diagnostic) => diagnostic.diagnosticCode == - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, ); } @@ -979,8 +977,7 @@ extension E on int { ''', errorFilter: (diagnostic) => - diagnostic.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_METHOD, + diagnostic.diagnosticCode == CompileTimeErrorCode.undefinedMethod, ); } @@ -995,8 +992,7 @@ extension E on int { await assertNoFix( errorFilter: (diagnostic) => - diagnostic.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_METHOD, + diagnostic.diagnosticCode == CompileTimeErrorCode.undefinedMethod, ); } @@ -1020,8 +1016,7 @@ extension E on int { ''', errorFilter: (diagnostic) => - diagnostic.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_METHOD, + diagnostic.diagnosticCode == CompileTimeErrorCode.undefinedMethod, ); } @@ -1042,8 +1037,7 @@ extension E on B { await assertNoFix( errorFilter: (diagnostic) => - diagnostic.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_METHOD, + diagnostic.diagnosticCode == CompileTimeErrorCode.undefinedMethod, ); } 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 820054eb91c..6e2fe28af9f 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 @@ -278,7 +278,7 @@ A f() { ''', errorFilter: (e) { return e.diagnosticCode == - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_GETTER; + CompileTimeErrorCode.dotShorthandUndefinedGetter; }, ); } @@ -301,7 +301,7 @@ A f() { ''', errorFilter: (e) { return e.diagnosticCode == - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_GETTER; + CompileTimeErrorCode.dotShorthandUndefinedGetter; }, ); } 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 e964eccc3d9..7190b9aa2ab 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 @@ -46,8 +46,7 @@ class B implements A { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode - .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE; + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne; }, ); } @@ -76,8 +75,7 @@ class B implements A { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode - .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE; + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne; }, ); } @@ -105,8 +103,7 @@ class B implements A { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode - .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE; + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne; }, ); } 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 95cdbe36b86..e028f463015 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 @@ -298,8 +298,7 @@ mixin Test { } ''', errorFilter: (error) { - return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER; + return error.diagnosticCode == CompileTimeErrorCode.undefinedIdentifier; }, ); assertLinkedGroup(change.linkedEditGroups[0], ['Test])', 'Test {']); diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test_support.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test_support.dart index 62048c7b298..54fa68c7b8e 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test_support.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test_support.dart @@ -60,7 +60,7 @@ mixin DataDrivenFixProcessorTestMixin on AbstractSingleUnitTest { /// A method that can be used as an error filter to ignore any unused_import /// diagnostics. bool ignoreUnusedImport(Diagnostic diagnostic) => - diagnostic.diagnosticCode != WarningCode.UNUSED_IMPORT; + diagnostic.diagnosticCode != WarningCode.unusedImport; /// Sets the content of the library that defines the element referenced by the /// data on which this test is based. diff --git a/pkg/analysis_server/test/src/services/correction/fix/import_library_hide_test.dart b/pkg/analysis_server/test/src/services/correction/fix/import_library_hide_test.dart index e059a2f4596..f98bd4f5e35 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/import_library_hide_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/import_library_hide_test.dart @@ -42,7 +42,7 @@ void f(A a, B b, C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_CLASS && + return error.diagnosticCode == CompileTimeErrorCode.undefinedClass && testCode.indexOf('B b') == error.offset; }, ); @@ -54,7 +54,7 @@ void f(A a, B b, C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_CLASS && + return error.diagnosticCode == CompileTimeErrorCode.undefinedClass && testCode.indexOf('C c') == error.offset; }, ); @@ -89,7 +89,7 @@ void f(String s, lib.C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_METHOD; + return error.diagnosticCode == CompileTimeErrorCode.undefinedMethod; }, ); } @@ -123,7 +123,7 @@ void f(String s, C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_METHOD; + return error.diagnosticCode == CompileTimeErrorCode.undefinedMethod; }, ); } @@ -162,7 +162,7 @@ void f(String s, C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_OPERATOR; + return error.diagnosticCode == CompileTimeErrorCode.undefinedOperator; }, ); } @@ -197,7 +197,7 @@ void f() { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_CLASS && + return error.diagnosticCode == CompileTimeErrorCode.undefinedClass && testCode.indexOf('B?') == error.offset; }, ); @@ -253,7 +253,7 @@ void f(A a1) { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER && + CompileTimeErrorCode.undefinedIdentifier && testCode.indexOf('E.') == error.offset; }, ); @@ -266,7 +266,7 @@ void f(A a1) { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER && + CompileTimeErrorCode.undefinedIdentifier && testCode.indexOf("a')") == error.offset; }, ); 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 3e4d00dd762..e5602e134b7 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 @@ -71,7 +71,7 @@ void f() { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_CLASS; + return error.diagnosticCode == CompileTimeErrorCode.undefinedClass; }, ); } @@ -99,7 +99,7 @@ void f() { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_CLASS; + return error.diagnosticCode == CompileTimeErrorCode.undefinedClass; }, ); } 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 b112c10f215..637b3d45895 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 @@ -714,7 +714,7 @@ void f() { } ''', errorFilter: - (e) => e.diagnosticCode == CompileTimeErrorCode.UNDEFINED_FUNCTION, + (e) => e.diagnosticCode == CompileTimeErrorCode.undefinedFunction, ); } 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 6f4594bbb63..3e69423069d 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 @@ -269,8 +269,7 @@ class MyAnnotation { void f() {} ''', errorFilter: (error) { - return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER; + return error.diagnosticCode == CompileTimeErrorCode.undefinedIdentifier; }, ); } 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 0722116e920..202cb71f51a 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 @@ -42,7 +42,7 @@ void f(A a, B b, C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_CLASS && + return error.diagnosticCode == CompileTimeErrorCode.undefinedClass && testCode.indexOf('B') == error.offset; }, ); @@ -54,7 +54,7 @@ void f(A a, B b, C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_CLASS && + return error.diagnosticCode == CompileTimeErrorCode.undefinedClass && testCode.indexOf('C') == error.offset; }, ); @@ -88,7 +88,7 @@ void f(String s, lib.C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_METHOD; + return error.diagnosticCode == CompileTimeErrorCode.undefinedMethod; }, ); } @@ -121,7 +121,7 @@ void f(String s, C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_METHOD; + return error.diagnosticCode == CompileTimeErrorCode.undefinedMethod; }, ); } @@ -159,7 +159,7 @@ void f(String s, C c) { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_OPERATOR; + return error.diagnosticCode == CompileTimeErrorCode.undefinedOperator; }, ); } @@ -193,7 +193,7 @@ void f() { } ''', errorFilter: (error) { - return error.diagnosticCode == CompileTimeErrorCode.UNDEFINED_CLASS && + return error.diagnosticCode == CompileTimeErrorCode.undefinedClass && testCode.indexOf('B') == error.offset; }, ); @@ -248,7 +248,7 @@ void f(A a1) { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER && + CompileTimeErrorCode.undefinedIdentifier && testCode.indexOf('E') == error.offset; }, ); @@ -261,7 +261,7 @@ void f(A a1) { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.UNDEFINED_IDENTIFIER && + CompileTimeErrorCode.undefinedIdentifier && testCode.indexOf("a')") == error.offset; }, ); diff --git a/pkg/analysis_server/test/src/services/correction/fix/insert_body_test.dart b/pkg/analysis_server/test/src/services/correction/fix/insert_body_test.dart index 9d64f04ffdc..00d7dd23ab4 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/insert_body_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/insert_body_test.dart @@ -128,8 +128,7 @@ enum E {}''', errorFilter: (error) => - error.diagnosticCode != - CompileTimeErrorCode.ENUM_WITHOUT_CONSTANTS, + error.diagnosticCode != CompileTimeErrorCode.enumWithoutConstants, ); } } diff --git a/pkg/analysis_server/test/src/services/correction/fix/insert_on_keyword_test.dart b/pkg/analysis_server/test/src/services/correction/fix/insert_on_keyword_test.dart index 501da39171a..ae938a2927c 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/insert_on_keyword_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/insert_on_keyword_test.dart @@ -25,7 +25,7 @@ extension String {} extension String {} '''); var fixes = await getFixesForFirst( - (e) => e.diagnosticCode == ParserErrorCode.EXPECTED_TOKEN, + (e) => e.diagnosticCode == ParserErrorCode.expectedToken, ); expect(fixes, hasLength(1)); assertProduces(fixes.first, r''' @@ -49,7 +49,7 @@ extension int {} extension on int {} ''', errorFilter: (error) { - return error.diagnosticCode == ParserErrorCode.EXPECTED_TOKEN; + return error.diagnosticCode == ParserErrorCode.expectedToken; }, ); } @@ -90,7 +90,7 @@ extension List {} extension on List {} ''', errorFilter: (error) { - return error.diagnosticCode == ParserErrorCode.EXPECTED_TOKEN; + return error.diagnosticCode == ParserErrorCode.expectedToken; }, ); } 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 f56857bf742..1415ed9b868 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 @@ -182,7 +182,7 @@ f() { f() { var l = [ for (final i in [1, 2]) i + 3 ]; } -''', errorFilter: (e) => e.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE); +''', errorFilter: (e) => e.diagnosticCode != WarningCode.unusedLocalVariable); } Future test_listPattern() async { @@ -195,7 +195,7 @@ f() { f() { for (final [i, j] in [[1, 2]]) { } } -''', errorFilter: (e) => e.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE); +''', errorFilter: (e) => e.diagnosticCode != WarningCode.unusedLocalVariable); } Future test_mapPattern() async { @@ -208,7 +208,7 @@ f() { f() { for (final {'i' : j} in [{'i' : 1}]) { } } -''', errorFilter: (e) => e.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE); +''', errorFilter: (e) => e.diagnosticCode != WarningCode.unusedLocalVariable); } Future test_noType() async { @@ -248,7 +248,7 @@ class A { f() { for (final A(:a) in [A(1)]) { } } -''', errorFilter: (e) => e.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE); +''', errorFilter: (e) => e.diagnosticCode != WarningCode.unusedLocalVariable); } Future test_recordPattern() async { @@ -261,7 +261,7 @@ f() { f() { for (final (i, j) in [(1, 2)]) { } } -''', errorFilter: (e) => e.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE); +''', errorFilter: (e) => e.diagnosticCode != WarningCode.unusedLocalVariable); } Future test_type() async { diff --git a/pkg/analysis_server/test/src/services/correction/fix/merge_combinators_test.dart b/pkg/analysis_server/test/src/services/correction/fix/merge_combinators_test.dart index 236a237b1f2..d19ae113bf2 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/merge_combinators_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/merge_combinators_test.dart @@ -34,7 +34,7 @@ import 'other.dart' show Stream, Future hide Stream; DartFixKind.MERGE_COMBINATORS_HIDE_SHOW, ], errorFilter: (error) { - return error.diagnosticCode == WarningCode.MULTIPLE_COMBINATORS; + return error.diagnosticCode == WarningCode.multipleCombinators; }, ); } @@ -49,7 +49,7 @@ import 'other.dart' hide Stream hide Future; DartFixKind.MERGE_COMBINATORS_SHOW_HIDE, ], errorFilter: (error) { - return error.diagnosticCode == WarningCode.MULTIPLE_COMBINATORS; + return error.diagnosticCode == WarningCode.multipleCombinators; }, ); } @@ -58,7 +58,7 @@ import 'other.dart' hide Stream hide Future; @reflectiveTest class MergeHideUsingHideTest extends _MergeCombinatorTest { @override - DiagnosticCode get diagnosticCode => WarningCode.MULTIPLE_COMBINATORS; + DiagnosticCode get diagnosticCode => WarningCode.multipleCombinators; @override FixKind get kind => DartFixKind.MERGE_COMBINATORS_HIDE_HIDE; @@ -170,7 +170,7 @@ import 'other.dart' show Stream, FutureOr, Future show Stream, FutureOr; @reflectiveTest class MergeHideUsingShowTest extends _MergeCombinatorTest { @override - DiagnosticCode get diagnosticCode => WarningCode.MULTIPLE_COMBINATORS; + DiagnosticCode get diagnosticCode => WarningCode.multipleCombinators; @override FixKind get kind => DartFixKind.MERGE_COMBINATORS_SHOW_HIDE; @@ -282,7 +282,7 @@ import 'other.dart' show Stream, FutureOr, Future show Stream, FutureOr; @reflectiveTest class MergeShowUsingHideTest extends _MergeCombinatorTest { @override - DiagnosticCode get diagnosticCode => WarningCode.MULTIPLE_COMBINATORS; + DiagnosticCode get diagnosticCode => WarningCode.multipleCombinators; @override FixKind get kind => DartFixKind.MERGE_COMBINATORS_HIDE_SHOW; @@ -422,7 +422,7 @@ import 'other.dart' hide Completer, Future, Timer; @reflectiveTest class MergeShowUsingShowTest extends _MergeCombinatorTest { @override - DiagnosticCode get diagnosticCode => WarningCode.MULTIPLE_COMBINATORS; + DiagnosticCode get diagnosticCode => WarningCode.multipleCombinators; @override FixKind get kind => DartFixKind.MERGE_COMBINATORS_SHOW_SHOW; 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 99c144c4877..6d39f1cebd5 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 @@ -97,7 +97,7 @@ class OrganizeImportsDirectivesOrderingTest extends FixProcessorLintTest { var firstError = true; return (Diagnostic diagnostic) { if (firstError && - diagnostic.diagnosticCode == WarningCode.UNUSED_SHOWN_NAME) { + diagnostic.diagnosticCode == WarningCode.unusedShownName) { firstError = false; return true; } diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_abstract_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_abstract_test.dart index 9864555b5c5..4094f8f1024 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_abstract_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_abstract_test.dart @@ -28,7 +28,7 @@ class MyClass { abstract void m2() {} } '''); - await assertHasFixAllFix(ParserErrorCode.ABSTRACT_CLASS_MEMBER, ''' + await assertHasFixAllFix(ParserErrorCode.abstractClassMember, ''' class MyClass { void m1() {} void m2() {} 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 7cc1890f85f..5afed527034 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 @@ -22,7 +22,7 @@ void main() { } bool _ignoreDeadCode(Diagnostic diagnostic) => - diagnostic.diagnosticCode != WarningCode.DEAD_CODE; + diagnostic.diagnosticCode != WarningCode.deadCode; @reflectiveTest class RemoveComparisonTest extends FixProcessorTest { 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 ac091458f1c..e4471a25e3a 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 @@ -68,7 +68,7 @@ void f(int i) { errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, + CompileTimeErrorCode.constConstructorParamTypeMismatch, ); } @@ -175,7 +175,7 @@ var v = [const A(), B()]; errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, + CompileTimeErrorCode.nonConstantListElement, ); } @@ -203,7 +203,7 @@ Object f() { (error) => error.offset == parsedTestCode.positions[0].offset && error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, + CompileTimeErrorCode.nonConstantListElement, ); await assertHasFix( r''' @@ -219,7 +219,7 @@ Object f() { (error) => error.offset == parsedTestCode.positions[1].offset && error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, + CompileTimeErrorCode.nonConstantListElement, ); } @@ -247,7 +247,7 @@ Object f() { (error) => error.offset == parsedTestCode.position.offset && error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, + CompileTimeErrorCode.nonConstantListElement, ); } @@ -273,7 +273,7 @@ final x = [const A(), A.nonConst()]; errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, + CompileTimeErrorCode.nonConstantListElement, ); } } @@ -428,8 +428,7 @@ var v = {1: const A(), 2: B()}; // TODO(FMorschel): CONST_WITH_NON_CONST should not be probably triggered errorFilter: (error) => - error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, + error.diagnosticCode == CompileTimeErrorCode.nonConstantMapValue, ); } @@ -452,8 +451,7 @@ final v = {1: const A(), 2: A.nonConst()}; // TODO(FMorschel): CONST_WITH_NON_CONST should not be probably triggered errorFilter: (error) => - error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, + error.diagnosticCode == CompileTimeErrorCode.nonConstantMapValue, ); } } @@ -518,7 +516,7 @@ var v = {const A(), B()}; errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, + CompileTimeErrorCode.nonConstantSetElement, ); } @@ -542,7 +540,7 @@ final v = {const A(), A.nonConst()}; errorFilter: (error) => error.diagnosticCode == - CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, + CompileTimeErrorCode.nonConstantSetElement, ); } } @@ -713,7 +711,7 @@ class B { var x = B(a1: A(), b: const [0], a2: A()); ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST && + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst && e.offset == testCode.indexOf('A()'); }, ); @@ -753,7 +751,7 @@ class A {} var x = [A(), if (true) const [0] else const [1]]; ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST; + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst; }, ); } @@ -779,7 +777,7 @@ class B { var x = [A(), const B(), const B(), A()]; ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST && + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst && e.offset == testCode.indexOf('A()'); }, ); @@ -798,7 +796,7 @@ class A {} var x = [A(), const [0], const [1]]; ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST; + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst; }, ); } @@ -817,7 +815,7 @@ class A {} var x = [A(), ...const [0], ...const [1]]; ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST; + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst; }, ); } @@ -835,7 +833,7 @@ class A {} var x = {0: A(), ...const {1: 2}, ...const {3: 4}}; ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST; + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst; }, ); } @@ -853,7 +851,7 @@ class A {} var x = {A(), ...const {0}, ...const {1}}; ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST; + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst; }, ); } @@ -871,7 +869,7 @@ class A {} final x = A(), y = const [0], z = A(); ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST && + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst && e.offset == testCode.lastIndexOf('A()'); }, ); @@ -890,7 +888,7 @@ class A {} final Object x = A(), y = const [0]; ''', errorFilter: (e) { - return e.diagnosticCode == CompileTimeErrorCode.CONST_WITH_NON_CONST; + return e.diagnosticCode == CompileTimeErrorCode.constWithNonConst; }, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_extends_clause_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_extends_clause_test.dart index 1a87b3a1747..81d68e67fae 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_extends_clause_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_extends_clause_test.dart @@ -28,7 +28,7 @@ mixin class B extends A {} mixin class C extends A {} '''); await assertHasFixAllFix( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, ''' class A {} mixin class B {} 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 e1c583ee954..c8df29c3374 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 @@ -21,7 +21,7 @@ void main() { } bool _ignoreDeadCode(Diagnostic diagnostic) => - diagnostic.diagnosticCode != WarningCode.DEAD_CODE; + diagnostic.diagnosticCode != WarningCode.deadCode; @reflectiveTest class DeadNullAwareAssignmentExpressionTest extends FixProcessorTest { diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_lexeme_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_lexeme_test.dart index 8554b7db125..295dbc8da29 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_lexeme_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_lexeme_test.dart @@ -36,16 +36,13 @@ augment abstract class A {} augment final class A {} '''); - await assertHasFixAllFix( - CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, - ''' + await assertHasFixAllFix(CompileTimeErrorCode.augmentationModifierExtra, ''' part of 'a.dart'; augment class A {} augment class A {} -''', - ); +'''); } } diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_declaration_clause_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_declaration_clause_test.dart index c4c262c51d4..a530db9974c 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_declaration_clause_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_name_from_declaration_clause_test.dart @@ -331,8 +331,7 @@ final class S extends Struct {} final class C {} ''', errorFilter: - (error) => - error.diagnosticCode == FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH, + (error) => error.diagnosticCode == FfiCode.subtypeOfStructClassInWith, ); } } diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_on_clause_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_on_clause_test.dart index d7737cf9a00..83ba6a309aa 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_on_clause_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_on_clause_test.dart @@ -36,7 +36,7 @@ augment extension E on int { } augment extension E on num { } '''); await assertHasFixAllFix( - ParserErrorCode.EXTENSION_AUGMENTATION_HAS_ON_CLAUSE, + ParserErrorCode.extensionAugmentationHasOnClause, ''' part of 'a.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 f57e734fa7e..6f4dfa562fd 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 @@ -57,7 +57,7 @@ void f(Object p, Object q) { } } '''); - await assertHasFixAllFix(WarningCode.UNNECESSARY_CAST, ''' + await assertHasFixAllFix(WarningCode.unnecessaryCast, ''' void f(Object p, Object q) { if (p is String) { var v = p; diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_final_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_final_test.dart index f7feb5f2fd9..5ce622f2223 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_final_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_final_test.dart @@ -54,7 +54,7 @@ class A { int v2; } '''); - await assertHasFixAllFix(WarningCode.UNNECESSARY_FINAL, ''' + await assertHasFixAllFix(WarningCode.unnecessaryFinal, ''' class A { A(this.v1, this.v2); int v1; 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 ba7af2fe132..94d11c517c1 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 @@ -31,7 +31,7 @@ void f() { } } '''); - await assertHasFixAllFix(WarningCode.UNUSED_CATCH_CLAUSE, ''' + await assertHasFixAllFix(WarningCode.unusedCatchClause, ''' void f() { try { throw 42; 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 086983a98b7..d164dd8dee0 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 @@ -31,7 +31,7 @@ void f() { } } '''); - await assertHasFixAllFix(WarningCode.UNUSED_CATCH_STACK, ''' + await assertHasFixAllFix(WarningCode.unusedCatchStack, ''' void f() { try { throw 42; 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 b804c314e81..b79add4e4dd 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 @@ -181,7 +181,7 @@ enum _MyEnum {A, B, C} ''', errorFilter: (diagnostic) => - diagnostic.diagnosticCode == WarningCode.UNUSED_ELEMENT, + diagnostic.diagnosticCode == WarningCode.unusedElement, ); } 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 390dade74ce..341c1346929 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 @@ -94,7 +94,7 @@ import 'dart:math'; import 'dart:async'; void f() {} '''); - await assertHasFixAllFix(WarningCode.UNUSED_IMPORT, ''' + await assertHasFixAllFix(WarningCode.unusedImport, ''' void f() {} '''); } @@ -109,7 +109,7 @@ var tau = math.pi * 2; void f() {} '''); - await assertHasFixAllFix(WarningCode.UNUSED_IMPORT, ''' + await assertHasFixAllFix(WarningCode.unusedImport, ''' import 'dart:math' as math; var tau = math.pi * 2; @@ -126,7 +126,7 @@ void f() {} import 'dart:math'; import 'dart:math'; import 'dart:math'; void f() {} '''); - await assertHasFixAllFix(WarningCode.UNUSED_IMPORT, ''' + await assertHasFixAllFix(WarningCode.unusedImport, ''' void f() {} '''); @@ -137,7 +137,7 @@ void f() {} import 'dart:math'; import 'dart:math'; import 'dart:math'; void f() {} '''); - await assertHasFixAllFix(WarningCode.UNUSED_IMPORT, ''' + await assertHasFixAllFix(WarningCode.unusedImport, ''' import 'dart:math'; void f() {} '''); @@ -150,7 +150,7 @@ import 'dart:math'; import 'dart:math'; void f() {} '''); - await assertHasFixAllFix(WarningCode.UNUSED_IMPORT, ''' + await assertHasFixAllFix(WarningCode.unusedImport, ''' void f() {} '''); } @@ -213,7 +213,7 @@ import 'dart:_internal'; '''); await assertHasFix(''' -''', errorFilter: (e) => e.diagnosticCode == WarningCode.UNUSED_IMPORT); +''', errorFilter: (e) => e.diagnosticCode == WarningCode.unusedImport); } Future test_severalLines() async { 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 d62638ae60f..890e4da7390 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 @@ -272,7 +272,7 @@ void f() { errorFilter: (e) => e.diagnosticCode != - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, ); } } diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_var_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_var_test.dart index 32b04a19dd4..d882da6123a 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_var_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_var_test.dart @@ -75,7 +75,7 @@ typedef F = var Function(); typedef F = Function(); ''', errorFilter: (error) { - return error.diagnosticCode == ParserErrorCode.VAR_RETURN_TYPE; + return error.diagnosticCode == ParserErrorCode.varReturnType; }, ); } 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 ec432a055e4..db852df628a 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 @@ -28,7 +28,7 @@ void f() { boolean w; } '''); - await assertHasFixAllFix(CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN, ''' + await assertHasFixAllFix(CompileTimeErrorCode.undefinedClassBoolean, ''' void f() { bool v; bool w; 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 d36c869076c..c068df1be4f 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 @@ -140,7 +140,7 @@ Future> f() async {} ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; + CompileTimeErrorCode.illegalAsyncReturnType; }, ); } @@ -166,7 +166,7 @@ al.Future f() async {} ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; + CompileTimeErrorCode.illegalAsyncReturnType; }, ); } @@ -196,7 +196,7 @@ Future f() async {} ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE; + CompileTimeErrorCode.illegalAsyncReturnType; }, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_stream_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_stream_test.dart index 85c622a8eb5..7c64cdf4083 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_stream_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_stream_test.dart @@ -32,7 +32,7 @@ Stream> f() async* {} ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE; + CompileTimeErrorCode.illegalAsyncGeneratorReturnType; }, ); } @@ -58,7 +58,7 @@ al.Stream f() async* {} ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE; + CompileTimeErrorCode.illegalAsyncGeneratorReturnType; }, ); } @@ -75,7 +75,7 @@ Stream f() async* {} ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE; + CompileTimeErrorCode.illegalAsyncGeneratorReturnType; }, ); } diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_test.dart index 1935fa4e6c2..f85ae8d52e4 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/replace_return_type_test.dart @@ -93,7 +93,7 @@ void top() { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION; + CompileTimeErrorCode.returnOfInvalidTypeFromFunction; }, ); } @@ -137,7 +137,7 @@ class B extends A { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD; + CompileTimeErrorCode.returnOfInvalidTypeFromMethod; }, ); } @@ -215,7 +215,7 @@ num f() { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION; + CompileTimeErrorCode.returnOfInvalidTypeFromFunction; }, ); } @@ -244,7 +244,7 @@ class A { ''', errorFilter: (error) { return error.diagnosticCode == - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD; + CompileTimeErrorCode.returnOfInvalidTypeFromMethod; }, ); } 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 35513efde90..66cb02f35bb 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 @@ -33,7 +33,7 @@ class A { } ''', errorFilter: (error) { - return error.diagnosticCode == ParserErrorCode.VAR_AS_TYPE_NAME; + return error.diagnosticCode == ParserErrorCode.varAsTypeName; }, ); } 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 2fbe637a387..91304d17c16 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 @@ -28,7 +28,7 @@ void f(p, q) { q is Null; } '''); - await assertHasFixAllFix(WarningCode.TYPE_CHECK_IS_NULL, ''' + await assertHasFixAllFix(WarningCode.typeCheckIsNull, ''' void f(p, q) { p == null; q == null; 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 5c56d8d00a1..cea0f8315b1 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 @@ -28,7 +28,7 @@ void f(p, q) { q is! Null; } '''); - await assertHasFixAllFix(WarningCode.TYPE_CHECK_IS_NOT_NULL, ''' + await assertHasFixAllFix(WarningCode.typeCheckIsNotNull, ''' void f(p, q) { p != null; q != null; diff --git a/pkg/analysis_server_plugin/test/single_unit.dart b/pkg/analysis_server_plugin/test/single_unit.dart index 7d03f59597a..5d056bdb733 100644 --- a/pkg/analysis_server_plugin/test/single_unit.dart +++ b/pkg/analysis_server_plugin/test/single_unit.dart @@ -78,13 +78,13 @@ class SingleUnitTest with ResourceProviderMixin { var testUnit = result.unit; expect(result.diagnostics.where((d) { - return d.diagnosticCode != WarningCode.DEAD_CODE && - d.diagnosticCode != WarningCode.UNUSED_CATCH_CLAUSE && - d.diagnosticCode != WarningCode.UNUSED_CATCH_STACK && - d.diagnosticCode != WarningCode.UNUSED_ELEMENT && - d.diagnosticCode != WarningCode.UNUSED_FIELD && - d.diagnosticCode != WarningCode.UNUSED_IMPORT && - d.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE; + return d.diagnosticCode != WarningCode.deadCode && + d.diagnosticCode != WarningCode.unusedCatchClause && + d.diagnosticCode != WarningCode.unusedCatchStack && + d.diagnosticCode != WarningCode.unusedElement && + d.diagnosticCode != WarningCode.unusedField && + d.diagnosticCode != WarningCode.unusedImport && + d.diagnosticCode != WarningCode.unusedLocalVariable; }), isEmpty); findNode = FindNode(testCode, testUnit); diff --git a/pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart b/pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart index 0d8c5e45f2b..8fa392c0fad 100644 --- a/pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart +++ b/pkg/analyzer/lib/src/analysis_options/error/option_codes.g.dart @@ -37,7 +37,7 @@ class AnalysisOptionsErrorCode extends DiagnosticCode { /// Object p2: the ending offset of the text in the file that contains the /// error /// Object p3: the error message - static const AnalysisOptionsErrorCode INCLUDED_FILE_PARSE_ERROR = + static const AnalysisOptionsErrorCode includedFileParseError = AnalysisOptionsErrorCode( 'INCLUDED_FILE_PARSE_ERROR', "{3} in {0}({1}..{2})", @@ -47,7 +47,7 @@ class AnalysisOptionsErrorCode extends DiagnosticCode { /// /// Parameters: /// Object p0: the error message from the parse error - static const AnalysisOptionsErrorCode PARSE_ERROR = AnalysisOptionsErrorCode( + static const AnalysisOptionsErrorCode parseError = AnalysisOptionsErrorCode( 'PARSE_ERROR', "{0}", ); @@ -78,7 +78,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// /// Parameters: /// Object p0: the option name - static const AnalysisOptionsWarningCode ANALYSIS_OPTION_DEPRECATED = + static const AnalysisOptionsWarningCode analysisOptionDeprecated = AnalysisOptionsWarningCode( 'ANALYSIS_OPTION_DEPRECATED', "The option '{0}' is no longer supported.", @@ -90,7 +90,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Object p0: the option name /// Object p1: the replacement option name static const AnalysisOptionsWarningCode - ANALYSIS_OPTION_DEPRECATED_WITH_REPLACEMENT = AnalysisOptionsWarningCode( + analysisOptionDeprecatedWithReplacement = AnalysisOptionsWarningCode( 'ANALYSIS_OPTION_DEPRECATED', "The option '{0}' is no longer supported.", correctionMessage: "Try using the new '{1}' option.", @@ -101,7 +101,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the rule name - static const AnalysisOptionsWarningCode DEPRECATED_LINT = + static const AnalysisOptionsWarningCode deprecatedLint = AnalysisOptionsWarningCode( 'DEPRECATED_LINT', "'{0}' is a deprecated lint rule and should not be used.", @@ -113,7 +113,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the deprecated lint name /// String p1: the replacing rule name - static const AnalysisOptionsWarningCode DEPRECATED_LINT_WITH_REPLACEMENT = + static const AnalysisOptionsWarningCode deprecatedLintWithReplacement = AnalysisOptionsWarningCode( 'DEPRECATED_LINT_WITH_REPLACEMENT', "'{0}' is deprecated and should be replaced by '{1}'.", @@ -125,7 +125,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the rule name static const AnalysisOptionsWarningCode - DUPLICATE_RULE = AnalysisOptionsWarningCode( + duplicateRule = AnalysisOptionsWarningCode( 'DUPLICATE_RULE', "The rule {0} is already specified and doesn't need to be specified again.", correctionMessage: "Try removing all but one specification of the rule.", @@ -140,7 +140,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Object p2: the ending offset of the text in the file that contains the /// warning /// Object p3: the warning message - static const AnalysisOptionsWarningCode INCLUDED_FILE_WARNING = + static const AnalysisOptionsWarningCode includedFileWarning = AnalysisOptionsWarningCode( 'INCLUDED_FILE_WARNING', "Warning in the included options file {0}({1}..{2}): {3}", @@ -152,7 +152,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Object p0: the URI of the file to be included /// Object p1: the path of the file containing the include directive /// Object p2: the path of the context being analyzed - static const AnalysisOptionsWarningCode INCLUDE_FILE_NOT_FOUND = + static const AnalysisOptionsWarningCode includeFileNotFound = AnalysisOptionsWarningCode( 'INCLUDE_FILE_NOT_FOUND', "The include file '{0}' in '{1}' can't be found when analyzing '{2}'.", @@ -163,7 +163,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the rule name /// String p1: the incompatible rule - static const AnalysisOptionsWarningCode INCOMPATIBLE_LINT = + static const AnalysisOptionsWarningCode incompatibleLint = AnalysisOptionsWarningCode( 'INCOMPATIBLE_LINT', "The rule '{0}' is incompatible with the rule '{1}'.", @@ -176,7 +176,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the option name /// String p1: the detail message - static const AnalysisOptionsWarningCode INVALID_OPTION = + static const AnalysisOptionsWarningCode invalidOption = AnalysisOptionsWarningCode( 'INVALID_OPTION', "Invalid option specified for '{0}': {1}", @@ -186,7 +186,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the section name - static const AnalysisOptionsWarningCode INVALID_SECTION_FORMAT = + static const AnalysisOptionsWarningCode invalidSectionFormat = AnalysisOptionsWarningCode( 'INVALID_SECTION_FORMAT', "Invalid format for the '{0}' section.", @@ -196,7 +196,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the first plugin - static const AnalysisOptionsWarningCode MULTIPLE_PLUGINS = + static const AnalysisOptionsWarningCode multiplePlugins = AnalysisOptionsWarningCode( 'MULTIPLE_PLUGINS', "Multiple plugins can't be enabled.", @@ -208,7 +208,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the URI of the file to be included /// Object p1: the path of the file containing the include directive - static const AnalysisOptionsWarningCode RECURSIVE_INCLUDE_FILE = + static const AnalysisOptionsWarningCode recursiveIncludeFile = AnalysisOptionsWarningCode( 'RECURSIVE_INCLUDE_FILE', "The include file '{0}' in '{1}' includes itself recursively.", @@ -221,7 +221,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the rule name /// String p1: the SDK version in which the lint was removed - static const AnalysisOptionsWarningCode REMOVED_LINT = + static const AnalysisOptionsWarningCode removedLint = AnalysisOptionsWarningCode( 'REMOVED_LINT', "'{0}' was removed in Dart '{1}'", @@ -234,7 +234,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// String p0: the rule name /// String p1: the SDK version in which the lint was removed /// String p2: the name of a replacing lint - static const AnalysisOptionsWarningCode REPLACED_LINT = + static const AnalysisOptionsWarningCode replacedLint = AnalysisOptionsWarningCode( 'REPLACED_LINT', "'{0}' was replaced by '{2}' in Dart '{1}'.", @@ -245,7 +245,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the rule name - static const AnalysisOptionsWarningCode UNDEFINED_LINT = + static const AnalysisOptionsWarningCode undefinedLint = AnalysisOptionsWarningCode( 'UNDEFINED_LINT', "'{0}' is not a recognized lint rule.", @@ -257,7 +257,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the unrecognized error code - static const AnalysisOptionsWarningCode UNRECOGNIZED_ERROR_CODE = + static const AnalysisOptionsWarningCode unrecognizedErrorCode = AnalysisOptionsWarningCode( 'UNRECOGNIZED_ERROR_CODE', "'{0}' isn't a recognized error code.", @@ -269,7 +269,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the plugin name /// String p1: the unsupported option key - static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITHOUT_VALUES = + static const AnalysisOptionsWarningCode unsupportedOptionWithoutValues = AnalysisOptionsWarningCode( 'UNSUPPORTED_OPTION_WITHOUT_VALUES', "The option '{1}' isn't supported by '{0}'.", @@ -283,7 +283,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// String p1: the unsupported option key /// String p2: the legal value static const AnalysisOptionsWarningCode - UNSUPPORTED_OPTION_WITH_LEGAL_VALUE = AnalysisOptionsWarningCode( + unsupportedOptionWithLegalValue = AnalysisOptionsWarningCode( 'UNSUPPORTED_OPTION_WITH_LEGAL_VALUE', "The option '{1}' isn't supported by '{0}'. Try using the only supported " "option: '{2}'.", @@ -296,7 +296,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// String p0: the section name /// String p1: the unsupported option key /// String p2: legal values - static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION_WITH_LEGAL_VALUES = + static const AnalysisOptionsWarningCode unsupportedOptionWithLegalValues = AnalysisOptionsWarningCode( 'UNSUPPORTED_OPTION_WITH_LEGAL_VALUES', "The option '{1}' isn't supported by '{0}'.", @@ -310,7 +310,7 @@ class AnalysisOptionsWarningCode extends DiagnosticCode { /// String p0: the option name /// int p1: the unsupported value /// String p2: legal values - static const AnalysisOptionsWarningCode UNSUPPORTED_VALUE = + static const AnalysisOptionsWarningCode unsupportedValue = AnalysisOptionsWarningCode( 'UNSUPPORTED_VALUE', "The value '{1}' isn't supported by '{0}'.", diff --git a/pkg/analyzer/lib/src/analysis_options/options_file_validator.dart b/pkg/analyzer/lib/src/analysis_options/options_file_validator.dart index 2157816548d..d3b12ad2196 100644 --- a/pkg/analyzer/lib/src/analysis_options/options_file_validator.dart +++ b/pkg/analyzer/lib/src/analysis_options/options_file_validator.dart @@ -62,7 +62,7 @@ List analyzeAnalysisOptions( source: initialSource, offset: initialIncludeSpan!.start.offset, length: initialIncludeSpan!.length, - diagnosticCode: AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING, + diagnosticCode: AnalysisOptionsWarningCode.includedFileWarning, arguments: args, ), ); @@ -121,7 +121,7 @@ List analyzeAnalysisOptions( source: initialSource, offset: initialIncludeSpan!.start.offset, length: initialIncludeSpan!.length, - diagnosticCode: AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, + diagnosticCode: AnalysisOptionsWarningCode.recursiveIncludeFile, arguments: [includeUri, source.fullName], ), ); @@ -133,7 +133,7 @@ List analyzeAnalysisOptions( source: initialSource, offset: initialIncludeSpan!.start.offset, length: initialIncludeSpan!.length, - diagnosticCode: AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND, + diagnosticCode: AnalysisOptionsWarningCode.includeFileNotFound, arguments: [includeUri, source.fullName, contextRoot], ), ); @@ -146,7 +146,7 @@ List analyzeAnalysisOptions( source: initialSource, offset: initialIncludeSpan!.start.offset, length: initialIncludeSpan!.length, - diagnosticCode: AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING, + diagnosticCode: AnalysisOptionsWarningCode.includedFileWarning, arguments: [ includedSource, spanInChain.start.offset, @@ -190,7 +190,7 @@ List analyzeAnalysisOptions( source: initialSource, offset: initialIncludeSpan!.start.offset, length: initialIncludeSpan!.length, - diagnosticCode: AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR, + diagnosticCode: AnalysisOptionsErrorCode.includedFileParseError, arguments: args, ), ); @@ -218,7 +218,7 @@ List analyzeAnalysisOptions( source: source, offset: span.start.offset, length: span.length, - diagnosticCode: AnalysisOptionsErrorCode.PARSE_ERROR, + diagnosticCode: AnalysisOptionsErrorCode.parseError, arguments: [e.message], ), ); @@ -354,7 +354,7 @@ class _CannotIgnoreOptionValidator extends OptionsValidator { !_removedDiagnosticCodes.contains(upperCaseName)) { reporter.atSourceSpan( unignorableNameNode.span, - AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE, + AnalysisOptionsWarningCode.unrecognizedErrorCode, arguments: [unignorableName], ); } else if (listedNames.contains(upperCaseName)) { @@ -366,7 +366,7 @@ class _CannotIgnoreOptionValidator extends OptionsValidator { } else { reporter.atSourceSpan( unignorableNameNode.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.cannotIgnore], ); } @@ -374,7 +374,7 @@ class _CannotIgnoreOptionValidator extends OptionsValidator { } else if (unignorableNames != null) { reporter.atSourceSpan( unignorableNames.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.cannotIgnore], ); } @@ -395,7 +395,7 @@ class _CodeStyleOptionsValidator extends OptionsValidator { } else { reporter.atSourceSpan( keyNode.span, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES, + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues, arguments: [AnalysisOptionsFile.codeStyle, keyNode.toString()], ); } @@ -403,13 +403,13 @@ class _CodeStyleOptionsValidator extends OptionsValidator { } else if (codeStyle is YamlScalar && codeStyle.value != null) { reporter.atSourceSpan( codeStyle.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.codeStyle], ); } else if (codeStyle is YamlList) { reporter.atSourceSpan( codeStyle.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.codeStyle], ); } @@ -419,7 +419,7 @@ class _CodeStyleOptionsValidator extends OptionsValidator { if (format is! YamlScalar) { reporter.atSourceSpan( format.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.format], ); return; @@ -428,7 +428,7 @@ class _CodeStyleOptionsValidator extends OptionsValidator { if (formatValue == null) { reporter.atSourceSpan( format.span, - AnalysisOptionsWarningCode.UNSUPPORTED_VALUE, + AnalysisOptionsWarningCode.unsupportedValue, arguments: [ AnalysisOptionsFile.format, format.valueOrThrow, @@ -471,7 +471,7 @@ class _EnableExperimentsValidator extends OptionsValidator { if (validationResult is UnrecognizedFlag) { reporter.atSourceSpan( span, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES, + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues, arguments: [ AnalysisOptionsFile.enableExperiment, flags[flagIndex], @@ -480,7 +480,7 @@ class _EnableExperimentsValidator extends OptionsValidator { } else { reporter.atSourceSpan( span, - AnalysisOptionsWarningCode.INVALID_OPTION, + AnalysisOptionsWarningCode.invalidOption, arguments: [ AnalysisOptionsFile.enableExperiment, validationResult.message, @@ -491,7 +491,7 @@ class _EnableExperimentsValidator extends OptionsValidator { } else if (experimentNames != null) { reporter.atSourceSpan( experimentNames.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.enableExperiment], ); } @@ -502,13 +502,13 @@ class _EnableExperimentsValidator extends OptionsValidator { /// Builds error reports with value proposals. class _ErrorBuilder { static AnalysisOptionsWarningCode get noProposalCode => - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES; + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues; static AnalysisOptionsWarningCode get pluralProposalCode => - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES; + AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues; static AnalysisOptionsWarningCode get singularProposalCode => - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE; + AnalysisOptionsWarningCode.unsupportedOptionWithLegalValue; final String proposal; @@ -593,7 +593,7 @@ class _ErrorFilterOptionValidator extends OptionsValidator { !_removedDiagnosticCodes.contains(value)) { reporter.atSourceSpan( k.span, - AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE, + AnalysisOptionsWarningCode.unrecognizedErrorCode, arguments: [k.value.toString()], ); } @@ -603,7 +603,7 @@ class _ErrorFilterOptionValidator extends OptionsValidator { if (!legalValues.contains(value)) { reporter.atSourceSpan( v.span, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES, + AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues, arguments: [ AnalysisOptionsFile.errors, v.value.toString(), @@ -614,7 +614,7 @@ class _ErrorFilterOptionValidator extends OptionsValidator { } else { reporter.atSourceSpan( v.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.enableExperiment], ); } @@ -622,7 +622,7 @@ class _ErrorFilterOptionValidator extends OptionsValidator { } else if (filters != null) { reporter.atSourceSpan( filters.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.enableExperiment], ); } @@ -649,7 +649,7 @@ class _FormatterOptionsValidator extends OptionsValidator { } else { reporter.atSourceSpan( keyNode.span, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES, + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues, arguments: [AnalysisOptionsFile.formatter, keyNode.toString()], ); } @@ -657,7 +657,7 @@ class _FormatterOptionsValidator extends OptionsValidator { } else if (formatter.value != null) { reporter.atSourceSpan( formatter.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.formatter], ); } @@ -672,7 +672,7 @@ class _FormatterOptionsValidator extends OptionsValidator { if (value is! int || value <= 0) { reporter.atSourceSpan( valueNode.span, - AnalysisOptionsWarningCode.INVALID_OPTION, + AnalysisOptionsWarningCode.invalidOption, arguments: [ keyNode.toString(), '"page_width" must be a positive integer.', @@ -691,7 +691,7 @@ class _FormatterOptionsValidator extends OptionsValidator { if (!TrailingCommas.values.any((item) => item.name == value)) { reporter.atSourceSpan( valueNode.span, - AnalysisOptionsWarningCode.INVALID_OPTION, + AnalysisOptionsWarningCode.invalidOption, arguments: [ keyNode.toString(), '"trailing_commas" must be "automate" or "preserve".', @@ -732,7 +732,7 @@ class _LanguageOptionValidator extends OptionsValidator { if (!AnalysisOptionsFile.trueOrFalse.contains(value)) { reporter.atSourceSpan( v.span, - AnalysisOptionsWarningCode.UNSUPPORTED_VALUE, + AnalysisOptionsWarningCode.unsupportedValue, arguments: [ key!, v.valueOrThrow, @@ -745,13 +745,13 @@ class _LanguageOptionValidator extends OptionsValidator { } else if (language is YamlScalar && language.value != null) { reporter.atSourceSpan( language.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.language], ); } else if (language is YamlList) { reporter.atSourceSpan( language.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.language], ); } @@ -780,7 +780,7 @@ class _LegacyPluginsOptionValidator extends OptionsValidator { _firstIncludedPluginName != plugins.value) { reporter.atSourceSpan( plugins.span, - AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, + AnalysisOptionsWarningCode.multiplePlugins, arguments: [_firstIncludedPluginName], ); } @@ -792,7 +792,7 @@ class _LegacyPluginsOptionValidator extends OptionsValidator { if (plugin.value != _firstIncludedPluginName) { reporter.atSourceSpan( plugin.span, - AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, + AnalysisOptionsWarningCode.multiplePlugins, arguments: [_firstIncludedPluginName], ); } @@ -812,7 +812,7 @@ class _LegacyPluginsOptionValidator extends OptionsValidator { } else if (plugin.value != firstPlugin) { reporter.atSourceSpan( plugin.span, - AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, + AnalysisOptionsWarningCode.multiplePlugins, arguments: [firstPlugin], ); } @@ -826,7 +826,7 @@ class _LegacyPluginsOptionValidator extends OptionsValidator { if (plugin != null && plugin.value != _firstIncludedPluginName) { reporter.atSourceSpan( plugin.span, - AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, + AnalysisOptionsWarningCode.multiplePlugins, arguments: [_firstIncludedPluginName], ); } @@ -846,7 +846,7 @@ class _LegacyPluginsOptionValidator extends OptionsValidator { } else if (plugin != null && plugin.value != firstPlugin) { reporter.atSourceSpan( plugin.span, - AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, + AnalysisOptionsWarningCode.multiplePlugins, arguments: [firstPlugin], ); } @@ -898,7 +898,7 @@ class _OptionalChecksValueValidator extends OptionsValidator { if (!AnalysisOptionsFile.trueOrFalse.contains(value)) { reporter.atSourceSpan( v.span, - AnalysisOptionsWarningCode.UNSUPPORTED_VALUE, + AnalysisOptionsWarningCode.unsupportedValue, arguments: [ key!, v.valueOrThrow, @@ -912,7 +912,7 @@ class _OptionalChecksValueValidator extends OptionsValidator { } else if (v != null) { reporter.atSourceSpan( v.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.enableExperiment], ); } @@ -945,7 +945,7 @@ class _PluginsOptionsValidator extends OptionsValidator { default: reporter.atSourceSpan( plugins.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: ['${AnalysisOptionsFile.plugins}/$pluginName'], ); } @@ -953,14 +953,14 @@ class _PluginsOptionsValidator extends OptionsValidator { case YamlList(): reporter.atSourceSpan( plugins.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.plugins], ); case YamlScalar(:var value): if (value != null) { reporter.atSourceSpan( plugins.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.plugins], ); } @@ -1005,7 +1005,7 @@ class _StrongModeOptionValueValidator extends OptionsValidator { } else if (strongModeNode != null) { reporter.atSourceSpan( strongModeNode.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.strongMode], ); } @@ -1024,7 +1024,7 @@ class _StrongModeOptionValueValidator extends OptionsValidator { } else if (key == AnalysisOptionsFile.declarationCasts) { reporter.atSourceSpan( v.span, - AnalysisOptionsWarningCode.UNSUPPORTED_VALUE, + AnalysisOptionsWarningCode.unsupportedValue, arguments: [ AnalysisOptionsFile.strongMode, v.valueOrThrow, @@ -1038,7 +1038,7 @@ class _StrongModeOptionValueValidator extends OptionsValidator { if (!AnalysisOptionsFile.trueOrFalse.contains(value)) { reporter.atSourceSpan( v.span, - AnalysisOptionsWarningCode.UNSUPPORTED_VALUE, + AnalysisOptionsWarningCode.unsupportedValue, arguments: [ key!, v.valueOrThrow, @@ -1071,8 +1071,8 @@ class _TopLevelOptionValidator extends OptionsValidator { _valueProposal = supportedOptions.quotedAndCommaSeparatedWithAnd, _warningCode = supportedOptions.length == 1 - ? AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE - : AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES; + ? AnalysisOptionsWarningCode.unsupportedOptionWithLegalValue + : AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues; @override void validate(DiagnosticReporter reporter, YamlMap options) { @@ -1083,7 +1083,7 @@ class _TopLevelOptionValidator extends OptionsValidator { if (node is! YamlMap) { reporter.atSourceSpan( node.span, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, + AnalysisOptionsWarningCode.invalidSectionFormat, arguments: [AnalysisOptionsFile.cannotIgnore], ); return; diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart index 630b5a9fbb6..f0d970f8c35 100644 --- a/pkg/analyzer/lib/src/dart/analysis/driver.dart +++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart @@ -1975,7 +1975,7 @@ class AnalysisDriver { source: file.source, offset: 0, length: 0, - diagnosticCode: CompileTimeErrorCode.MISSING_DART_LIBRARY, + diagnosticCode: CompileTimeErrorCode.missingDartLibrary, arguments: [missingUri], ), ], diff --git a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart index 11f96e0c5da..0c87be8e55f 100644 --- a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart +++ b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart @@ -282,7 +282,7 @@ class LibraryAnalyzer { if (shouldReport) { libraryUnitAnalysis.diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.INCONSISTENT_LANGUAGE_VERSION_OVERRIDE, + CompileTimeErrorCode.inconsistentLanguageVersionOverride, ); } } @@ -618,20 +618,20 @@ class LibraryAnalyzer { for (var errorCode in errorCodes) { if (const { - CompileTimeErrorCode.AMBIGUOUS_IMPORT, - CompileTimeErrorCode.CONST_WITH_NON_TYPE, - CompileTimeErrorCode.EXTENDS_NON_CLASS, - CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, - CompileTimeErrorCode.MIXIN_OF_NON_CLASS, - CompileTimeErrorCode.NEW_WITH_NON_TYPE, - CompileTimeErrorCode.NOT_A_TYPE, - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - CompileTimeErrorCode.UNDEFINED_ANNOTATION, - CompileTimeErrorCode.UNDEFINED_CLASS, - CompileTimeErrorCode.UNDEFINED_FUNCTION, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER, - CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, - WarningCode.DEPRECATED_EXPORT_USE, + CompileTimeErrorCode.ambiguousImport, + CompileTimeErrorCode.constWithNonType, + CompileTimeErrorCode.extendsNonClass, + CompileTimeErrorCode.implementsNonClass, + CompileTimeErrorCode.mixinOfNonClass, + CompileTimeErrorCode.newWithNonType, + CompileTimeErrorCode.notAType, + CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, + CompileTimeErrorCode.undefinedAnnotation, + CompileTimeErrorCode.undefinedClass, + CompileTimeErrorCode.undefinedFunction, + CompileTimeErrorCode.undefinedIdentifier, + CompileTimeErrorCode.undefinedPrefixedName, + WarningCode.deprecatedExportUse, }.contains(errorCode)) { return true; } @@ -696,13 +696,13 @@ class LibraryAnalyzer { if (selectedUriStr.startsWith('dart-ext:')) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.USE_OF_NATIVE_EXTENSION, + CompileTimeErrorCode.useOfNativeExtension, ); } else if (state.importedSource == null) { var errorCode = state.isDocImport - ? WarningCode.URI_DOES_NOT_EXIST_IN_DOC_IMPORT - : CompileTimeErrorCode.URI_DOES_NOT_EXIST; + ? WarningCode.uriDoesNotExistInDocImport + : CompileTimeErrorCode.uriDoesNotExist; diagnosticReporter.atNode( directive.uri, errorCode, @@ -711,10 +711,10 @@ class LibraryAnalyzer { } else if (state is LibraryImportWithFile && !state.importedFile.exists) { var errorCode = state.isDocImport - ? WarningCode.URI_DOES_NOT_EXIST_IN_DOC_IMPORT + ? WarningCode.uriDoesNotExistInDocImport : state.importedSource.isGenerated - ? CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED - : CompileTimeErrorCode.URI_DOES_NOT_EXIST; + ? CompileTimeErrorCode.uriHasNotBeenGenerated + : CompileTimeErrorCode.uriDoesNotExist; diagnosticReporter.atNode( directive.uri, errorCode, @@ -723,20 +723,20 @@ class LibraryAnalyzer { } else if (state.importedLibrarySource == null) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, + CompileTimeErrorCode.importOfNonLibrary, arguments: [selectedUriStr], ); } } else if (state is LibraryImportWithUriStr) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.INVALID_URI, + CompileTimeErrorCode.invalidUri, arguments: [state.selectedUri.relativeUriStr], ); } else { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.URI_WITH_INTERPOLATION, + CompileTimeErrorCode.uriWithInterpolation, ); } } @@ -920,19 +920,19 @@ class LibraryAnalyzer { if (selectedUriStr.startsWith('dart-ext:')) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.USE_OF_NATIVE_EXTENSION, + CompileTimeErrorCode.useOfNativeExtension, ); } else if (state.exportedSource == null) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.URI_DOES_NOT_EXIST, + CompileTimeErrorCode.uriDoesNotExist, arguments: [selectedUriStr], ); } else if (state is LibraryExportWithFile && !state.exportedFile.exists) { var errorCode = isGeneratedSource(state.exportedSource) - ? CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED - : CompileTimeErrorCode.URI_DOES_NOT_EXIST; + ? CompileTimeErrorCode.uriHasNotBeenGenerated + : CompileTimeErrorCode.uriDoesNotExist; diagnosticReporter.atNode( directive.uri, errorCode, @@ -941,20 +941,20 @@ class LibraryAnalyzer { } else if (state.exportedLibrarySource == null) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, + CompileTimeErrorCode.exportOfNonLibrary, arguments: [selectedUriStr], ); } } else if (state is LibraryExportWithUriStr) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.INVALID_URI, + CompileTimeErrorCode.invalidUri, arguments: [state.selectedUri.relativeUriStr], ); } else { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.URI_WITH_INTERPOLATION, + CompileTimeErrorCode.uriWithInterpolation, ); } } @@ -1001,13 +1001,13 @@ class LibraryAnalyzer { } if (partState is! PartIncludeWithUriStr) { - reportOnDirectiveUri(CompileTimeErrorCode.URI_WITH_INTERPOLATION); + reportOnDirectiveUri(CompileTimeErrorCode.uriWithInterpolation); return; } if (partState is! PartIncludeWithUri) { reportOnDirectiveUri( - CompileTimeErrorCode.INVALID_URI, + CompileTimeErrorCode.invalidUri, arguments: [partState.selectedUri.relativeUriStr], ); return; @@ -1015,7 +1015,7 @@ class LibraryAnalyzer { if (partState is! PartIncludeWithFile) { reportOnDirectiveUri( - CompileTimeErrorCode.URI_DOES_NOT_EXIST, + CompileTimeErrorCode.uriDoesNotExist, arguments: [partState.selectedUri.relativeUriStr], ); return; @@ -1027,11 +1027,11 @@ class LibraryAnalyzer { if (includedKind is! PartFileKind) { DiagnosticCode diagnosticCode; if (includedFile.exists) { - diagnosticCode = CompileTimeErrorCode.PART_OF_NON_PART; + diagnosticCode = CompileTimeErrorCode.partOfNonPart; } else if (isGeneratedSource(includedFile.source)) { - diagnosticCode = CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED; + diagnosticCode = CompileTimeErrorCode.uriHasNotBeenGenerated; } else { - diagnosticCode = CompileTimeErrorCode.URI_DOES_NOT_EXIST; + diagnosticCode = CompileTimeErrorCode.uriDoesNotExist; } reportOnDirectiveUri(diagnosticCode, arguments: [includedFile.uriStr]); return; @@ -1042,7 +1042,7 @@ class LibraryAnalyzer { // if (_libraryFiles.containsKey(includedFile)) { reportOnDirectiveUri( - CompileTimeErrorCode.DUPLICATE_PART, + CompileTimeErrorCode.duplicatePart, arguments: [includedFile.uri], ); return; @@ -1057,19 +1057,19 @@ class LibraryAnalyzer { var libraryName = _libraryElement.name; if (libraryName.isEmpty) { reportOnDirectiveUri( - CompileTimeErrorCode.PART_OF_UNNAMED_LIBRARY, + CompileTimeErrorCode.partOfUnnamedLibrary, arguments: [name], ); } else { reportOnDirectiveUri( - CompileTimeErrorCode.PART_OF_DIFFERENT_LIBRARY, + CompileTimeErrorCode.partOfDifferentLibrary, arguments: [libraryName, name], ); } } case PartOfUriFileKind(): reportOnDirectiveUri( - CompileTimeErrorCode.PART_OF_DIFFERENT_LIBRARY, + CompileTimeErrorCode.partOfDifferentLibrary, arguments: [enclosingFile.file.uriStr, includedFile.uriStr], ); } diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart index 1eb9ad80abe..9b38166a970 100644 --- a/pkg/analyzer/lib/src/dart/ast/ast.dart +++ b/pkg/analyzer/lib/src/dart/ast/ast.dart @@ -7899,7 +7899,7 @@ sealed class ExpressionImpl extends CollectionElementImpl var constant = visitor.evaluateAndReportInvalidConstant(this); var isInvalidConstant = diagnosticListener.diagnostics.any( - (e) => e.diagnosticCode == CompileTimeErrorCode.INVALID_CONSTANT, + (e) => e.diagnosticCode == CompileTimeErrorCode.invalidConstant, ); if (isInvalidConstant) { return null; diff --git a/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart b/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart index c6c09373f3b..30c33d02763 100644 --- a/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart +++ b/pkg/analyzer/lib/src/dart/constant/constant_verifier.dart @@ -112,7 +112,7 @@ class ConstantVerifier extends RecursiveAstVisitor { if (!element.isConst) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR, + CompileTimeErrorCode.nonConstantAnnotationConstructor, ); return; } @@ -121,7 +121,7 @@ class ConstantVerifier extends RecursiveAstVisitor { if (argumentList == null) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, + CompileTimeErrorCode.noAnnotationConstructorArguments, ); return; } @@ -139,7 +139,7 @@ class ConstantVerifier extends RecursiveAstVisitor { var value = _evaluateAndReportError( expression, - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, ); if (value is DartObjectImpl) { if (_currentLibrary.featureSet.isEnabled(Feature.patterns)) { @@ -152,7 +152,7 @@ class ConstantVerifier extends RecursiveAstVisitor { if (!_canBeEqual(constantType, matchedValueType)) { _diagnosticReporter.atNode( node, - WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, + WarningCode.constantPatternNeverMatchesValueType, arguments: [matchedValueType, constantType], ); return; @@ -177,7 +177,7 @@ class ConstantVerifier extends RecursiveAstVisitor { !element.isFactory) { _diagnosticReporter.atNode( node.returnType, - CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, + CompileTimeErrorCode.recursiveConstantConstructor, ); } @@ -200,7 +200,7 @@ class ConstantVerifier extends RecursiveAstVisitor { if (node.inConstantContext || node.inConstantExpression) { _checkForConstWithTypeParameters( node.constructorName.type, - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersConstructorTearoff, ); } } @@ -252,7 +252,7 @@ class ConstantVerifier extends RecursiveAstVisitor { for (var typeArgument in typeArguments.arguments) { _checkForConstWithTypeParameters( typeArgument, - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, ); } } @@ -267,7 +267,7 @@ class ConstantVerifier extends RecursiveAstVisitor { (parent as Expression).inConstantContext) { _checkForConstWithTypeParameters( node, - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, + CompileTimeErrorCode.constWithTypeParameters, ); } } @@ -280,7 +280,7 @@ class ConstantVerifier extends RecursiveAstVisitor { var namedType = node.constructorName.type; _checkForConstWithTypeParameters( namedType, - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, + CompileTimeErrorCode.constWithTypeParameters, ); var constructor = node.constructorName.element; @@ -300,7 +300,7 @@ class ConstantVerifier extends RecursiveAstVisitor { var elementType = nodeType.typeArguments[0]; var verifier = _ConstLiteralVerifier( this, - diagnosticCode: CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, + diagnosticCode: CompileTimeErrorCode.nonConstantListElement, listElementType: elementType, ); for (var element in node.elements) { @@ -334,7 +334,7 @@ class ConstantVerifier extends RecursiveAstVisitor { var key = element.key; var keyValue = _evaluateAndReportError( key, - CompileTimeErrorCode.NON_CONSTANT_MAP_PATTERN_KEY, + CompileTimeErrorCode.nonConstantMapPatternKey, ); if (keyValue is DartObjectImpl) { _mapPatternKeyValues?[key] = keyValue; @@ -373,7 +373,7 @@ class ConstantVerifier extends RecursiveAstVisitor { for (var field in node.fields) { _evaluateAndReportError( field, - CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD, + CompileTimeErrorCode.nonConstantRecordField, ); } } @@ -385,7 +385,7 @@ class ConstantVerifier extends RecursiveAstVisitor { _evaluateAndReportError( node.operand, - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, ); } @@ -399,7 +399,7 @@ class ConstantVerifier extends RecursiveAstVisitor { var config = _SetVerifierConfig(elementType: elementType); var verifier = _ConstLiteralVerifier( this, - diagnosticCode: CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, + diagnosticCode: CompileTimeErrorCode.nonConstantSetElement, setConfig: config, ); for (CollectionElement element in node.elements) { @@ -423,7 +423,7 @@ class ConstantVerifier extends RecursiveAstVisitor { var config = _MapVerifierConfig(keyType: keyType, valueType: valueType); var verifier = _ConstLiteralVerifier( this, - diagnosticCode: CompileTimeErrorCode.NON_CONSTANT_MAP_ELEMENT, + diagnosticCode: CompileTimeErrorCode.nonConstantMapElement, mapConfig: config, ); for (var entry in node.elements) { @@ -514,7 +514,7 @@ class ConstantVerifier extends RecursiveAstVisitor { if (node.isConst) { _reportError( result, - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, ); } else { _reportError(result, null); @@ -562,7 +562,7 @@ class ConstantVerifier extends RecursiveAstVisitor { /// /// A generic function type is allowed to reference its own type parameter(s). /// - /// See [CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS]. + /// See [CompileTimeErrorCode.constWithTypeParameters]. void _checkForConstWithTypeParameters( TypeAnnotation type, DiagnosticCode diagnosticCode, { @@ -678,150 +678,133 @@ class ConstantVerifier extends RecursiveAstVisitor { DiagnosticCode diagnosticCode = error.diagnosticCode; if (identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, + CompileTimeErrorCode.constEvalExtensionMethod, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, + CompileTimeErrorCode.constEvalExtensionTypeMethod, + ) || + identical(diagnosticCode, CompileTimeErrorCode.constEvalForElement) || + identical( + diagnosticCode, + CompileTimeErrorCode.constEvalMethodInvocation, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, + CompileTimeErrorCode.constEvalPrimitiveEquality, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, + CompileTimeErrorCode.constEvalPropertyAccess, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, + CompileTimeErrorCode.constEvalThrowsException, + ) || + identical(diagnosticCode, CompileTimeErrorCode.constEvalThrowsIdbze) || + identical( + diagnosticCode, + CompileTimeErrorCode.constEvalTypeBoolNumString, + ) || + identical(diagnosticCode, CompileTimeErrorCode.constEvalTypeBool) || + identical(diagnosticCode, CompileTimeErrorCode.constEvalTypeBoolInt) || + identical(diagnosticCode, CompileTimeErrorCode.constEvalTypeInt) || + identical(diagnosticCode, CompileTimeErrorCode.constEvalTypeNum) || + identical( + diagnosticCode, + CompileTimeErrorCode.constEvalTypeNumString, + ) || + identical(diagnosticCode, CompileTimeErrorCode.constEvalTypeString) || + identical( + diagnosticCode, + CompileTimeErrorCode.recursiveCompileTimeConstant, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, + CompileTimeErrorCode.constConstructorFieldTypeMismatch, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constConstructorParamTypeMismatch, + ) || + identical(diagnosticCode, CompileTimeErrorCode.constTypeParameter) || + identical( + diagnosticCode, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE, + CompileTimeErrorCode.constSpreadExpectedListOrSet, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, + CompileTimeErrorCode.constSpreadExpectedMap, ) || - identical(diagnosticCode, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL) || + identical(diagnosticCode, CompileTimeErrorCode.expressionInMap) || + identical(diagnosticCode, CompileTimeErrorCode.variableTypeMismatch) || + identical(diagnosticCode, CompileTimeErrorCode.nonBoolCondition) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT, - ) || - identical(diagnosticCode, CompileTimeErrorCode.CONST_EVAL_TYPE_INT) || - identical(diagnosticCode, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM) || - identical( - diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_TYPE_NUM_STRING, + CompileTimeErrorCode.nonConstantDefaultValueFromDeferredLibrary, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_EVAL_TYPE_STRING, + CompileTimeErrorCode.nonConstantMapKeyFromDeferredLibrary, ) || identical( diagnosticCode, - CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, + CompileTimeErrorCode.nonConstantMapValueFromDeferredLibrary, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, + CompileTimeErrorCode.setElementFromDeferredLibrary, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - ) || - identical(diagnosticCode, CompileTimeErrorCode.CONST_TYPE_PARAMETER) || - identical( - diagnosticCode, - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.spreadExpressionFromDeferredLibrary, ) || identical( diagnosticCode, - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, - ) || - identical( - diagnosticCode, - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, - ) || - identical(diagnosticCode, CompileTimeErrorCode.EXPRESSION_IN_MAP) || - identical( - diagnosticCode, - CompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, - ) || - identical(diagnosticCode, CompileTimeErrorCode.NON_BOOL_CONDITION) || - identical( - diagnosticCode, - CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY, - ) || - identical( - diagnosticCode, - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY, - ) || - identical( - diagnosticCode, - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY, - ) || - identical( - diagnosticCode, - CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY, - ) || - identical( - diagnosticCode, - CompileTimeErrorCode.SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantCaseExpressionFromDeferredLibrary, ) || identical( diagnosticCode, CompileTimeErrorCode - .NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY, + .invalidAnnotationConstantValueFromDeferredLibrary, + ) || + identical( + diagnosticCode, + CompileTimeErrorCode.ifElementConditionFromDeferredLibrary, ) || identical( diagnosticCode, CompileTimeErrorCode - .INVALID_ANNOTATION_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, + .constInitializedWithNonConstantValueFromDeferredLibrary, ) || identical( diagnosticCode, - CompileTimeErrorCode.IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantListElementFromDeferredLibrary, + ) || + identical( + diagnosticCode, + CompileTimeErrorCode.nonConstantRecordFieldFromDeferredLibrary, ) || identical( diagnosticCode, CompileTimeErrorCode - .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, + .constInitializedWithNonConstantValueFromDeferredLibrary, ) || identical( diagnosticCode, - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.patternConstantFromDeferredLibrary, ) || identical( diagnosticCode, - CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, ) || identical( diagnosticCode, - CompileTimeErrorCode - .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, - ) || - identical( - diagnosticCode, - CompileTimeErrorCode.PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY, - ) || - identical( - diagnosticCode, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - ) || - identical( - diagnosticCode, - CompileTimeErrorCode - .WRONG_NUMBER_OF_TYPE_ARGUMENTS_ANONYMOUS_FUNCTION, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsAnonymousFunction, )) { _diagnosticReporter.reportError( Diagnostic.tmp( @@ -855,7 +838,7 @@ class ConstantVerifier extends RecursiveAstVisitor { for (var notConst in notPotentiallyConstants) { _diagnosticReporter.atNode( notConst, - CompileTimeErrorCode.INVALID_CONSTANT, + CompileTimeErrorCode.invalidConstant, ); } } @@ -881,7 +864,7 @@ class ConstantVerifier extends RecursiveAstVisitor { argument is NamedExpression ? argument.expression : argument; _evaluateAndReportError( realArgument, - CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, + CompileTimeErrorCode.constWithNonConstantArgument, ); } } @@ -965,7 +948,7 @@ class ConstantVerifier extends RecursiveAstVisitor { } else { result = _evaluateAndReportError( defaultValue, - CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, + CompileTimeErrorCode.nonConstantDefaultValue, ); } var element = parameter.declaredFragment!.element; @@ -1012,7 +995,7 @@ class ConstantVerifier extends RecursiveAstVisitor { _diagnosticReporter.atToken( constKeyword, CompileTimeErrorCode - .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, + .constConstructorWithFieldInitializedByNonConst, arguments: [variableDeclaration.name.lexeme], ); } @@ -1091,7 +1074,7 @@ class ConstantVerifier extends RecursiveAstVisitor { }; _diagnosticReporter.atToken( errorToken, - WarningCode.UNREACHABLE_SWITCH_CASE, + WarningCode.unreachableSwitchCase, ); } if (nonExhaustiveness != null) { @@ -1118,8 +1101,8 @@ class ConstantVerifier extends RecursiveAstVisitor { var diagnostic = _diagnosticReporter.atToken( switchKeyword, isSwitchExpression - ? CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION - : CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, + ? CompileTimeErrorCode.nonExhaustiveSwitchExpression + : CompileTimeErrorCode.nonExhaustiveSwitchStatement, arguments: [ scrutineeType, errorBuffer.toString(), @@ -1135,7 +1118,7 @@ class ConstantVerifier extends RecursiveAstVisitor { // Default node is unreachable _diagnosticReporter.atToken( defaultNode.keyword, - WarningCode.UNREACHABLE_SWITCH_DEFAULT, + WarningCode.unreachableSwitchDefault, ); } } @@ -1166,7 +1149,7 @@ class ConstantVerifier extends RecursiveAstVisitor { void validateExpression(Expression expression) { var expressionValue = _evaluateAndReportError( expression, - CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION, + CompileTimeErrorCode.nonConstantCaseExpression, ); if (expressionValue is! DartObjectImpl) { return; @@ -1178,7 +1161,7 @@ class ConstantVerifier extends RecursiveAstVisitor { if (!expressionValue.hasPrimitiveEquality(featureSet)) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, + CompileTimeErrorCode.caseExpressionTypeImplementsEquals, arguments: [expressionType], ); } @@ -1253,7 +1236,7 @@ class _ConstLiteralVerifier { } else if (element is ForElement) { verifier._diagnosticReporter.atNode( element, - CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, + CompileTimeErrorCode.constEvalForElement, ); return false; } else if (element is IfElement) { @@ -1359,9 +1342,9 @@ class _ConstLiteralVerifier { for (var notConst in notPotentiallyConstants) { CompileTimeErrorCode errorCode; if (listElementType != null) { - errorCode = CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT; + errorCode = CompileTimeErrorCode.nonConstantListElement; } else if (mapConfig != null) { - errorCode = CompileTimeErrorCode.NON_CONSTANT_MAP_ELEMENT; + errorCode = CompileTimeErrorCode.nonConstantMapElement; for ( AstNode? parent = notConst; parent != null; @@ -1369,15 +1352,15 @@ class _ConstLiteralVerifier { ) { if (parent is MapLiteralEntry) { if (parent.key == notConst) { - errorCode = CompileTimeErrorCode.NON_CONSTANT_MAP_KEY; + errorCode = CompileTimeErrorCode.nonConstantMapKey; } else { - errorCode = CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE; + errorCode = CompileTimeErrorCode.nonConstantMapValue; } break; } } } else if (setConfig != null) { - errorCode = CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT; + errorCode = CompileTimeErrorCode.nonConstantSetElement; } else { throw UnimplementedError(); } @@ -1399,13 +1382,13 @@ class _ConstLiteralVerifier { )) { verifier._diagnosticReporter.atNode( expression, - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, arguments: [value.type, listElementType], ); } else { verifier._diagnosticReporter.atNode( expression, - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.listElementTypeNotAssignable, arguments: [value.type, listElementType], ); } @@ -1429,7 +1412,7 @@ class _ConstLiteralVerifier { // _addElementsTo methods.. verifier._diagnosticReporter.atNode( element.expression, - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, + CompileTimeErrorCode.constSpreadExpectedListOrSet, ); return false; } @@ -1444,7 +1427,7 @@ class _ConstLiteralVerifier { if (!listValue.every((e) => e.hasPrimitiveEquality(featureSet))) { verifier._diagnosticReporter.atNode( element, - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, + CompileTimeErrorCode.constSetElementNotPrimitiveEquality, arguments: [value.type], ); return false; @@ -1476,11 +1459,11 @@ class _ConstLiteralVerifier { var keyValue = verifier._evaluateAndReportError( keyExpression, - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, + CompileTimeErrorCode.nonConstantMapKey, ); var valueValue = verifier._evaluateAndReportError( valueExpression, - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, + CompileTimeErrorCode.nonConstantMapValue, ); if (keyValue is DartObjectImpl) { @@ -1498,13 +1481,13 @@ class _ConstLiteralVerifier { )) { verifier._diagnosticReporter.atNode( keyExpression, - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.mapKeyTypeNotAssignableNullability, arguments: [keyType, expectedKeyType], ); } else { verifier._diagnosticReporter.atNode( keyExpression, - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.mapKeyTypeNotAssignable, arguments: [keyType, expectedKeyType], ); } @@ -1514,7 +1497,7 @@ class _ConstLiteralVerifier { if (!keyValue.hasPrimitiveEquality(featureSet)) { verifier._diagnosticReporter.atNode( keyExpression, - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, + CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, arguments: [keyType], ); } @@ -1548,13 +1531,13 @@ class _ConstLiteralVerifier { )) { verifier._diagnosticReporter.atNode( valueExpression, - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.mapValueTypeNotAssignableNullability, arguments: [valueValue.type, expectedValueType], ); } else { verifier._diagnosticReporter.atNode( valueExpression, - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.mapValueTypeNotAssignable, arguments: [valueValue.type, expectedValueType], ); } @@ -1590,7 +1573,7 @@ class _ConstLiteralVerifier { } verifier._diagnosticReporter.atNode( element.expression, - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, + CompileTimeErrorCode.constSpreadExpectedMap, ); return false; } @@ -1607,13 +1590,13 @@ class _ConstLiteralVerifier { )) { verifier._diagnosticReporter.atNode( expression, - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.setElementTypeNotAssignableNullability, arguments: [value.type, config.elementType], ); } else { verifier._diagnosticReporter.atNode( expression, - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.setElementTypeNotAssignable, arguments: [value.type, config.elementType], ); } @@ -1624,7 +1607,7 @@ class _ConstLiteralVerifier { if (!value.hasPrimitiveEquality(featureSet)) { verifier._diagnosticReporter.atNode( expression, - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, + CompileTimeErrorCode.constSetElementNotPrimitiveEquality, arguments: [value.type], ); return false; diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart index ae6ee52077a..684bfb50513 100644 --- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart +++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart @@ -133,7 +133,7 @@ class ConstantEvaluationEngine { )) { constant.evaluationResult = InvalidConstant.forEntity( entity: constantInitializer, - diagnosticCode: CompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, + diagnosticCode: CompileTimeErrorCode.variableTypeMismatch, arguments: [ dartConstant.type.getDisplayString(), constant.type.getDisplayString(), @@ -389,7 +389,7 @@ class ConstantEvaluationEngine { var errorNode = configuration.errorNode(node); result = InvalidConstant.forEntity( entity: errorNode, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + diagnosticCode: CompileTimeErrorCode.constEvalThrowsException, contextMessages: [...result.contextMessages, contextMessage], ); } @@ -437,11 +437,11 @@ class ConstantEvaluationEngine { // description of the cycle. diagnosticReporter.atElement2( constant, - CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, + CompileTimeErrorCode.recursiveCompileTimeConstant, ); constant.evaluationResult = InvalidConstant.forElement( element: constant, - diagnosticCode: CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, + diagnosticCode: CompileTimeErrorCode.recursiveCompileTimeConstant, ); } else if (constant is ConstructorElementImpl) { // We don't report cycle errors on constructor declarations here since @@ -651,12 +651,12 @@ class ConstantVisitor extends UnifyingAstVisitor { case ExtensionElement(): return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, + diagnosticCode: CompileTimeErrorCode.constEvalExtensionMethod, ); case ExtensionTypeElement(): return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, + diagnosticCode: CompileTimeErrorCode.constEvalExtensionTypeMethod, ); } @@ -784,7 +784,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (!conditionConstant.isBool) { return InvalidConstant.forEntity( entity: condition, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, + diagnosticCode: CompileTimeErrorCode.constEvalTypeBool, ); } conditionConstant = _dartObjectComputer.applyBooleanConversion( @@ -827,7 +827,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (constructorFunctionType is! FunctionTypeImpl) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } var classType = constructorFunctionType.returnType as InterfaceTypeImpl; @@ -853,7 +853,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (constructorElement == null) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } @@ -896,7 +896,7 @@ class ConstantVisitor extends UnifyingAstVisitor { // problem - the error has already been reported. return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } @@ -951,8 +951,7 @@ class ConstantVisitor extends UnifyingAstVisitor { return InvalidConstant.forEntity( entity: node, diagnosticCode: - CompileTimeErrorCode - .CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, ); } } @@ -968,15 +967,14 @@ class ConstantVisitor extends UnifyingAstVisitor { var typeArgumentConstant = evaluateConstant(typeArgument); switch (typeArgumentConstant) { case InvalidConstant( - diagnosticCode: CompileTimeErrorCode.CONST_TYPE_PARAMETER, + diagnosticCode: CompileTimeErrorCode.constTypeParameter, ): // If there's a type parameter error in the evaluated constant, we // convert the message to a more specific function reference error. return InvalidConstant.forEntity( entity: typeArgument, diagnosticCode: - CompileTimeErrorCode - .CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, ); case InvalidConstant(): return typeArgumentConstant; @@ -985,7 +983,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (typeArgumentType == null) { return InvalidConstant.forEntity( entity: typeArgument, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } // TODO(srawlins): Test type alias types (`typedef i = int`) used as @@ -1027,7 +1025,7 @@ class ConstantVisitor extends UnifyingAstVisitor { // TODO(kallentu): Use a better error code for this. return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } @@ -1067,7 +1065,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (!result.isBoolNumStringOrNull) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, + diagnosticCode: CompileTimeErrorCode.constEvalTypeBoolNumString, ); } return _dartObjectComputer.performToString(node, result); @@ -1100,7 +1098,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (!node.isConst) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL, + diagnosticCode: CompileTimeErrorCode.missingConstInListLiteral, ); } var nodeType = node.staticType; @@ -1150,7 +1148,7 @@ class ConstantVisitor extends UnifyingAstVisitor { hasTypeParameterReference(type)) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.CONST_TYPE_PARAMETER, + diagnosticCode: CompileTimeErrorCode.constTypeParameter, ); } else if (node.isDeferred) { return _getDeferredLibraryError(node, node.name); @@ -1232,12 +1230,12 @@ class ConstantVisitor extends UnifyingAstVisitor { case ExtensionElement(): return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, + diagnosticCode: CompileTimeErrorCode.constEvalExtensionMethod, ); case ExtensionTypeElement(): return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, + diagnosticCode: CompileTimeErrorCode.constEvalExtensionTypeMethod, ); } @@ -1357,7 +1355,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (!node.isConst) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL, + diagnosticCode: CompileTimeErrorCode.missingConstInMapLiteral, ); } var keyType = _typeProvider.dynamicType; @@ -1385,7 +1383,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (!node.isConst) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.MISSING_CONST_IN_SET_LITERAL, + diagnosticCode: CompileTimeErrorCode.missingConstInSetLiteral, ); } var nodeType = node.staticType; @@ -1473,7 +1471,7 @@ class ConstantVisitor extends UnifyingAstVisitor { case ForElement(): return InvalidConstant.forEntity( entity: element, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, + diagnosticCode: CompileTimeErrorCode.constEvalForElement, ); case IfElement(): var condition = evaluateConstant(element.expression); @@ -1495,7 +1493,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (conditionValue == null) { return InvalidConstant.forEntity( entity: element.expression, - diagnosticCode: CompileTimeErrorCode.NON_BOOL_CONDITION, + diagnosticCode: CompileTimeErrorCode.nonBoolCondition, ); } else if (conditionValue) { branchResult = _buildListConstant( @@ -1519,7 +1517,7 @@ class ConstantVisitor extends UnifyingAstVisitor { case MapLiteralEntry(): return InvalidConstant.forEntity( entity: element, - diagnosticCode: CompileTimeErrorCode.MAP_ENTRY_NOT_IN_MAP, + diagnosticCode: CompileTimeErrorCode.mapEntryNotInMap, ); case SpreadElement(): var spread = evaluateConstant(element.expression); @@ -1536,7 +1534,7 @@ class ConstantVisitor extends UnifyingAstVisitor { return InvalidConstant.forEntity( entity: element.expression, diagnosticCode: - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, + CompileTimeErrorCode.constSpreadExpectedListOrSet, ); } list.addAll(listValue); @@ -1586,12 +1584,12 @@ class ConstantVisitor extends UnifyingAstVisitor { case Expression(): return InvalidConstant.forEntity( entity: element, - diagnosticCode: CompileTimeErrorCode.EXPRESSION_IN_MAP, + diagnosticCode: CompileTimeErrorCode.expressionInMap, ); case ForElement(): return InvalidConstant.forEntity( entity: element, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, + diagnosticCode: CompileTimeErrorCode.constEvalForElement, ); case IfElement(): var condition = evaluateConstant(element.expression); @@ -1614,7 +1612,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (conditionValue == null) { return InvalidConstant.forEntity( entity: element.expression, - diagnosticCode: CompileTimeErrorCode.NON_BOOL_CONDITION, + diagnosticCode: CompileTimeErrorCode.nonBoolCondition, ); } else if (conditionValue) { branchResult = _buildMapConstant( @@ -1663,8 +1661,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (mapValue == null) { return InvalidConstant.forEntity( entity: element.expression, - diagnosticCode: - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, + diagnosticCode: CompileTimeErrorCode.constSpreadExpectedMap, ); } map.addAll(mapValue); @@ -1674,7 +1671,7 @@ class ConstantVisitor extends UnifyingAstVisitor { // `CompileTimeErrorCode.NULL_AWARE_ELEMENT_IN_MAP`? return InvalidConstant.forEntity( entity: element, - diagnosticCode: CompileTimeErrorCode.EXPRESSION_IN_MAP, + diagnosticCode: CompileTimeErrorCode.expressionInMap, ); } } @@ -1713,7 +1710,7 @@ class ConstantVisitor extends UnifyingAstVisitor { case ForElement(): return InvalidConstant.forEntity( entity: element, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, + diagnosticCode: CompileTimeErrorCode.constEvalForElement, ); case IfElement(): var condition = evaluateConstant(element.expression); @@ -1735,7 +1732,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (conditionValue == null) { return InvalidConstant.forEntity( entity: element.expression, - diagnosticCode: CompileTimeErrorCode.NON_BOOL_CONDITION, + diagnosticCode: CompileTimeErrorCode.nonBoolCondition, ); } else if (conditionValue) { branchResult = _buildSetConstant( @@ -1759,7 +1756,7 @@ class ConstantVisitor extends UnifyingAstVisitor { case MapLiteralEntry(): return InvalidConstant.forEntity( entity: element, - diagnosticCode: CompileTimeErrorCode.MAP_ENTRY_NOT_IN_MAP, + diagnosticCode: CompileTimeErrorCode.mapEntryNotInMap, ); case SpreadElement(): var spread = evaluateConstant(element.expression); @@ -1776,7 +1773,7 @@ class ConstantVisitor extends UnifyingAstVisitor { return InvalidConstant.forEntity( entity: element.expression, diagnosticCode: - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, + CompileTimeErrorCode.constSpreadExpectedListOrSet, ); } set.addAll(setValue); @@ -1862,12 +1859,12 @@ class ConstantVisitor extends UnifyingAstVisitor { case ExtensionElement(): return InvalidConstant.forEntity( entity: errorNode, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, + diagnosticCode: CompileTimeErrorCode.constEvalExtensionMethod, ); case ExtensionTypeElement(): return InvalidConstant.forEntity( entity: errorNode, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, + diagnosticCode: CompileTimeErrorCode.constEvalExtensionTypeMethod, ); } @@ -1890,7 +1887,7 @@ class ConstantVisitor extends UnifyingAstVisitor { // No other property access is allowed except for `.length` of a `String`. return InvalidConstant.forEntity( entity: errorNode, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, + diagnosticCode: CompileTimeErrorCode.constEvalPropertyAccess, arguments: [identifier.name, targetType.getDisplayString()], ); } @@ -1922,7 +1919,7 @@ class ConstantVisitor extends UnifyingAstVisitor { false)) { return InvalidConstant.forEntity( entity: expression, - diagnosticCode: CompileTimeErrorCode.CONST_TYPE_PARAMETER, + diagnosticCode: CompileTimeErrorCode.constTypeParameter, ); } @@ -1947,7 +1944,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (identifier == null) { return InvalidConstant.forEntity( entity: errorNode, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } return _instantiateFunctionTypeForSimpleIdentifier( @@ -1959,7 +1956,7 @@ class ConstantVisitor extends UnifyingAstVisitor { // if we remove `avoidReporting`. return InvalidConstant.forEntity( entity: errorNode, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, avoidReporting: true, isUnresolved: true, ); @@ -1982,7 +1979,7 @@ class ConstantVisitor extends UnifyingAstVisitor { if (identifier == null) { return InvalidConstant.forEntity( entity: errorNode, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } return _instantiateFunctionTypeForSimpleIdentifier(identifier, rawType); @@ -2043,7 +2040,7 @@ class ConstantVisitor extends UnifyingAstVisitor { } return InvalidConstant.forEntity( entity: errorNode2, - diagnosticCode: CompileTimeErrorCode.CONST_TYPE_PARAMETER, + diagnosticCode: CompileTimeErrorCode.constTypeParameter, ); } } @@ -2063,7 +2060,7 @@ class ConstantVisitor extends UnifyingAstVisitor { /// library. /// /// If no specific error can be chosen, an [InvalidConstant] error using - /// [CompileTimeErrorCode.INVALID_CONSTANT] is returned. + /// [CompileTimeErrorCode.invalidConstant] is returned. InvalidConstant _getDeferredLibraryError( AstNode node, SyntacticEntity errorTarget, @@ -2073,45 +2070,40 @@ class ConstantVisitor extends UnifyingAstVisitor { for (AstNode? current = node; current != null;) { if (current is Annotation) { return CompileTimeErrorCode - .INVALID_ANNOTATION_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY; + .invalidAnnotationConstantValueFromDeferredLibrary; } else if (current is ConstantContextForExpressionImpl) { return CompileTimeErrorCode - .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY; + .constInitializedWithNonConstantValueFromDeferredLibrary; } else if (current is DefaultFormalParameter) { return CompileTimeErrorCode - .NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY; + .nonConstantDefaultValueFromDeferredLibrary; } else if (current is IfElement && current.expression == node) { - return CompileTimeErrorCode - .IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY; + return CompileTimeErrorCode.ifElementConditionFromDeferredLibrary; } else if (current is InstanceCreationExpression) { return CompileTimeErrorCode - .CONST_CONSTRUCTOR_CONSTANT_FROM_DEFERRED_LIBRARY; + .constConstructorConstantFromDeferredLibrary; } else if (current is ListLiteral) { - return CompileTimeErrorCode - .NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY; + return CompileTimeErrorCode.nonConstantListElementFromDeferredLibrary; } else if (current is MapLiteralEntry) { if (previous == current.key) { - return CompileTimeErrorCode - .NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY; + return CompileTimeErrorCode.nonConstantMapKeyFromDeferredLibrary; } else { - return CompileTimeErrorCode - .NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY; + return CompileTimeErrorCode.nonConstantMapValueFromDeferredLibrary; } } else if (current is RecordLiteral) { - return CompileTimeErrorCode - .NON_CONSTANT_RECORD_FIELD_FROM_DEFERRED_LIBRARY; + return CompileTimeErrorCode.nonConstantRecordFieldFromDeferredLibrary; } else if (current is SetOrMapLiteral) { - return CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY; + return CompileTimeErrorCode.setElementFromDeferredLibrary; } else if (current is SpreadElement) { - return CompileTimeErrorCode.SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY; + return CompileTimeErrorCode.spreadExpressionFromDeferredLibrary; } else if (current is SwitchCase) { return CompileTimeErrorCode - .NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY; + .nonConstantCaseExpressionFromDeferredLibrary; } else if (current is SwitchPatternCase) { - return CompileTimeErrorCode.PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY; + return CompileTimeErrorCode.patternConstantFromDeferredLibrary; } else if (current is VariableDeclaration) { return CompileTimeErrorCode - .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY; + .constInitializedWithNonConstantValueFromDeferredLibrary; } previous = current; current = current.parent; @@ -2125,7 +2117,7 @@ class ConstantVisitor extends UnifyingAstVisitor { } return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } @@ -2201,14 +2193,14 @@ class ConstantVisitor extends UnifyingAstVisitor { if (node.staticType is InvalidType) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, isUnresolved: true, ); } return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, + diagnosticCode: CompileTimeErrorCode.constEvalMethodInvocation, ); } @@ -2224,7 +2216,7 @@ class ConstantVisitor extends UnifyingAstVisitor { // Only report the first invalid constant we see. return InvalidConstant.forEntity( entity: notPotentiallyConstants.first, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } @@ -2706,7 +2698,7 @@ class DartObjectComputer { return InvalidConstant.forEntity( entity: typeArgumentsErrorNode, diagnosticCode: - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, arguments: [ node.name, rawType.typeParameters.length, @@ -2717,8 +2709,7 @@ class DartObjectComputer { return InvalidConstant.forEntity( entity: typeArgumentsErrorNode, diagnosticCode: - CompileTimeErrorCode - .WRONG_NUMBER_OF_TYPE_ARGUMENTS_ANONYMOUS_FUNCTION, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsAnonymousFunction, arguments: [rawType.typeParameters.length, typeArguments.length], ); } @@ -2727,7 +2718,7 @@ class DartObjectComputer { } else { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, ); } } @@ -2892,7 +2883,7 @@ class _InstanceCreationEvaluator { if (!_checkFromEnvironmentArguments(arguments, definingType)) { return InvalidConstant.forEntity( entity: _errorNode, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + diagnosticCode: CompileTimeErrorCode.constEvalThrowsException, ); } String? variableName = @@ -2935,7 +2926,7 @@ class _InstanceCreationEvaluator { if (!_checkSymbolArguments(arguments)) { return InvalidConstant.forEntity( entity: _errorNode, - diagnosticCode: CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + diagnosticCode: CompileTimeErrorCode.constEvalThrowsException, ); } return DartObjectImpl( @@ -3060,7 +3051,7 @@ class _InstanceCreationEvaluator { return InvalidConstant.forEntity( entity: errorNode, diagnosticCode: - CompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, + CompileTimeErrorCode.constConstructorFieldTypeMismatch, arguments: [ fieldValue.type.getDisplayString(), field.name ?? '', @@ -3137,8 +3128,7 @@ class _InstanceCreationEvaluator { return _InitializersEvaluationResult( InvalidConstant.forEntity( entity: _errorNode, - diagnosticCode: - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + diagnosticCode: CompileTimeErrorCode.constEvalThrowsException, ), evaluationIsComplete: true, ); @@ -3161,8 +3151,7 @@ class _InstanceCreationEvaluator { InvalidConstant.forEntity( entity: errorNode, diagnosticCode: - CompileTimeErrorCode - .CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, + CompileTimeErrorCode.constConstructorFieldTypeMismatch, arguments: [ evaluationResult.type.getDisplayString(), fieldName, @@ -3259,7 +3248,7 @@ class _InstanceCreationEvaluator { entity: initializer, diagnosticCode: CompileTimeErrorCode - .CONST_EVAL_ASSERTION_FAILURE_WITH_MESSAGE, + .constEvalAssertionFailureWithMessage, arguments: [assertMessage], isRuntimeException: true, ); @@ -3269,8 +3258,7 @@ class _InstanceCreationEvaluator { invalidConstant ??= InvalidConstant.forEntity( entity: initializer, - diagnosticCode: - CompileTimeErrorCode.CONST_EVAL_ASSERTION_FAILURE, + diagnosticCode: CompileTimeErrorCode.constEvalAssertionFailure, isRuntimeException: true, ); return _InitializersEvaluationResult( @@ -3377,7 +3365,7 @@ class _InstanceCreationEvaluator { return InvalidConstant.forEntity( entity: errorTarget, diagnosticCode: - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, + CompileTimeErrorCode.constConstructorParamTypeMismatch, arguments: [ argumentValue.type.getDisplayString(), parameter.type.getDisplayString(), @@ -3398,8 +3386,7 @@ class _InstanceCreationEvaluator { return InvalidConstant.forEntity( entity: errorTarget, diagnosticCode: - CompileTimeErrorCode - .CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, + CompileTimeErrorCode.constConstructorParamTypeMismatch, arguments: [ argumentValue.type.getDisplayString(), fieldType.getDisplayString(), @@ -3411,8 +3398,7 @@ class _InstanceCreationEvaluator { if (_fieldMap.containsKey(fieldName)) { return InvalidConstant.forEntity( entity: _errorNode, - diagnosticCode: - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + diagnosticCode: CompileTimeErrorCode.constEvalThrowsException, ); } _fieldMap[fieldName] = argumentValue; @@ -3574,7 +3560,7 @@ class _InstanceCreationEvaluator { } return InvalidConstant.forEntity( entity: keyword ?? node, - diagnosticCode: CompileTimeErrorCode.CONST_WITH_NON_CONST, + diagnosticCode: CompileTimeErrorCode.constWithNonConst, ); } diff --git a/pkg/analyzer/lib/src/dart/constant/value.dart b/pkg/analyzer/lib/src/dart/constant/value.dart index 7b664cc82b7..d1cbed59df1 100644 --- a/pkg/analyzer/lib/src/dart/constant/value.dart +++ b/pkg/analyzer/lib/src/dart/constant/value.dart @@ -365,9 +365,7 @@ class DartObjectImpl implements DartObject, Constant { if (!typeSystem.isSubtypeOf(type, resultType)) { // TODO(kallentu): Make a more specific error for casting. - throw EvaluationException( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, - ); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } return this; } @@ -449,7 +447,7 @@ class DartObjectImpl implements DartObject, Constant { state.bitAnd(rightOperand.state), ); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeBoolInt); } /// Return the result of invoking the '|' operator on this object with the @@ -474,7 +472,7 @@ class DartObjectImpl implements DartObject, Constant { state.bitOr(rightOperand.state), ); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeBoolInt); } /// Return the result of invoking the '^' operator on this object with the @@ -499,7 +497,7 @@ class DartObjectImpl implements DartObject, Constant { state.bitXor(rightOperand.state), ); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeBoolInt); } /// Returns the result of invoking the '==' operator on this object with the @@ -540,8 +538,8 @@ class DartObjectImpl implements DartObject, Constant { } throw EvaluationException( featureSet.isEnabled(Feature.patterns) - ? CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY - : CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, + ? CompileTimeErrorCode.constEvalPrimitiveEquality + : CompileTimeErrorCode.constEvalTypeBoolNumString, ); } @@ -1072,7 +1070,7 @@ class DartObjectImpl implements DartObject, Constant { /// value. void _assertType(DartObjectImpl object) { if (object.state is! TypeState) { - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_TYPE); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeType); } } } @@ -1121,7 +1119,7 @@ class DoubleState extends NumState { } return DoubleState(value! + rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1151,7 +1149,7 @@ class DoubleState extends NumState { } return DoubleState(value! / rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1173,7 +1171,7 @@ class DoubleState extends NumState { } return BoolState.from(value! > rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1195,7 +1193,7 @@ class DoubleState extends NumState { } return BoolState.from(value! >= rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1223,7 +1221,7 @@ class DoubleState extends NumState { return IntState(result.toInt()); } } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1273,7 +1271,7 @@ class DoubleState extends NumState { } return BoolState.from(value! < rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1295,7 +1293,7 @@ class DoubleState extends NumState { } return BoolState.from(value! <= rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1317,7 +1315,7 @@ class DoubleState extends NumState { } return DoubleState(value! - rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1347,7 +1345,7 @@ class DoubleState extends NumState { } return DoubleState(value! % rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1369,7 +1367,7 @@ class DoubleState extends NumState { } return DoubleState(value! * rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -1654,14 +1652,14 @@ abstract class InstanceState { } assertNumStringOrNull(this); assertNumStringOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Throws an exception if the given [state] does not represent a `bool` /// value. void assertBool(InstanceState? state) { if (state is! BoolState) { - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeBool); } } @@ -1669,7 +1667,7 @@ abstract class InstanceState { /// `null` value. void assertIntOrNull(InstanceState state) { if (!(state is IntState || state is NullState)) { - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_INT); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeInt); } } @@ -1677,7 +1675,7 @@ abstract class InstanceState { /// `null` value. void assertNumOrNull(InstanceState state) { if (!(state is NumState || state is NullState)) { - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_NUM); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeNum); } } @@ -1685,9 +1683,7 @@ abstract class InstanceState { /// `String`, or `null` value. void assertNumStringOrNull(InstanceState state) { if (!(state is NumState || state is StringState || state is NullState)) { - throw EvaluationException( - CompileTimeErrorCode.CONST_EVAL_TYPE_NUM_STRING, - ); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeNumString); } } @@ -1695,7 +1691,7 @@ abstract class InstanceState { /// value. void assertString(InstanceState state) { if (state is! StringState) { - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_TYPE_STRING); + throw EvaluationException(CompileTimeErrorCode.constEvalTypeString); } } @@ -1707,7 +1703,7 @@ abstract class InstanceState { IntState bitAnd(InstanceState rightOperand) { assertIntOrNull(this); assertIntOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '~' operator on this object. @@ -1716,7 +1712,7 @@ abstract class InstanceState { /// object of this kind. IntState bitNot() { assertIntOrNull(this); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '|' operator on this object with the @@ -1727,7 +1723,7 @@ abstract class InstanceState { IntState bitOr(InstanceState rightOperand) { assertIntOrNull(this); assertIntOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '^' operator on this object with the @@ -1738,7 +1734,7 @@ abstract class InstanceState { IntState bitXor(InstanceState rightOperand) { assertIntOrNull(this); assertIntOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the ' ' operator on this object with the @@ -1748,7 +1744,7 @@ abstract class InstanceState { /// object of this kind. StringState concatenate(InstanceState rightOperand) { assertString(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of applying boolean conversion to this object. @@ -1771,7 +1767,7 @@ abstract class InstanceState { NumState divide(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '==' operator on this object with the @@ -1789,7 +1785,7 @@ abstract class InstanceState { BoolState greaterThan(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '>=' operator on this object with the @@ -1800,7 +1796,7 @@ abstract class InstanceState { BoolState greaterThanOrEqual(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Returns `true` if this value, inside a library with the [featureSet], @@ -1815,7 +1811,7 @@ abstract class InstanceState { IntState integerDivide(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the identical function on this object with @@ -1860,7 +1856,7 @@ abstract class InstanceState { BoolState lessThan(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '<=' operator on this object with the @@ -1871,7 +1867,7 @@ abstract class InstanceState { BoolState lessThanOrEqual(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '&' operator on this object with the @@ -1923,7 +1919,7 @@ abstract class InstanceState { IntState logicalShiftRight(InstanceState rightOperand) { assertIntOrNull(this); assertIntOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '^' operator on this object with the @@ -1950,7 +1946,7 @@ abstract class InstanceState { NumState minus(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '-' operator on this object. @@ -1959,7 +1955,7 @@ abstract class InstanceState { /// object of this kind. NumState negated() { assertNumOrNull(this); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '%' operator on this object with the @@ -1970,7 +1966,7 @@ abstract class InstanceState { NumState remainder(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '<<' operator on this object with @@ -1981,7 +1977,7 @@ abstract class InstanceState { IntState shiftLeft(InstanceState rightOperand) { assertIntOrNull(this); assertIntOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '>>' operator on this object with @@ -1992,7 +1988,7 @@ abstract class InstanceState { IntState shiftRight(InstanceState rightOperand) { assertIntOrNull(this); assertIntOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the 'length' getter on this object. @@ -2001,7 +1997,7 @@ abstract class InstanceState { /// object of this kind. IntState stringLength() { assertString(this); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } /// Return the result of invoking the '*' operator on this object with the @@ -2012,7 +2008,7 @@ abstract class InstanceState { NumState times(InstanceState rightOperand) { assertNumOrNull(this); assertNumOrNull(rightOperand); - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } } @@ -2065,7 +2061,7 @@ class IntState extends NumState { } return DoubleState(value!.toDouble() + rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2081,7 +2077,7 @@ class IntState extends NumState { } return IntState(value! & rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2105,7 +2101,7 @@ class IntState extends NumState { } return IntState(value! | rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2121,7 +2117,7 @@ class IntState extends NumState { } return IntState(value! ^ rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2152,7 +2148,7 @@ class IntState extends NumState { } return DoubleState(value!.toDouble() / rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2174,7 +2170,7 @@ class IntState extends NumState { } return BoolState.from(value!.toDouble() > rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2196,7 +2192,7 @@ class IntState extends NumState { } return BoolState.from(value!.toDouble() >= rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2214,7 +2210,7 @@ class IntState extends NumState { return UNKNOWN_VALUE; } else if (rightValue == 0) { throw EvaluationException( - CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE, + CompileTimeErrorCode.constEvalThrowsIdbze, isRuntimeException: true, ); } @@ -2229,7 +2225,7 @@ class IntState extends NumState { return IntState(result.toInt()); } } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2272,7 +2268,7 @@ class IntState extends NumState { } return BoolState.from(value!.toDouble() < rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2294,7 +2290,7 @@ class IntState extends NumState { } return BoolState.from(value!.toDouble() <= rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2317,7 +2313,7 @@ class IntState extends NumState { ); } } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2342,7 +2338,7 @@ class IntState extends NumState { } return DoubleState(value!.toDouble() - rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2377,7 +2373,7 @@ class IntState extends NumState { } return DoubleState(value!.toDouble() % rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2397,7 +2393,7 @@ class IntState extends NumState { return IntState(value! << rightValue); } } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2417,7 +2413,7 @@ class IntState extends NumState { return IntState(value! >> rightValue); } } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2442,7 +2438,7 @@ class IntState extends NumState { } return DoubleState(value!.toDouble() * rightValue); } - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2481,7 +2477,7 @@ class InvalidConstant implements Constant { /// /// In [ConstantEvaluationEngine.evaluateAndFormatErrorsInConstructorCall], /// we convert this error into a - /// [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION] with a context message + /// [CompileTimeErrorCode.constEvalThrowsException] with a context message /// pointing to where the exception was thrown. final bool isRuntimeException; @@ -2557,13 +2553,13 @@ class InvalidConstant implements Constant { parent2.isConst) { return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, + diagnosticCode: CompileTimeErrorCode.constWithNonConstantArgument, isUnresolved: isUnresolved, ); } return InvalidConstant.forEntity( entity: node, - diagnosticCode: CompileTimeErrorCode.INVALID_CONSTANT, + diagnosticCode: CompileTimeErrorCode.invalidConstant, isUnresolved: isUnresolved, ); } @@ -2819,7 +2815,7 @@ class NullState extends InstanceState { @override BoolState convertToBool() { - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override @@ -2840,7 +2836,7 @@ class NullState extends InstanceState { @override BoolState logicalNot() { - throw EvaluationException(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION); + throw EvaluationException(CompileTimeErrorCode.constEvalThrowsException); } @override diff --git a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart index f40b42dbe61..a7f05a6fdc3 100644 --- a/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart +++ b/pkg/analyzer/lib/src/dart/element/generic_inferrer.dart @@ -323,7 +323,7 @@ class GenericInferrer { _diagnosticReporter?.atEntity( errorEntity!, - CompileTimeErrorCode.COULD_NOT_INFER, + CompileTimeErrorCode.couldNotInfer, arguments: [name, _formatError(parameter, inferred, constraints)], ); @@ -352,7 +352,7 @@ class GenericInferrer { var typeParametersStr = typeParameters.map(_elementStr).join(', '); _diagnosticReporter.atEntity( errorEntity!, - CompileTimeErrorCode.COULD_NOT_INFER, + CompileTimeErrorCode.couldNotInfer, arguments: [ name, ' Inferred candidate type ${_typeStr(inferred)} has type parameters' @@ -409,7 +409,7 @@ class GenericInferrer { // TODO(jmesserly): improve this error message. _diagnosticReporter?.atEntity( errorEntity!, - CompileTimeErrorCode.COULD_NOT_INFER, + CompileTimeErrorCode.couldNotInfer, arguments: [ name, "\nRecursive bound cannot be instantiated: '$typeParamBound'." @@ -461,7 +461,7 @@ class GenericInferrer { if (!_typeSystem.isSubtypeOf(argument, bound)) { diagnosticReporter?.atEntity( errorEntity!, - CompileTimeErrorCode.COULD_NOT_INFER, + CompileTimeErrorCode.couldNotInfer, arguments: [ name, "\n'${_typeStr(argument)}' doesn't conform to " @@ -735,7 +735,7 @@ class GenericInferrer { : '${errorEntity.type}.${errorEntity.name}'; diagnosticReporter.atNode( errorEntity, - WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, + WarningCode.inferenceFailureOnInstanceCreation, arguments: [constructorName], ); } else if (errorEntity is Annotation) { @@ -749,7 +749,7 @@ class GenericInferrer { : '${errorEntity.name.name}.${errorEntity.constructorName}'; diagnosticReporter.atNode( errorEntity, - WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, + WarningCode.inferenceFailureOnInstanceCreation, arguments: [constructorName], ); } @@ -773,7 +773,7 @@ class GenericInferrer { if (!element.metadata.hasOptionalTypeArgs) { diagnosticReporter.atNode( errorEntity, - WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, + WarningCode.inferenceFailureOnFunctionInvocation, arguments: [errorEntity.name], ); return; @@ -785,7 +785,7 @@ class GenericInferrer { var typeDisplayString = _typeStr(type); diagnosticReporter.atNode( errorEntity, - WarningCode.INFERENCE_FAILURE_ON_GENERIC_INVOCATION, + WarningCode.inferenceFailureOnGenericInvocation, arguments: [typeDisplayString], ); return; diff --git a/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart b/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart index 1b1dc660dd9..113d264a866 100644 --- a/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart +++ b/pkg/analyzer/lib/src/dart/error/ffi_code.g.dart @@ -28,7 +28,7 @@ import "package:_fe_analyzer_shared/src/base/errors.dart"; class FfiCode extends DiagnosticCode { /// No parameters. - static const FfiCode ABI_SPECIFIC_INTEGER_INVALID = FfiCode( + static const FfiCode abiSpecificIntegerInvalid = FfiCode( 'ABI_SPECIFIC_INTEGER_INVALID', "Classes extending 'AbiSpecificInteger' must have exactly one const " "constructor, no other members, and no type parameters.", @@ -39,7 +39,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode ABI_SPECIFIC_INTEGER_MAPPING_EXTRA = FfiCode( + static const FfiCode abiSpecificIntegerMappingExtra = FfiCode( 'ABI_SPECIFIC_INTEGER_MAPPING_EXTRA', "Classes extending 'AbiSpecificInteger' must have exactly one " "'AbiSpecificIntegerMapping' annotation specifying the mapping from " @@ -49,7 +49,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode ABI_SPECIFIC_INTEGER_MAPPING_MISSING = FfiCode( + static const FfiCode abiSpecificIntegerMappingMissing = FfiCode( 'ABI_SPECIFIC_INTEGER_MAPPING_MISSING', "Classes extending 'AbiSpecificInteger' must have exactly one " "'AbiSpecificIntegerMapping' annotation specifying the mapping from " @@ -60,7 +60,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the value of the invalid mapping - static const FfiCode ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED = FfiCode( + static const FfiCode abiSpecificIntegerMappingUnsupported = FfiCode( 'ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED', "Invalid mapping to '{0}'; only mappings to 'Int8', 'Int16', 'Int32', " "'Int64', 'Uint8', 'Uint16', 'UInt32', and 'Uint64' are supported.", @@ -71,14 +71,14 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode ADDRESS_POSITION = FfiCode( + static const FfiCode addressPosition = FfiCode( 'ADDRESS_POSITION', "The '.address' expression can only be used as argument to a leaf native " "external call.", ); /// No parameters. - static const FfiCode ADDRESS_RECEIVER = FfiCode( + static const FfiCode addressReceiver = FfiCode( 'ADDRESS_RECEIVER', "The receiver of '.address' must be a concrete 'TypedData', a concrete " "'TypedData' '[]', an 'Array', an 'Array' '[]', a Struct field, or a " @@ -88,7 +88,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode ANNOTATION_ON_POINTER_FIELD = FfiCode( + static const FfiCode annotationOnPointerField = FfiCode( 'ANNOTATION_ON_POINTER_FIELD', "Fields in a struct class whose type is 'Pointer' shouldn't have any " "annotations.", @@ -98,7 +98,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the argument - static const FfiCode ARGUMENT_MUST_BE_A_CONSTANT = FfiCode( + static const FfiCode argumentMustBeAConstant = FfiCode( 'ARGUMENT_MUST_BE_A_CONSTANT', "Argument '{0}' must be a constant.", correctionMessage: "Try replacing the value with a literal or const.", @@ -106,7 +106,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode ARGUMENT_MUST_BE_NATIVE = FfiCode( + static const FfiCode argumentMustBeNative = FfiCode( 'ARGUMENT_MUST_BE_NATIVE', "Argument to 'Native.addressOf' must be annotated with @Native", correctionMessage: @@ -116,7 +116,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the struct or union class - static const FfiCode COMPOUND_IMPLEMENTS_FINALIZABLE = FfiCode( + static const FfiCode compoundImplementsFinalizable = FfiCode( 'COMPOUND_IMPLEMENTS_FINALIZABLE', "The class '{0}' can't implement Finalizable.", correctionMessage: "Try removing the implements clause from '{0}'.", @@ -124,7 +124,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode CREATION_OF_STRUCT_OR_UNION = FfiCode( + static const FfiCode creationOfStructOrUnion = FfiCode( 'CREATION_OF_STRUCT_OR_UNION', "Subclasses of 'Struct' and 'Union' are backed by native memory, and can't " "be instantiated by a generative constructor.", @@ -136,7 +136,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the subclass /// String p1: the name of the superclass - static const FfiCode EMPTY_STRUCT = FfiCode( + static const FfiCode emptyStruct = FfiCode( 'EMPTY_STRUCT', "The class '{0}' can't be empty because it's a subclass of '{1}'.", correctionMessage: @@ -145,7 +145,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode EXTRA_ANNOTATION_ON_STRUCT_FIELD = FfiCode( + static const FfiCode extraAnnotationOnStructField = FfiCode( 'EXTRA_ANNOTATION_ON_STRUCT_FIELD', "Fields in a struct class must have exactly one annotation indicating the " "native type.", @@ -154,7 +154,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode EXTRA_SIZE_ANNOTATION_CARRAY = FfiCode( + static const FfiCode extraSizeAnnotationCarray = FfiCode( 'EXTRA_SIZE_ANNOTATION_CARRAY', "'Array's must have exactly one 'Array' annotation.", correctionMessage: "Try removing the extra annotation.", @@ -162,7 +162,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode FFI_NATIVE_INVALID_DUPLICATE_DEFAULT_ASSET = FfiCode( + static const FfiCode ffiNativeInvalidDuplicateDefaultAsset = FfiCode( 'FFI_NATIVE_INVALID_DUPLICATE_DEFAULT_ASSET', "There may be at most one @DefaultAsset annotation on a library.", correctionMessage: "Try removing the extra annotation.", @@ -170,7 +170,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode FFI_NATIVE_INVALID_MULTIPLE_ANNOTATIONS = FfiCode( + static const FfiCode ffiNativeInvalidMultipleAnnotations = FfiCode( 'FFI_NATIVE_INVALID_MULTIPLE_ANNOTATIONS', "Native functions and fields must have exactly one `@Native` annotation.", correctionMessage: "Try removing the extra annotation.", @@ -178,7 +178,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode FFI_NATIVE_MUST_BE_EXTERNAL = FfiCode( + static const FfiCode ffiNativeMustBeExternal = FfiCode( 'FFI_NATIVE_MUST_BE_EXTERNAL', "Native functions must be declared external.", correctionMessage: "Add the `external` keyword to the function.", @@ -187,7 +187,7 @@ class FfiCode extends DiagnosticCode { /// No parameters. static const FfiCode - FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER = FfiCode( + ffiNativeOnlyClassesExtendingNativefieldwrapperclass1CanBePointer = FfiCode( 'FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER', "Only classes extending NativeFieldWrapperClass1 can be passed as Pointer.", correctionMessage: "Pass as Handle instead.", @@ -196,7 +196,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// int p0: the expected number of parameters /// int p1: the actual number of parameters - static const FfiCode FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS = FfiCode( + static const FfiCode ffiNativeUnexpectedNumberOfParameters = FfiCode( 'FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS', "Unexpected number of Native annotation parameters. Expected {0} but has " "{1}.", @@ -208,7 +208,7 @@ class FfiCode extends DiagnosticCode { /// int p0: the expected number of parameters /// int p1: the actual number of parameters static const FfiCode - FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER = FfiCode( + ffiNativeUnexpectedNumberOfParametersWithReceiver = FfiCode( 'FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER', "Unexpected number of Native annotation parameters. Expected {0} but has " "{1}. Native instance method annotation must have receiver as first " @@ -220,7 +220,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode FIELD_MUST_BE_EXTERNAL_IN_STRUCT = FfiCode( + static const FfiCode fieldMustBeExternalInStruct = FfiCode( 'FIELD_MUST_BE_EXTERNAL_IN_STRUCT', "Fields of 'Struct' and 'Union' subclasses must be marked external.", correctionMessage: "Try adding the 'external' modifier.", @@ -229,7 +229,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the struct class - static const FfiCode GENERIC_STRUCT_SUBCLASS = FfiCode( + static const FfiCode genericStructSubclass = FfiCode( 'GENERIC_STRUCT_SUBCLASS', "The class '{0}' can't extend 'Struct' or 'Union' because '{0}' is " "generic.", @@ -239,7 +239,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method - static const FfiCode INVALID_EXCEPTION_VALUE = FfiCode( + static const FfiCode invalidExceptionValue = FfiCode( 'INVALID_EXCEPTION_VALUE', "The method {0} can't have an exceptional return value (the second " "argument) when the return type of the function is either 'void', " @@ -250,7 +250,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the type of the field - static const FfiCode INVALID_FIELD_TYPE_IN_STRUCT = FfiCode( + static const FfiCode invalidFieldTypeInStruct = FfiCode( 'INVALID_FIELD_TYPE_IN_STRUCT', "Fields in struct classes can't have the type '{0}'. They can only be " "declared as 'int', 'double', 'Array', 'Pointer', or subtype of " @@ -262,7 +262,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode LEAF_CALL_MUST_NOT_RETURN_HANDLE = FfiCode( + static const FfiCode leafCallMustNotReturnHandle = FfiCode( 'LEAF_CALL_MUST_NOT_RETURN_HANDLE', "FFI leaf call can't return a 'Handle'.", correctionMessage: "Try changing the return type to primitive or struct.", @@ -270,7 +270,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode LEAF_CALL_MUST_NOT_TAKE_HANDLE = FfiCode( + static const FfiCode leafCallMustNotTakeHandle = FfiCode( 'LEAF_CALL_MUST_NOT_TAKE_HANDLE', "FFI leaf call can't take arguments of type 'Handle'.", correctionMessage: "Try changing the argument type to primitive or struct.", @@ -278,7 +278,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode MISMATCHED_ANNOTATION_ON_STRUCT_FIELD = FfiCode( + static const FfiCode mismatchedAnnotationOnStructField = FfiCode( 'MISMATCHED_ANNOTATION_ON_STRUCT_FIELD', "The annotation doesn't match the declared type of the field.", correctionMessage: @@ -290,7 +290,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// Type p0: the type that is missing a native type annotation /// String p1: the superclass which is extended by this field's class - static const FfiCode MISSING_ANNOTATION_ON_STRUCT_FIELD = FfiCode( + static const FfiCode missingAnnotationOnStructField = FfiCode( 'MISSING_ANNOTATION_ON_STRUCT_FIELD', "Fields of type '{0}' in a subclass of '{1}' must have an annotation " "indicating the native type.", @@ -300,7 +300,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method - static const FfiCode MISSING_EXCEPTION_VALUE = FfiCode( + static const FfiCode missingExceptionValue = FfiCode( 'MISSING_EXCEPTION_VALUE', "The method {0} must have an exceptional return value (the second " "argument) when the return type of the function is neither 'void', " @@ -310,7 +310,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode MISSING_FIELD_TYPE_IN_STRUCT = FfiCode( + static const FfiCode missingFieldTypeInStruct = FfiCode( 'MISSING_FIELD_TYPE_IN_STRUCT', "Fields in struct classes must have an explicitly declared type of 'int', " "'double' or 'Pointer'.", @@ -319,7 +319,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode MISSING_SIZE_ANNOTATION_CARRAY = FfiCode( + static const FfiCode missingSizeAnnotationCarray = FfiCode( 'MISSING_SIZE_ANNOTATION_CARRAY', "Fields of type 'Array' must have exactly one 'Array' annotation.", correctionMessage: @@ -332,7 +332,7 @@ class FfiCode extends DiagnosticCode { /// Object p0: the type that should be a valid dart:ffi native type. /// String p1: the name of the function whose invocation depends on this /// relationship - static const FfiCode MUST_BE_A_NATIVE_FUNCTION_TYPE = FfiCode( + static const FfiCode mustBeANativeFunctionType = FfiCode( 'MUST_BE_A_NATIVE_FUNCTION_TYPE', "The type '{0}' given to '{1}' must be a valid 'dart:ffi' native function " "type.", @@ -346,7 +346,7 @@ class FfiCode extends DiagnosticCode { /// Type p1: the supertype that the subtype is compared to /// String p2: the name of the function whose invocation depends on this /// relationship - static const FfiCode MUST_BE_A_SUBTYPE = FfiCode( + static const FfiCode mustBeASubtype = FfiCode( 'MUST_BE_A_SUBTYPE', "The type '{0}' must be a subtype of '{1}' for '{2}'.", correctionMessage: "Try changing one or both of the type arguments.", @@ -355,7 +355,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// Type p0: the return type that should be 'void'. - static const FfiCode MUST_RETURN_VOID = FfiCode( + static const FfiCode mustReturnVoid = FfiCode( 'MUST_RETURN_VOID', "The return type of the function passed to 'NativeCallable.listener' must " "be 'void' rather than '{0}'.", @@ -365,7 +365,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// Type p0: The invalid type. - static const FfiCode NATIVE_FIELD_INVALID_TYPE = FfiCode( + static const FfiCode nativeFieldInvalidType = FfiCode( 'NATIVE_FIELD_INVALID_TYPE', "'{0}' is an unsupported type for native fields. Native fields only " "support pointers, arrays or numeric and compound types.", @@ -376,7 +376,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode NATIVE_FIELD_MISSING_TYPE = FfiCode( + static const FfiCode nativeFieldMissingType = FfiCode( 'NATIVE_FIELD_MISSING_TYPE', "The native type of this field could not be inferred and must be specified " "in the annotation.", @@ -387,7 +387,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode NATIVE_FIELD_NOT_STATIC = FfiCode( + static const FfiCode nativeFieldNotStatic = FfiCode( 'NATIVE_FIELD_NOT_STATIC', "Native fields must be static.", correctionMessage: "Try adding the modifier 'static' to this field.", @@ -395,7 +395,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode NATIVE_FUNCTION_MISSING_TYPE = FfiCode( + static const FfiCode nativeFunctionMissingType = FfiCode( 'NATIVE_FUNCTION_MISSING_TYPE', "The native type of this function couldn't be inferred so it must be " "specified in the annotation.", @@ -406,7 +406,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode NEGATIVE_VARIABLE_DIMENSION = FfiCode( + static const FfiCode negativeVariableDimension = FfiCode( 'NEGATIVE_VARIABLE_DIMENSION', "The variable dimension of a variable-length array must be non-negative.", correctionMessage: "Try using a value that is zero or greater.", @@ -416,7 +416,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the function, method, or constructor having type /// arguments - static const FfiCode NON_CONSTANT_TYPE_ARGUMENT = FfiCode( + static const FfiCode nonConstantTypeArgument = FfiCode( 'NON_CONSTANT_TYPE_ARGUMENT', "The type arguments to '{0}' must be known at compile time, so they can't " "be type parameters.", @@ -426,7 +426,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// Type p0: the type that should be a valid dart:ffi native type. - static const FfiCode NON_NATIVE_FUNCTION_TYPE_ARGUMENT_TO_POINTER = FfiCode( + static const FfiCode nonNativeFunctionTypeArgumentToPointer = FfiCode( 'NON_NATIVE_FUNCTION_TYPE_ARGUMENT_TO_POINTER', "Can't invoke 'asFunction' because the function signature '{0}' for the " "pointer isn't a valid C function signature.", @@ -437,7 +437,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode NON_POSITIVE_ARRAY_DIMENSION = FfiCode( + static const FfiCode nonPositiveArrayDimension = FfiCode( 'NON_POSITIVE_ARRAY_DIMENSION', "Array dimensions must be positive numbers.", correctionMessage: "Try changing the input to a positive number.", @@ -447,7 +447,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the field /// Type p1: the type of the field - static const FfiCode NON_SIZED_TYPE_ARGUMENT = FfiCode( + static const FfiCode nonSizedTypeArgument = FfiCode( 'NON_SIZED_TYPE_ARGUMENT', "The type '{1}' isn't a valid type argument for '{0}'. The type argument " "must be a native integer, 'Float', 'Double', 'Pointer', or subtype of " @@ -459,7 +459,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode PACKED_ANNOTATION = FfiCode( + static const FfiCode packedAnnotation = FfiCode( 'PACKED_ANNOTATION', "Structs must have at most one 'Packed' annotation.", correctionMessage: "Try removing extra 'Packed' annotations.", @@ -467,7 +467,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode PACKED_ANNOTATION_ALIGNMENT = FfiCode( + static const FfiCode packedAnnotationAlignment = FfiCode( 'PACKED_ANNOTATION_ALIGNMENT', "Only packing to 1, 2, 4, 8, and 16 bytes is supported.", correctionMessage: @@ -476,7 +476,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode SIZE_ANNOTATION_DIMENSIONS = FfiCode( + static const FfiCode sizeAnnotationDimensions = FfiCode( 'SIZE_ANNOTATION_DIMENSIONS', "'Array's must have an 'Array' annotation that matches the dimensions.", correctionMessage: "Try adjusting the arguments in the 'Array' annotation.", @@ -486,7 +486,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the subclass /// String p1: the name of the class being extended, implemented, or mixed in - static const FfiCode SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS = FfiCode( + static const FfiCode subtypeOfStructClassInExtends = FfiCode( 'SUBTYPE_OF_STRUCT_CLASS', "The class '{0}' can't extend '{1}' because '{1}' is a subtype of " "'Struct', 'Union', or 'AbiSpecificInteger'.", @@ -499,7 +499,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the subclass /// String p1: the name of the class being extended, implemented, or mixed in - static const FfiCode SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS = FfiCode( + static const FfiCode subtypeOfStructClassInImplements = FfiCode( 'SUBTYPE_OF_STRUCT_CLASS', "The class '{0}' can't implement '{1}' because '{1}' is a subtype of " "'Struct', 'Union', or 'AbiSpecificInteger'.", @@ -512,7 +512,7 @@ class FfiCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the subclass /// String p1: the name of the class being extended, implemented, or mixed in - static const FfiCode SUBTYPE_OF_STRUCT_CLASS_IN_WITH = FfiCode( + static const FfiCode subtypeOfStructClassInWith = FfiCode( 'SUBTYPE_OF_STRUCT_CLASS', "The class '{0}' can't mix in '{1}' because '{1}' is a subtype of " "'Struct', 'Union', or 'AbiSpecificInteger'.", @@ -523,7 +523,7 @@ class FfiCode extends DiagnosticCode { ); /// No parameters. - static const FfiCode VARIABLE_LENGTH_ARRAY_NOT_LAST = FfiCode( + static const FfiCode variableLengthArrayNotLast = FfiCode( 'VARIABLE_LENGTH_ARRAY_NOT_LAST', "Variable length 'Array's must only occur as the last field of Structs.", correctionMessage: "Try adjusting the arguments in the 'Array' annotation.", diff --git a/pkg/analyzer/lib/src/dart/error/hint_codes.g.dart b/pkg/analyzer/lib/src/dart/error/hint_codes.g.dart index 19c6b1b13af..81c4a990e2f 100644 --- a/pkg/analyzer/lib/src/dart/error/hint_codes.g.dart +++ b/pkg/analyzer/lib/src/dart/error/hint_codes.g.dart @@ -31,7 +31,7 @@ class HintCode extends DiagnosticCode { /// plan to go through the exercise of converting it to a Warning. /// /// No parameters. - static const HintCode DEPRECATED_COLON_FOR_DEFAULT_VALUE = HintCode( + static const HintCode deprecatedColonForDefaultValue = HintCode( 'DEPRECATED_COLON_FOR_DEFAULT_VALUE', "Using a colon as the separator before a default value is deprecated and " "will not be supported in language version 3.0 and later.", @@ -41,7 +41,7 @@ class HintCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member - static const HintCode DEPRECATED_MEMBER_USE = HintCode( + static const HintCode deprecatedMemberUse = HintCode( 'DEPRECATED_MEMBER_USE', "'{0}' is deprecated and shouldn't be used.", correctionMessage: @@ -54,7 +54,7 @@ class HintCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the member - static const HintCode DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE = HintCode( + static const HintCode deprecatedMemberUseFromSamePackage = HintCode( 'DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE', "'{0}' is deprecated and shouldn't be used.", correctionMessage: @@ -69,7 +69,7 @@ class HintCode extends DiagnosticCode { /// Object p0: the name of the member /// Object p1: message details static const HintCode - DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE = HintCode( + deprecatedMemberUseFromSamePackageWithMessage = HintCode( 'DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE', "'{0}' is deprecated and shouldn't be used. {1}", correctionMessage: @@ -81,7 +81,7 @@ class HintCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member /// String p1: message details - static const HintCode DEPRECATED_MEMBER_USE_WITH_MESSAGE = HintCode( + static const HintCode deprecatedMemberUseWithMessage = HintCode( 'DEPRECATED_MEMBER_USE', "'{0}' is deprecated and shouldn't be used. {1}", correctionMessage: @@ -91,7 +91,7 @@ class HintCode extends DiagnosticCode { ); /// No parameters. - static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = HintCode( + static const HintCode importDeferredLibraryWithLoadFunction = HintCode( 'IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', "The imported library defines a top-level function named 'loadLibrary' " "that is hidden by deferring this library.", @@ -104,7 +104,7 @@ class HintCode extends DiagnosticCode { /// Parameters: /// String p0: the URI that is not necessary /// String p1: the URI that makes it unnecessary - static const HintCode UNNECESSARY_IMPORT = HintCode( + static const HintCode unnecessaryImport = HintCode( 'UNNECESSARY_IMPORT', "The import of '{0}' is unnecessary because all of the used elements are " "also provided by the import of '{1}'.", @@ -112,6 +112,9 @@ class HintCode extends DiagnosticCode { hasPublishedDocs: true, ); + @Deprecated("Please use unnecessaryImport") + static const HintCode UNNECESSARY_IMPORT = unnecessaryImport; + /// Initialize a newly created error code to have the given [name]. const HintCode( String name, diff --git a/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart b/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart index 7336b4042d5..99933a96f4a 100644 --- a/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart +++ b/pkg/analyzer/lib/src/dart/error/syntactic_errors.g.dart @@ -28,188 +28,188 @@ import "package:_fe_analyzer_shared/src/base/errors.dart"; final fastaAnalyzerErrorCodes = [ null, - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, - ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, - ParserErrorCode.EXTERNAL_CLASS, - ParserErrorCode.STATIC_CONSTRUCTOR, - ParserErrorCode.EXTERNAL_ENUM, - ParserErrorCode.PREFIX_AFTER_COMBINATOR, - ParserErrorCode.TYPEDEF_IN_CLASS, - ParserErrorCode.EXPECTED_CLASS_BODY, - ParserErrorCode.INVALID_AWAIT_IN_FOR, - ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, - ParserErrorCode.WITH_BEFORE_EXTENDS, - ParserErrorCode.VAR_RETURN_TYPE, - ParserErrorCode.TYPE_ARGUMENTS_ON_TYPE_VARIABLE, - ParserErrorCode.TOP_LEVEL_OPERATOR, - ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, - ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, - ParserErrorCode.STATIC_OPERATOR, - ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER, - ParserErrorCode.STACK_OVERFLOW, - ParserErrorCode.MISSING_CATCH_OR_FINALLY, - ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, - ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY, - ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, - ParserErrorCode.MULTIPLE_WITH_CLAUSES, - ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, - ParserErrorCode.MULTIPLE_ON_CLAUSES, - ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES, - ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, - ParserErrorCode.MISSING_STATEMENT, - ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT, - ParserErrorCode.MISSING_KEYWORD_OPERATOR, - ParserErrorCode.MISSING_EXPRESSION_IN_THROW, - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, - ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, - ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, - ParserErrorCode.MISSING_INITIALIZER, - ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, - ParserErrorCode.INVALID_UNICODE_ESCAPE_U_STARTED, - ParserErrorCode.INVALID_OPERATOR, - ParserErrorCode.INVALID_HEX_ESCAPE, - ParserErrorCode.EXPECTED_INSTEAD, - ParserErrorCode.IMPLEMENTS_BEFORE_WITH, - ParserErrorCode.IMPLEMENTS_BEFORE_ON, - ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, - ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, - ParserErrorCode.EXPECTED_ELSE_OR_COMMA, - ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, - ParserErrorCode.EXTERNAL_FIELD, - ParserErrorCode.ABSTRACT_CLASS_MEMBER, - ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, - ParserErrorCode.CLASS_IN_CLASS, - ParserErrorCode.COLON_IN_PLACE_OF_IN, - ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, - ParserErrorCode.MODIFIER_OUT_OF_ORDER, - ParserErrorCode.TYPE_BEFORE_FACTORY, - ParserErrorCode.CONST_AND_FINAL, - ParserErrorCode.CONFLICTING_MODIFIERS, - ParserErrorCode.CONST_CLASS, - ParserErrorCode.VAR_AS_TYPE_NAME, - ParserErrorCode.CONST_FACTORY, - ParserErrorCode.CONST_METHOD, - ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, - ParserErrorCode.INVALID_THIS_IN_INITIALIZER, - ParserErrorCode.COVARIANT_AND_STATIC, - ParserErrorCode.COVARIANT_MEMBER, - ParserErrorCode.DEFERRED_AFTER_PREFIX, - ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, - ParserErrorCode.DUPLICATED_MODIFIER, - ParserErrorCode.DUPLICATE_DEFERRED, - ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT, - ParserErrorCode.DUPLICATE_PREFIX, - ParserErrorCode.ENUM_IN_CLASS, - ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, - ParserErrorCode.EXTERNAL_TYPEDEF, - ParserErrorCode.EXTRANEOUS_MODIFIER, - ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, - ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - ParserErrorCode.FINAL_AND_COVARIANT, - ParserErrorCode.FINAL_AND_VAR, - ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, - ParserErrorCode.CATCH_SYNTAX_EXTRA_PARAMETERS, - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXTERNAL_FACTORY_REDIRECTION, - ParserErrorCode.EXTERNAL_FACTORY_WITH_BODY, - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, - ParserErrorCode.FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS, - ParserErrorCode.VAR_AND_TYPE, - ParserErrorCode.INVALID_INITIALIZER, - ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS, - ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR, - ParserErrorCode.EXTENSION_AUGMENTATION_HAS_ON_CLAUSE, - ParserErrorCode.EXTENSION_DECLARES_ABSTRACT_MEMBER, - ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR, - ParserErrorCode.NULL_AWARE_CASCADE_OUT_OF_ORDER, - ParserErrorCode.MULTIPLE_VARIANCE_MODIFIERS, - ParserErrorCode.INVALID_USE_OF_COVARIANT_IN_EXTENSION, - ParserErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR, - ParserErrorCode.VOID_WITH_TYPE_ARGUMENTS, - ParserErrorCode.FINAL_AND_COVARIANT_LATE_WITH_INITIALIZER, - ParserErrorCode.INVALID_CONSTRUCTOR_NAME, - ParserErrorCode.GETTER_CONSTRUCTOR, - ParserErrorCode.SETTER_CONSTRUCTOR, - ParserErrorCode.MEMBER_WITH_CLASS_NAME, - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_INITIALIZER, - ParserErrorCode.ABSTRACT_STATIC_FIELD, - ParserErrorCode.ABSTRACT_LATE_FIELD, - ParserErrorCode.EXTERNAL_LATE_FIELD, - ParserErrorCode.ABSTRACT_EXTERNAL_FIELD, - ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, - ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, - ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED, - ParserErrorCode.LITERAL_WITH_CLASS_AND_NEW, - ParserErrorCode.LITERAL_WITH_CLASS, - ParserErrorCode.LITERAL_WITH_NEW, - ParserErrorCode.CONSTRUCTOR_WITH_TYPE_ARGUMENTS, - ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, - ParserErrorCode.TYPE_PARAMETER_ON_OPERATOR, - ParserErrorCode.MULTIPLE_CLAUSES, - ParserErrorCode.OUT_OF_ORDER_CLAUSES, - ParserErrorCode.UNEXPECTED_TOKENS, - ParserErrorCode.INVALID_UNICODE_ESCAPE_U_NO_BRACKET, - ParserErrorCode.INVALID_UNICODE_ESCAPE_U_BRACKET, - ParserErrorCode.INVALID_UNICODE_ESCAPE_STARTED, - ParserErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, - ParserErrorCode.EMPTY_RECORD_LITERAL_WITH_COMMA, - ParserErrorCode.EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST, - ParserErrorCode.EMPTY_RECORD_TYPE_WITH_COMMA, - ParserErrorCode.RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA, - ParserErrorCode.ABSTRACT_SEALED_CLASS, - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - ParserErrorCode.ANNOTATION_SPACE_BEFORE_PARENTHESIS, - ParserErrorCode.INVALID_CONSTANT_PATTERN_NEGATION, - ParserErrorCode.INVALID_CONSTANT_PATTERN_UNARY, - ParserErrorCode.INVALID_CONSTANT_PATTERN_DUPLICATE_CONST, - ParserErrorCode.INVALID_CONSTANT_PATTERN_EMPTY_RECORD_LITERAL, - ParserErrorCode.INVALID_CONSTANT_PATTERN_GENERIC, - ParserErrorCode.INVALID_CONSTANT_CONST_PREFIX, - ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY, - ParserErrorCode.FINAL_MIXIN_CLASS, - ParserErrorCode.INTERFACE_MIXIN_CLASS, - ParserErrorCode.SEALED_MIXIN_CLASS, - ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, - ParserErrorCode.FINAL_MIXIN, - ParserErrorCode.INTERFACE_MIXIN, - ParserErrorCode.SEALED_MIXIN, - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT, - ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, - ParserErrorCode.LATE_PATTERN_VARIABLE_DECLARATION, - ParserErrorCode.PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD, - ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION, - ParserErrorCode.MIXIN_WITH_CLAUSE, - ParserErrorCode.BASE_ENUM, - ParserErrorCode.FINAL_ENUM, - ParserErrorCode.INTERFACE_ENUM, - ParserErrorCode.SEALED_ENUM, - ParserErrorCode.ILLEGAL_PATTERN_VARIABLE_NAME, - ParserErrorCode.ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME, - ParserErrorCode.ILLEGAL_PATTERN_IDENTIFIER_NAME, - ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR, - ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR_PARAMETERS, - ParserErrorCode.EXTENSION_TYPE_EXTENDS, - ParserErrorCode.EXTENSION_TYPE_WITH, - ParserErrorCode.EXPECTED_MIXIN_BODY, - ParserErrorCode.EXPECTED_EXTENSION_TYPE_BODY, - ParserErrorCode.EXPECTED_TRY_STATEMENT_BODY, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ParserErrorCode.EXPECTED_FINALLY_CLAUSE_BODY, - ParserErrorCode.EXPECTED_SWITCH_EXPRESSION_BODY, - ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY, - ParserErrorCode.EXPECTED_EXTENSION_BODY, - ParserErrorCode.EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE, - ParserErrorCode.EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR, - ParserErrorCode.ABSTRACT_FINAL_BASE_CLASS, - ParserErrorCode.ABSTRACT_FINAL_INTERFACE_CLASS, - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS, + ParserErrorCode.equalityCannotBeEqualityOperand, + ParserErrorCode.continueOutsideOfLoop, + ParserErrorCode.externalClass, + ParserErrorCode.staticConstructor, + ParserErrorCode.externalEnum, + ParserErrorCode.prefixAfterCombinator, + ParserErrorCode.typedefInClass, + ParserErrorCode.expectedClassBody, + ParserErrorCode.invalidAwaitInFor, + ParserErrorCode.importDirectiveAfterPartDirective, + ParserErrorCode.withBeforeExtends, + ParserErrorCode.varReturnType, + ParserErrorCode.typeArgumentsOnTypeVariable, + ParserErrorCode.topLevelOperator, + ParserErrorCode.switchHasMultipleDefaultCases, + ParserErrorCode.switchHasCaseAfterDefaultCase, + ParserErrorCode.staticOperator, + ParserErrorCode.invalidOperatorQuestionmarkPeriodForSuper, + ParserErrorCode.stackOverflow, + ParserErrorCode.missingCatchOrFinally, + ParserErrorCode.redirectionInNonFactoryConstructor, + ParserErrorCode.redirectingConstructorWithBody, + ParserErrorCode.nativeClauseShouldBeAnnotation, + ParserErrorCode.multipleWithClauses, + ParserErrorCode.multiplePartOfDirectives, + ParserErrorCode.multipleOnClauses, + ParserErrorCode.multipleLibraryDirectives, + ParserErrorCode.multipleExtendsClauses, + ParserErrorCode.missingStatement, + ParserErrorCode.missingPrefixInDeferredImport, + ParserErrorCode.missingKeywordOperator, + ParserErrorCode.missingExpressionInThrow, + ParserErrorCode.missingConstFinalVarOrType, + ParserErrorCode.missingAssignmentInInitializer, + ParserErrorCode.missingAssignableSelector, + ParserErrorCode.missingInitializer, + ParserErrorCode.libraryDirectiveNotFirst, + ParserErrorCode.invalidUnicodeEscapeUStarted, + ParserErrorCode.invalidOperator, + ParserErrorCode.invalidHexEscape, + ParserErrorCode.expectedInstead, + ParserErrorCode.implementsBeforeWith, + ParserErrorCode.implementsBeforeOn, + ParserErrorCode.implementsBeforeExtends, + ParserErrorCode.illegalAssignmentToNonAssignable, + ParserErrorCode.expectedElseOrComma, + ParserErrorCode.invalidSuperInInitializer, + ParserErrorCode.experimentNotEnabled, + ParserErrorCode.externalMethodWithBody, + ParserErrorCode.externalField, + ParserErrorCode.abstractClassMember, + ParserErrorCode.breakOutsideOfLoop, + ParserErrorCode.classInClass, + ParserErrorCode.colonInPlaceOfIn, + ParserErrorCode.constructorWithReturnType, + ParserErrorCode.modifierOutOfOrder, + ParserErrorCode.typeBeforeFactory, + ParserErrorCode.constAndFinal, + ParserErrorCode.conflictingModifiers, + ParserErrorCode.constClass, + ParserErrorCode.varAsTypeName, + ParserErrorCode.constFactory, + ParserErrorCode.constMethod, + ParserErrorCode.continueWithoutLabelInCase, + ParserErrorCode.invalidThisInInitializer, + ParserErrorCode.covariantAndStatic, + ParserErrorCode.covariantMember, + ParserErrorCode.deferredAfterPrefix, + ParserErrorCode.directiveAfterDeclaration, + ParserErrorCode.duplicatedModifier, + ParserErrorCode.duplicateDeferred, + ParserErrorCode.duplicateLabelInSwitchStatement, + ParserErrorCode.duplicatePrefix, + ParserErrorCode.enumInClass, + ParserErrorCode.exportDirectiveAfterPartDirective, + ParserErrorCode.externalTypedef, + ParserErrorCode.extraneousModifier, + ParserErrorCode.factoryTopLevelDeclaration, + ParserErrorCode.fieldInitializerOutsideConstructor, + ParserErrorCode.finalAndCovariant, + ParserErrorCode.finalAndVar, + ParserErrorCode.initializedVariableInForEach, + ParserErrorCode.catchSyntaxExtraParameters, + ParserErrorCode.catchSyntax, + ParserErrorCode.externalFactoryRedirection, + ParserErrorCode.externalFactoryWithBody, + ParserErrorCode.externalConstructorWithBody, + ParserErrorCode.fieldInitializedOutsideDeclaringClass, + ParserErrorCode.varAndType, + ParserErrorCode.invalidInitializer, + ParserErrorCode.annotationWithTypeArguments, + ParserErrorCode.extensionDeclaresConstructor, + ParserErrorCode.extensionAugmentationHasOnClause, + ParserErrorCode.extensionDeclaresAbstractMember, + ParserErrorCode.mixinDeclaresConstructor, + ParserErrorCode.nullAwareCascadeOutOfOrder, + ParserErrorCode.multipleVarianceModifiers, + ParserErrorCode.invalidUseOfCovariantInExtension, + ParserErrorCode.typeParameterOnConstructor, + ParserErrorCode.voidWithTypeArguments, + ParserErrorCode.finalAndCovariantLateWithInitializer, + ParserErrorCode.invalidConstructorName, + ParserErrorCode.getterConstructor, + ParserErrorCode.setterConstructor, + ParserErrorCode.memberWithClassName, + ParserErrorCode.externalConstructorWithInitializer, + ParserErrorCode.abstractStaticField, + ParserErrorCode.abstractLateField, + ParserErrorCode.externalLateField, + ParserErrorCode.abstractExternalField, + ParserErrorCode.annotationOnTypeArgument, + ParserErrorCode.binaryOperatorWrittenOut, + ParserErrorCode.expectedIdentifierButGotKeyword, + ParserErrorCode.annotationWithTypeArgumentsUninstantiated, + ParserErrorCode.literalWithClassAndNew, + ParserErrorCode.literalWithClass, + ParserErrorCode.literalWithNew, + ParserErrorCode.constructorWithTypeArguments, + ParserErrorCode.functionTypedParameterVar, + ParserErrorCode.typeParameterOnOperator, + ParserErrorCode.multipleClauses, + ParserErrorCode.outOfOrderClauses, + ParserErrorCode.unexpectedTokens, + ParserErrorCode.invalidUnicodeEscapeUNoBracket, + ParserErrorCode.invalidUnicodeEscapeUBracket, + ParserErrorCode.invalidUnicodeEscapeStarted, + ParserErrorCode.recordLiteralOnePositionalNoTrailingComma, + ParserErrorCode.emptyRecordLiteralWithComma, + ParserErrorCode.emptyRecordTypeNamedFieldsList, + ParserErrorCode.emptyRecordTypeWithComma, + ParserErrorCode.recordTypeOnePositionalNoTrailingComma, + ParserErrorCode.abstractSealedClass, + ParserErrorCode.experimentNotEnabledOffByDefault, + ParserErrorCode.annotationSpaceBeforeParenthesis, + ParserErrorCode.invalidConstantPatternNegation, + ParserErrorCode.invalidConstantPatternUnary, + ParserErrorCode.invalidConstantPatternDuplicateConst, + ParserErrorCode.invalidConstantPatternEmptyRecordLiteral, + ParserErrorCode.invalidConstantPatternGeneric, + ParserErrorCode.invalidConstantConstPrefix, + ParserErrorCode.invalidConstantPatternBinary, + ParserErrorCode.finalMixinClass, + ParserErrorCode.interfaceMixinClass, + ParserErrorCode.sealedMixinClass, + ParserErrorCode.patternAssignmentDeclaresVariable, + ParserErrorCode.finalMixin, + ParserErrorCode.interfaceMixin, + ParserErrorCode.sealedMixin, + ParserErrorCode.variablePatternKeywordInDeclarationContext, + ParserErrorCode.invalidInsideUnaryPattern, + ParserErrorCode.latePatternVariableDeclaration, + ParserErrorCode.patternVariableDeclarationOutsideFunctionOrMethod, + ParserErrorCode.defaultInSwitchExpression, + ParserErrorCode.mixinWithClause, + ParserErrorCode.baseEnum, + ParserErrorCode.finalEnum, + ParserErrorCode.interfaceEnum, + ParserErrorCode.sealedEnum, + ParserErrorCode.illegalPatternVariableName, + ParserErrorCode.illegalPatternAssignmentVariableName, + ParserErrorCode.illegalPatternIdentifierName, + ParserErrorCode.missingPrimaryConstructor, + ParserErrorCode.missingPrimaryConstructorParameters, + ParserErrorCode.extensionTypeExtends, + ParserErrorCode.extensionTypeWith, + ParserErrorCode.expectedMixinBody, + ParserErrorCode.expectedExtensionTypeBody, + ParserErrorCode.expectedTryStatementBody, + ParserErrorCode.expectedCatchClauseBody, + ParserErrorCode.expectedFinallyClauseBody, + ParserErrorCode.expectedSwitchExpressionBody, + ParserErrorCode.expectedSwitchStatementBody, + ParserErrorCode.expectedExtensionBody, + ParserErrorCode.extraneousModifierInExtensionType, + ParserErrorCode.extraneousModifierInPrimaryConstructor, + ParserErrorCode.abstractFinalBaseClass, + ParserErrorCode.abstractFinalInterfaceClass, + ParserErrorCode.externalConstructorWithFieldInitializers, ]; class ParserErrorCode extends DiagnosticCode { - static const ParserErrorCode ABSTRACT_CLASS_MEMBER = ParserErrorCode( + static const ParserErrorCode abstractClassMember = ParserErrorCode( 'ABSTRACT_CLASS_MEMBER', "Members of classes can't be declared to be 'abstract'.", correctionMessage: @@ -217,32 +217,32 @@ class ParserErrorCode extends DiagnosticCode { "keyword before the class declaration.", ); - static const ParserErrorCode ABSTRACT_EXTERNAL_FIELD = ParserErrorCode( + static const ParserErrorCode abstractExternalField = ParserErrorCode( 'ABSTRACT_EXTERNAL_FIELD', "Fields can't be declared both 'abstract' and 'external'.", correctionMessage: "Try removing the 'abstract' or 'external' keyword.", ); - static const ParserErrorCode ABSTRACT_FINAL_BASE_CLASS = ParserErrorCode( + static const ParserErrorCode abstractFinalBaseClass = ParserErrorCode( 'ABSTRACT_FINAL_BASE_CLASS', "An 'abstract' class can't be declared as both 'final' and 'base'.", correctionMessage: "Try removing either the 'final' or 'base' keyword.", ); - static const ParserErrorCode ABSTRACT_FINAL_INTERFACE_CLASS = ParserErrorCode( + static const ParserErrorCode abstractFinalInterfaceClass = ParserErrorCode( 'ABSTRACT_FINAL_INTERFACE_CLASS', "An 'abstract' class can't be declared as both 'final' and 'interface'.", correctionMessage: "Try removing either the 'final' or 'interface' keyword.", ); - static const ParserErrorCode ABSTRACT_LATE_FIELD = ParserErrorCode( + static const ParserErrorCode abstractLateField = ParserErrorCode( 'ABSTRACT_LATE_FIELD', "Abstract fields cannot be late.", correctionMessage: "Try removing the 'abstract' or 'late' keyword.", ); - static const ParserErrorCode ABSTRACT_SEALED_CLASS = ParserErrorCode( + static const ParserErrorCode abstractSealedClass = ParserErrorCode( 'ABSTRACT_SEALED_CLASS', "A 'sealed' class can't be marked 'abstract' because it's already " "implicitly abstract.", @@ -250,25 +250,25 @@ class ParserErrorCode extends DiagnosticCode { hasPublishedDocs: true, ); - static const ParserErrorCode ABSTRACT_STATIC_FIELD = ParserErrorCode( + static const ParserErrorCode abstractStaticField = ParserErrorCode( 'ABSTRACT_STATIC_FIELD', "Static fields can't be declared 'abstract'.", correctionMessage: "Try removing the 'abstract' or 'static' keyword.", ); /// No parameters. - static const ParserErrorCode ABSTRACT_STATIC_METHOD = ParserErrorCode( + static const ParserErrorCode abstractStaticMethod = ParserErrorCode( 'ABSTRACT_STATIC_METHOD', "Static methods can't be declared to be 'abstract'.", correctionMessage: "Try removing the keyword 'abstract'.", ); - static const ParserErrorCode ANNOTATION_ON_TYPE_ARGUMENT = ParserErrorCode( + static const ParserErrorCode annotationOnTypeArgument = ParserErrorCode( 'ANNOTATION_ON_TYPE_ARGUMENT', "Type arguments can't have annotations because they aren't declarations.", ); - static const ParserErrorCode ANNOTATION_SPACE_BEFORE_PARENTHESIS = + static const ParserErrorCode annotationSpaceBeforeParenthesis = ParserErrorCode( 'ANNOTATION_SPACE_BEFORE_PARENTHESIS', "Annotations can't have spaces or comments before the parenthesis.", @@ -276,13 +276,13 @@ class ParserErrorCode extends DiagnosticCode { "Remove any spaces or comments before the parenthesis.", ); - static const ParserErrorCode ANNOTATION_WITH_TYPE_ARGUMENTS = ParserErrorCode( + static const ParserErrorCode annotationWithTypeArguments = ParserErrorCode( 'ANNOTATION_WITH_TYPE_ARGUMENTS', "An annotation can't use type arguments.", ); static const ParserErrorCode - ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED = ParserErrorCode( + annotationWithTypeArgumentsUninstantiated = ParserErrorCode( 'ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED', "An annotation with type arguments must be followed by an argument list.", ); @@ -292,33 +292,32 @@ class ParserErrorCode extends DiagnosticCode { /// body marked with either async, async, or sync. /// /// No parameters. - static const ParserErrorCode ASYNC_KEYWORD_USED_AS_IDENTIFIER = - ParserErrorCode( - 'ASYNC_KEYWORD_USED_AS_IDENTIFIER', - "The keywords 'await' and 'yield' can't be used as identifiers in an " - "asynchronous or generator function.", - ); + static const ParserErrorCode asyncKeywordUsedAsIdentifier = ParserErrorCode( + 'ASYNC_KEYWORD_USED_AS_IDENTIFIER', + "The keywords 'await' and 'yield' can't be used as identifiers in an " + "asynchronous or generator function.", + ); - static const ParserErrorCode BASE_ENUM = ParserErrorCode( + static const ParserErrorCode baseEnum = ParserErrorCode( 'BASE_ENUM', "Enums can't be declared to be 'base'.", correctionMessage: "Try removing the keyword 'base'.", ); - static const ParserErrorCode BINARY_OPERATOR_WRITTEN_OUT = ParserErrorCode( + static const ParserErrorCode binaryOperatorWrittenOut = ParserErrorCode( 'BINARY_OPERATOR_WRITTEN_OUT', "Binary operator '{0}' is written as '{1}' instead of the written out " "word.", correctionMessage: "Try replacing '{0}' with '{1}'.", ); - static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = ParserErrorCode( + static const ParserErrorCode breakOutsideOfLoop = ParserErrorCode( 'BREAK_OUTSIDE_OF_LOOP', "A break statement can't be used outside of a loop or switch statement.", correctionMessage: "Try removing the break statement.", ); - static const ParserErrorCode CATCH_SYNTAX = ParserErrorCode( + static const ParserErrorCode catchSyntax = ParserErrorCode( 'CATCH_SYNTAX', "'catch' must be followed by '(identifier)' or '(identifier, identifier)'.", correctionMessage: @@ -326,7 +325,7 @@ class ParserErrorCode extends DiagnosticCode { "'StackTrace'.", ); - static const ParserErrorCode CATCH_SYNTAX_EXTRA_PARAMETERS = ParserErrorCode( + static const ParserErrorCode catchSyntaxExtraParameters = ParserErrorCode( 'CATCH_SYNTAX_EXTRA_PARAMETERS', "'catch' must be followed by '(identifier)' or '(identifier, identifier)'.", correctionMessage: @@ -334,32 +333,31 @@ class ParserErrorCode extends DiagnosticCode { "'StackTrace'.", ); - static const ParserErrorCode CLASS_IN_CLASS = ParserErrorCode( + static const ParserErrorCode classInClass = ParserErrorCode( 'CLASS_IN_CLASS', "Classes can't be declared inside other classes.", correctionMessage: "Try moving the class to the top-level.", ); - static const ParserErrorCode COLON_IN_PLACE_OF_IN = ParserErrorCode( + static const ParserErrorCode colonInPlaceOfIn = ParserErrorCode( 'COLON_IN_PLACE_OF_IN', "For-in loops use 'in' rather than a colon.", correctionMessage: "Try replacing the colon with the keyword 'in'.", ); - static const ParserErrorCode CONFLICTING_MODIFIERS = ParserErrorCode( + static const ParserErrorCode conflictingModifiers = ParserErrorCode( 'CONFLICTING_MODIFIERS', "Members can't be declared to be both '{0}' and '{1}'.", correctionMessage: "Try removing one of the keywords.", ); - static const ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = ParserErrorCode( + static const ParserErrorCode constructorWithReturnType = ParserErrorCode( 'CONSTRUCTOR_WITH_RETURN_TYPE', "Constructors can't have a return type.", correctionMessage: "Try removing the return type.", ); - static const ParserErrorCode - CONSTRUCTOR_WITH_TYPE_ARGUMENTS = ParserErrorCode( + static const ParserErrorCode constructorWithTypeArguments = ParserErrorCode( 'CONSTRUCTOR_WITH_TYPE_ARGUMENTS', "A constructor invocation can't have type arguments after the constructor " "name.", @@ -367,13 +365,13 @@ class ParserErrorCode extends DiagnosticCode { "Try removing the type arguments or placing them after the class name.", ); - static const ParserErrorCode CONST_AND_FINAL = ParserErrorCode( + static const ParserErrorCode constAndFinal = ParserErrorCode( 'CONST_AND_FINAL', "Members can't be declared to be both 'const' and 'final'.", correctionMessage: "Try removing either the 'const' or 'final' keyword.", ); - static const ParserErrorCode CONST_CLASS = ParserErrorCode( + static const ParserErrorCode constClass = ParserErrorCode( 'CONST_CLASS', "Classes can't be declared to be 'const'.", correctionMessage: @@ -383,13 +381,13 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = ParserErrorCode( + static const ParserErrorCode constConstructorWithBody = ParserErrorCode( 'CONST_CONSTRUCTOR_WITH_BODY', "Const constructors can't have a body.", correctionMessage: "Try removing either the 'const' keyword or the body.", ); - static const ParserErrorCode CONST_FACTORY = ParserErrorCode( + static const ParserErrorCode constFactory = ParserErrorCode( 'CONST_FACTORY', "Only redirecting factory constructors can be declared to be 'const'.", correctionMessage: @@ -397,19 +395,19 @@ class ParserErrorCode extends DiagnosticCode { "followed by a valid target.", ); - static const ParserErrorCode CONST_METHOD = ParserErrorCode( + static const ParserErrorCode constMethod = ParserErrorCode( 'CONST_METHOD', "Getters, setters and methods can't be declared to be 'const'.", correctionMessage: "Try removing the 'const' keyword.", ); - static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = ParserErrorCode( + static const ParserErrorCode continueOutsideOfLoop = ParserErrorCode( 'CONTINUE_OUTSIDE_OF_LOOP', "A continue statement can't be used outside of a loop or switch statement.", correctionMessage: "Try removing the continue statement.", ); - static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = ParserErrorCode( + static const ParserErrorCode continueWithoutLabelInCase = ParserErrorCode( 'CONTINUE_WITHOUT_LABEL_IN_CASE', "A continue statement in a switch statement must have a label as a target.", correctionMessage: @@ -417,7 +415,7 @@ class ParserErrorCode extends DiagnosticCode { "continue statement.", ); - static const ParserErrorCode COVARIANT_AND_STATIC = ParserErrorCode( + static const ParserErrorCode covariantAndStatic = ParserErrorCode( 'COVARIANT_AND_STATIC', "Members can't be declared to be both 'covariant' and 'static'.", correctionMessage: @@ -425,41 +423,41 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode COVARIANT_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode covariantConstructor = ParserErrorCode( 'COVARIANT_CONSTRUCTOR', "A constructor can't be declared to be 'covariant'.", correctionMessage: "Try removing the keyword 'covariant'.", ); - static const ParserErrorCode COVARIANT_MEMBER = ParserErrorCode( + static const ParserErrorCode covariantMember = ParserErrorCode( 'COVARIANT_MEMBER', "Getters, setters and methods can't be declared to be 'covariant'.", correctionMessage: "Try removing the 'covariant' keyword.", ); /// No parameters. - static const ParserErrorCode DEFAULT_IN_SWITCH_EXPRESSION = ParserErrorCode( + static const ParserErrorCode defaultInSwitchExpression = ParserErrorCode( 'DEFAULT_IN_SWITCH_EXPRESSION', "A switch expression may not use the `default` keyword.", correctionMessage: "Try replacing `default` with `_`.", ); /// No parameters. - static const ParserErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE = ParserErrorCode( + static const ParserErrorCode defaultValueInFunctionType = ParserErrorCode( 'DEFAULT_VALUE_IN_FUNCTION_TYPE', "Parameters in a function type can't have default values.", correctionMessage: "Try removing the default value.", hasPublishedDocs: true, ); - static const ParserErrorCode DEFERRED_AFTER_PREFIX = ParserErrorCode( + static const ParserErrorCode deferredAfterPrefix = ParserErrorCode( 'DEFERRED_AFTER_PREFIX', "The deferred keyword should come immediately before the prefix ('as' " "clause).", correctionMessage: "Try moving the deferred keyword before the prefix.", ); - static const ParserErrorCode DIRECTIVE_AFTER_DECLARATION = ParserErrorCode( + static const ParserErrorCode directiveAfterDeclaration = ParserErrorCode( 'DIRECTIVE_AFTER_DECLARATION', "Directives must appear before any declarations.", correctionMessage: "Try moving the directive before any declarations.", @@ -467,13 +465,13 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// 0: the modifier that was duplicated - static const ParserErrorCode DUPLICATED_MODIFIER = ParserErrorCode( + static const ParserErrorCode duplicatedModifier = ParserErrorCode( 'DUPLICATED_MODIFIER', "The modifier '{0}' was already specified.", correctionMessage: "Try removing all but one occurrence of the modifier.", ); - static const ParserErrorCode DUPLICATE_DEFERRED = ParserErrorCode( + static const ParserErrorCode duplicateDeferred = ParserErrorCode( 'DUPLICATE_DEFERRED', "An import directive can only have one 'deferred' keyword.", correctionMessage: "Try removing all but one 'deferred' keyword.", @@ -481,56 +479,54 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// 0: the label that was duplicated - static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = + static const ParserErrorCode duplicateLabelInSwitchStatement = ParserErrorCode( 'DUPLICATE_LABEL_IN_SWITCH_STATEMENT', "The label '{0}' was already used in this switch statement.", correctionMessage: "Try choosing a different name for this label.", ); - static const ParserErrorCode DUPLICATE_PREFIX = ParserErrorCode( + static const ParserErrorCode duplicatePrefix = ParserErrorCode( 'DUPLICATE_PREFIX', "An import directive can only have one prefix ('as' clause).", correctionMessage: "Try removing all but one prefix.", ); /// No parameters. - static const ParserErrorCode EMPTY_ENUM_BODY = ParserErrorCode( + static const ParserErrorCode emptyEnumBody = ParserErrorCode( 'EMPTY_ENUM_BODY', "An enum must declare at least one constant name.", correctionMessage: "Try declaring a constant.", ); - static const ParserErrorCode EMPTY_RECORD_LITERAL_WITH_COMMA = - ParserErrorCode( - 'EMPTY_RECORD_LITERAL_WITH_COMMA', - "A record literal without fields can't have a trailing comma.", - correctionMessage: "Try removing the trailing comma.", - hasPublishedDocs: true, - ); + static const ParserErrorCode emptyRecordLiteralWithComma = ParserErrorCode( + 'EMPTY_RECORD_LITERAL_WITH_COMMA', + "A record literal without fields can't have a trailing comma.", + correctionMessage: "Try removing the trailing comma.", + hasPublishedDocs: true, + ); - static const ParserErrorCode EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST = - ParserErrorCode( - 'EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST', - "The list of named fields in a record type can't be empty.", - correctionMessage: "Try adding a named field to the list.", - hasPublishedDocs: true, - ); + static const ParserErrorCode emptyRecordTypeNamedFieldsList = ParserErrorCode( + 'EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST', + "The list of named fields in a record type can't be empty.", + correctionMessage: "Try adding a named field to the list.", + hasPublishedDocs: true, + ); - static const ParserErrorCode EMPTY_RECORD_TYPE_WITH_COMMA = ParserErrorCode( + static const ParserErrorCode emptyRecordTypeWithComma = ParserErrorCode( 'EMPTY_RECORD_TYPE_WITH_COMMA', "A record type without fields can't have a trailing comma.", correctionMessage: "Try removing the trailing comma.", hasPublishedDocs: true, ); - static const ParserErrorCode ENUM_IN_CLASS = ParserErrorCode( + static const ParserErrorCode enumInClass = ParserErrorCode( 'ENUM_IN_CLASS', "Enums can't be declared inside classes.", correctionMessage: "Try moving the enum to the top-level.", ); - static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = + static const ParserErrorCode equalityCannotBeEqualityOperand = ParserErrorCode( 'EQUALITY_CANNOT_BE_EQUALITY_OPERAND', "A comparison expression can't be an operand of another comparison " @@ -540,20 +536,20 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = ParserErrorCode( + static const ParserErrorCode expectedCaseOrDefault = ParserErrorCode( 'EXPECTED_CASE_OR_DEFAULT', "Expected 'case' or 'default'.", correctionMessage: "Try placing this code inside a case clause.", ); - static const ParserErrorCode EXPECTED_CATCH_CLAUSE_BODY = ParserErrorCode( + static const ParserErrorCode expectedCatchClauseBody = ParserErrorCode( 'EXPECTED_BODY', "A catch clause must have a body, even if it is empty.", correctionMessage: "Try adding an empty body.", uniqueName: 'EXPECTED_CATCH_CLAUSE_BODY', ); - static const ParserErrorCode EXPECTED_CLASS_BODY = ParserErrorCode( + static const ParserErrorCode expectedClassBody = ParserErrorCode( 'EXPECTED_BODY', "A class declaration must have a body, even if it is empty.", correctionMessage: "Try adding an empty body.", @@ -561,47 +557,47 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_CLASS_MEMBER = ParserErrorCode( + static const ParserErrorCode expectedClassMember = ParserErrorCode( 'EXPECTED_CLASS_MEMBER', "Expected a class member.", correctionMessage: "Try placing this code inside a class member.", ); - static const ParserErrorCode EXPECTED_ELSE_OR_COMMA = ParserErrorCode( + static const ParserErrorCode expectedElseOrComma = ParserErrorCode( 'EXPECTED_ELSE_OR_COMMA', "Expected 'else' or comma.", ); /// No parameters. - static const ParserErrorCode EXPECTED_EXECUTABLE = ParserErrorCode( + static const ParserErrorCode expectedExecutable = ParserErrorCode( 'EXPECTED_EXECUTABLE', "Expected a method, getter, setter or operator declaration.", correctionMessage: "This appears to be incomplete code. Try removing it or completing it.", ); - static const ParserErrorCode EXPECTED_EXTENSION_BODY = ParserErrorCode( + static const ParserErrorCode expectedExtensionBody = ParserErrorCode( 'EXPECTED_BODY', "An extension declaration must have a body, even if it is empty.", correctionMessage: "Try adding an empty body.", uniqueName: 'EXPECTED_EXTENSION_BODY', ); - static const ParserErrorCode EXPECTED_EXTENSION_TYPE_BODY = ParserErrorCode( + static const ParserErrorCode expectedExtensionTypeBody = ParserErrorCode( 'EXPECTED_BODY', "An extension type declaration must have a body, even if it is empty.", correctionMessage: "Try adding an empty body.", uniqueName: 'EXPECTED_EXTENSION_TYPE_BODY', ); - static const ParserErrorCode EXPECTED_FINALLY_CLAUSE_BODY = ParserErrorCode( + static const ParserErrorCode expectedFinallyClauseBody = ParserErrorCode( 'EXPECTED_BODY', "A finally clause must have a body, even if it is empty.", correctionMessage: "Try adding an empty body.", uniqueName: 'EXPECTED_FINALLY_CLAUSE_BODY', ); - static const ParserErrorCode EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD = + static const ParserErrorCode expectedIdentifierButGotKeyword = ParserErrorCode( 'EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD', "'{0}' can't be used as an identifier because it's a keyword.", @@ -609,20 +605,20 @@ class ParserErrorCode extends DiagnosticCode { "Try renaming this to be an identifier that isn't a keyword.", ); - static const ParserErrorCode EXPECTED_INSTEAD = ParserErrorCode( + static const ParserErrorCode expectedInstead = ParserErrorCode( 'EXPECTED_INSTEAD', "Expected '{0}' instead of this.", ); /// No parameters. - static const ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = ParserErrorCode( + static const ParserErrorCode expectedListOrMapLiteral = ParserErrorCode( 'EXPECTED_LIST_OR_MAP_LITERAL', "Expected a list or map literal.", correctionMessage: "Try inserting a list or map literal, or remove the type arguments.", ); - static const ParserErrorCode EXPECTED_MIXIN_BODY = ParserErrorCode( + static const ParserErrorCode expectedMixinBody = ParserErrorCode( 'EXPECTED_BODY', "A mixin declaration must have a body, even if it is empty.", correctionMessage: "Try adding an empty body.", @@ -630,7 +626,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_NAMED_TYPE_EXTENDS = ParserErrorCode( + static const ParserErrorCode expectedNamedTypeExtends = ParserErrorCode( 'EXPECTED_NAMED_TYPE', "Expected a class name.", correctionMessage: "Try using a class name, possibly with type arguments.", @@ -638,7 +634,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_NAMED_TYPE_IMPLEMENTS = ParserErrorCode( + static const ParserErrorCode expectedNamedTypeImplements = ParserErrorCode( 'EXPECTED_NAMED_TYPE', "Expected the name of a class or mixin.", correctionMessage: @@ -647,7 +643,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_NAMED_TYPE_ON = ParserErrorCode( + static const ParserErrorCode expectedNamedTypeOn = ParserErrorCode( 'EXPECTED_NAMED_TYPE', "Expected the name of a class or mixin.", correctionMessage: @@ -656,7 +652,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_NAMED_TYPE_WITH = ParserErrorCode( + static const ParserErrorCode expectedNamedTypeWith = ParserErrorCode( 'EXPECTED_NAMED_TYPE', "Expected a mixin name.", correctionMessage: "Try using a mixin name, possibly with type arguments.", @@ -664,7 +660,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_REPRESENTATION_FIELD = ParserErrorCode( + static const ParserErrorCode expectedRepresentationField = ParserErrorCode( 'EXPECTED_REPRESENTATION_FIELD', "Expected a representation field.", correctionMessage: @@ -672,7 +668,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_REPRESENTATION_TYPE = ParserErrorCode( + static const ParserErrorCode expectedRepresentationType = ParserErrorCode( 'EXPECTED_REPRESENTATION_TYPE', "Expected a representation type.", correctionMessage: @@ -680,20 +676,19 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_STRING_LITERAL = ParserErrorCode( + static const ParserErrorCode expectedStringLiteral = ParserErrorCode( 'EXPECTED_STRING_LITERAL', "Expected a string literal.", ); - static const ParserErrorCode EXPECTED_SWITCH_EXPRESSION_BODY = - ParserErrorCode( - 'EXPECTED_BODY', - "A switch expression must have a body, even if it is empty.", - correctionMessage: "Try adding an empty body.", - uniqueName: 'EXPECTED_SWITCH_EXPRESSION_BODY', - ); + static const ParserErrorCode expectedSwitchExpressionBody = ParserErrorCode( + 'EXPECTED_BODY', + "A switch expression must have a body, even if it is empty.", + correctionMessage: "Try adding an empty body.", + uniqueName: 'EXPECTED_SWITCH_EXPRESSION_BODY', + ); - static const ParserErrorCode EXPECTED_SWITCH_STATEMENT_BODY = ParserErrorCode( + static const ParserErrorCode expectedSwitchStatementBody = ParserErrorCode( 'EXPECTED_BODY', "A switch statement must have a body, even if it is empty.", correctionMessage: "Try adding an empty body.", @@ -702,12 +697,12 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the token that was expected but not found - static const ParserErrorCode EXPECTED_TOKEN = ParserErrorCode( + static const ParserErrorCode expectedToken = ParserErrorCode( 'EXPECTED_TOKEN', "Expected to find '{0}'.", ); - static const ParserErrorCode EXPECTED_TRY_STATEMENT_BODY = ParserErrorCode( + static const ParserErrorCode expectedTryStatementBody = ParserErrorCode( 'EXPECTED_BODY', "A try statement must have a body, even if it is empty.", correctionMessage: "Try adding an empty body.", @@ -715,12 +710,12 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXPECTED_TYPE_NAME = ParserErrorCode( + static const ParserErrorCode expectedTypeName = ParserErrorCode( 'EXPECTED_TYPE_NAME', "Expected a type name.", ); - static const ParserErrorCode EXPERIMENT_NOT_ENABLED = ParserErrorCode( + static const ParserErrorCode experimentNotEnabled = ParserErrorCode( 'EXPERIMENT_NOT_ENABLED', "This requires the '{0}' language feature to be enabled.", correctionMessage: @@ -728,7 +723,10 @@ class ParserErrorCode extends DiagnosticCode { "{1} or higher, and running 'pub get'.", ); - static const ParserErrorCode EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT = + @Deprecated("Please use experimentNotEnabled") + static const ParserErrorCode EXPERIMENT_NOT_ENABLED = experimentNotEnabled; + + static const ParserErrorCode experimentNotEnabledOffByDefault = ParserErrorCode( 'EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT', "This requires the experimental '{0}' language feature to be enabled.", @@ -736,7 +734,7 @@ class ParserErrorCode extends DiagnosticCode { "Try passing the '--enable-experiment={0}' command line option.", ); - static const ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = + static const ParserErrorCode exportDirectiveAfterPartDirective = ParserErrorCode( 'EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', "Export directives must precede part directives.", @@ -745,7 +743,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXTENSION_AUGMENTATION_HAS_ON_CLAUSE = + static const ParserErrorCode extensionAugmentationHasOnClause = ParserErrorCode( 'EXTENSION_AUGMENTATION_HAS_ON_CLAUSE', "Extension augmentations can't have 'on' clauses.", @@ -753,7 +751,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXTENSION_DECLARES_ABSTRACT_MEMBER = + static const ParserErrorCode extensionDeclaresAbstractMember = ParserErrorCode( 'EXTENSION_DECLARES_ABSTRACT_MEMBER', "Extensions can't declare abstract members.", @@ -762,14 +760,14 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXTENSION_DECLARES_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode extensionDeclaresConstructor = ParserErrorCode( 'EXTENSION_DECLARES_CONSTRUCTOR', "Extensions can't declare constructors.", correctionMessage: "Try removing the constructor declaration.", hasPublishedDocs: true, ); - static const ParserErrorCode EXTENSION_TYPE_EXTENDS = ParserErrorCode( + static const ParserErrorCode extensionTypeExtends = ParserErrorCode( 'EXTENSION_TYPE_EXTENDS', "An extension type declaration can't have an 'extends' clause.", correctionMessage: @@ -777,7 +775,7 @@ class ParserErrorCode extends DiagnosticCode { "'implements'.", ); - static const ParserErrorCode EXTENSION_TYPE_WITH = ParserErrorCode( + static const ParserErrorCode extensionTypeWith = ParserErrorCode( 'EXTENSION_TYPE_WITH', "An extension type declaration can't have a 'with' clause.", correctionMessage: @@ -785,13 +783,13 @@ class ParserErrorCode extends DiagnosticCode { "'implements'.", ); - static const ParserErrorCode EXTERNAL_CLASS = ParserErrorCode( + static const ParserErrorCode externalClass = ParserErrorCode( 'EXTERNAL_CLASS', "Classes can't be declared to be 'external'.", correctionMessage: "Try removing the keyword 'external'.", ); - static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = ParserErrorCode( + static const ParserErrorCode externalConstructorWithBody = ParserErrorCode( 'EXTERNAL_CONSTRUCTOR_WITH_BODY', "External constructors can't have a body.", correctionMessage: @@ -799,7 +797,7 @@ class ParserErrorCode extends DiagnosticCode { "'external'.", ); - static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS = + static const ParserErrorCode externalConstructorWithFieldInitializers = ParserErrorCode( 'EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS', "An external constructor can't initialize fields.", @@ -808,25 +806,25 @@ class ParserErrorCode extends DiagnosticCode { "'external'.", ); - static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_INITIALIZER = + static const ParserErrorCode externalConstructorWithInitializer = ParserErrorCode( 'EXTERNAL_CONSTRUCTOR_WITH_INITIALIZER', "An external constructor can't have any initializers.", ); - static const ParserErrorCode EXTERNAL_ENUM = ParserErrorCode( + static const ParserErrorCode externalEnum = ParserErrorCode( 'EXTERNAL_ENUM', "Enums can't be declared to be 'external'.", correctionMessage: "Try removing the keyword 'external'.", ); - static const ParserErrorCode EXTERNAL_FACTORY_REDIRECTION = ParserErrorCode( + static const ParserErrorCode externalFactoryRedirection = ParserErrorCode( 'EXTERNAL_FACTORY_REDIRECTION', "A redirecting factory can't be external.", correctionMessage: "Try removing the 'external' modifier.", ); - static const ParserErrorCode EXTERNAL_FACTORY_WITH_BODY = ParserErrorCode( + static const ParserErrorCode externalFactoryWithBody = ParserErrorCode( 'EXTERNAL_FACTORY_WITH_BODY', "External factories can't have a body.", correctionMessage: @@ -834,7 +832,7 @@ class ParserErrorCode extends DiagnosticCode { "'external'.", ); - static const ParserErrorCode EXTERNAL_FIELD = ParserErrorCode( + static const ParserErrorCode externalField = ParserErrorCode( 'EXTERNAL_FIELD', "Fields can't be declared to be 'external'.", correctionMessage: @@ -843,7 +841,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXTERNAL_GETTER_WITH_BODY = ParserErrorCode( + static const ParserErrorCode externalGetterWithBody = ParserErrorCode( 'EXTERNAL_GETTER_WITH_BODY', "External getters can't have a body.", correctionMessage: @@ -851,19 +849,19 @@ class ParserErrorCode extends DiagnosticCode { "'external'.", ); - static const ParserErrorCode EXTERNAL_LATE_FIELD = ParserErrorCode( + static const ParserErrorCode externalLateField = ParserErrorCode( 'EXTERNAL_LATE_FIELD', "External fields cannot be late.", correctionMessage: "Try removing the 'external' or 'late' keyword.", ); - static const ParserErrorCode EXTERNAL_METHOD_WITH_BODY = ParserErrorCode( + static const ParserErrorCode externalMethodWithBody = ParserErrorCode( 'EXTERNAL_METHOD_WITH_BODY', "An external or native method can't have a body.", ); /// No parameters. - static const ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = ParserErrorCode( + static const ParserErrorCode externalOperatorWithBody = ParserErrorCode( 'EXTERNAL_OPERATOR_WITH_BODY', "External operators can't have a body.", correctionMessage: @@ -872,7 +870,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode EXTERNAL_SETTER_WITH_BODY = ParserErrorCode( + static const ParserErrorCode externalSetterWithBody = ParserErrorCode( 'EXTERNAL_SETTER_WITH_BODY', "External setters can't have a body.", correctionMessage: @@ -880,47 +878,47 @@ class ParserErrorCode extends DiagnosticCode { "'external'.", ); - static const ParserErrorCode EXTERNAL_TYPEDEF = ParserErrorCode( + static const ParserErrorCode externalTypedef = ParserErrorCode( 'EXTERNAL_TYPEDEF', "Typedefs can't be declared to be 'external'.", correctionMessage: "Try removing the keyword 'external'.", ); - static const ParserErrorCode EXTRANEOUS_MODIFIER = ParserErrorCode( + static const ParserErrorCode extraneousModifier = ParserErrorCode( 'EXTRANEOUS_MODIFIER', "Can't have modifier '{0}' here.", correctionMessage: "Try removing '{0}'.", ); - static const ParserErrorCode EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE = + static const ParserErrorCode extraneousModifierInExtensionType = ParserErrorCode( 'EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE', "Can't have modifier '{0}' in an extension type.", correctionMessage: "Try removing '{0}'.", ); - static const ParserErrorCode EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR = + static const ParserErrorCode extraneousModifierInPrimaryConstructor = ParserErrorCode( 'EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR', "Can't have modifier '{0}' in a primary constructor.", correctionMessage: "Try removing '{0}'.", ); - static const ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = ParserErrorCode( + static const ParserErrorCode factoryTopLevelDeclaration = ParserErrorCode( 'FACTORY_TOP_LEVEL_DECLARATION', "Top-level declarations can't be declared to be 'factory'.", correctionMessage: "Try removing the keyword 'factory'.", ); /// No parameters. - static const ParserErrorCode FACTORY_WITHOUT_BODY = ParserErrorCode( + static const ParserErrorCode factoryWithoutBody = ParserErrorCode( 'FACTORY_WITHOUT_BODY', "A non-redirecting 'factory' constructor must have a body.", correctionMessage: "Try adding a body to the constructor.", ); /// No parameters. - static const ParserErrorCode FACTORY_WITH_INITIALIZERS = ParserErrorCode( + static const ParserErrorCode factoryWithInitializers = ParserErrorCode( 'FACTORY_WITH_INITIALIZERS', "A 'factory' constructor can't have initializers.", correctionMessage: @@ -929,7 +927,7 @@ class ParserErrorCode extends DiagnosticCode { ); static const ParserErrorCode - FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS = ParserErrorCode( + fieldInitializedOutsideDeclaringClass = ParserErrorCode( 'FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS', "A field can only be initialized in its declaring class", correctionMessage: @@ -937,7 +935,7 @@ class ParserErrorCode extends DiagnosticCode { "initialization into the constructor body.", ); - static const ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = + static const ParserErrorCode fieldInitializerOutsideConstructor = ParserErrorCode( 'FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', "Field formal parameters can only be used in a constructor.", @@ -945,7 +943,7 @@ class ParserErrorCode extends DiagnosticCode { hasPublishedDocs: true, ); - static const ParserErrorCode FINAL_AND_COVARIANT = ParserErrorCode( + static const ParserErrorCode finalAndCovariant = ParserErrorCode( 'FINAL_AND_COVARIANT', "Members can't be declared to be both 'final' and 'covariant'.", correctionMessage: @@ -953,7 +951,7 @@ class ParserErrorCode extends DiagnosticCode { ); static const ParserErrorCode - FINAL_AND_COVARIANT_LATE_WITH_INITIALIZER = ParserErrorCode( + finalAndCovariantLateWithInitializer = ParserErrorCode( 'FINAL_AND_COVARIANT_LATE_WITH_INITIALIZER', "Members marked 'late' with an initializer can't be declared to be both " "'final' and 'covariant'.", @@ -962,59 +960,59 @@ class ParserErrorCode extends DiagnosticCode { "the initializer.", ); - static const ParserErrorCode FINAL_AND_VAR = ParserErrorCode( + static const ParserErrorCode finalAndVar = ParserErrorCode( 'FINAL_AND_VAR', "Members can't be declared to be both 'final' and 'var'.", correctionMessage: "Try removing the keyword 'var'.", ); /// No parameters. - static const ParserErrorCode FINAL_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode finalConstructor = ParserErrorCode( 'FINAL_CONSTRUCTOR', "A constructor can't be declared to be 'final'.", correctionMessage: "Try removing the keyword 'final'.", ); - static const ParserErrorCode FINAL_ENUM = ParserErrorCode( + static const ParserErrorCode finalEnum = ParserErrorCode( 'FINAL_ENUM', "Enums can't be declared to be 'final'.", correctionMessage: "Try removing the keyword 'final'.", ); /// No parameters. - static const ParserErrorCode FINAL_METHOD = ParserErrorCode( + static const ParserErrorCode finalMethod = ParserErrorCode( 'FINAL_METHOD', "Getters, setters and methods can't be declared to be 'final'.", correctionMessage: "Try removing the keyword 'final'.", ); - static const ParserErrorCode FINAL_MIXIN = ParserErrorCode( + static const ParserErrorCode finalMixin = ParserErrorCode( 'FINAL_MIXIN', "A mixin can't be declared 'final'.", correctionMessage: "Try removing the 'final' keyword.", ); - static const ParserErrorCode FINAL_MIXIN_CLASS = ParserErrorCode( + static const ParserErrorCode finalMixinClass = ParserErrorCode( 'FINAL_MIXIN_CLASS', "A mixin class can't be declared 'final'.", correctionMessage: "Try removing the 'final' keyword.", ); - static const ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = ParserErrorCode( + static const ParserErrorCode functionTypedParameterVar = ParserErrorCode( 'FUNCTION_TYPED_PARAMETER_VAR', "Function-typed parameters can't specify 'const', 'final' or 'var' in " "place of a return type.", correctionMessage: "Try replacing the keyword with a return type.", ); - static const ParserErrorCode GETTER_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode getterConstructor = ParserErrorCode( 'GETTER_CONSTRUCTOR', "Constructors can't be a getter.", correctionMessage: "Try removing 'get'.", ); /// No parameters. - static const ParserErrorCode GETTER_IN_FUNCTION = ParserErrorCode( + static const ParserErrorCode getterInFunction = ParserErrorCode( 'GETTER_IN_FUNCTION', "Getters can't be defined within methods or functions.", correctionMessage: @@ -1023,7 +1021,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode GETTER_WITH_PARAMETERS = ParserErrorCode( + static const ParserErrorCode getterWithParameters = ParserErrorCode( 'GETTER_WITH_PARAMETERS', "Getters must be declared without a parameter list.", correctionMessage: @@ -1031,7 +1029,7 @@ class ParserErrorCode extends DiagnosticCode { "define a method rather than a getter.", ); - static const ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = + static const ParserErrorCode illegalAssignmentToNonAssignable = ParserErrorCode( 'ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', "Illegal assignment to non-assignable expression.", @@ -1039,7 +1037,7 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// 0: the illegal name - static const ParserErrorCode ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME = + static const ParserErrorCode illegalPatternAssignmentVariableName = ParserErrorCode( 'ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME', "A variable assigned by a pattern assignment can't be named '{0}'.", @@ -1048,42 +1046,41 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// 0: the illegal name - static const ParserErrorCode ILLEGAL_PATTERN_IDENTIFIER_NAME = - ParserErrorCode( - 'ILLEGAL_PATTERN_IDENTIFIER_NAME', - "A pattern can't refer to an identifier named '{0}'.", - correctionMessage: "Match the identifier using '==", - ); + static const ParserErrorCode illegalPatternIdentifierName = ParserErrorCode( + 'ILLEGAL_PATTERN_IDENTIFIER_NAME', + "A pattern can't refer to an identifier named '{0}'.", + correctionMessage: "Match the identifier using '==", + ); /// Parameters: /// 0: the illegal name - static const ParserErrorCode ILLEGAL_PATTERN_VARIABLE_NAME = ParserErrorCode( + static const ParserErrorCode illegalPatternVariableName = ParserErrorCode( 'ILLEGAL_PATTERN_VARIABLE_NAME', "The variable declared by a variable pattern can't be named '{0}'.", correctionMessage: "Choose a different name.", ); - static const ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = ParserErrorCode( + static const ParserErrorCode implementsBeforeExtends = ParserErrorCode( 'IMPLEMENTS_BEFORE_EXTENDS', "The extends clause must be before the implements clause.", correctionMessage: "Try moving the extends clause before the implements clause.", ); - static const ParserErrorCode IMPLEMENTS_BEFORE_ON = ParserErrorCode( + static const ParserErrorCode implementsBeforeOn = ParserErrorCode( 'IMPLEMENTS_BEFORE_ON', "The on clause must be before the implements clause.", correctionMessage: "Try moving the on clause before the implements clause.", ); - static const ParserErrorCode IMPLEMENTS_BEFORE_WITH = ParserErrorCode( + static const ParserErrorCode implementsBeforeWith = ParserErrorCode( 'IMPLEMENTS_BEFORE_WITH', "The with clause must be before the implements clause.", correctionMessage: "Try moving the with clause before the implements clause.", ); - static const ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = + static const ParserErrorCode importDirectiveAfterPartDirective = ParserErrorCode( 'IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', "Import directives must precede part directives.", @@ -1091,33 +1088,32 @@ class ParserErrorCode extends DiagnosticCode { "Try moving the import directives before the part directives.", ); - static const ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = - ParserErrorCode( - 'INITIALIZED_VARIABLE_IN_FOR_EACH', - "The loop variable in a for-each loop can't be initialized.", - correctionMessage: - "Try removing the initializer, or using a different kind of loop.", - ); + static const ParserErrorCode initializedVariableInForEach = ParserErrorCode( + 'INITIALIZED_VARIABLE_IN_FOR_EACH', + "The loop variable in a for-each loop can't be initialized.", + correctionMessage: + "Try removing the initializer, or using a different kind of loop.", + ); - static const ParserErrorCode INTERFACE_ENUM = ParserErrorCode( + static const ParserErrorCode interfaceEnum = ParserErrorCode( 'INTERFACE_ENUM', "Enums can't be declared to be 'interface'.", correctionMessage: "Try removing the keyword 'interface'.", ); - static const ParserErrorCode INTERFACE_MIXIN = ParserErrorCode( + static const ParserErrorCode interfaceMixin = ParserErrorCode( 'INTERFACE_MIXIN', "A mixin can't be declared 'interface'.", correctionMessage: "Try removing the 'interface' keyword.", ); - static const ParserErrorCode INTERFACE_MIXIN_CLASS = ParserErrorCode( + static const ParserErrorCode interfaceMixinClass = ParserErrorCode( 'INTERFACE_MIXIN_CLASS', "A mixin class can't be declared 'interface'.", correctionMessage: "Try removing the 'interface' keyword.", ); - static const ParserErrorCode INVALID_AWAIT_IN_FOR = ParserErrorCode( + static const ParserErrorCode invalidAwaitInFor = ParserErrorCode( 'INVALID_AWAIT_IN_FOR', "The keyword 'await' isn't allowed for a normal 'for' statement.", correctionMessage: "Try removing the keyword, or use a for-each statement.", @@ -1125,72 +1121,69 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the invalid escape sequence - static const ParserErrorCode INVALID_CODE_POINT = ParserErrorCode( + static const ParserErrorCode invalidCodePoint = ParserErrorCode( 'INVALID_CODE_POINT', "The escape sequence '{0}' isn't a valid code point.", ); /// No parameters. - static const ParserErrorCode INVALID_COMMENT_REFERENCE = ParserErrorCode( + static const ParserErrorCode invalidCommentReference = ParserErrorCode( 'INVALID_COMMENT_REFERENCE', "Comment references should contain a possibly prefixed identifier and can " "start with 'new', but shouldn't contain anything else.", ); - static const ParserErrorCode INVALID_CONSTANT_CONST_PREFIX = ParserErrorCode( + static const ParserErrorCode invalidConstantConstPrefix = ParserErrorCode( 'INVALID_CONSTANT_CONST_PREFIX', "The expression can't be prefixed by 'const' to form a constant pattern.", correctionMessage: "Try wrapping the expression in 'const ( ... )' instead.", ); - static const ParserErrorCode INVALID_CONSTANT_PATTERN_BINARY = - ParserErrorCode( - 'INVALID_CONSTANT_PATTERN_BINARY', - "The binary operator {0} is not supported as a constant pattern.", - correctionMessage: "Try wrapping the expression in 'const ( ... )'.", - ); + static const ParserErrorCode invalidConstantPatternBinary = ParserErrorCode( + 'INVALID_CONSTANT_PATTERN_BINARY', + "The binary operator {0} is not supported as a constant pattern.", + correctionMessage: "Try wrapping the expression in 'const ( ... )'.", + ); - static const ParserErrorCode INVALID_CONSTANT_PATTERN_DUPLICATE_CONST = + static const ParserErrorCode invalidConstantPatternDuplicateConst = ParserErrorCode( 'INVALID_CONSTANT_PATTERN_DUPLICATE_CONST', "Duplicate 'const' keyword in constant expression.", correctionMessage: "Try removing one of the 'const' keywords.", ); - static const ParserErrorCode INVALID_CONSTANT_PATTERN_EMPTY_RECORD_LITERAL = + static const ParserErrorCode invalidConstantPatternEmptyRecordLiteral = ParserErrorCode( 'INVALID_CONSTANT_PATTERN_EMPTY_RECORD_LITERAL', "The empty record literal is not supported as a constant pattern.", ); - static const ParserErrorCode INVALID_CONSTANT_PATTERN_GENERIC = - ParserErrorCode( - 'INVALID_CONSTANT_PATTERN_GENERIC', - "This expression is not supported as a constant pattern.", - correctionMessage: "Try wrapping the expression in 'const ( ... )'.", - ); + static const ParserErrorCode invalidConstantPatternGeneric = ParserErrorCode( + 'INVALID_CONSTANT_PATTERN_GENERIC', + "This expression is not supported as a constant pattern.", + correctionMessage: "Try wrapping the expression in 'const ( ... )'.", + ); - static const ParserErrorCode - INVALID_CONSTANT_PATTERN_NEGATION = ParserErrorCode( + static const ParserErrorCode invalidConstantPatternNegation = ParserErrorCode( 'INVALID_CONSTANT_PATTERN_NEGATION', "Only negation of a numeric literal is supported as a constant pattern.", correctionMessage: "Try wrapping the expression in 'const ( ... )'.", ); - static const ParserErrorCode INVALID_CONSTANT_PATTERN_UNARY = ParserErrorCode( + static const ParserErrorCode invalidConstantPatternUnary = ParserErrorCode( 'INVALID_CONSTANT_PATTERN_UNARY', "The unary operator {0} is not supported as a constant pattern.", correctionMessage: "Try wrapping the expression in 'const ( ... )'.", ); - static const ParserErrorCode INVALID_CONSTRUCTOR_NAME = ParserErrorCode( + static const ParserErrorCode invalidConstructorName = ParserErrorCode( 'INVALID_CONSTRUCTOR_NAME', "The name of a constructor must match the name of the enclosing class.", ); /// No parameters. - static const ParserErrorCode INVALID_GENERIC_FUNCTION_TYPE = ParserErrorCode( + static const ParserErrorCode invalidGenericFunctionType = ParserErrorCode( 'INVALID_GENERIC_FUNCTION_TYPE', "Invalid generic function type.", correctionMessage: @@ -1198,20 +1191,20 @@ class ParserErrorCode extends DiagnosticCode { "')').", ); - static const ParserErrorCode INVALID_HEX_ESCAPE = ParserErrorCode( + static const ParserErrorCode invalidHexEscape = ParserErrorCode( 'INVALID_HEX_ESCAPE', "An escape sequence starting with '\\x' must be followed by 2 hexadecimal " "digits.", ); - static const ParserErrorCode INVALID_INITIALIZER = ParserErrorCode( + static const ParserErrorCode invalidInitializer = ParserErrorCode( 'INVALID_INITIALIZER', "Not a valid initializer.", correctionMessage: "To initialize a field, use the syntax 'name = value'.", ); /// No parameters. - static const ParserErrorCode INVALID_INSIDE_UNARY_PATTERN = ParserErrorCode( + static const ParserErrorCode invalidInsideUnaryPattern = ParserErrorCode( 'INVALID_INSIDE_UNARY_PATTERN', "This pattern cannot appear inside a unary pattern (cast pattern, null " "check pattern, or null assert pattern) without parentheses.", @@ -1221,16 +1214,15 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode INVALID_LITERAL_IN_CONFIGURATION = - ParserErrorCode( - 'INVALID_LITERAL_IN_CONFIGURATION', - "The literal in a configuration can't contain interpolation.", - correctionMessage: "Try removing the interpolation expressions.", - ); + static const ParserErrorCode invalidLiteralInConfiguration = ParserErrorCode( + 'INVALID_LITERAL_IN_CONFIGURATION', + "The literal in a configuration can't contain interpolation.", + correctionMessage: "Try removing the interpolation expressions.", + ); /// Parameters: /// 0: the operator that is invalid - static const ParserErrorCode INVALID_OPERATOR = ParserErrorCode( + static const ParserErrorCode invalidOperator = ParserErrorCode( 'INVALID_OPERATOR', "The string '{0}' isn't a user-definable operator.", ); @@ -1240,13 +1232,13 @@ class ParserErrorCode extends DiagnosticCode { /// /// Parameters: /// Object p0: the operator being applied to 'super' - static const ParserErrorCode INVALID_OPERATOR_FOR_SUPER = ParserErrorCode( + static const ParserErrorCode invalidOperatorForSuper = ParserErrorCode( 'INVALID_OPERATOR_FOR_SUPER', "The operator '{0}' can't be used with 'super'.", ); static const ParserErrorCode - INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER = ParserErrorCode( + invalidOperatorQuestionmarkPeriodForSuper = ParserErrorCode( 'INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER', "The operator '?.' cannot be used with 'super' because 'super' cannot be " "null.", @@ -1254,61 +1246,58 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode INVALID_STAR_AFTER_ASYNC = ParserErrorCode( + static const ParserErrorCode invalidStarAfterAsync = ParserErrorCode( 'INVALID_STAR_AFTER_ASYNC', "The modifier 'async*' isn't allowed for an expression function body.", correctionMessage: "Try converting the body to a block.", ); - static const ParserErrorCode INVALID_SUPER_IN_INITIALIZER = ParserErrorCode( + static const ParserErrorCode invalidSuperInInitializer = ParserErrorCode( 'INVALID_SUPER_IN_INITIALIZER', "Can only use 'super' in an initializer for calling the superclass " "constructor (e.g. 'super()' or 'super.namedConstructor()')", ); /// No parameters. - static const ParserErrorCode INVALID_SYNC = ParserErrorCode( + static const ParserErrorCode invalidSync = ParserErrorCode( 'INVALID_SYNC', "The modifier 'sync' isn't allowed for an expression function body.", correctionMessage: "Try converting the body to a block.", ); - static const ParserErrorCode INVALID_THIS_IN_INITIALIZER = ParserErrorCode( + static const ParserErrorCode invalidThisInInitializer = ParserErrorCode( 'INVALID_THIS_IN_INITIALIZER', "Can only use 'this' in an initializer for field initialization (e.g. " "'this.x = something') and constructor redirection (e.g. 'this()' or " "'this.namedConstructor())", ); - static const ParserErrorCode INVALID_UNICODE_ESCAPE_STARTED = ParserErrorCode( + static const ParserErrorCode invalidUnicodeEscapeStarted = ParserErrorCode( 'INVALID_UNICODE_ESCAPE_STARTED', "The string '\\' can't stand alone.", correctionMessage: "Try adding another backslash (\\) to escape the '\\'.", ); - static const ParserErrorCode INVALID_UNICODE_ESCAPE_U_BRACKET = - ParserErrorCode( - 'INVALID_UNICODE_ESCAPE_U_BRACKET', - "An escape sequence starting with '\\u{' must be followed by 1 to 6 " - "hexadecimal digits followed by a '}'.", - ); + static const ParserErrorCode invalidUnicodeEscapeUBracket = ParserErrorCode( + 'INVALID_UNICODE_ESCAPE_U_BRACKET', + "An escape sequence starting with '\\u{' must be followed by 1 to 6 " + "hexadecimal digits followed by a '}'.", + ); - static const ParserErrorCode - INVALID_UNICODE_ESCAPE_U_NO_BRACKET = ParserErrorCode( + static const ParserErrorCode invalidUnicodeEscapeUNoBracket = ParserErrorCode( 'INVALID_UNICODE_ESCAPE_U_NO_BRACKET', "An escape sequence starting with '\\u' must be followed by 4 hexadecimal " "digits.", ); - static const ParserErrorCode - INVALID_UNICODE_ESCAPE_U_STARTED = ParserErrorCode( + static const ParserErrorCode invalidUnicodeEscapeUStarted = ParserErrorCode( 'INVALID_UNICODE_ESCAPE_U_STARTED', "An escape sequence starting with '\\u' must be followed by 4 hexadecimal " "digits or from 1 to 6 digits between '{' and '}'.", ); /// No parameters. - static const ParserErrorCode INVALID_USE_OF_COVARIANT_IN_EXTENSION = + static const ParserErrorCode invalidUseOfCovariantInExtension = ParserErrorCode( 'INVALID_USE_OF_COVARIANT_IN_EXTENSION', "Can't have modifier '{0}' in an extension.", @@ -1318,7 +1307,7 @@ class ParserErrorCode extends DiagnosticCode { /// No parameters. static const ParserErrorCode - INVALID_USE_OF_IDENTIFIER_AUGMENTED = ParserErrorCode( + invalidUseOfIdentifierAugmented = ParserErrorCode( 'INVALID_USE_OF_IDENTIFIER_AUGMENTED', "The identifier 'augmented' can only be used to reference the augmented " "declaration inside an augmentation.", @@ -1326,67 +1315,64 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode LATE_PATTERN_VARIABLE_DECLARATION = - ParserErrorCode( - 'LATE_PATTERN_VARIABLE_DECLARATION', - "A pattern variable declaration may not use the `late` keyword.", - correctionMessage: "Try removing the keyword `late`.", - ); + static const ParserErrorCode latePatternVariableDeclaration = ParserErrorCode( + 'LATE_PATTERN_VARIABLE_DECLARATION', + "A pattern variable declaration may not use the `late` keyword.", + correctionMessage: "Try removing the keyword `late`.", + ); - static const ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = ParserErrorCode( + static const ParserErrorCode libraryDirectiveNotFirst = ParserErrorCode( 'LIBRARY_DIRECTIVE_NOT_FIRST', "The library directive must appear before all other directives.", correctionMessage: "Try moving the library directive before any other directives.", ); - static const ParserErrorCode LITERAL_WITH_CLASS = ParserErrorCode( + static const ParserErrorCode literalWithClass = ParserErrorCode( 'LITERAL_WITH_CLASS', "A {0} literal can't be prefixed by '{1}'.", correctionMessage: "Try removing '{1}'", ); - static const ParserErrorCode LITERAL_WITH_CLASS_AND_NEW = ParserErrorCode( + static const ParserErrorCode literalWithClassAndNew = ParserErrorCode( 'LITERAL_WITH_CLASS_AND_NEW', "A {0} literal can't be prefixed by 'new {1}'.", correctionMessage: "Try removing 'new' and '{1}'", ); - static const ParserErrorCode LITERAL_WITH_NEW = ParserErrorCode( + static const ParserErrorCode literalWithNew = ParserErrorCode( 'LITERAL_WITH_NEW', "A literal can't be prefixed by 'new'.", correctionMessage: "Try removing 'new'", ); /// No parameters. - static const ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = + static const ParserErrorCode localFunctionDeclarationModifier = ParserErrorCode( 'LOCAL_FUNCTION_DECLARATION_MODIFIER', "Local function declarations can't specify any modifiers.", correctionMessage: "Try removing the modifier.", ); - static const ParserErrorCode MEMBER_WITH_CLASS_NAME = ParserErrorCode( + static const ParserErrorCode memberWithClassName = ParserErrorCode( 'MEMBER_WITH_CLASS_NAME', "A class member can't have the same name as the enclosing class.", correctionMessage: "Try renaming the member.", ); - static const ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = ParserErrorCode( + static const ParserErrorCode missingAssignableSelector = ParserErrorCode( 'MISSING_ASSIGNABLE_SELECTOR', "Missing selector such as '.identifier' or '[0]'.", correctionMessage: "Try adding a selector.", ); - static const ParserErrorCode MISSING_ASSIGNMENT_IN_INITIALIZER = - ParserErrorCode( - 'MISSING_ASSIGNMENT_IN_INITIALIZER', - "Expected an assignment after the field name.", - correctionMessage: - "To initialize a field, use the syntax 'name = value'.", - ); + static const ParserErrorCode missingAssignmentInInitializer = ParserErrorCode( + 'MISSING_ASSIGNMENT_IN_INITIALIZER', + "Expected an assignment after the field name.", + correctionMessage: "To initialize a field, use the syntax 'name = value'.", + ); - static const ParserErrorCode MISSING_CATCH_OR_FINALLY = ParserErrorCode( + static const ParserErrorCode missingCatchOrFinally = ParserErrorCode( 'MISSING_CATCH_OR_FINALLY', "A try block must be followed by an 'on', 'catch', or 'finally' clause.", correctionMessage: @@ -1395,14 +1381,13 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MISSING_CLOSING_PARENTHESIS = ParserErrorCode( + static const ParserErrorCode missingClosingParenthesis = ParserErrorCode( 'MISSING_CLOSING_PARENTHESIS', "The closing parenthesis is missing.", correctionMessage: "Try adding the closing parenthesis.", ); - static const ParserErrorCode - MISSING_CONST_FINAL_VAR_OR_TYPE = ParserErrorCode( + static const ParserErrorCode missingConstFinalVarOrType = ParserErrorCode( 'MISSING_CONST_FINAL_VAR_OR_TYPE', "Variables must be declared using the keywords 'const', 'final', 'var' or " "a type name.", @@ -1411,23 +1396,22 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MISSING_ENUM_BODY = ParserErrorCode( + static const ParserErrorCode missingEnumBody = ParserErrorCode( 'MISSING_ENUM_BODY', "An enum definition must have a body with at least one constant name.", correctionMessage: "Try adding a body and defining at least one constant.", ); /// No parameters. - static const ParserErrorCode MISSING_EXPRESSION_IN_INITIALIZER = - ParserErrorCode( - 'MISSING_EXPRESSION_IN_INITIALIZER', - "Expected an expression after the assignment operator.", - correctionMessage: - "Try adding the value to be assigned, or remove the assignment " - "operator.", - ); + static const ParserErrorCode missingExpressionInInitializer = ParserErrorCode( + 'MISSING_EXPRESSION_IN_INITIALIZER', + "Expected an expression after the assignment operator.", + correctionMessage: + "Try adding the value to be assigned, or remove the assignment " + "operator.", + ); - static const ParserErrorCode MISSING_EXPRESSION_IN_THROW = ParserErrorCode( + static const ParserErrorCode missingExpressionInThrow = ParserErrorCode( 'MISSING_EXPRESSION_IN_THROW', "Missing expression after 'throw'.", correctionMessage: @@ -1436,14 +1420,14 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MISSING_FUNCTION_BODY = ParserErrorCode( + static const ParserErrorCode missingFunctionBody = ParserErrorCode( 'MISSING_FUNCTION_BODY', "A function body must be provided.", correctionMessage: "Try adding a function body.", ); /// No parameters. - static const ParserErrorCode MISSING_FUNCTION_KEYWORD = ParserErrorCode( + static const ParserErrorCode missingFunctionKeyword = ParserErrorCode( 'MISSING_FUNCTION_KEYWORD', "Function types must have the keyword 'Function' before the parameter " "list.", @@ -1451,46 +1435,45 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MISSING_FUNCTION_PARAMETERS = ParserErrorCode( + static const ParserErrorCode missingFunctionParameters = ParserErrorCode( 'MISSING_FUNCTION_PARAMETERS', "Functions must have an explicit list of parameters.", correctionMessage: "Try adding a parameter list.", ); /// No parameters. - static const ParserErrorCode MISSING_GET = ParserErrorCode( + static const ParserErrorCode missingGet = ParserErrorCode( 'MISSING_GET', "Getters must have the keyword 'get' before the getter name.", correctionMessage: "Try adding the keyword 'get'.", ); /// No parameters. - static const ParserErrorCode MISSING_IDENTIFIER = ParserErrorCode( + static const ParserErrorCode missingIdentifier = ParserErrorCode( 'MISSING_IDENTIFIER', "Expected an identifier.", ); - static const ParserErrorCode MISSING_INITIALIZER = ParserErrorCode( + static const ParserErrorCode missingInitializer = ParserErrorCode( 'MISSING_INITIALIZER', "Expected an initializer.", ); - static const ParserErrorCode MISSING_KEYWORD_OPERATOR = ParserErrorCode( + static const ParserErrorCode missingKeywordOperator = ParserErrorCode( 'MISSING_KEYWORD_OPERATOR', "Operator declarations must be preceded by the keyword 'operator'.", correctionMessage: "Try adding the keyword 'operator'.", ); /// No parameters. - static const ParserErrorCode MISSING_METHOD_PARAMETERS = ParserErrorCode( + static const ParserErrorCode missingMethodParameters = ParserErrorCode( 'MISSING_METHOD_PARAMETERS', "Methods must have an explicit list of parameters.", correctionMessage: "Try adding a parameter list.", ); /// No parameters. - static const ParserErrorCode - MISSING_NAME_FOR_NAMED_PARAMETER = ParserErrorCode( + static const ParserErrorCode missingNameForNamedParameter = ParserErrorCode( 'MISSING_NAME_FOR_NAMED_PARAMETER', "Named parameters in a function type must have a name", correctionMessage: @@ -1498,8 +1481,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode - MISSING_NAME_IN_LIBRARY_DIRECTIVE = ParserErrorCode( + static const ParserErrorCode missingNameInLibraryDirective = ParserErrorCode( 'MISSING_NAME_IN_LIBRARY_DIRECTIVE', "Library directives must include a library name.", correctionMessage: @@ -1508,22 +1490,20 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = - ParserErrorCode( - 'MISSING_NAME_IN_PART_OF_DIRECTIVE', - "Part-of directives must include a library name.", - correctionMessage: "Try adding a library name after the 'of'.", - ); + static const ParserErrorCode missingNameInPartOfDirective = ParserErrorCode( + 'MISSING_NAME_IN_PART_OF_DIRECTIVE', + "Part-of directives must include a library name.", + correctionMessage: "Try adding a library name after the 'of'.", + ); - static const ParserErrorCode MISSING_PREFIX_IN_DEFERRED_IMPORT = - ParserErrorCode( - 'MISSING_PREFIX_IN_DEFERRED_IMPORT', - "Deferred imports should have a prefix.", - correctionMessage: - "Try adding a prefix to the import by adding an 'as' clause.", - ); + static const ParserErrorCode missingPrefixInDeferredImport = ParserErrorCode( + 'MISSING_PREFIX_IN_DEFERRED_IMPORT', + "Deferred imports should have a prefix.", + correctionMessage: + "Try adding a prefix to the import by adding an 'as' clause.", + ); - static const ParserErrorCode MISSING_PRIMARY_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode missingPrimaryConstructor = ParserErrorCode( 'MISSING_PRIMARY_CONSTRUCTOR', "An extension type declaration must have a primary constructor " "declaration.", @@ -1531,7 +1511,7 @@ class ParserErrorCode extends DiagnosticCode { "Try adding a primary constructor to the extension type declaration.", ); - static const ParserErrorCode MISSING_PRIMARY_CONSTRUCTOR_PARAMETERS = + static const ParserErrorCode missingPrimaryConstructorParameters = ParserErrorCode( 'MISSING_PRIMARY_CONSTRUCTOR_PARAMETERS', "A primary constructor declaration must have formal parameters.", @@ -1540,20 +1520,20 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MISSING_STAR_AFTER_SYNC = ParserErrorCode( + static const ParserErrorCode missingStarAfterSync = ParserErrorCode( 'MISSING_STAR_AFTER_SYNC', "The modifier 'sync' must be followed by a star ('*').", correctionMessage: "Try removing the modifier, or add a star.", ); - static const ParserErrorCode MISSING_STATEMENT = ParserErrorCode( + static const ParserErrorCode missingStatement = ParserErrorCode( 'MISSING_STATEMENT', "Expected a statement.", ); /// Parameters: /// Object p0: the terminator that is missing - static const ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = + static const ParserErrorCode missingTerminatorForParameterGroup = ParserErrorCode( 'MISSING_TERMINATOR_FOR_PARAMETER_GROUP', "There is no '{0}' to close the parameter group.", @@ -1561,14 +1541,14 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MISSING_TYPEDEF_PARAMETERS = ParserErrorCode( + static const ParserErrorCode missingTypedefParameters = ParserErrorCode( 'MISSING_TYPEDEF_PARAMETERS', "Typedefs must have an explicit list of parameters.", correctionMessage: "Try adding a parameter list.", ); /// No parameters. - static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = ParserErrorCode( + static const ParserErrorCode missingVariableInForEach = ParserErrorCode( 'MISSING_VARIABLE_IN_FOR_EACH', "A loop variable must be declared in a for-each loop before the 'in', but " "none was found.", @@ -1576,37 +1556,37 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MIXED_PARAMETER_GROUPS = ParserErrorCode( + static const ParserErrorCode mixedParameterGroups = ParserErrorCode( 'MIXED_PARAMETER_GROUPS', "Can't have both positional and named parameters in a single parameter " "list.", correctionMessage: "Try choosing a single style of optional parameters.", ); - static const ParserErrorCode MIXIN_DECLARES_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode mixinDeclaresConstructor = ParserErrorCode( 'MIXIN_DECLARES_CONSTRUCTOR', "Mixins can't declare constructors.", ); - static const ParserErrorCode MIXIN_WITH_CLAUSE = ParserErrorCode( + static const ParserErrorCode mixinWithClause = ParserErrorCode( 'MIXIN_WITH_CLAUSE', "A mixin can't have a with clause.", ); - static const ParserErrorCode MODIFIER_OUT_OF_ORDER = ParserErrorCode( + static const ParserErrorCode modifierOutOfOrder = ParserErrorCode( 'MODIFIER_OUT_OF_ORDER', "The modifier '{0}' should be before the modifier '{1}'.", correctionMessage: "Try re-ordering the modifiers.", ); - static const ParserErrorCode MULTIPLE_CLAUSES = ParserErrorCode( + static const ParserErrorCode multipleClauses = ParserErrorCode( 'MULTIPLE_CLAUSES', "Each '{0}' definition can have at most one '{1}' clause.", correctionMessage: "Try combining all of the '{1}' clauses into a single clause.", ); - static const ParserErrorCode MULTIPLE_EXTENDS_CLAUSES = ParserErrorCode( + static const ParserErrorCode multipleExtendsClauses = ParserErrorCode( 'MULTIPLE_EXTENDS_CLAUSES', "Each class definition can have at most one extends clause.", correctionMessage: @@ -1615,37 +1595,35 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = ParserErrorCode( + static const ParserErrorCode multipleImplementsClauses = ParserErrorCode( 'MULTIPLE_IMPLEMENTS_CLAUSES', "Each class or mixin definition can have at most one implements clause.", correctionMessage: "Try combining all of the implements clauses into a single clause.", ); - static const ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = ParserErrorCode( + static const ParserErrorCode multipleLibraryDirectives = ParserErrorCode( 'MULTIPLE_LIBRARY_DIRECTIVES', "Only one library directive may be declared in a file.", correctionMessage: "Try removing all but one of the library directives.", ); /// No parameters. - static const ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = - ParserErrorCode( - 'MULTIPLE_NAMED_PARAMETER_GROUPS', - "Can't have multiple groups of named parameters in a single parameter " - "list.", - correctionMessage: - "Try combining all of the groups into a single group.", - ); + static const ParserErrorCode multipleNamedParameterGroups = ParserErrorCode( + 'MULTIPLE_NAMED_PARAMETER_GROUPS', + "Can't have multiple groups of named parameters in a single parameter " + "list.", + correctionMessage: "Try combining all of the groups into a single group.", + ); - static const ParserErrorCode MULTIPLE_ON_CLAUSES = ParserErrorCode( + static const ParserErrorCode multipleOnClauses = ParserErrorCode( 'MULTIPLE_ON_CLAUSES', "Each mixin definition can have at most one on clause.", correctionMessage: "Try combining all of the on clauses into a single clause.", ); - static const ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = ParserErrorCode( + static const ParserErrorCode multiplePartOfDirectives = ParserErrorCode( 'MULTIPLE_PART_OF_DIRECTIVES', "Only one part-of directive may be declared in a file.", correctionMessage: "Try removing all but one of the part-of directives.", @@ -1653,7 +1631,7 @@ class ParserErrorCode extends DiagnosticCode { /// No parameters. static const ParserErrorCode - MULTIPLE_POSITIONAL_PARAMETER_GROUPS = ParserErrorCode( + multiplePositionalParameterGroups = ParserErrorCode( 'MULTIPLE_POSITIONAL_PARAMETER_GROUPS', "Can't have multiple groups of positional parameters in a single parameter " "list.", @@ -1661,7 +1639,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode MULTIPLE_REPRESENTATION_FIELDS = ParserErrorCode( + static const ParserErrorCode multipleRepresentationFields = ParserErrorCode( 'MULTIPLE_REPRESENTATION_FIELDS', "Each extension type should have exactly one representation field.", correctionMessage: @@ -1670,7 +1648,7 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the number of variables being declared - static const ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = ParserErrorCode( + static const ParserErrorCode multipleVariablesInForEach = ParserErrorCode( 'MULTIPLE_VARIABLES_IN_FOR_EACH', "A single loop variable must be declared in a for-each loop before the " "'in', but {0} were found.", @@ -1678,14 +1656,14 @@ class ParserErrorCode extends DiagnosticCode { "Try moving all but one of the declarations inside the loop body.", ); - static const ParserErrorCode MULTIPLE_VARIANCE_MODIFIERS = ParserErrorCode( + static const ParserErrorCode multipleVarianceModifiers = ParserErrorCode( 'MULTIPLE_VARIANCE_MODIFIERS', "Each type parameter can have at most one variance modifier.", correctionMessage: "Use at most one of the 'in', 'out', or 'inout' modifiers.", ); - static const ParserErrorCode MULTIPLE_WITH_CLAUSES = ParserErrorCode( + static const ParserErrorCode multipleWithClauses = ParserErrorCode( 'MULTIPLE_WITH_CLAUSES', "Each class definition can have at most one with clause.", correctionMessage: @@ -1693,7 +1671,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode NAMED_FUNCTION_EXPRESSION = ParserErrorCode( + static const ParserErrorCode namedFunctionExpression = ParserErrorCode( 'NAMED_FUNCTION_EXPRESSION', "Function expressions can't be named.", correctionMessage: @@ -1702,39 +1680,37 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode NAMED_FUNCTION_TYPE = ParserErrorCode( + static const ParserErrorCode namedFunctionType = ParserErrorCode( 'NAMED_FUNCTION_TYPE', "Function types can't be named.", correctionMessage: "Try replacing the name with the keyword 'Function'.", ); /// No parameters. - static const ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = ParserErrorCode( + static const ParserErrorCode namedParameterOutsideGroup = ParserErrorCode( 'NAMED_PARAMETER_OUTSIDE_GROUP', "Named parameters must be enclosed in curly braces ('{' and '}').", correctionMessage: "Try surrounding the named parameters in curly braces.", ); /// No parameters. - static const ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = ParserErrorCode( + static const ParserErrorCode nativeClauseInNonSdkCode = ParserErrorCode( 'NATIVE_CLAUSE_IN_NON_SDK_CODE', "Native clause can only be used in the SDK and code that is loaded through " "native extensions.", correctionMessage: "Try removing the native clause.", ); - static const ParserErrorCode NATIVE_CLAUSE_SHOULD_BE_ANNOTATION = - ParserErrorCode( - 'NATIVE_CLAUSE_SHOULD_BE_ANNOTATION', - "Native clause in this form is deprecated.", - correctionMessage: - "Try removing this native clause and adding @native() or " - "@native('native-name') before the declaration.", - ); + static const ParserErrorCode nativeClauseShouldBeAnnotation = ParserErrorCode( + 'NATIVE_CLAUSE_SHOULD_BE_ANNOTATION', + "Native clause in this form is deprecated.", + correctionMessage: + "Try removing this native clause and adding @native() or " + "@native('native-name') before the declaration.", + ); /// No parameters. - static const ParserErrorCode - NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = ParserErrorCode( + static const ParserErrorCode nativeFunctionBodyInNonSdkCode = ParserErrorCode( 'NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', "Native functions can only be declared in the SDK and code that is loaded " "through native extensions.", @@ -1742,21 +1718,21 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = ParserErrorCode( + static const ParserErrorCode nonConstructorFactory = ParserErrorCode( 'NON_CONSTRUCTOR_FACTORY', "Only a constructor can be declared to be a factory.", correctionMessage: "Try removing the keyword 'factory'.", ); /// No parameters. - static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = ParserErrorCode( + static const ParserErrorCode nonIdentifierLibraryName = ParserErrorCode( 'NON_IDENTIFIER_LIBRARY_NAME', "The name of a library must be an identifier.", correctionMessage: "Try using an identifier as the name of the library.", ); /// No parameters. - static const ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = ParserErrorCode( + static const ParserErrorCode nonPartOfDirectiveInPart = ParserErrorCode( 'NON_PART_OF_DIRECTIVE_IN_PART', "The part-of directive must be the only directive in a part.", correctionMessage: @@ -1765,7 +1741,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode NON_STRING_LITERAL_AS_URI = ParserErrorCode( + static const ParserErrorCode nonStringLiteralAsUri = ParserErrorCode( 'NON_STRING_LITERAL_AS_URI', "The URI must be a string literal.", correctionMessage: @@ -1774,23 +1750,21 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the operator that the user is trying to define - static const ParserErrorCode NON_USER_DEFINABLE_OPERATOR = ParserErrorCode( + static const ParserErrorCode nonUserDefinableOperator = ParserErrorCode( 'NON_USER_DEFINABLE_OPERATOR', "The operator '{0}' isn't user definable.", ); /// No parameters. - static const ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = - ParserErrorCode( - 'NORMAL_BEFORE_OPTIONAL_PARAMETERS', - "Normal parameters must occur before optional parameters.", - correctionMessage: - "Try moving all of the normal parameters before the optional " - "parameters.", - ); + static const ParserErrorCode normalBeforeOptionalParameters = ParserErrorCode( + 'NORMAL_BEFORE_OPTIONAL_PARAMETERS', + "Normal parameters must occur before optional parameters.", + correctionMessage: + "Try moving all of the normal parameters before the optional " + "parameters.", + ); - static const ParserErrorCode - NULL_AWARE_CASCADE_OUT_OF_ORDER = ParserErrorCode( + static const ParserErrorCode nullAwareCascadeOutOfOrder = ParserErrorCode( 'NULL_AWARE_CASCADE_OUT_OF_ORDER', "The '?..' cascade operator must be first in the cascade sequence.", correctionMessage: @@ -1798,20 +1772,20 @@ class ParserErrorCode extends DiagnosticCode { "sequence.", ); - static const ParserErrorCode OUT_OF_ORDER_CLAUSES = ParserErrorCode( + static const ParserErrorCode outOfOrderClauses = ParserErrorCode( 'OUT_OF_ORDER_CLAUSES', "The '{0}' clause must come before the '{1}' clause.", correctionMessage: "Try moving the '{0}' clause before the '{1}' clause.", ); /// No parameters. - static const ParserErrorCode PART_OF_NAME = ParserErrorCode( + static const ParserErrorCode partOfName = ParserErrorCode( 'PART_OF_NAME', "The 'part of' directive can't use a name with the enhanced-parts feature.", correctionMessage: "Try using 'part of' with a URI instead.", ); - static const ParserErrorCode PATTERN_ASSIGNMENT_DECLARES_VARIABLE = + static const ParserErrorCode patternAssignmentDeclaresVariable = ParserErrorCode( 'PATTERN_ASSIGNMENT_DECLARES_VARIABLE', "Variable '{0}' can't be declared in a pattern assignment.", @@ -1822,7 +1796,7 @@ class ParserErrorCode extends DiagnosticCode { /// No parameters. static const ParserErrorCode - PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD = ParserErrorCode( + patternVariableDeclarationOutsideFunctionOrMethod = ParserErrorCode( 'PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD', "A pattern variable declaration may not appear outside a function or " "method.", @@ -1832,32 +1806,31 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = - ParserErrorCode( - 'POSITIONAL_AFTER_NAMED_ARGUMENT', - "Positional arguments must occur before named arguments.", - correctionMessage: - "Try moving all of the positional arguments before the named " - "arguments.", - ); + static const ParserErrorCode positionalAfterNamedArgument = ParserErrorCode( + 'POSITIONAL_AFTER_NAMED_ARGUMENT', + "Positional arguments must occur before named arguments.", + correctionMessage: + "Try moving all of the positional arguments before the named " + "arguments.", + ); /// No parameters. static const ParserErrorCode - POSITIONAL_PARAMETER_OUTSIDE_GROUP = ParserErrorCode( + positionalParameterOutsideGroup = ParserErrorCode( 'POSITIONAL_PARAMETER_OUTSIDE_GROUP', "Positional parameters must be enclosed in square brackets ('[' and ']').", correctionMessage: "Try surrounding the positional parameters in square brackets.", ); - static const ParserErrorCode PREFIX_AFTER_COMBINATOR = ParserErrorCode( + static const ParserErrorCode prefixAfterCombinator = ParserErrorCode( 'PREFIX_AFTER_COMBINATOR', "The prefix ('as' clause) should come before any show/hide combinators.", correctionMessage: "Try moving the prefix before the combinators.", ); static const ParserErrorCode - RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA = ParserErrorCode( + recordLiteralOnePositionalNoTrailingComma = ParserErrorCode( 'RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA', "A record literal with exactly one positional field requires a trailing " "comma.", @@ -1865,7 +1838,7 @@ class ParserErrorCode extends DiagnosticCode { hasPublishedDocs: true, ); - static const ParserErrorCode RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA = + static const ParserErrorCode recordTypeOnePositionalNoTrailingComma = ParserErrorCode( 'RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA', "A record type with exactly one positional field requires a trailing " @@ -1874,15 +1847,14 @@ class ParserErrorCode extends DiagnosticCode { hasPublishedDocs: true, ); - static const ParserErrorCode - REDIRECTING_CONSTRUCTOR_WITH_BODY = ParserErrorCode( + static const ParserErrorCode redirectingConstructorWithBody = ParserErrorCode( 'REDIRECTING_CONSTRUCTOR_WITH_BODY', "Redirecting constructors can't have a body.", correctionMessage: "Try removing the body, or not making this a redirecting constructor.", ); - static const ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = + static const ParserErrorCode redirectionInNonFactoryConstructor = ParserErrorCode( 'REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', "Only factory constructor can specify '=' redirection.", @@ -1891,101 +1863,99 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode REPRESENTATION_FIELD_MODIFIER = ParserErrorCode( + static const ParserErrorCode representationFieldModifier = ParserErrorCode( 'REPRESENTATION_FIELD_MODIFIER', "Representation fields can't have modifiers.", correctionMessage: "Try removing the modifier.", ); /// No parameters. - static const ParserErrorCode REPRESENTATION_FIELD_TRAILING_COMMA = + static const ParserErrorCode representationFieldTrailingComma = ParserErrorCode( 'REPRESENTATION_FIELD_TRAILING_COMMA', "The representation field can't have a trailing comma.", correctionMessage: "Try removing the trailing comma.", ); - static const ParserErrorCode SEALED_ENUM = ParserErrorCode( + static const ParserErrorCode sealedEnum = ParserErrorCode( 'SEALED_ENUM', "Enums can't be declared to be 'sealed'.", correctionMessage: "Try removing the keyword 'sealed'.", ); - static const ParserErrorCode SEALED_MIXIN = ParserErrorCode( + static const ParserErrorCode sealedMixin = ParserErrorCode( 'SEALED_MIXIN', "A mixin can't be declared 'sealed'.", correctionMessage: "Try removing the 'sealed' keyword.", ); - static const ParserErrorCode SEALED_MIXIN_CLASS = ParserErrorCode( + static const ParserErrorCode sealedMixinClass = ParserErrorCode( 'SEALED_MIXIN_CLASS', "A mixin class can't be declared 'sealed'.", correctionMessage: "Try removing the 'sealed' keyword.", ); - static const ParserErrorCode SETTER_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode setterConstructor = ParserErrorCode( 'SETTER_CONSTRUCTOR', "Constructors can't be a setter.", correctionMessage: "Try removing 'set'.", ); /// No parameters. - static const ParserErrorCode SETTER_IN_FUNCTION = ParserErrorCode( + static const ParserErrorCode setterInFunction = ParserErrorCode( 'SETTER_IN_FUNCTION', "Setters can't be defined within methods or functions.", correctionMessage: "Try moving the setter outside the method or function.", ); - static const ParserErrorCode STACK_OVERFLOW = ParserErrorCode( + static const ParserErrorCode stackOverflow = ParserErrorCode( 'STACK_OVERFLOW', "The file has too many nested expressions or statements.", correctionMessage: "Try simplifying the code.", ); - static const ParserErrorCode STATIC_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode staticConstructor = ParserErrorCode( 'STATIC_CONSTRUCTOR', "Constructors can't be static.", correctionMessage: "Try removing the keyword 'static'.", ); /// No parameters. - static const ParserErrorCode STATIC_GETTER_WITHOUT_BODY = ParserErrorCode( + static const ParserErrorCode staticGetterWithoutBody = ParserErrorCode( 'STATIC_GETTER_WITHOUT_BODY', "A 'static' getter must have a body.", correctionMessage: "Try adding a body to the getter, or removing the keyword 'static'.", ); - static const ParserErrorCode STATIC_OPERATOR = ParserErrorCode( + static const ParserErrorCode staticOperator = ParserErrorCode( 'STATIC_OPERATOR', "Operators can't be static.", correctionMessage: "Try removing the keyword 'static'.", ); /// No parameters. - static const ParserErrorCode STATIC_SETTER_WITHOUT_BODY = ParserErrorCode( + static const ParserErrorCode staticSetterWithoutBody = ParserErrorCode( 'STATIC_SETTER_WITHOUT_BODY', "A 'static' setter must have a body.", correctionMessage: "Try adding a body to the setter, or removing the keyword 'static'.", ); - static const ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = - ParserErrorCode( - 'SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', - "The default case should be the last case in a switch statement.", - correctionMessage: - "Try moving the default case after the other case clauses.", - ); + static const ParserErrorCode switchHasCaseAfterDefaultCase = ParserErrorCode( + 'SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', + "The default case should be the last case in a switch statement.", + correctionMessage: + "Try moving the default case after the other case clauses.", + ); - static const ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = - ParserErrorCode( - 'SWITCH_HAS_MULTIPLE_DEFAULT_CASES', - "The 'default' case can only be declared once.", - correctionMessage: "Try removing all but one default case.", - ); + static const ParserErrorCode switchHasMultipleDefaultCases = ParserErrorCode( + 'SWITCH_HAS_MULTIPLE_DEFAULT_CASES', + "The 'default' case can only be declared once.", + correctionMessage: "Try removing all but one default case.", + ); - static const ParserErrorCode TOP_LEVEL_OPERATOR = ParserErrorCode( + static const ParserErrorCode topLevelOperator = ParserErrorCode( 'TOP_LEVEL_OPERATOR', "Operators must be declared within a class.", correctionMessage: @@ -1993,26 +1963,25 @@ class ParserErrorCode extends DiagnosticCode { "be a function.", ); - static const ParserErrorCode TYPEDEF_IN_CLASS = ParserErrorCode( + static const ParserErrorCode typedefInClass = ParserErrorCode( 'TYPEDEF_IN_CLASS', "Typedefs can't be declared inside classes.", correctionMessage: "Try moving the typedef to the top-level.", ); - static const ParserErrorCode TYPE_ARGUMENTS_ON_TYPE_VARIABLE = - ParserErrorCode( - 'TYPE_ARGUMENTS_ON_TYPE_VARIABLE', - "Can't use type arguments with type variable '{0}'.", - correctionMessage: "Try removing the type arguments.", - ); + static const ParserErrorCode typeArgumentsOnTypeVariable = ParserErrorCode( + 'TYPE_ARGUMENTS_ON_TYPE_VARIABLE', + "Can't use type arguments with type variable '{0}'.", + correctionMessage: "Try removing the type arguments.", + ); - static const ParserErrorCode TYPE_BEFORE_FACTORY = ParserErrorCode( + static const ParserErrorCode typeBeforeFactory = ParserErrorCode( 'TYPE_BEFORE_FACTORY', "Factory constructors cannot have a return type.", correctionMessage: "Try removing the type appearing before 'factory'.", ); - static const ParserErrorCode TYPE_PARAMETER_ON_CONSTRUCTOR = ParserErrorCode( + static const ParserErrorCode typeParameterOnConstructor = ParserErrorCode( 'TYPE_PARAMETER_ON_CONSTRUCTOR', "Constructors can't have type parameters.", correctionMessage: "Try removing the type parameters.", @@ -2020,7 +1989,7 @@ class ParserErrorCode extends DiagnosticCode { /// 7.1.1 Operators: Type parameters are not syntactically supported on an /// operator. - static const ParserErrorCode TYPE_PARAMETER_ON_OPERATOR = ParserErrorCode( + static const ParserErrorCode typeParameterOnOperator = ParserErrorCode( 'TYPE_PARAMETER_ON_OPERATOR', "Types parameters aren't allowed when defining an operator.", correctionMessage: "Try removing the type parameters.", @@ -2028,7 +1997,7 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the starting character that was missing - static const ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = + static const ParserErrorCode unexpectedTerminatorForParameterGroup = ParserErrorCode( 'UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', "There is no '{0}' to open a parameter group.", @@ -2038,20 +2007,23 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the unexpected text that was found - static const ParserErrorCode UNEXPECTED_TOKEN = ParserErrorCode( + static const ParserErrorCode unexpectedToken = ParserErrorCode( 'UNEXPECTED_TOKEN', "Unexpected text '{0}'.", correctionMessage: "Try removing the text.", ); - static const ParserErrorCode UNEXPECTED_TOKENS = ParserErrorCode( + @Deprecated("Please use unexpectedToken") + static const ParserErrorCode UNEXPECTED_TOKEN = unexpectedToken; + + static const ParserErrorCode unexpectedTokens = ParserErrorCode( 'UNEXPECTED_TOKENS', "Unexpected tokens.", ); /// No parameters. static const ParserErrorCode - VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT = ParserErrorCode( + variablePatternKeywordInDeclarationContext = ParserErrorCode( 'VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT', "Variable patterns in declaration context can't specify 'var' or 'final' " "keyword.", @@ -2059,32 +2031,32 @@ class ParserErrorCode extends DiagnosticCode { hasPublishedDocs: true, ); - static const ParserErrorCode VAR_AND_TYPE = ParserErrorCode( + static const ParserErrorCode varAndType = ParserErrorCode( 'VAR_AND_TYPE', "Variables can't be declared using both 'var' and a type name.", correctionMessage: "Try removing 'var.'", ); - static const ParserErrorCode VAR_AS_TYPE_NAME = ParserErrorCode( + static const ParserErrorCode varAsTypeName = ParserErrorCode( 'VAR_AS_TYPE_NAME', "The keyword 'var' can't be used as a type name.", ); /// No parameters. - static const ParserErrorCode VAR_CLASS = ParserErrorCode( + static const ParserErrorCode varClass = ParserErrorCode( 'VAR_CLASS', "Classes can't be declared to be 'var'.", correctionMessage: "Try removing the keyword 'var'.", ); /// No parameters. - static const ParserErrorCode VAR_ENUM = ParserErrorCode( + static const ParserErrorCode varEnum = ParserErrorCode( 'VAR_ENUM', "Enums can't be declared to be 'var'.", correctionMessage: "Try removing the keyword 'var'.", ); - static const ParserErrorCode VAR_RETURN_TYPE = ParserErrorCode( + static const ParserErrorCode varReturnType = ParserErrorCode( 'VAR_RETURN_TYPE', "The return type can't be 'var'.", correctionMessage: @@ -2093,7 +2065,7 @@ class ParserErrorCode extends DiagnosticCode { ); /// No parameters. - static const ParserErrorCode VAR_TYPEDEF = ParserErrorCode( + static const ParserErrorCode varTypedef = ParserErrorCode( 'VAR_TYPEDEF', "Typedefs can't be declared to be 'var'.", correctionMessage: @@ -2101,20 +2073,20 @@ class ParserErrorCode extends DiagnosticCode { "return type.", ); - static const ParserErrorCode VOID_WITH_TYPE_ARGUMENTS = ParserErrorCode( + static const ParserErrorCode voidWithTypeArguments = ParserErrorCode( 'VOID_WITH_TYPE_ARGUMENTS', "Type 'void' can't have type arguments.", correctionMessage: "Try removing the type arguments.", ); - static const ParserErrorCode WITH_BEFORE_EXTENDS = ParserErrorCode( + static const ParserErrorCode withBeforeExtends = ParserErrorCode( 'WITH_BEFORE_EXTENDS', "The extends clause must be before the with clause.", correctionMessage: "Try moving the extends clause before the with clause.", ); /// No parameters. - static const ParserErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = + static const ParserErrorCode wrongNumberOfParametersForSetter = ParserErrorCode( 'WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', "Setters must declare exactly one required positional parameter.", @@ -2123,7 +2095,7 @@ class ParserErrorCode extends DiagnosticCode { /// No parameters. static const ParserErrorCode - WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = ParserErrorCode( + wrongSeparatorForPositionalParameter = ParserErrorCode( 'WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', "The default value of a positional parameter should be preceded by '='.", correctionMessage: "Try replacing the ':' with '='.", @@ -2132,7 +2104,7 @@ class ParserErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the terminator that was expected /// Object p1: the terminator that was found - static const ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = + static const ParserErrorCode wrongTerminatorForParameterGroup = ParserErrorCode( 'WRONG_TERMINATOR_FOR_PARAMETER_GROUP', "Expected '{0}' to close parameter group.", diff --git a/pkg/analyzer/lib/src/dart/error/todo_codes.dart b/pkg/analyzer/lib/src/dart/error/todo_codes.dart index de5e4b99ce9..24152569ddb 100644 --- a/pkg/analyzer/lib/src/dart/error/todo_codes.dart +++ b/pkg/analyzer/lib/src/dart/error/todo_codes.dart @@ -11,10 +11,10 @@ import 'package:analyzer/error/error.dart'; /// Static helper methods and properties for working with [TodoCode]s. class Todo { static const _codes = { - 'TODO': TodoCode.TODO, - 'FIXME': TodoCode.FIXME, - 'HACK': TodoCode.HACK, - 'UNDONE': TodoCode.UNDONE, + 'TODO': TodoCode.todo, + 'FIXME': TodoCode.fixme, + 'HACK': TodoCode.hack, + 'UNDONE': TodoCode.undone, }; /// This matches the two common Dart task styles @@ -50,8 +50,8 @@ class Todo { throw UnimplementedError('Do not construct'); } - /// Returns the TodoCode for [kind], falling back to [TodoCode.TODO]. - static TodoCode forKind(String kind) => _codes[kind] ?? TodoCode.TODO; + /// Returns the TodoCode for [kind], falling back to [TodoCode.todo]. + static TodoCode forKind(String kind) => _codes[kind] ?? TodoCode.todo; } /** @@ -62,22 +62,22 @@ class TodoCode extends DiagnosticCode { /** * A standard TODO comment marked as TODO. */ - static const TodoCode TODO = TodoCode('TODO'); + static const TodoCode todo = TodoCode('TODO'); /** * A TODO comment marked as FIXME. */ - static const TodoCode FIXME = TodoCode('FIXME'); + static const TodoCode fixme = TodoCode('FIXME'); /** * A TODO comment marked as HACK. */ - static const TodoCode HACK = TodoCode('HACK'); + static const TodoCode hack = TodoCode('HACK'); /** * A TODO comment marked as UNDONE. */ - static const TodoCode UNDONE = TodoCode('UNDONE'); + static const TodoCode undone = TodoCode('UNDONE'); /** * Initialize a newly created error code to have the given [name]. diff --git a/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart index 4c73efcf811..bb65c4b6ecb 100644 --- a/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart @@ -93,7 +93,7 @@ class AnnotationResolver { ); _resolveAnnotationElementGetter(node, getter); } else if (getter is! ConstructorElement) { - _diagnosticReporter.atNode(node, CompileTimeErrorCode.INVALID_ANNOTATION); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.invalidAnnotation); } _visitArguments( @@ -117,7 +117,7 @@ class AnnotationResolver { node.element = constructorElement; if (constructorElement == null) { - _diagnosticReporter.atNode(node, CompileTimeErrorCode.INVALID_ANNOTATION); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.invalidAnnotation); AnnotationInferrer( resolver: _resolver, node: node, @@ -172,7 +172,7 @@ class AnnotationResolver { ); _resolveAnnotationElementGetter(node, getter); } else { - _diagnosticReporter.atNode(node, CompileTimeErrorCode.INVALID_ANNOTATION); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.invalidAnnotation); } _visitArguments( @@ -188,7 +188,7 @@ class AnnotationResolver { List whyNotPromotedArguments, ) { if (!element.isConst || node.arguments != null) { - _diagnosticReporter.atNode(node, CompileTimeErrorCode.INVALID_ANNOTATION); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.invalidAnnotation); } _visitArguments( @@ -239,7 +239,7 @@ class AnnotationResolver { if (element1 == null) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_ANNOTATION, + CompileTimeErrorCode.undefinedAnnotation, arguments: [name1.name], ); _visitArguments( @@ -331,7 +331,7 @@ class AnnotationResolver { if (element == null) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_ANNOTATION, + CompileTimeErrorCode.undefinedAnnotation, arguments: [name2.name], ); _visitArguments( @@ -375,7 +375,7 @@ class AnnotationResolver { return; } - _diagnosticReporter.atNode(node, CompileTimeErrorCode.INVALID_ANNOTATION); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.invalidAnnotation); _visitArguments( node, @@ -395,7 +395,7 @@ class AnnotationResolver { annotation.arguments != null) { _diagnosticReporter.atNode( annotation, - CompileTimeErrorCode.INVALID_ANNOTATION, + CompileTimeErrorCode.invalidAnnotation, ); } } @@ -459,7 +459,7 @@ class AnnotationResolver { ); _resolveAnnotationElementGetter(node, getter); } else if (getter is! ConstructorElement) { - _diagnosticReporter.atNode(node, CompileTimeErrorCode.INVALID_ANNOTATION); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.invalidAnnotation); } _visitArguments( diff --git a/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart index eb2431e1bfd..a2463309878 100644 --- a/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/assignment_expression_resolver.dart @@ -152,7 +152,7 @@ class AssignmentExpressionResolver { )) { _diagnosticReporter.atNode( right, - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, ); return; } @@ -160,7 +160,7 @@ class AssignmentExpressionResolver { _diagnosticReporter.atNode( right, - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, arguments: [rightType, writeType], contextMessages: _resolver.computeWhyNotPromotedMessages( right, @@ -173,7 +173,7 @@ class AssignmentExpressionResolver { /// when it returns 'void'. Or, in rare cases, when other types of expressions /// are void, such as identifiers. /// - /// See [CompileTimeErrorCode.USE_OF_VOID_RESULT]. + /// See [CompileTimeErrorCode.useOfVoidResult]. // TODO(scheglov): this is duplicate bool _checkForUseOfVoidResult(Expression expression) { if (!identical(expression.staticType, VoidTypeImpl.instance)) { @@ -184,12 +184,12 @@ class AssignmentExpressionResolver { SimpleIdentifier methodName = expression.methodName; _diagnosticReporter.atNode( methodName, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } else { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } @@ -242,7 +242,7 @@ class AssignmentExpressionResolver { if (leftType is VoidType) { _diagnosticReporter.atToken( operator, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); return; } @@ -274,7 +274,7 @@ class AssignmentExpressionResolver { if (result.needsGetterError) { _diagnosticReporter.atToken( operator, - CompileTimeErrorCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.undefinedOperator, arguments: [methodName, leftType], ); } @@ -402,14 +402,14 @@ class AssignmentExpressionShared { if (isForEachIdentifier || assigned) { _errorReporter.atNode( left, - CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, + CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, ); } } else { if (isForEachIdentifier || !unassigned) { _errorReporter.atNode( left, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, + CompileTimeErrorCode.assignmentToFinalLocal, arguments: [element.name!], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart b/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart index e4680b9f1b3..abe808a1114 100644 --- a/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart +++ b/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart @@ -435,7 +435,7 @@ class AstRewriter { if (typeArguments != null) { _diagnosticReporter.atNode( typeArguments, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, arguments: [typeNameIdentifier.toString(), constructorIdentifier.name], ); } @@ -602,7 +602,7 @@ class AstRewriter { if (typeArguments != null) { _diagnosticReporter.atNode( typeArguments, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, arguments: [typeIdentifier.name, constructorIdentifier.name], ); } 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 879dee48219..a45ed19542a 100644 --- a/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart @@ -70,7 +70,7 @@ class BinaryExpressionResolver { if (operator != TokenType.BANG_EQ_EQ && operator != TokenType.EQ_EQ_EQ) { _diagnosticReporter.atToken( node.operator, - CompileTimeErrorCode.NOT_BINARY_OPERATOR, + CompileTimeErrorCode.notBinaryOperator, arguments: [operator.lexeme], ); } @@ -85,7 +85,7 @@ class BinaryExpressionResolver { }) { _resolver.boolExpressionVerifier.checkForNonBoolExpression( operand, - diagnosticCode: CompileTimeErrorCode.NON_BOOL_OPERAND, + diagnosticCode: CompileTimeErrorCode.nonBoolOperand, arguments: [operator], whyNotPromoted: whyNotPromoted, ); @@ -148,8 +148,8 @@ class BinaryExpressionResolver { void reportNullComparison(SyntacticEntity start, SyntacticEntity end) { var errorCode = notEqual - ? WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE - : WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE; + ? WarningCode.unnecessaryNullComparisonAlwaysNullFalse + : WarningCode.unnecessaryNullComparisonAlwaysNullTrue; var offset = start.offset; _diagnosticReporter.atOffset( offset: offset, @@ -407,7 +407,7 @@ class BinaryExpressionResolver { // safe to assume `extension.name` is non-`null`. _diagnosticReporter.atToken( node.operator, - CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, + CompileTimeErrorCode.undefinedExtensionOperator, arguments: [methodName, extension.name!], ); } @@ -421,7 +421,7 @@ class BinaryExpressionResolver { if (identical(leftType, NeverTypeImpl.instance)) { _resolver.diagnosticReporter.atNode( leftOperand, - WarningCode.RECEIVER_OF_TYPE_NEVER, + WarningCode.receiverOfTypeNever, ); return; } @@ -446,13 +446,13 @@ class BinaryExpressionResolver { if (leftOperand is SuperExpression) { _diagnosticReporter.atToken( node.operator, - CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, + CompileTimeErrorCode.undefinedSuperOperator, arguments: [methodName, leftType], ); } else { _diagnosticReporter.atToken( node.operator, - CompileTimeErrorCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.undefinedOperator, arguments: [methodName, leftType], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/constructor_reference_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/constructor_reference_resolver.dart index adf9f73c165..405832e1e1d 100644 --- a/pkg/analyzer/lib/src/dart/resolver/constructor_reference_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/constructor_reference_resolver.dart @@ -25,7 +25,7 @@ class ConstructorReferenceResolver { // the parser has already reported an error. _resolver.diagnosticReporter.atNode( node, - WarningCode.SDK_VERSION_CONSTRUCTOR_TEAROFFS, + WarningCode.sdkVersionConstructorTearoffs, ); } node.constructorName.accept(_resolver); @@ -35,8 +35,7 @@ class ConstructorReferenceResolver { if (enclosingElement is ClassElementImpl && enclosingElement.isAbstract) { _resolver.diagnosticReporter.atNode( node, - CompileTimeErrorCode - .TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS, + CompileTimeErrorCode.tearoffOfGenerativeConstructorOfAbstractClass, ); } } @@ -68,10 +67,9 @@ class ConstructorReferenceResolver { if (method != null) { var error = method.isStatic - ? CompileTimeErrorCode - .CLASS_INSTANTIATION_ACCESS_TO_STATIC_MEMBER + ? CompileTimeErrorCode.classInstantiationAccessToStaticMember : CompileTimeErrorCode - .CLASS_INSTANTIATION_ACCESS_TO_INSTANCE_MEMBER; + .classInstantiationAccessToInstanceMember; _resolver.diagnosticReporter.atNode( node, error, @@ -80,7 +78,7 @@ class ConstructorReferenceResolver { } else if (!name.isSynthetic) { _resolver.diagnosticReporter.atNode( node, - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_UNKNOWN_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToUnknownMember, arguments: [enclosingElement.name!, name.name], ); } 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 2b710b42b3d..a85babcecf0 100644 --- a/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/extension_member_resolver.dart @@ -118,7 +118,7 @@ class ExtensionMemberResolver { if (mostSpecific.length == 2) { _diagnosticReporter.atEntity( nameEntity, - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, arguments: [ name.name, mostSpecific[0].extension, @@ -129,7 +129,7 @@ class ExtensionMemberResolver { var extensions = mostSpecific.map((e) => e.extension).toList(); _diagnosticReporter.atEntity( nameEntity, - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_THREE_OR_MORE, + CompileTimeErrorCode.ambiguousExtensionMemberAccessThreeOrMore, arguments: [ name.name, mostSpecific.map((e) { @@ -207,7 +207,7 @@ class ExtensionMemberResolver { if (!_isCascadeTarget(node)) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.EXTENSION_OVERRIDE_WITHOUT_ACCESS, + CompileTimeErrorCode.extensionOverrideWithoutAccess, ); } nodeImpl.setPseudoExpressionStaticType(DynamicTypeImpl.instance); @@ -217,7 +217,7 @@ class ExtensionMemberResolver { if (arguments.length != 1) { _diagnosticReporter.atNode( node.argumentList, - CompileTimeErrorCode.INVALID_EXTENSION_ARGUMENT_COUNT, + CompileTimeErrorCode.invalidExtensionArgumentCount, ); nodeImpl.typeArgumentTypes = _listOfDynamic(typeParameters); nodeImpl.extendedType = DynamicTypeImpl.instance; @@ -260,7 +260,7 @@ class ExtensionMemberResolver { if (receiverType is VoidType) { _diagnosticReporter.atNode( receiverExpression, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } else if (!_typeSystem.isAssignableTo( receiverType, @@ -271,7 +271,7 @@ class ExtensionMemberResolver { whyNotPromotedArguments.isEmpty ? null : whyNotPromotedArguments[0]; _diagnosticReporter.atNode( receiverExpression, - CompileTimeErrorCode.EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE, + CompileTimeErrorCode.extensionOverrideArgumentNotAssignable, arguments: [receiverType, extendedType], contextMessages: _resolver.computeWhyNotPromotedMessages( receiverExpression, @@ -298,7 +298,7 @@ class ExtensionMemberResolver { if (!_typeSystem.isSubtypeOf(argument, parameterBound)) { _diagnosticReporter.atNode( typeArgumentList.arguments[i], - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, arguments: [argument, name, parameterBound], ); } @@ -381,7 +381,7 @@ class ExtensionMemberResolver { // explicit extension overrides cannot refer to unnamed extensions. _diagnosticReporter.atNode( typeArguments, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsExtension, arguments: [element.name!, typeParameters.length, arguments.length], ); return _listOfDynamic(typeParameters); diff --git a/pkg/analyzer/lib/src/dart/resolver/for_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/for_resolver.dart index 3e7c050ef30..2ae62ffa3c1 100644 --- a/pkg/analyzer/lib/src/dart/resolver/for_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/for_resolver.dart @@ -85,7 +85,7 @@ class ForResolver { ); _resolver.popRewrite(); _resolver.nullableDereferenceVerifier.expression( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsIterator, forLoopParts.iterable, ); } @@ -177,7 +177,7 @@ class ForResolver { iterable = _resolver.popRewrite()!; _resolver.nullableDereferenceVerifier.expression( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsIterator, iterable, ); diff --git a/pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart index 180924d59b7..e0ed4cb9794 100644 --- a/pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/function_expression_invocation_resolver.dart @@ -65,7 +65,7 @@ class FunctionExpressionInvocationResolver { receiverType = _typeSystem.resolveToBound(receiverType); if (receiverType is FunctionTypeImpl) { _nullableDereferenceVerifier.expression( - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedInvocationOfNullableValue, function, ); _resolve( @@ -78,7 +78,7 @@ class FunctionExpressionInvocationResolver { } if (identical(receiverType, NeverTypeImpl.instance)) { - _diagnosticReporter.atNode(function, WarningCode.RECEIVER_OF_TYPE_NEVER); + _diagnosticReporter.atNode(function, WarningCode.receiverOfTypeNever); _unresolved( node, NeverTypeImpl.instance, @@ -103,7 +103,7 @@ class FunctionExpressionInvocationResolver { if (result.needsGetterError) { _diagnosticReporter.atNode( function, - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, + CompileTimeErrorCode.invocationOfNonFunctionExpression, ); } var type = @@ -122,7 +122,7 @@ class FunctionExpressionInvocationResolver { if (callElement.kind != ElementKind.METHOD) { _diagnosticReporter.atNode( function, - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, + CompileTimeErrorCode.invocationOfNonFunctionExpression, ); _unresolved( node, @@ -142,7 +142,7 @@ class FunctionExpressionInvocationResolver { /// when it returns 'void'. Or, in rare cases, when other types of expressions /// are void, such as identifiers. /// - /// See [CompileTimeErrorCode.USE_OF_VOID_RESULT]. + /// See [CompileTimeErrorCode.useOfVoidResult]. /// // TODO(scheglov): this is duplicate bool _checkForUseOfVoidResult(Expression expression, DartType type) { @@ -154,12 +154,12 @@ class FunctionExpressionInvocationResolver { SimpleIdentifier methodName = expression.methodName; _diagnosticReporter.atNode( methodName, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } else { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } @@ -203,7 +203,7 @@ class FunctionExpressionInvocationResolver { if (callElement == null) { _diagnosticReporter.atNode( function, - CompileTimeErrorCode.INVOCATION_OF_EXTENSION_WITHOUT_CALL, + CompileTimeErrorCode.invocationOfExtensionWithoutCall, arguments: [function.name.lexeme], ); return _unresolved( @@ -217,7 +217,7 @@ class FunctionExpressionInvocationResolver { if (callElement.isStatic) { _diagnosticReporter.atNode( node.argumentList, - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/function_reference_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/function_reference_resolver.dart index 3dce4fc84a3..0724712a0f9 100644 --- a/pkg/analyzer/lib/src/dart/resolver/function_reference_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/function_reference_resolver.dart @@ -57,7 +57,7 @@ class FunctionReferenceResolver { // interpreted as a type literal (e.g. `List`). _diagnosticReporter.atNode( typeArguments, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, arguments: [ function.constructorName.type.qualifiedName, function.constructorName.name!.name, @@ -105,7 +105,7 @@ class FunctionReferenceResolver { if (prefixType is DynamicType) { _diagnosticReporter.atNode( function, - CompileTimeErrorCode.GENERIC_METHOD_TYPE_INSTANTIATION_ON_DYNAMIC, + CompileTimeErrorCode.genericMethodTypeInstantiationOnDynamic, ); node.recordStaticType(InvalidTypeImpl.instance, resolver: _resolver); return true; @@ -122,10 +122,9 @@ class FunctionReferenceResolver { if (typeArgumentList.arguments.length != typeParameters.length) { if (name == null && errorCode == - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION) { + CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction) { errorCode = - CompileTimeErrorCode - .WRONG_NUMBER_OF_TYPE_ARGUMENTS_ANONYMOUS_FUNCTION; + CompileTimeErrorCode.wrongNumberOfTypeArgumentsAnonymousFunction; _diagnosticReporter.atNode( typeArgumentList, errorCode, @@ -188,14 +187,13 @@ class FunctionReferenceResolver { if (_resolver.enclosingExtension != null) { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode - .UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE, + CompileTimeErrorCode.unqualifiedReferenceToStaticMemberOfExtendedType, arguments: [enclosingElement.displayName], ); } else { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, + CompileTimeErrorCode.unqualifiedReferenceToNonLocalStaticMember, arguments: [enclosingElement.displayName], ); } @@ -203,8 +201,7 @@ class FunctionReferenceResolver { enclosingElement.name == null) { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode - .INSTANCE_ACCESS_TO_STATIC_MEMBER_OF_UNNAMED_EXTENSION, + CompileTimeErrorCode.instanceAccessToStaticMemberOfUnnamedExtension, arguments: [nameNode.name, element.kind.displayName], ); } else { @@ -212,7 +209,7 @@ class FunctionReferenceResolver { // it can only be `null` for extensions, and we handle that case above. _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, arguments: [ nameNode.name, element.kind.displayName, @@ -264,7 +261,7 @@ class FunctionReferenceResolver { typeArguments, name, rawType.typeParameters, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, ); var invokeType = rawType.instantiate(typeArgumentTypes); @@ -278,7 +275,7 @@ class FunctionReferenceResolver { // tearoff feature is enabled. _diagnosticReporter.atNode( node.function, - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, ); node.recordStaticType(InvalidTypeImpl.instance, resolver: _resolver); } else if (rawType is DynamicType) { @@ -300,7 +297,7 @@ class FunctionReferenceResolver { node.typeArguments!, MethodElement.CALL_METHOD_NAME, callMethodType.typeParameters, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, ); var callReference = ImplicitCallReferenceImpl( expression: node.function, @@ -331,7 +328,7 @@ class FunctionReferenceResolver { node.typeArguments!, name.name, element.typeParameters, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, + CompileTimeErrorCode.wrongNumberOfTypeArguments, ); var type = element.instantiateImpl( typeArguments: typeArguments, @@ -353,7 +350,7 @@ class FunctionReferenceResolver { // tearoff feature is enabled. _diagnosticReporter.atNode( node.function, - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, ); } _resolve(node: node, rawType: rawType); @@ -379,7 +376,7 @@ class FunctionReferenceResolver { if (member.isStatic) { _resolver.diagnosticReporter.atNode( function.propertyName, - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, ); // Continue to resolve type. } @@ -387,7 +384,7 @@ class FunctionReferenceResolver { if (function.isCascaded) { _resolver.diagnosticReporter.atToken( override.name, - CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE, + CompileTimeErrorCode.extensionOverrideWithCascade, ); // Continue to resolve type. } @@ -441,7 +438,7 @@ class FunctionReferenceResolver { if (prefixElement == null) { _diagnosticReporter.atNode( function.prefix, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER, + CompileTimeErrorCode.undefinedIdentifier, arguments: [function.name], ); function.setPseudoExpressionStaticType(InvalidTypeImpl.instance); @@ -465,7 +462,7 @@ class FunctionReferenceResolver { if (functionElement == null) { _diagnosticReporter.atNode( function.identifier, - CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, + CompileTimeErrorCode.undefinedPrefixedName, arguments: [functionName, function.prefix.name], ); function.setPseudoExpressionStaticType(InvalidTypeImpl.instance); @@ -510,7 +507,7 @@ class FunctionReferenceResolver { // If it is known, we must report the bad type instantiation here. _diagnosticReporter.atNode( function.identifier, - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, ); } _resolver.analyzeExpression(function, _resolver.operations.unknownType); @@ -555,7 +552,7 @@ class FunctionReferenceResolver { if (targetType is DynamicType) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.GENERIC_METHOD_TYPE_INSTANTIATION_ON_DYNAMIC, + CompileTimeErrorCode.genericMethodTypeInstantiationOnDynamic, ); node.recordStaticType(InvalidTypeImpl.instance, resolver: _resolver); return; @@ -582,7 +579,7 @@ class FunctionReferenceResolver { // If it is known, we must report the bad type instantiation here. _diagnosticReporter.atNode( function.propertyName, - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, ); } @@ -703,7 +700,7 @@ class FunctionReferenceResolver { } else { _diagnosticReporter.atNode( function, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER, + CompileTimeErrorCode.undefinedIdentifier, arguments: [function.name], ); function.setPseudoExpressionStaticType(InvalidTypeImpl.instance); @@ -747,7 +744,7 @@ class FunctionReferenceResolver { } else { _resolver.diagnosticReporter.atNode( function, - CompileTimeErrorCode.UNDEFINED_METHOD, + CompileTimeErrorCode.undefinedMethod, arguments: [function.name, receiverType], ); function.setPseudoExpressionStaticType(InvalidTypeImpl.instance); @@ -862,7 +859,7 @@ class FunctionReferenceResolver { node.typeArguments!, element.name, element.typeParameters, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, + CompileTimeErrorCode.wrongNumberOfTypeArguments, ); var type = element.instantiateImpl( typeArguments: typeArguments, diff --git a/pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart index 10f86aa5828..ab25910af96 100644 --- a/pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/instance_creation_expression_resolver.dart @@ -86,7 +86,7 @@ class InstanceCreationExpressionResolver { } else { _resolver.diagnosticReporter.atNode( node.constructorName, - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, + CompileTimeErrorCode.constWithUndefinedConstructor, arguments: [contextType, node.constructorName.name], ); } @@ -98,14 +98,14 @@ class InstanceCreationExpressionResolver { if (constructorElement != null && !constructorElement.isFactory) { _resolver.diagnosticReporter.atNode( node, - CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, + CompileTimeErrorCode.instantiateAbstractClass, ); } } else if (typeArguments != null) { _resolver.diagnosticReporter.atNode( typeArguments, CompileTimeErrorCode - .WRONG_NUMBER_OF_TYPE_ARGUMENTS_DOT_SHORTHAND_CONSTRUCTOR, + .wrongNumberOfTypeArgumentsDotShorthandConstructor, arguments: [ dotShorthandContextType.getDisplayString(), node.constructorName.name, @@ -115,7 +115,7 @@ class InstanceCreationExpressionResolver { } else { _resolver.diagnosticReporter.atNode( node, - CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, + CompileTimeErrorCode.dotShorthandMissingContext, ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart b/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart index 47aaabea231..2ee1a052b97 100644 --- a/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart +++ b/pkg/analyzer/lib/src/dart/resolver/invocation_inferrer.dart @@ -88,7 +88,7 @@ class AnnotationInferrer extends FullInvocationInferrer { @override DiagnosticCode get _wrongNumberOfTypeArgumentsErrorCode => - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS; + CompileTimeErrorCode.wrongNumberOfTypeArguments; @override List? _storeResult( @@ -197,7 +197,7 @@ abstract class FullInvocationInferrer TypeArgumentListImpl? get _typeArguments; DiagnosticCode get _wrongNumberOfTypeArgumentsErrorCode => - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD; + CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod; @override DartType resolveInvocation({required FunctionTypeImpl? rawType}) { @@ -252,7 +252,7 @@ abstract class FullInvocationInferrer if (!resolver.typeSystem.isSubtypeOf(typeArgument, bound)) { resolver.diagnosticReporter.atNode( typeArgumentList.arguments[i], - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, arguments: [typeArgument, typeParameter.name!, bound], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/list_pattern_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/list_pattern_resolver.dart index 62d170f1dd4..e4d826ab6bb 100644 --- a/pkg/analyzer/lib/src/dart/resolver/list_pattern_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/list_pattern_resolver.dart @@ -26,7 +26,7 @@ class ListPatternResolver { if (length != 1) { resolverVisitor.diagnosticReporter.atNode( typeArguments, - CompileTimeErrorCode.EXPECTED_ONE_LIST_PATTERN_TYPE_ARGUMENTS, + CompileTimeErrorCode.expectedOneListPatternTypeArguments, arguments: [length], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart index 393d3a190ac..7f4f39da908 100644 --- a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart @@ -227,7 +227,7 @@ class MethodInvocationResolver with ScopeHelpers { // of a function type). _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNDEFINED_METHOD_ON_FUNCTION_TYPE, + CompileTimeErrorCode.undefinedMethodOnFunctionType, arguments: [name, receiver.type.qualifiedName], ); _setInvalidTypeResolution( @@ -286,7 +286,7 @@ class MethodInvocationResolver with ScopeHelpers { _resolver.diagnosticReporter.atNode( node.memberName, - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, + CompileTimeErrorCode.dotShorthandUndefinedInvocation, arguments: [node.memberName.name, contextType.getDisplayString()], ); _setInvalidTypeResolutionForDotShorthand( @@ -321,14 +321,13 @@ class MethodInvocationResolver with ScopeHelpers { if (_resolver.enclosingExtension != null) { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode - .UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE, + CompileTimeErrorCode.unqualifiedReferenceToStaticMemberOfExtendedType, arguments: [enclosingElement.displayString()], ); } else { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, + CompileTimeErrorCode.unqualifiedReferenceToNonLocalStaticMember, arguments: [enclosingElement.displayString()], ); } @@ -336,8 +335,7 @@ class MethodInvocationResolver with ScopeHelpers { enclosingElement.name == null) { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode - .INSTANCE_ACCESS_TO_STATIC_MEMBER_OF_UNNAMED_EXTENSION, + CompileTimeErrorCode.instanceAccessToStaticMemberOfUnnamedExtension, arguments: [nameNode.name, element.kind.displayName], ); } else { @@ -345,7 +343,7 @@ class MethodInvocationResolver with ScopeHelpers { // it can only be `null` for extensions, and we handle that case above. _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, arguments: [ nameNode.name, element.kind.displayName, @@ -361,7 +359,7 @@ class MethodInvocationResolver with ScopeHelpers { void _reportInvocationOfNonFunction(SimpleIdentifierImpl methodName) { _resolver.diagnosticReporter.atNode( methodName, - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION, + CompileTimeErrorCode.invocationOfNonFunction, arguments: [methodName.name], ); } @@ -369,7 +367,7 @@ class MethodInvocationResolver with ScopeHelpers { void _reportPrefixIdentifierNotFollowedByDot(SimpleIdentifier target) { _resolver.diagnosticReporter.atNode( target, - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, + CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, arguments: [target.name], ); } @@ -381,7 +379,7 @@ class MethodInvocationResolver with ScopeHelpers { if (!element.isStatic) { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, + CompileTimeErrorCode.staticAccessToInstanceMember, arguments: [nameNode.name], ); } @@ -406,7 +404,7 @@ class MethodInvocationResolver with ScopeHelpers { _resolver.diagnosticReporter.atNode( node.methodName, - CompileTimeErrorCode.UNDEFINED_FUNCTION, + CompileTimeErrorCode.undefinedFunction, arguments: [node.methodName.name], ); } @@ -420,7 +418,7 @@ class MethodInvocationResolver with ScopeHelpers { if (_resolver.isConstructorTearoffsEnabled) { _resolver.diagnosticReporter.atNode( methodName, - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, + CompileTimeErrorCode.newWithUndefinedConstructorDefault, arguments: [receiver.displayName], ); } else { @@ -430,7 +428,7 @@ class MethodInvocationResolver with ScopeHelpers { } else { _resolver.diagnosticReporter.atNode( methodName, - CompileTimeErrorCode.UNDEFINED_METHOD, + CompileTimeErrorCode.undefinedMethod, arguments: [methodName.name, receiver.displayName], ); } @@ -439,7 +437,7 @@ class MethodInvocationResolver with ScopeHelpers { void _reportUseOfVoidType(AstNode errorNode) { _resolver.diagnosticReporter.atNode( errorNode, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } @@ -546,7 +544,7 @@ class MethodInvocationResolver with ScopeHelpers { // `extension.name` is non-`null`. _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD, + CompileTimeErrorCode.undefinedExtensionMethod, arguments: [name, extension.name!], ); return null; @@ -578,7 +576,7 @@ class MethodInvocationResolver with ScopeHelpers { // assume `override.staticElement!.name` is non-`null`. _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD, + CompileTimeErrorCode.undefinedExtensionMethod, arguments: [name, override.element.name!], ); return null; @@ -587,7 +585,7 @@ class MethodInvocationResolver with ScopeHelpers { if (member.isStatic) { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, ); } @@ -595,7 +593,7 @@ class MethodInvocationResolver with ScopeHelpers { // Report this error and recover by treating it like a non-cascade. _resolver.diagnosticReporter.atToken( override.name, - CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE, + CompileTimeErrorCode.extensionOverrideWithCascade, ); } @@ -723,7 +721,7 @@ class MethodInvocationResolver with ScopeHelpers { _resolver.diagnosticReporter.atNode( receiver, - WarningCode.RECEIVER_OF_TYPE_NEVER, + WarningCode.receiverOfTypeNever, ); node.methodName.setPseudoExpressionStaticType(_dynamicType); @@ -856,7 +854,7 @@ class MethodInvocationResolver with ScopeHelpers { }; _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNDEFINED_METHOD, + CompileTimeErrorCode.undefinedMethod, arguments: [name, receiverTypeName], ); return null; @@ -1027,7 +1025,7 @@ class MethodInvocationResolver with ScopeHelpers { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, + CompileTimeErrorCode.abstractSuperMemberReference, arguments: [target.kind.displayName, name], ); return null; @@ -1041,7 +1039,7 @@ class MethodInvocationResolver with ScopeHelpers { ); _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, + CompileTimeErrorCode.undefinedSuperMethod, arguments: [name, enclosingClass.firstFragment.displayName], ); return null; @@ -1165,7 +1163,7 @@ class MethodInvocationResolver with ScopeHelpers { if (!nameNode.isSynthetic) { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNDEFINED_METHOD, + CompileTimeErrorCode.undefinedMethod, arguments: [name, receiverClassName], ); } @@ -1271,7 +1269,7 @@ class MethodInvocationResolver with ScopeHelpers { } else { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, + CompileTimeErrorCode.dotShorthandUndefinedInvocation, arguments: [nameNode.name, receiver.displayName], ); _setInvalidTypeResolutionForDotShorthand( @@ -1305,7 +1303,7 @@ class MethodInvocationResolver with ScopeHelpers { _resolver.diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, + CompileTimeErrorCode.dotShorthandUndefinedInvocation, arguments: [nameNode.name, receiver.displayName], ); _setInvalidTypeResolutionForDotShorthand( 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 14b96837411..4fac57ad77f 100644 --- a/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/named_type_resolver.dart @@ -120,7 +120,7 @@ class NamedTypeResolver with ScopeHelpers { diagnosticReporter.atToken( prefixToken, - CompileTimeErrorCode.PREFIX_SHADOWED_BY_LOCAL_DECLARATION, + CompileTimeErrorCode.prefixShadowedByLocalDeclaration, arguments: [prefixName], ); node.type = InvalidTypeImpl.instance; @@ -147,7 +147,7 @@ class NamedTypeResolver with ScopeHelpers { if (argumentCount != parameterCount) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, + CompileTimeErrorCode.wrongNumberOfTypeArguments, arguments: [node.name.lexeme, parameterCount, argumentCount], ); return List.filled(parameterCount, InvalidTypeImpl.instance); @@ -359,7 +359,7 @@ class NamedTypeResolver with ScopeHelpers { if (typeArguments != null) { diagnosticReporter.atNode( typeArguments, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, arguments: [importPrefix.name.lexeme, nameToken.lexeme], ); var instanceCreation = constructorName.parent; @@ -409,7 +409,7 @@ class NamedTypeResolver with ScopeHelpers { diagnosticReporter.atOffset( offset: importPrefix.offset, length: nameToken.end - importPrefix.offset, - diagnosticCode: CompileTimeErrorCode.NOT_A_TYPE, + diagnosticCode: CompileTimeErrorCode.notAType, arguments: ['${importPrefix.name.lexeme}.${nameToken.lexeme}'], contextMessages: [ if (source != null && nameOffset != null) @@ -436,22 +436,22 @@ class NamedTypeResolver with ScopeHelpers { if (parent is ExtendsClause || parent is ClassTypeAlias) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, + CompileTimeErrorCode.nullableTypeInExtendsClause, ); } else if (parent is ImplementsClause) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, + CompileTimeErrorCode.nullableTypeInImplementsClause, ); } else if (parent is MixinOnClause) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.NULLABLE_TYPE_IN_ON_CLAUSE, + CompileTimeErrorCode.nullableTypeInOnClause, ); } else if (parent is WithClause) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, + CompileTimeErrorCode.nullableTypeInWithClause, ); } return type.withNullability(NullabilitySuffix.none); @@ -477,8 +477,7 @@ class NamedTypeResolver with ScopeHelpers { offset: errorRange.offset, length: errorRange.length, diagnosticCode: - CompileTimeErrorCode - .INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.instantiateTypeAliasExpandsToTypeParameter, ); } else if (constructorUsage is ConstructorDeclaration && constructorUsage.redirectedConstructor == parent) { @@ -486,8 +485,7 @@ class NamedTypeResolver with ScopeHelpers { offset: errorRange.offset, length: errorRange.length, diagnosticCode: - CompileTimeErrorCode - .REDIRECT_TO_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.redirectToTypeAliasExpandsToTypeParameter, ); } else { throw UnimplementedError('${constructorUsage.runtimeType}'); @@ -499,17 +497,16 @@ class NamedTypeResolver with ScopeHelpers { DiagnosticCode? diagnosticCode; if (parent is ExtendsClause) { diagnosticCode = - CompileTimeErrorCode.EXTENDS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER; + CompileTimeErrorCode.extendsTypeAliasExpandsToTypeParameter; } else if (parent is ImplementsClause) { diagnosticCode = - CompileTimeErrorCode - .IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER; + CompileTimeErrorCode.implementsTypeAliasExpandsToTypeParameter; } else if (parent is MixinOnClause) { diagnosticCode = - CompileTimeErrorCode.MIXIN_ON_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER; + CompileTimeErrorCode.mixinOnTypeAliasExpandsToTypeParameter; } else if (parent is WithClause) { diagnosticCode = - CompileTimeErrorCode.MIXIN_OF_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER; + CompileTimeErrorCode.mixinOfTypeAliasExpandsToTypeParameter; } if (diagnosticCode != null) { var errorRange = _ErrorHelper._getErrorRange(node); @@ -553,8 +550,8 @@ class _ErrorHelper { length: errorRange.length, diagnosticCode: instanceCreation.isConst - ? CompileTimeErrorCode.CONST_WITH_NON_TYPE - : CompileTimeErrorCode.NEW_WITH_NON_TYPE, + ? CompileTimeErrorCode.constWithNonType + : CompileTimeErrorCode.newWithNonType, arguments: [node.name.lexeme], ); return true; @@ -573,7 +570,7 @@ class _ErrorHelper { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN, + diagnosticCode: CompileTimeErrorCode.undefinedClassBoolean, arguments: [node.name.lexeme], ); return; @@ -584,7 +581,7 @@ class _ErrorHelper { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE, + diagnosticCode: CompileTimeErrorCode.nonTypeInCatchClause, arguments: [node.name.lexeme], ); return; @@ -595,7 +592,7 @@ class _ErrorHelper { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.CAST_TO_NON_TYPE, + diagnosticCode: CompileTimeErrorCode.castToNonType, arguments: [node.name.lexeme], ); return; @@ -607,14 +604,14 @@ class _ErrorHelper { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.TYPE_TEST_WITH_NON_TYPE, + diagnosticCode: CompileTimeErrorCode.typeTestWithNonType, arguments: [node.name.lexeme], ); } else { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME, + diagnosticCode: CompileTimeErrorCode.typeTestWithUndefinedName, arguments: [node.name.lexeme], ); } @@ -626,7 +623,7 @@ class _ErrorHelper { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.REDIRECT_TO_NON_CLASS, + diagnosticCode: CompileTimeErrorCode.redirectToNonClass, arguments: [node.name.lexeme], ); return; @@ -637,7 +634,7 @@ class _ErrorHelper { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, + diagnosticCode: CompileTimeErrorCode.nonTypeAsTypeArgument, arguments: [node.name.lexeme], ); return; @@ -676,7 +673,7 @@ class _ErrorHelper { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.NOT_A_TYPE, + diagnosticCode: CompileTimeErrorCode.notAType, arguments: [name], contextMessages: [ if (source != null && nameOffset != null) @@ -695,7 +692,7 @@ class _ErrorHelper { if (node.importPrefix == null && node.name.lexeme == 'await') { diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT, + CompileTimeErrorCode.undefinedIdentifierAwait, ); return; } @@ -704,7 +701,7 @@ class _ErrorHelper { diagnosticReporter.atOffset( offset: errorRange.offset, length: errorRange.length, - diagnosticCode: CompileTimeErrorCode.UNDEFINED_CLASS, + diagnosticCode: CompileTimeErrorCode.undefinedClass, arguments: [node.name.lexeme], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart index 9b25a26f267..025b528be3a 100644 --- a/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart @@ -86,7 +86,7 @@ class PostfixExpressionResolver { )) { _resolver.diagnosticReporter.atNode( node, - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, arguments: [type, operandWriteType], ); } @@ -133,7 +133,7 @@ class PostfixExpressionResolver { if (identical(receiverType, NeverTypeImpl.instance)) { _resolver.diagnosticReporter.atNode( operand, - WarningCode.RECEIVER_OF_TYPE_NEVER, + WarningCode.receiverOfTypeNever, ); return; } @@ -153,13 +153,13 @@ class PostfixExpressionResolver { if (operand is SuperExpression) { _diagnosticReporter.atToken( node.operator, - CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, + CompileTimeErrorCode.undefinedSuperOperator, arguments: [methodName, receiverType], ); } else { _diagnosticReporter.atToken( node.operator, - CompileTimeErrorCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.undefinedOperator, arguments: [methodName, receiverType], ); } @@ -217,7 +217,7 @@ class PostfixExpressionResolver { if (operand is SuperExpression) { _resolver.diagnosticReporter.atNode( node, - ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, + ParserErrorCode.missingAssignableSelector, ); operand.setPseudoExpressionStaticType(DynamicTypeImpl.instance); node.recordStaticType(DynamicTypeImpl.instance, resolver: _resolver); diff --git a/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart index d20db4053d9..e587a220444 100644 --- a/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart @@ -104,7 +104,7 @@ class PrefixExpressionResolver { )) { _resolver.diagnosticReporter.atNode( node, - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, arguments: [type, operandWriteType], ); } @@ -162,7 +162,7 @@ class PrefixExpressionResolver { // safely assume `element.name` is non-`null`. _diagnosticReporter.atToken( node.operator, - CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, + CompileTimeErrorCode.undefinedExtensionOperator, arguments: [methodName, element.name!], ); } @@ -177,7 +177,7 @@ class PrefixExpressionResolver { if (identical(readType, NeverTypeImpl.instance)) { _resolver.diagnosticReporter.atNode( operand, - WarningCode.RECEIVER_OF_TYPE_NEVER, + WarningCode.receiverOfTypeNever, ); return; } @@ -196,13 +196,13 @@ class PrefixExpressionResolver { if (operand is SuperExpression) { _diagnosticReporter.atToken( operator, - CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, + CompileTimeErrorCode.undefinedSuperOperator, arguments: [methodName, readType], ); } else { _diagnosticReporter.atToken( operator, - CompileTimeErrorCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.undefinedOperator, arguments: [methodName, readType], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart index eeef642b5d6..6b47fbef00d 100644 --- a/pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart @@ -181,7 +181,7 @@ class PrefixedIdentifierResolver { _resolver.diagnosticReporter.atNode( node, - CompileTimeErrorCode.EXTENSION_AS_EXPRESSION, + CompileTimeErrorCode.extensionAsExpression, arguments: [node.name], ); 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 9aa16e0b4f4..0add720a196 100644 --- a/pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/property_element_resolver.dart @@ -73,7 +73,7 @@ class PropertyElementResolver with ScopeHelpers { _resolver.diagnosticReporter.atNode( node, CompileTimeErrorCode - .TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS, + .tearoffOfGenerativeConstructorOfAbstractClass, ); } } @@ -127,7 +127,7 @@ class PropertyElementResolver with ScopeHelpers { diagnosticReporter.atNode( node, - CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, + CompileTimeErrorCode.dotShorthandMissingContext, ); return PropertyElementResolverResult(); } @@ -150,7 +150,7 @@ class PropertyElementResolver with ScopeHelpers { // to assume that `target.staticElement!.name` is non-`null`. _reportUnresolvedIndex( node, - CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, + CompileTimeErrorCode.undefinedExtensionOperator, ['[]', target.element.name!], ); } @@ -162,7 +162,7 @@ class PropertyElementResolver with ScopeHelpers { // to assume that `target.staticElement!.name` is non-`null`. _reportUnresolvedIndex( node, - CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, + CompileTimeErrorCode.undefinedExtensionOperator, ['[]=', target.element.name!], ); } @@ -180,13 +180,13 @@ class PropertyElementResolver with ScopeHelpers { if (targetType is VoidType) { // TODO(scheglov): Report directly in TypePropertyResolver? - _reportUnresolvedIndex(node, CompileTimeErrorCode.USE_OF_VOID_RESULT); + _reportUnresolvedIndex(node, CompileTimeErrorCode.useOfVoidResult); return PropertyElementResolverResult(); } if (identical(targetType, NeverTypeImpl.instance)) { // TODO(scheglov): Report directly in TypePropertyResolver? - diagnosticReporter.atNode(target, WarningCode.RECEIVER_OF_TYPE_NEVER); + diagnosticReporter.atNode(target, WarningCode.receiverOfTypeNever); return PropertyElementResolverResult(); } @@ -212,8 +212,8 @@ class PropertyElementResolver with ScopeHelpers { _reportUnresolvedIndex( node, target is SuperExpression - ? CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR - : CompileTimeErrorCode.UNDEFINED_OPERATOR, + ? CompileTimeErrorCode.undefinedSuperOperator + : CompileTimeErrorCode.undefinedOperator, ['[]', targetType], ); } @@ -222,8 +222,8 @@ class PropertyElementResolver with ScopeHelpers { _reportUnresolvedIndex( node, target is SuperExpression - ? CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR - : CompileTimeErrorCode.UNDEFINED_OPERATOR, + ? CompileTimeErrorCode.undefinedSuperOperator + : CompileTimeErrorCode.undefinedOperator, ['[]=', targetType], ); } @@ -407,7 +407,7 @@ class PropertyElementResolver with ScopeHelpers { diagnosticReporter.atNode( identifier, - CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, + CompileTimeErrorCode.staticAccessToInstanceMember, arguments: [identifier.name], ); return true; @@ -422,7 +422,7 @@ class PropertyElementResolver with ScopeHelpers { if (target is ExtensionOverride) { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, ); } else { var enclosingElement = element.enclosingElement; @@ -430,8 +430,7 @@ class PropertyElementResolver with ScopeHelpers { enclosingElement.name == null) { _resolver.diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode - .INSTANCE_ACCESS_TO_STATIC_MEMBER_OF_UNNAMED_EXTENSION, + CompileTimeErrorCode.instanceAccessToStaticMemberOfUnnamedExtension, arguments: [propertyName.name, element.kind.displayName], ); } else { @@ -440,7 +439,7 @@ class PropertyElementResolver with ScopeHelpers { // case above. diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, arguments: [ propertyName.name, element.kind.displayName, @@ -544,7 +543,7 @@ class PropertyElementResolver with ScopeHelpers { if (targetType is VoidType) { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); return PropertyElementResolverResult(); } @@ -560,13 +559,13 @@ class PropertyElementResolver with ScopeHelpers { if (hasRead) { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_GETTER_ON_FUNCTION_TYPE, + CompileTimeErrorCode.undefinedGetterOnFunctionType, arguments: [propertyName.name, target.type.qualifiedName], ); } else { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_SETTER_ON_FUNCTION_TYPE, + CompileTimeErrorCode.undefinedSetterOnFunctionType, arguments: [propertyName.name, target.type.qualifiedName], ); } @@ -609,7 +608,7 @@ class PropertyElementResolver with ScopeHelpers { if (result.needsGetterError) { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_GETTER, + CompileTimeErrorCode.undefinedGetter, arguments: [propertyName.name, targetType], ); } @@ -669,7 +668,7 @@ class PropertyElementResolver with ScopeHelpers { // assume that `extension.name` is non-`null`. diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, + CompileTimeErrorCode.undefinedExtensionGetter, arguments: [memberName, extension.name!], ); } else { @@ -689,7 +688,7 @@ class PropertyElementResolver with ScopeHelpers { if (writeElement == null) { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, + CompileTimeErrorCode.undefinedExtensionSetter, arguments: [memberName, extension.name!], ); } else { @@ -719,7 +718,7 @@ class PropertyElementResolver with ScopeHelpers { // Report this error and recover by treating it like a non-cascade. diagnosticReporter.atToken( target.name, - CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE, + CompileTimeErrorCode.extensionOverrideWithCascade, ); } @@ -738,7 +737,7 @@ class PropertyElementResolver with ScopeHelpers { // assume that `element.name` is non-`null`. diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, + CompileTimeErrorCode.undefinedExtensionGetter, arguments: [memberName, element.name!], ); } else { @@ -756,7 +755,7 @@ class PropertyElementResolver with ScopeHelpers { // assume that `element.name` is non-`null`. diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, + CompileTimeErrorCode.undefinedExtensionSetter, arguments: [memberName, element.name!], ); } @@ -810,14 +809,14 @@ class PropertyElementResolver with ScopeHelpers { // context type. diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_GETTER, + CompileTimeErrorCode.dotShorthandUndefinedGetter, arguments: [propertyName.name, typeReference.name!], ); } else { var code = typeReference is EnumElement - ? CompileTimeErrorCode.UNDEFINED_ENUM_CONSTANT - : CompileTimeErrorCode.UNDEFINED_GETTER; + ? CompileTimeErrorCode.undefinedEnumConstant + : CompileTimeErrorCode.undefinedGetter; diagnosticReporter.atNode( propertyName, code, @@ -835,7 +834,7 @@ class PropertyElementResolver with ScopeHelpers { if (!_isAccessible(writeElement)) { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.PRIVATE_SETTER, + CompileTimeErrorCode.privateSetter, arguments: [propertyName.name], ); } @@ -894,7 +893,7 @@ class PropertyElementResolver with ScopeHelpers { )) { diagnosticReporter.atNode( identifier, - CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, + CompileTimeErrorCode.undefinedPrefixedName, arguments: [identifier.name, target.name!], ); } @@ -945,13 +944,13 @@ class PropertyElementResolver with ScopeHelpers { if (readElement != null) { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, + CompileTimeErrorCode.abstractSuperMemberReference, arguments: [readElement.kind.displayName, propertyName.name], ); } else { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, + CompileTimeErrorCode.undefinedSuperGetter, arguments: [propertyName.name, targetType], ); } @@ -993,13 +992,13 @@ class PropertyElementResolver with ScopeHelpers { if (writeElement != null) { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, + CompileTimeErrorCode.abstractSuperMemberReference, arguments: [writeElement.kind.displayName, propertyName.name], ); } else { diagnosticReporter.atNode( propertyName, - CompileTimeErrorCode.UNDEFINED_SUPER_SETTER, + CompileTimeErrorCode.undefinedSuperSetter, arguments: [propertyName.name, targetType], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/record_literal_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/record_literal_resolver.dart index ce5e46f697d..25851907bbc 100644 --- a/pkg/analyzer/lib/src/dart/resolver/record_literal_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/record_literal_resolver.dart @@ -113,7 +113,7 @@ class RecordLiteralResolver { if (name.startsWith('_')) { _diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, + CompileTimeErrorCode.invalidFieldNamePrivate, ); } else { var index = RecordTypeExtension.positionalFieldIndex(name); @@ -121,13 +121,13 @@ class RecordLiteralResolver { if (index < positionalCount) { _diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.INVALID_FIELD_NAME_POSITIONAL, + CompileTimeErrorCode.invalidFieldNamePositional, ); } } else if (isForbiddenNameForRecordField(name)) { _diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, + CompileTimeErrorCode.invalidFieldNameFromObject, ); } } @@ -157,10 +157,7 @@ class RecordLiteralResolver { } if (staticType is VoidType) { - _diagnosticReporter.atNode( - field, - CompileTimeErrorCode.USE_OF_VOID_RESULT, - ); + _diagnosticReporter.atNode(field, CompileTimeErrorCode.useOfVoidResult); } return staticType; diff --git a/pkg/analyzer/lib/src/dart/resolver/record_type_annotation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/record_type_annotation_resolver.dart index 468504918f7..2acaedd8c92 100644 --- a/pkg/analyzer/lib/src/dart/resolver/record_type_annotation_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/record_type_annotation_resolver.dart @@ -74,7 +74,7 @@ class RecordTypeAnnotationResolver { if (!isPositionalWildCard(field, name)) { _diagnosticReporter.atToken( nameToken, - CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, + CompileTimeErrorCode.invalidFieldNamePrivate, ); } } else { @@ -84,7 +84,7 @@ class RecordTypeAnnotationResolver { positionalFields.indexOf(field) != index) { _diagnosticReporter.atToken( nameToken, - CompileTimeErrorCode.INVALID_FIELD_NAME_POSITIONAL, + CompileTimeErrorCode.invalidFieldNamePositional, ); } } else if (RecordLiteralResolver.isForbiddenNameForRecordField( @@ -92,7 +92,7 @@ class RecordTypeAnnotationResolver { )) { _diagnosticReporter.atToken( nameToken, - CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, + CompileTimeErrorCode.invalidFieldNameFromObject, ); } } diff --git a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart index caa14966022..e5b7f1ca728 100644 --- a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart +++ b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart @@ -198,14 +198,14 @@ class ResolutionVisitor extends RecursiveAstVisitor { if (element == null) { _diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER, + CompileTimeErrorCode.undefinedIdentifier, arguments: [name], ); } else if (!(element is LocalVariableElement || element is FormalParameterElement)) { _diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, + CompileTimeErrorCode.patternAssignmentNotLocalVariable, ); } } @@ -998,7 +998,7 @@ class ResolutionVisitor extends RecursiveAstVisitor { // parser thinks this could be an InstanceCreationExpression. _diagnosticReporter.atNode( node, - WarningCode.SDK_VERSION_CONSTRUCTOR_TEAROFFS, + WarningCode.sdkVersionConstructorTearoffs, ); } return newNode.accept(this); @@ -1749,22 +1749,22 @@ class ResolutionVisitor extends RecursiveAstVisitor { switch (clause) { case null: if (declaration is ClassTypeAlias) { - diagnosticCode = CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS; + diagnosticCode = CompileTimeErrorCode.mixinWithNonClassSuperclass; } case ExtendsClause(): if (declaration is ClassDeclaration) { diagnosticCode = declaration.withClause == null - ? CompileTimeErrorCode.EXTENDS_NON_CLASS - : CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS; + ? CompileTimeErrorCode.extendsNonClass + : CompileTimeErrorCode.mixinWithNonClassSuperclass; } case ImplementsClause(): - diagnosticCode = CompileTimeErrorCode.IMPLEMENTS_NON_CLASS; + diagnosticCode = CompileTimeErrorCode.implementsNonClass; case MixinOnClause(): diagnosticCode = - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE; + CompileTimeErrorCode.mixinSuperClassConstraintNonInterface; case WithClause(): - diagnosticCode = CompileTimeErrorCode.MIXIN_OF_NON_CLASS; + diagnosticCode = CompileTimeErrorCode.mixinOfNonClass; } // Should not happen. @@ -1856,7 +1856,7 @@ class ResolutionVisitor extends RecursiveAstVisitor { if (!typeSystem.isValidExtensionTypeSuperinterface(type)) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, arguments: [type], ); return; @@ -1879,7 +1879,7 @@ class ResolutionVisitor extends RecursiveAstVisitor { _diagnosticReporter.atNode( node, CompileTimeErrorCode - .EXTENSION_TYPE_IMPLEMENTS_REPRESENTATION_NOT_SUPERTYPE, + .extensionTypeImplementsRepresentationNotSupertype, arguments: [ implementedRepresentation, type.element.name ?? '', @@ -1894,7 +1894,7 @@ class ResolutionVisitor extends RecursiveAstVisitor { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_NOT_SUPERTYPE, + CompileTimeErrorCode.extensionTypeImplementsNotSupertype, arguments: [type, declaredRepresentation], ); } @@ -2043,7 +2043,7 @@ class _VariableBinderErrors visitor._diagnosticReporter.reportError( DiagnosticFactory().duplicateDefinitionForNodes( visitor._diagnosticReporter.source, - CompileTimeErrorCode.DUPLICATE_VARIABLE_PATTERN, + CompileTimeErrorCode.duplicateVariablePattern, duplicate.node.name, original.node.name, [name], @@ -2061,7 +2061,7 @@ class _VariableBinderErrors }) { visitor._diagnosticReporter.atNode( hasInLeft ? node.rightOperand : node.leftOperand, - CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, + CompileTimeErrorCode.missingVariablePattern, arguments: [name], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart b/pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart index c5adf5010f9..f91df748707 100644 --- a/pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart +++ b/pkg/analyzer/lib/src/dart/resolver/shared_type_analyzer.dart @@ -44,8 +44,7 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atNode( caseExpression, - CompileTimeErrorCode - .CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE, + CompileTimeErrorCode.caseExpressionTypeIsNotSwitchExpressionSubtype, arguments: [caseExpressionType, scrutineeType], ); } @@ -103,7 +102,7 @@ class SharedTypeAnalyzerErrors @override void emptyMapPattern({required DartPattern pattern}) { - _diagnosticReporter.atNode(pattern, CompileTimeErrorCode.EMPTY_MAP_PATTERN); + _diagnosticReporter.atNode(pattern, CompileTimeErrorCode.emptyMapPattern); } @override @@ -113,7 +112,7 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atElement2( component, - CompileTimeErrorCode.INCONSISTENT_PATTERN_VARIABLE_LOGICAL_OR, + CompileTimeErrorCode.inconsistentPatternVariableLogicalOr, arguments: [variable.name!], ); } @@ -126,12 +125,12 @@ class SharedTypeAnalyzerErrors if (pattern is NullAssertPattern) { _diagnosticReporter.atToken( pattern.operator, - StaticWarningCode.UNNECESSARY_NULL_ASSERT_PATTERN, + StaticWarningCode.unnecessaryNullAssertPattern, ); } else if (pattern is NullCheckPattern) { _diagnosticReporter.atToken( pattern.operator, - StaticWarningCode.UNNECESSARY_NULL_CHECK_PATTERN, + StaticWarningCode.unnecessaryNullCheckPattern, ); } else { throw UnimplementedError('(${pattern.runtimeType}) $pattern'); @@ -146,13 +145,13 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atToken( pattern.asToken, - WarningCode.UNNECESSARY_CAST_PATTERN, + WarningCode.unnecessaryCastPattern, ); } @override void nonBooleanCondition({required Expression node}) { - _diagnosticReporter.atNode(node, CompileTimeErrorCode.NON_BOOL_CONDITION); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.nonBoolCondition); } @override @@ -163,7 +162,7 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, + CompileTimeErrorCode.forInOfInvalidType, arguments: [expressionType, 'Iterable'], ); } @@ -177,7 +176,7 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atNode( pattern, - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, arguments: [matchedType, requiredType], ); } @@ -189,7 +188,7 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atNode( pattern, - CompileTimeErrorCode.REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.refutablePatternInIrrefutableContext, ); } @@ -201,7 +200,7 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atNode( pattern.operand, - CompileTimeErrorCode.RELATIONAL_PATTERN_OPERAND_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.relationalPatternOperandTypeNotAssignable, arguments: [operandType, parameterType, pattern.operator.lexeme], ); } @@ -214,7 +213,7 @@ class SharedTypeAnalyzerErrors _diagnosticReporter.atToken( pattern.operator, CompileTimeErrorCode - .RELATIONAL_PATTERN_OPERATOR_RETURN_TYPE_NOT_ASSIGNABLE_TO_BOOL, + .relationalPatternOperatorReturnTypeNotAssignableToBool, ); } @@ -225,7 +224,7 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atNode( element, - CompileTimeErrorCode.REST_ELEMENT_IN_MAP_PATTERN, + CompileTimeErrorCode.restElementInMapPattern, ); } @@ -236,7 +235,7 @@ class SharedTypeAnalyzerErrors }) { _diagnosticReporter.atToken( node.members[caseIndex].keyword, - CompileTimeErrorCode.SWITCH_CASE_COMPLETES_NORMALLY, + CompileTimeErrorCode.switchCaseCompletesNormally, ); } @@ -249,7 +248,7 @@ class SharedTypeAnalyzerErrors case UnnecessaryWildcardKind.logicalAndPatternOperand: _diagnosticReporter.atNode( pattern, - WarningCode.UNNECESSARY_WILDCARD_PATTERN, + WarningCode.unnecessaryWildcardPattern, ); } } diff --git a/pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart index a695dc0de00..da38ffdf5ae 100644 --- a/pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart @@ -198,7 +198,7 @@ class SimpleIdentifierResolver with ScopeHelpers { !identical(element, enclosingClass)) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS, + CompileTimeErrorCode.invalidFactoryNameNotAClass, ); } else if (_isConstructorReturnType(node) && !identical(element, enclosingClass)) { @@ -208,7 +208,7 @@ class SimpleIdentifierResolver with ScopeHelpers { if (element.name case var name?) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, + CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, arguments: [name], ); } @@ -217,14 +217,14 @@ class SimpleIdentifierResolver with ScopeHelpers { if (node.name == "await" && _resolver.enclosingFunction != null) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT, + CompileTimeErrorCode.undefinedIdentifierAwait, ); } else if (!_resolver.libraryFragment.shouldIgnoreUndefinedIdentifier( node, )) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER, + CompileTimeErrorCode.undefinedIdentifier, arguments: [node.name], ); } @@ -334,7 +334,7 @@ class SimpleIdentifierResolver with ScopeHelpers { _resolver.diagnosticReporter.atNode( node, - CompileTimeErrorCode.EXTENSION_AS_EXPRESSION, + CompileTimeErrorCode.extensionAsExpression, arguments: [node.name], ); 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 56d6f6e560e..7c7b2276d48 100644 --- a/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart @@ -127,7 +127,7 @@ class TypePropertyResolver { CompileTimeErrorCode errorCode; List arguments; if (parentNode == null) { - errorCode = CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE; + errorCode = CompileTimeErrorCode.uncheckedInvocationOfNullableValue; arguments = []; } else { if (parentNode is CascadeExpression) { @@ -135,22 +135,19 @@ class TypePropertyResolver { } if (parentNode is BinaryExpression || parentNode is RelationalPattern) { errorCode = - CompileTimeErrorCode - .UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE; + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue; arguments = [name]; } else if (parentNode is MethodInvocation || parentNode is MethodReferenceExpression) { errorCode = - CompileTimeErrorCode - .UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE; + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue; arguments = [name]; } else if (parentNode is FunctionExpressionInvocation) { - errorCode = - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE; + errorCode = CompileTimeErrorCode.uncheckedInvocationOfNullableValue; arguments = []; } else { errorCode = - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE; + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue; arguments = [name]; } } 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 fea364a355c..3ee0b7c93aa 100644 --- a/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart @@ -519,7 +519,7 @@ class TypedLiteralResolver { // as the types of those elements are considered resolved. _diagnosticReporter.atNode( node, - WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, + WarningCode.inferenceFailureOnCollectionLiteral, arguments: ['List'], ); } @@ -636,12 +636,12 @@ class TypedLiteralResolver { if (mustBeAMap && mustBeASet) { _diagnosticReporter.atNode( literal, - CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH, + CompileTimeErrorCode.ambiguousSetOrMapLiteralBoth, ); } else { _diagnosticReporter.atNode( literal, - CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, + CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, ); } return _typeProvider.dynamicType; @@ -790,7 +790,7 @@ class TypedLiteralResolver { // as the types of those elements are considered resolved. _diagnosticReporter.atNode( node, - WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, + WarningCode.inferenceFailureOnCollectionLiteral, arguments: [node.isMap ? 'Map' : 'Set'], ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/variable_declaration_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/variable_declaration_resolver.dart index b7a5d8800f1..cd116324f75 100644 --- a/pkg/analyzer/lib/src/dart/resolver/variable_declaration_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/variable_declaration_resolver.dart @@ -31,7 +31,7 @@ class VariableDeclarationResolver { if (_strictInference && parent.type == null) { _resolver.diagnosticReporter.atNode( node, - WarningCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE, + WarningCode.inferenceFailureOnUninitializedVariable, arguments: [node.name.lexeme], ); } @@ -85,7 +85,7 @@ class VariableDeclarationResolver { initializer, initializerType, element.type, - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, whyNotPromoted: whyNotPromoted, ); } diff --git a/pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart index da1c8f5a820..f359808869c 100644 --- a/pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart +++ b/pkg/analyzer/lib/src/dart/resolver/yield_statement_resolver.dart @@ -40,7 +40,7 @@ class YieldStatementResolver { /// it returns 'void'. Or, in rare cases, when other types of expressions are /// void, such as identifiers. /// - /// See [CompileTimeErrorCode.USE_OF_VOID_RESULT]. + /// See [CompileTimeErrorCode.useOfVoidResult]. /// // TODO(scheglov): This is duplicate // TODO(scheglov): Also in [BoolExpressionVerifier] @@ -52,12 +52,12 @@ class YieldStatementResolver { if (expression is MethodInvocation) { _diagnosticReporter.atNode( expression.methodName, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } else { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } @@ -95,7 +95,7 @@ class YieldStatementResolver { )) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, + CompileTimeErrorCode.yieldEachOfInvalidType, arguments: [impliedReturnType, imposedReturnType], ); return; @@ -115,7 +115,7 @@ class YieldStatementResolver { )) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, + CompileTimeErrorCode.yieldOfInvalidType, arguments: [expressionType, imposedValueType], ); return; @@ -142,7 +142,7 @@ class YieldStatementResolver { )) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, + CompileTimeErrorCode.yieldEachOfInvalidType, arguments: [impliedReturnType, requiredReturnType], ); } @@ -180,7 +180,7 @@ class YieldStatementResolver { if (node.star != null) { _resolver.nullableDereferenceVerifier.expression( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH, + CompileTimeErrorCode.uncheckedUseOfNullableValueInYieldEach, node.expression, ); } @@ -205,8 +205,8 @@ class YieldStatementResolver { _diagnosticReporter.atNode( node, node.star != null - ? CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR - : CompileTimeErrorCode.YIELD_IN_NON_GENERATOR, + ? CompileTimeErrorCode.yieldEachInNonGenerator + : CompileTimeErrorCode.yieldInNonGenerator, ); _checkForUseOfVoidResult(node.expression); diff --git a/pkg/analyzer/lib/src/dart/scanner/scanner.dart b/pkg/analyzer/lib/src/dart/scanner/scanner.dart index 8dbeebef90d..0513850dfa8 100644 --- a/pkg/analyzer/lib/src/dart/scanner/scanner.dart +++ b/pkg/analyzer/lib/src/dart/scanner/scanner.dart @@ -206,7 +206,7 @@ class Scanner { source: source, offset: versionToken.offset, length: versionToken.length, - diagnosticCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER, + diagnosticCode: WarningCode.invalidLanguageVersionOverrideGreater, arguments: [latestVersion.major, latestVersion.minor], ), ); diff --git a/pkg/analyzer/lib/src/diagnostic/diagnostic_code_values.g.dart b/pkg/analyzer/lib/src/diagnostic/diagnostic_code_values.g.dart index 5a2222bb366..2c8e933ed94 100644 --- a/pkg/analyzer/lib/src/diagnostic/diagnostic_code_values.g.dart +++ b/pkg/analyzer/lib/src/diagnostic/diagnostic_code_values.g.dart @@ -25,1111 +25,1105 @@ import 'package:analyzer/src/pubspec/pubspec_warning_code.dart'; @AnalyzerPublicApi(message: 'exported by lib/error/error.dart') const List diagnosticCodeValues = [ - AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR, - AnalysisOptionsErrorCode.PARSE_ERROR, - AnalysisOptionsWarningCode.ANALYSIS_OPTION_DEPRECATED, - AnalysisOptionsWarningCode.ANALYSIS_OPTION_DEPRECATED_WITH_REPLACEMENT, - AnalysisOptionsWarningCode.DEPRECATED_LINT, - AnalysisOptionsWarningCode.DEPRECATED_LINT_WITH_REPLACEMENT, - AnalysisOptionsWarningCode.DUPLICATE_RULE, - AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING, - AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND, - AnalysisOptionsWarningCode.INCOMPATIBLE_LINT, - AnalysisOptionsWarningCode.INVALID_OPTION, - AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT, - AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, - AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, - AnalysisOptionsWarningCode.REMOVED_LINT, - AnalysisOptionsWarningCode.REPLACED_LINT, - AnalysisOptionsWarningCode.UNDEFINED_LINT, - AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES, - AnalysisOptionsWarningCode.UNSUPPORTED_VALUE, - CompileTimeErrorCode.ABSTRACT_FIELD_CONSTRUCTOR_INITIALIZER, - CompileTimeErrorCode.ABSTRACT_FIELD_INITIALIZER, - CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, - CompileTimeErrorCode.AMBIGUOUS_EXPORT, - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_THREE_OR_MORE, - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - CompileTimeErrorCode.AMBIGUOUS_IMPORT, - CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH, - CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, - CompileTimeErrorCode.ASSERT_IN_REDIRECTING_CONSTRUCTOR, - CompileTimeErrorCode.ASSIGNMENT_TO_CONST, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, - CompileTimeErrorCode.ASSIGNMENT_TO_FUNCTION, - CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, - CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, - CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT, - CompileTimeErrorCode.AUGMENTATION_EXTENDS_CLAUSE_ALREADY_PRESENT, - CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, - CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, - CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_BOUND, - CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, - CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_NAME, - CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, - CompileTimeErrorCode.AUGMENTED_EXPRESSION_IS_NOT_SETTER, - CompileTimeErrorCode.AUGMENTED_EXPRESSION_IS_SETTER, - CompileTimeErrorCode.AUGMENTED_EXPRESSION_NOT_OPERATOR, - CompileTimeErrorCode.AWAIT_IN_LATE_LOCAL_VARIABLE_INITIALIZER, - CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, - CompileTimeErrorCode.AWAIT_OF_INCOMPATIBLE_TYPE, - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, - CompileTimeErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_NAME, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_TYPE_NAME, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_PREFIX_NAME, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, - CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, - CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE, - CompileTimeErrorCode.CAST_TO_NON_TYPE, - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_INSTANCE_MEMBER, - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_STATIC_MEMBER, - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_UNKNOWN_MEMBER, - CompileTimeErrorCode.CLASS_USED_AS_MIXIN, - CompileTimeErrorCode.CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE, - CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD, - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_GETTER, - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD, - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_SETTER, - CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, - CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, - CompileTimeErrorCode.CONFLICTING_INHERITED_METHOD_AND_SETTER, - CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, - CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_ENUM, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION_TYPE, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_ENUM, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION_TYPE, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_MIXIN, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MIXIN, - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, - CompileTimeErrorCode.CONST_CONSTRUCTOR_CONSTANT_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELDS, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, - CompileTimeErrorCode.CONST_DEFERRED_CLASS, - CompileTimeErrorCode.CONST_EVAL_ASSERTION_FAILURE, - CompileTimeErrorCode.CONST_EVAL_ASSERTION_FAILURE_WITH_MESSAGE, - CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, - CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, - CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, - CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, - CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, - CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, - CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE, - CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, - CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT, - CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, - CompileTimeErrorCode.CONST_EVAL_TYPE_INT, - CompileTimeErrorCode.CONST_EVAL_TYPE_NUM, - CompileTimeErrorCode.CONST_EVAL_TYPE_NUM_STRING, - CompileTimeErrorCode.CONST_EVAL_TYPE_STRING, - CompileTimeErrorCode.CONST_EVAL_TYPE_TYPE, - CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - CompileTimeErrorCode - .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.CONST_INSTANCE_FIELD, - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, - CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, - CompileTimeErrorCode.CONST_TYPE_PARAMETER, - CompileTimeErrorCode.CONST_WITH_NON_CONST, - CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, - CompileTimeErrorCode.CONST_WITH_NON_TYPE, - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF, - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, - CompileTimeErrorCode.CONTINUE_LABEL_INVALID, - CompileTimeErrorCode.COULD_NOT_INFER, - CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR, - CompileTimeErrorCode.DEFAULT_VALUE_ON_REQUIRED_PARAMETER, - CompileTimeErrorCode.DEFERRED_IMPORT_OF_EXTENSION, - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, - CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_GETTER, - CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, - CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, - CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, - CompileTimeErrorCode.DUPLICATE_DEFINITION, - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, - CompileTimeErrorCode.DUPLICATE_FIELD_NAME, - CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, - CompileTimeErrorCode.DUPLICATE_PART, - CompileTimeErrorCode.DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE, - CompileTimeErrorCode.DUPLICATE_PATTERN_FIELD, - CompileTimeErrorCode.DUPLICATE_REST_ELEMENT_IN_PATTERN, - CompileTimeErrorCode.DUPLICATE_VARIABLE_PATTERN, - CompileTimeErrorCode.EMPTY_MAP_PATTERN, - CompileTimeErrorCode.ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR, - CompileTimeErrorCode.ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING, - CompileTimeErrorCode.ENUM_INSTANTIATED_TO_BOUNDS_IS_NOT_WELL_BOUNDED, - CompileTimeErrorCode.ENUM_MIXIN_WITH_INSTANCE_VARIABLE, - CompileTimeErrorCode.ENUM_WITHOUT_CONSTANTS, - CompileTimeErrorCode.ENUM_WITH_ABSTRACT_MEMBER, - CompileTimeErrorCode.ENUM_WITH_NAME_VALUES, - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, - CompileTimeErrorCode.EXPECTED_ONE_LIST_PATTERN_TYPE_ARGUMENTS, - CompileTimeErrorCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, - CompileTimeErrorCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS, - CompileTimeErrorCode.EXPECTED_TWO_MAP_PATTERN_TYPE_ARGUMENTS, - CompileTimeErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, - CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY, - CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, - CompileTimeErrorCode.EXPRESSION_IN_MAP, - CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS, - CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, - CompileTimeErrorCode.EXTENDS_NON_CLASS, - CompileTimeErrorCode.EXTENDS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, - CompileTimeErrorCode.EXTENSION_AS_EXPRESSION, - CompileTimeErrorCode.EXTENSION_CONFLICTING_STATIC_AND_INSTANCE, - CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, - CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, - CompileTimeErrorCode.EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE, - CompileTimeErrorCode.EXTENSION_OVERRIDE_WITHOUT_ACCESS, - CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE, - CompileTimeErrorCode.EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_FORMAL_PARAMETER, - CompileTimeErrorCode.EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION, - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_ITSELF, - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_NOT_SUPERTYPE, - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_REPRESENTATION_NOT_SUPERTYPE, - CompileTimeErrorCode.EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT, - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF, - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_TYPE_BOTTOM, - CompileTimeErrorCode.EXTENSION_TYPE_WITH_ABSTRACT_MEMBER, - CompileTimeErrorCode.EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER, - CompileTimeErrorCode.EXTERNAL_FIELD_INITIALIZER, - CompileTimeErrorCode.EXTERNAL_VARIABLE_INITIALIZER, - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, - CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, - CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, - CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, - CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, - CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, - CompileTimeErrorCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - CompileTimeErrorCode.FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, - CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS, - CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, - CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, - CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE, - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND, - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, - CompileTimeErrorCode.GENERIC_METHOD_TYPE_INSTANTIATION_ON_DYNAMIC, - CompileTimeErrorCode.GETTER_NOT_ASSIGNABLE_SETTER_TYPES, - CompileTimeErrorCode.GETTER_NOT_SUBTYPE_SETTER_TYPES, - CompileTimeErrorCode.IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, - CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, - CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, - CompileTimeErrorCode.ILLEGAL_LANGUAGE_VERSION_OVERRIDE, - CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, - CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, - CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, - CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, - CompileTimeErrorCode.IMPLEMENTS_REPEATED, - CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, - CompileTimeErrorCode.IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, - CompileTimeErrorCode.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS, - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, - CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, - CompileTimeErrorCode.INCONSISTENT_CASE_EXPRESSION_TYPES, - CompileTimeErrorCode.INCONSISTENT_INHERITANCE, - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, - CompileTimeErrorCode.INCONSISTENT_LANGUAGE_VERSION_OVERRIDE, - CompileTimeErrorCode.INCONSISTENT_PATTERN_VARIABLE_LOGICAL_OR, - CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, - CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER_OF_UNNAMED_EXTENSION, - CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, - CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, - CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, - CompileTimeErrorCode.INSTANTIATE_ENUM, - CompileTimeErrorCode.INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, - CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE, - CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE, - CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - CompileTimeErrorCode.INVALID_ANNOTATION, - CompileTimeErrorCode.INVALID_ANNOTATION_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.INVALID_ASSIGNMENT, - CompileTimeErrorCode.INVALID_CAST_FUNCTION, - CompileTimeErrorCode.INVALID_CAST_FUNCTION_EXPR, - CompileTimeErrorCode.INVALID_CAST_LITERAL, - CompileTimeErrorCode.INVALID_CAST_LITERAL_LIST, - CompileTimeErrorCode.INVALID_CAST_LITERAL_MAP, - CompileTimeErrorCode.INVALID_CAST_LITERAL_SET, - CompileTimeErrorCode.INVALID_CAST_METHOD, - CompileTimeErrorCode.INVALID_CAST_NEW_EXPR, - CompileTimeErrorCode.INVALID_CONSTANT, - CompileTimeErrorCode.INVALID_EXTENSION_ARGUMENT_COUNT, - CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS, - CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, - CompileTimeErrorCode.INVALID_FIELD_NAME_POSITIONAL, - CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, - CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, - CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE_SETTER, - CompileTimeErrorCode.INVALID_INLINE_FUNCTION_TYPE, - CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR, - CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER, - CompileTimeErrorCode.INVALID_OVERRIDE, - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, - CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST, - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP, - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_SET, - CompileTimeErrorCode.INVALID_URI, - CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, - CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, - CompileTimeErrorCode.INVOCATION_OF_EXTENSION_WITHOUT_CALL, - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION, - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE, - CompileTimeErrorCode.LABEL_UNDEFINED, - CompileTimeErrorCode.LATE_FINAL_FIELD_WITH_CONST_CONSTRUCTOR, - CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, - CompileTimeErrorCode.MAIN_FIRST_POSITIONAL_PARAMETER_TYPE, - CompileTimeErrorCode.MAIN_HAS_REQUIRED_NAMED_PARAMETERS, - CompileTimeErrorCode.MAIN_HAS_TOO_MANY_REQUIRED_POSITIONAL_PARAMETERS, - CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, - CompileTimeErrorCode.MAP_ENTRY_NOT_IN_MAP, - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE_NULLABILITY, - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE_NULLABILITY, - CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL, - CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL, - CompileTimeErrorCode.MISSING_CONST_IN_SET_LITERAL, - CompileTimeErrorCode.MISSING_DART_LIBRARY, - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_WITH_ANNOTATION, - CompileTimeErrorCode.MISSING_NAMED_PATTERN_FIELD_NAME, - CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, - CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, - CompileTimeErrorCode.MIXINS_SUPER_CLASS, - CompileTimeErrorCode.MIXIN_APPLICATION_CONCRETE_SUPER_INVOKED_MEMBER_TYPE, - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, - CompileTimeErrorCode.MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER, - CompileTimeErrorCode.MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_SETTER, - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, - CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, - CompileTimeErrorCode.MIXIN_DEFERRED_CLASS, - CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, - CompileTimeErrorCode.MIXIN_INSTANTIATE, - CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, - CompileTimeErrorCode.MIXIN_OF_NON_CLASS, - CompileTimeErrorCode.MIXIN_OF_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, - CompileTimeErrorCode.MIXIN_ON_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE, - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE, - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DEFERRED_CLASS, - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS, - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE, - CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS, - CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, - CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS, - CompileTimeErrorCode.NEW_WITH_NON_TYPE, - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, - CompileTimeErrorCode.NON_BOOL_CONDITION, - CompileTimeErrorCode.NON_BOOL_EXPRESSION, - CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, - CompileTimeErrorCode.NON_BOOL_OPERAND, - CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR, - CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION, - CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, - CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.NON_CONSTANT_MAP_ELEMENT, - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.NON_CONSTANT_MAP_PATTERN_KEY, - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD, - CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, - CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, - CompileTimeErrorCode.NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR, - CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, - CompileTimeErrorCode - .NON_COVARIANT_TYPE_PARAMETER_POSITION_IN_REPRESENTATION_TYPE, - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, - CompileTimeErrorCode.NON_FINAL_FIELD_IN_ENUM, - CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, - CompileTimeErrorCode.NON_GENERATIVE_IMPLICIT_CONSTRUCTOR, - CompileTimeErrorCode.NON_SYNC_FACTORY, - CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, - CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE, - CompileTimeErrorCode.NON_VOID_RETURN_FOR_OPERATOR, - CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, - CompileTimeErrorCode.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, - CompileTimeErrorCode.NOT_A_TYPE, - CompileTimeErrorCode.NOT_BINARY_OPERATOR, - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL, - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_PLURAL, - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_SINGULAR, - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, - CompileTimeErrorCode.NOT_ITERABLE_SPREAD, - CompileTimeErrorCode.NOT_MAP_SPREAD, - CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, - CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, - CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT, - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, - CompileTimeErrorCode.NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS, - CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, - CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, - CompileTimeErrorCode.NULLABLE_TYPE_IN_ON_CLAUSE, - CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, - CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS, - CompileTimeErrorCode.OBSOLETE_COLON_FOR_DEFAULT_VALUE, - CompileTimeErrorCode.ON_REPEATED, - CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, - CompileTimeErrorCode.PART_OF_DIFFERENT_LIBRARY, - CompileTimeErrorCode.PART_OF_NON_PART, - CompileTimeErrorCode.PART_OF_UNNAMED_LIBRARY, - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - CompileTimeErrorCode.PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, - CompileTimeErrorCode - .PATTERN_VARIABLE_SHARED_CASE_SCOPE_DIFFERENT_FINALITY_OR_TYPE, - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_HAS_LABEL, - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES, - CompileTimeErrorCode.POSITIONAL_FIELD_IN_OBJECT_PATTERN, - CompileTimeErrorCode - .POSITIONAL_SUPER_FORMAL_PARAMETER_WITH_POSITIONAL_ARGUMENT, - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - CompileTimeErrorCode.PREFIX_SHADOWED_BY_LOCAL_DECLARATION, - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, - CompileTimeErrorCode.PRIVATE_SETTER, - CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, - CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, - CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, - CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, - CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_EXTENDS, - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_IMPLEMENTS, - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_ON, - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_WITH, - CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, - CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR, - CompileTimeErrorCode.REDIRECT_TO_ABSTRACT_CLASS_CONSTRUCTOR, - CompileTimeErrorCode.REDIRECT_TO_INVALID_FUNCTION_TYPE, - CompileTimeErrorCode.REDIRECT_TO_INVALID_RETURN_TYPE, - CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR, - CompileTimeErrorCode.REDIRECT_TO_NON_CLASS, - CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, - CompileTimeErrorCode.REDIRECT_TO_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, - CompileTimeErrorCode.REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT, - CompileTimeErrorCode.RELATIONAL_PATTERN_OPERAND_TYPE_NOT_ASSIGNABLE, - CompileTimeErrorCode - .RELATIONAL_PATTERN_OPERATOR_RETURN_TYPE_NOT_ASSIGNABLE_TO_BOOL, - CompileTimeErrorCode.REST_ELEMENT_IN_MAP_PATTERN, - CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH, - CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, - CompileTimeErrorCode.RETURN_IN_GENERATOR, - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, - CompileTimeErrorCode.RETURN_WITHOUT_VALUE, - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, - CompileTimeErrorCode.SHARED_DEFERRED_PREFIX, - CompileTimeErrorCode.SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY, - CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED, - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED, - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, - CompileTimeErrorCode.SUPER_INITIALIZER_IN_OBJECT, - CompileTimeErrorCode.SUPER_INVOCATION_NOT_LAST, - CompileTimeErrorCode.SUPER_IN_ENUM_CONSTRUCTOR, - CompileTimeErrorCode.SUPER_IN_EXTENSION, - CompileTimeErrorCode.SUPER_IN_EXTENSION_TYPE, - CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, - CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR, - CompileTimeErrorCode.SWITCH_CASE_COMPLETES_NORMALLY, - CompileTimeErrorCode.TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS, - CompileTimeErrorCode.THROW_OF_INVALID_TYPE, - CompileTimeErrorCode.TOP_LEVEL_CYCLE, - CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, - CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, - CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - CompileTimeErrorCode.TYPE_TEST_WITH_NON_TYPE, - CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME, - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE, - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR, - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD, - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH, - CompileTimeErrorCode.UNDEFINED_ANNOTATION, - CompileTimeErrorCode.UNDEFINED_CLASS, - CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN, - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, - CompileTimeErrorCode.UNDEFINED_ENUM_CONSTANT, - CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_NAMED, - CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_UNNAMED, - CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, - CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD, - CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, - CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, - CompileTimeErrorCode.UNDEFINED_FUNCTION, - CompileTimeErrorCode.UNDEFINED_GETTER, - CompileTimeErrorCode.UNDEFINED_GETTER_ON_FUNCTION_TYPE, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT, - CompileTimeErrorCode.UNDEFINED_METHOD, - CompileTimeErrorCode.UNDEFINED_METHOD_ON_FUNCTION_TYPE, - CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, - CompileTimeErrorCode.UNDEFINED_OPERATOR, - CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, - CompileTimeErrorCode.UNDEFINED_SETTER, - CompileTimeErrorCode.UNDEFINED_SETTER_ON_FUNCTION_TYPE, - CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, - CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, - CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, - CompileTimeErrorCode.UNDEFINED_SUPER_SETTER, - CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, - CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE, - CompileTimeErrorCode.URI_DOES_NOT_EXIST, - CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, - CompileTimeErrorCode.URI_WITH_INTERPOLATION, - CompileTimeErrorCode.USE_OF_NATIVE_EXTENSION, - CompileTimeErrorCode.USE_OF_VOID_RESULT, - CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, - CompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, - CompileTimeErrorCode.WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, - CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, - CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_ANONYMOUS_FUNCTION, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_DOT_SHORTHAND_CONSTRUCTOR, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_ENUM, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_POSITION, - CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR, - CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, - CompileTimeErrorCode.YIELD_IN_NON_GENERATOR, - CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, - FfiCode.ABI_SPECIFIC_INTEGER_INVALID, - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_EXTRA, - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_MISSING, - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED, - FfiCode.ADDRESS_POSITION, - FfiCode.ADDRESS_RECEIVER, - FfiCode.ANNOTATION_ON_POINTER_FIELD, - FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, - FfiCode.ARGUMENT_MUST_BE_NATIVE, - FfiCode.COMPOUND_IMPLEMENTS_FINALIZABLE, - FfiCode.CREATION_OF_STRUCT_OR_UNION, - FfiCode.EMPTY_STRUCT, - FfiCode.EXTRA_ANNOTATION_ON_STRUCT_FIELD, - FfiCode.EXTRA_SIZE_ANNOTATION_CARRAY, - FfiCode.FFI_NATIVE_INVALID_DUPLICATE_DEFAULT_ASSET, - FfiCode.FFI_NATIVE_INVALID_MULTIPLE_ANNOTATIONS, - FfiCode.FFI_NATIVE_MUST_BE_EXTERNAL, - FfiCode - .FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER, - FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS, - FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER, - FfiCode.FIELD_MUST_BE_EXTERNAL_IN_STRUCT, - FfiCode.GENERIC_STRUCT_SUBCLASS, - FfiCode.INVALID_EXCEPTION_VALUE, - FfiCode.INVALID_FIELD_TYPE_IN_STRUCT, - FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, - FfiCode.LEAF_CALL_MUST_NOT_TAKE_HANDLE, - FfiCode.MISMATCHED_ANNOTATION_ON_STRUCT_FIELD, - FfiCode.MISSING_ANNOTATION_ON_STRUCT_FIELD, - FfiCode.MISSING_EXCEPTION_VALUE, - FfiCode.MISSING_FIELD_TYPE_IN_STRUCT, - FfiCode.MISSING_SIZE_ANNOTATION_CARRAY, - FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, - FfiCode.MUST_BE_A_SUBTYPE, - FfiCode.MUST_RETURN_VOID, - FfiCode.NATIVE_FIELD_INVALID_TYPE, - FfiCode.NATIVE_FIELD_MISSING_TYPE, - FfiCode.NATIVE_FIELD_NOT_STATIC, - FfiCode.NATIVE_FUNCTION_MISSING_TYPE, - FfiCode.NEGATIVE_VARIABLE_DIMENSION, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, - FfiCode.NON_NATIVE_FUNCTION_TYPE_ARGUMENT_TO_POINTER, - FfiCode.NON_POSITIVE_ARRAY_DIMENSION, - FfiCode.NON_SIZED_TYPE_ARGUMENT, - FfiCode.PACKED_ANNOTATION, - FfiCode.PACKED_ANNOTATION_ALIGNMENT, - FfiCode.SIZE_ANNOTATION_DIMENSIONS, - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS, - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS, - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH, - FfiCode.VARIABLE_LENGTH_ARRAY_NOT_LAST, - HintCode.DEPRECATED_COLON_FOR_DEFAULT_VALUE, - HintCode.DEPRECATED_MEMBER_USE, - HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE, - HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE, - HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE, - HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION, - HintCode.UNNECESSARY_IMPORT, - ManifestWarningCode.CAMERA_PERMISSIONS_INCOMPATIBLE, - ManifestWarningCode.NON_RESIZABLE_ACTIVITY, - ManifestWarningCode.NO_TOUCHSCREEN_FEATURE, - ManifestWarningCode.PERMISSION_IMPLIES_UNSUPPORTED_HARDWARE, - ManifestWarningCode.SETTING_ORIENTATION_ON_ACTIVITY, - ManifestWarningCode.UNSUPPORTED_CHROME_OS_FEATURE, - ManifestWarningCode.UNSUPPORTED_CHROME_OS_HARDWARE, - ParserErrorCode.ABSTRACT_CLASS_MEMBER, - ParserErrorCode.ABSTRACT_EXTERNAL_FIELD, - ParserErrorCode.ABSTRACT_FINAL_BASE_CLASS, - ParserErrorCode.ABSTRACT_FINAL_INTERFACE_CLASS, - ParserErrorCode.ABSTRACT_LATE_FIELD, - ParserErrorCode.ABSTRACT_SEALED_CLASS, - ParserErrorCode.ABSTRACT_STATIC_FIELD, - ParserErrorCode.ABSTRACT_STATIC_METHOD, - ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, - ParserErrorCode.ANNOTATION_SPACE_BEFORE_PARENTHESIS, - ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS, - ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED, - ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, - ParserErrorCode.BASE_ENUM, - ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, - ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.CATCH_SYNTAX_EXTRA_PARAMETERS, - ParserErrorCode.CLASS_IN_CLASS, - ParserErrorCode.COLON_IN_PLACE_OF_IN, - ParserErrorCode.CONFLICTING_MODIFIERS, - ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, - ParserErrorCode.CONSTRUCTOR_WITH_TYPE_ARGUMENTS, - ParserErrorCode.CONST_AND_FINAL, - ParserErrorCode.CONST_CLASS, - ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, - ParserErrorCode.CONST_FACTORY, - ParserErrorCode.CONST_METHOD, - ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, - ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, - ParserErrorCode.COVARIANT_AND_STATIC, - ParserErrorCode.COVARIANT_CONSTRUCTOR, - ParserErrorCode.COVARIANT_MEMBER, - ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION, - ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, - ParserErrorCode.DEFERRED_AFTER_PREFIX, - ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, - ParserErrorCode.DUPLICATED_MODIFIER, - ParserErrorCode.DUPLICATE_DEFERRED, - ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT, - ParserErrorCode.DUPLICATE_PREFIX, - ParserErrorCode.EMPTY_ENUM_BODY, - ParserErrorCode.EMPTY_RECORD_LITERAL_WITH_COMMA, - ParserErrorCode.EMPTY_RECORD_TYPE_NAMED_FIELDS_LIST, - ParserErrorCode.EMPTY_RECORD_TYPE_WITH_COMMA, - ParserErrorCode.ENUM_IN_CLASS, - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, - ParserErrorCode.EXPECTED_CASE_OR_DEFAULT, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ParserErrorCode.EXPECTED_CLASS_BODY, - ParserErrorCode.EXPECTED_CLASS_MEMBER, - ParserErrorCode.EXPECTED_ELSE_OR_COMMA, - ParserErrorCode.EXPECTED_EXECUTABLE, - ParserErrorCode.EXPECTED_EXTENSION_BODY, - ParserErrorCode.EXPECTED_EXTENSION_TYPE_BODY, - ParserErrorCode.EXPECTED_FINALLY_CLAUSE_BODY, - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, - ParserErrorCode.EXPECTED_INSTEAD, - ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL, - ParserErrorCode.EXPECTED_MIXIN_BODY, - ParserErrorCode.EXPECTED_NAMED_TYPE_EXTENDS, - ParserErrorCode.EXPECTED_NAMED_TYPE_IMPLEMENTS, - ParserErrorCode.EXPECTED_NAMED_TYPE_ON, - ParserErrorCode.EXPECTED_NAMED_TYPE_WITH, - ParserErrorCode.EXPECTED_REPRESENTATION_FIELD, - ParserErrorCode.EXPECTED_REPRESENTATION_TYPE, - ParserErrorCode.EXPECTED_STRING_LITERAL, - ParserErrorCode.EXPECTED_SWITCH_EXPRESSION_BODY, - ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TRY_STATEMENT_BODY, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, - ParserErrorCode.EXTENSION_AUGMENTATION_HAS_ON_CLAUSE, - ParserErrorCode.EXTENSION_DECLARES_ABSTRACT_MEMBER, - ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR, - ParserErrorCode.EXTENSION_TYPE_EXTENDS, - ParserErrorCode.EXTENSION_TYPE_WITH, - ParserErrorCode.EXTERNAL_CLASS, - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS, - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_INITIALIZER, - ParserErrorCode.EXTERNAL_ENUM, - ParserErrorCode.EXTERNAL_FACTORY_REDIRECTION, - ParserErrorCode.EXTERNAL_FACTORY_WITH_BODY, - ParserErrorCode.EXTERNAL_FIELD, - ParserErrorCode.EXTERNAL_GETTER_WITH_BODY, - ParserErrorCode.EXTERNAL_LATE_FIELD, - ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, - ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY, - ParserErrorCode.EXTERNAL_SETTER_WITH_BODY, - ParserErrorCode.EXTERNAL_TYPEDEF, - ParserErrorCode.EXTRANEOUS_MODIFIER, - ParserErrorCode.EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE, - ParserErrorCode.EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR, - ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, - ParserErrorCode.FACTORY_WITHOUT_BODY, - ParserErrorCode.FACTORY_WITH_INITIALIZERS, - ParserErrorCode.FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS, - ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - ParserErrorCode.FINAL_AND_COVARIANT, - ParserErrorCode.FINAL_AND_COVARIANT_LATE_WITH_INITIALIZER, - ParserErrorCode.FINAL_AND_VAR, - ParserErrorCode.FINAL_CONSTRUCTOR, - ParserErrorCode.FINAL_ENUM, - ParserErrorCode.FINAL_METHOD, - ParserErrorCode.FINAL_MIXIN, - ParserErrorCode.FINAL_MIXIN_CLASS, - ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, - ParserErrorCode.GETTER_CONSTRUCTOR, - ParserErrorCode.GETTER_IN_FUNCTION, - ParserErrorCode.GETTER_WITH_PARAMETERS, - ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, - ParserErrorCode.ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME, - ParserErrorCode.ILLEGAL_PATTERN_IDENTIFIER_NAME, - ParserErrorCode.ILLEGAL_PATTERN_VARIABLE_NAME, - ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, - ParserErrorCode.IMPLEMENTS_BEFORE_ON, - ParserErrorCode.IMPLEMENTS_BEFORE_WITH, - ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, - ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, - ParserErrorCode.INTERFACE_ENUM, - ParserErrorCode.INTERFACE_MIXIN, - ParserErrorCode.INTERFACE_MIXIN_CLASS, - ParserErrorCode.INVALID_AWAIT_IN_FOR, - ParserErrorCode.INVALID_CODE_POINT, - ParserErrorCode.INVALID_COMMENT_REFERENCE, - ParserErrorCode.INVALID_CONSTANT_CONST_PREFIX, - ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY, - ParserErrorCode.INVALID_CONSTANT_PATTERN_DUPLICATE_CONST, - ParserErrorCode.INVALID_CONSTANT_PATTERN_EMPTY_RECORD_LITERAL, - ParserErrorCode.INVALID_CONSTANT_PATTERN_GENERIC, - ParserErrorCode.INVALID_CONSTANT_PATTERN_NEGATION, - ParserErrorCode.INVALID_CONSTANT_PATTERN_UNARY, - ParserErrorCode.INVALID_CONSTRUCTOR_NAME, - ParserErrorCode.INVALID_GENERIC_FUNCTION_TYPE, - ParserErrorCode.INVALID_HEX_ESCAPE, - ParserErrorCode.INVALID_INITIALIZER, - ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, - ParserErrorCode.INVALID_LITERAL_IN_CONFIGURATION, - ParserErrorCode.INVALID_OPERATOR, - ParserErrorCode.INVALID_OPERATOR_FOR_SUPER, - ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER, - ParserErrorCode.INVALID_STAR_AFTER_ASYNC, - ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, - ParserErrorCode.INVALID_SYNC, - ParserErrorCode.INVALID_THIS_IN_INITIALIZER, - ParserErrorCode.INVALID_UNICODE_ESCAPE_STARTED, - ParserErrorCode.INVALID_UNICODE_ESCAPE_U_BRACKET, - ParserErrorCode.INVALID_UNICODE_ESCAPE_U_NO_BRACKET, - ParserErrorCode.INVALID_UNICODE_ESCAPE_U_STARTED, - ParserErrorCode.INVALID_USE_OF_COVARIANT_IN_EXTENSION, - ParserErrorCode.INVALID_USE_OF_IDENTIFIER_AUGMENTED, - ParserErrorCode.LATE_PATTERN_VARIABLE_DECLARATION, - ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, - ParserErrorCode.LITERAL_WITH_CLASS, - ParserErrorCode.LITERAL_WITH_CLASS_AND_NEW, - ParserErrorCode.LITERAL_WITH_NEW, - ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER, - ParserErrorCode.MEMBER_WITH_CLASS_NAME, - ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, - ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, - ParserErrorCode.MISSING_CATCH_OR_FINALLY, - ParserErrorCode.MISSING_CLOSING_PARENTHESIS, - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, - ParserErrorCode.MISSING_ENUM_BODY, - ParserErrorCode.MISSING_EXPRESSION_IN_INITIALIZER, - ParserErrorCode.MISSING_EXPRESSION_IN_THROW, - ParserErrorCode.MISSING_FUNCTION_BODY, - ParserErrorCode.MISSING_FUNCTION_KEYWORD, - ParserErrorCode.MISSING_FUNCTION_PARAMETERS, - ParserErrorCode.MISSING_GET, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_INITIALIZER, - ParserErrorCode.MISSING_KEYWORD_OPERATOR, - ParserErrorCode.MISSING_METHOD_PARAMETERS, - ParserErrorCode.MISSING_NAME_FOR_NAMED_PARAMETER, - ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE, - ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, - ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT, - ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR, - ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR_PARAMETERS, - ParserErrorCode.MISSING_STAR_AFTER_SYNC, - ParserErrorCode.MISSING_STATEMENT, - ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, - ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, - ParserErrorCode.MISSING_VARIABLE_IN_FOR_EACH, - ParserErrorCode.MIXED_PARAMETER_GROUPS, - ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR, - ParserErrorCode.MIXIN_WITH_CLAUSE, - ParserErrorCode.MODIFIER_OUT_OF_ORDER, - ParserErrorCode.MULTIPLE_CLAUSES, - ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, - ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, - ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES, - ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS, - ParserErrorCode.MULTIPLE_ON_CLAUSES, - ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, - ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS, - ParserErrorCode.MULTIPLE_REPRESENTATION_FIELDS, - ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, - ParserErrorCode.MULTIPLE_VARIANCE_MODIFIERS, - ParserErrorCode.MULTIPLE_WITH_CLAUSES, - ParserErrorCode.NAMED_FUNCTION_EXPRESSION, - ParserErrorCode.NAMED_FUNCTION_TYPE, - ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, - ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE, - ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, - ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, - ParserErrorCode.NON_CONSTRUCTOR_FACTORY, - ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME, - ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, - ParserErrorCode.NON_STRING_LITERAL_AS_URI, - ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, - ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS, - ParserErrorCode.NULL_AWARE_CASCADE_OUT_OF_ORDER, - ParserErrorCode.OUT_OF_ORDER_CLAUSES, - ParserErrorCode.PART_OF_NAME, - ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, - ParserErrorCode.PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD, - ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT, - ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, - ParserErrorCode.PREFIX_AFTER_COMBINATOR, - ParserErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, - ParserErrorCode.RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA, - ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY, - ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, - ParserErrorCode.REPRESENTATION_FIELD_MODIFIER, - ParserErrorCode.REPRESENTATION_FIELD_TRAILING_COMMA, - ParserErrorCode.SEALED_ENUM, - ParserErrorCode.SEALED_MIXIN, - ParserErrorCode.SEALED_MIXIN_CLASS, - ParserErrorCode.SETTER_CONSTRUCTOR, - ParserErrorCode.SETTER_IN_FUNCTION, - ParserErrorCode.STACK_OVERFLOW, - ParserErrorCode.STATIC_CONSTRUCTOR, - ParserErrorCode.STATIC_GETTER_WITHOUT_BODY, - ParserErrorCode.STATIC_OPERATOR, - ParserErrorCode.STATIC_SETTER_WITHOUT_BODY, - ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, - ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, - ParserErrorCode.TOP_LEVEL_OPERATOR, - ParserErrorCode.TYPEDEF_IN_CLASS, - ParserErrorCode.TYPE_ARGUMENTS_ON_TYPE_VARIABLE, - ParserErrorCode.TYPE_BEFORE_FACTORY, - ParserErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR, - ParserErrorCode.TYPE_PARAMETER_ON_OPERATOR, - ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, - ParserErrorCode.UNEXPECTED_TOKEN, - ParserErrorCode.UNEXPECTED_TOKENS, - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT, - ParserErrorCode.VAR_AND_TYPE, - ParserErrorCode.VAR_AS_TYPE_NAME, - ParserErrorCode.VAR_CLASS, - ParserErrorCode.VAR_ENUM, - ParserErrorCode.VAR_RETURN_TYPE, - ParserErrorCode.VAR_TYPEDEF, - ParserErrorCode.VOID_WITH_TYPE_ARGUMENTS, - ParserErrorCode.WITH_BEFORE_EXTENDS, - ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, - ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, - ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, - PubspecWarningCode.ASSET_DIRECTORY_DOES_NOT_EXIST, - PubspecWarningCode.ASSET_DOES_NOT_EXIST, - PubspecWarningCode.ASSET_FIELD_NOT_LIST, - PubspecWarningCode.ASSET_MISSING_PATH, - PubspecWarningCode.ASSET_NOT_STRING, - PubspecWarningCode.ASSET_NOT_STRING_OR_MAP, - PubspecWarningCode.ASSET_PATH_NOT_STRING, - PubspecWarningCode.DEPENDENCIES_FIELD_NOT_MAP, - PubspecWarningCode.DEPRECATED_FIELD, - PubspecWarningCode.FLUTTER_FIELD_NOT_MAP, - PubspecWarningCode.INVALID_DEPENDENCY, - PubspecWarningCode.INVALID_PLATFORMS_FIELD, - PubspecWarningCode.MISSING_DEPENDENCY, - PubspecWarningCode.MISSING_NAME, - PubspecWarningCode.NAME_NOT_STRING, - PubspecWarningCode.PATH_DOES_NOT_EXIST, - PubspecWarningCode.PATH_NOT_POSIX, - PubspecWarningCode.PATH_PUBSPEC_DOES_NOT_EXIST, - PubspecWarningCode.PLATFORM_VALUE_DISALLOWED, - PubspecWarningCode.UNKNOWN_PLATFORM, - PubspecWarningCode.UNNECESSARY_DEV_DEPENDENCY, - PubspecWarningCode.WORKSPACE_FIELD_NOT_LIST, - PubspecWarningCode.WORKSPACE_VALUE_NOT_STRING, - PubspecWarningCode.WORKSPACE_VALUE_NOT_SUBDIRECTORY, - ScannerErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.ILLEGAL_CHARACTER, - ScannerErrorCode.MISSING_DIGIT, - ScannerErrorCode.MISSING_HEX_DIGIT, - ScannerErrorCode.MISSING_IDENTIFIER, - ScannerErrorCode.MISSING_QUOTE, - ScannerErrorCode.UNABLE_GET_CONTENT, - ScannerErrorCode.UNEXPECTED_DOLLAR_IN_STRING, - ScannerErrorCode.UNEXPECTED_SEPARATOR_IN_NUMBER, - ScannerErrorCode.UNSUPPORTED_OPERATOR, - ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, - StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, - StaticWarningCode.INVALID_NULL_AWARE_ELEMENT, - StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_KEY, - StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_VALUE, - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, - StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, - StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION, - StaticWarningCode.UNNECESSARY_NULL_ASSERT_PATTERN, - StaticWarningCode.UNNECESSARY_NULL_CHECK_PATTERN, - TodoCode.FIXME, - TodoCode.HACK, - TodoCode.TODO, - TodoCode.UNDONE, - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, - WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR, - WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE, - WarningCode.CAST_FROM_NULLABLE_ALWAYS_FAILS, - WarningCode.CAST_FROM_NULL_ALWAYS_FAILS, - WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, - WarningCode.DEAD_CODE, - WarningCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, - WarningCode.DEAD_CODE_LATE_WILDCARD_VARIABLE_INITIALIZER, - WarningCode.DEAD_CODE_ON_CATCH_SUBTYPE, - WarningCode.DEPRECATED_EXPORT_USE, - WarningCode.DEPRECATED_EXTEND, - WarningCode.DEPRECATED_EXTENDS_FUNCTION, - WarningCode.DEPRECATED_IMPLEMENT, - WarningCode.DEPRECATED_IMPLEMENTS_FUNCTION, - WarningCode.DEPRECATED_MIXIN_FUNCTION, - WarningCode.DEPRECATED_NEW_IN_COMMENT_REFERENCE, - WarningCode.DEPRECATED_SUBCLASS, - WarningCode.DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT, - WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS, - WarningCode.DOC_DIRECTIVE_HAS_UNEXPECTED_NAMED_ARGUMENT, - WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE, - WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG, - WarningCode.DOC_DIRECTIVE_MISSING_ONE_ARGUMENT, - WarningCode.DOC_DIRECTIVE_MISSING_OPENING_TAG, - WarningCode.DOC_DIRECTIVE_MISSING_THREE_ARGUMENTS, - WarningCode.DOC_DIRECTIVE_MISSING_TWO_ARGUMENTS, - WarningCode.DOC_DIRECTIVE_UNKNOWN, - WarningCode.DOC_IMPORT_CANNOT_BE_DEFERRED, - WarningCode.DOC_IMPORT_CANNOT_HAVE_COMBINATORS, - WarningCode.DOC_IMPORT_CANNOT_HAVE_CONFIGURATIONS, - WarningCode.DOC_IMPORT_CANNOT_HAVE_PREFIX, - WarningCode.DUPLICATE_EXPORT, - WarningCode.DUPLICATE_HIDDEN_NAME, - WarningCode.DUPLICATE_IGNORE, - WarningCode.DUPLICATE_IMPORT, - WarningCode.DUPLICATE_SHOWN_NAME, - WarningCode.EQUAL_ELEMENTS_IN_SET, - WarningCode.EQUAL_KEYS_IN_MAP, - WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, - WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, - WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, - WarningCode.INFERENCE_FAILURE_ON_GENERIC_INVOCATION, - WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, - WarningCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE, - WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, - WarningCode.INVALID_ANNOTATION_TARGET, - WarningCode.INVALID_AWAIT_NOT_REQUIRED_ANNOTATION, - WarningCode.INVALID_DEPRECATED_EXTEND_ANNOTATION, - WarningCode.INVALID_DEPRECATED_IMPLEMENT_ANNOTATION, - WarningCode.INVALID_DEPRECATED_SUBCLASS_ANNOTATION, - WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, - WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY, - WarningCode.INVALID_FACTORY_METHOD_DECL, - WarningCode.INVALID_FACTORY_METHOD_IMPL, - WarningCode.INVALID_INTERNAL_ANNOTATION, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS, - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TWO_SLASHES, - WarningCode.INVALID_LITERAL_ANNOTATION, - WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, - WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, - WarningCode.INVALID_REOPEN_ANNOTATION, - WarningCode.INVALID_REQUIRED_NAMED_PARAM, - WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM, - WarningCode.INVALID_REQUIRED_POSITIONAL_PARAM, - WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, - WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, - WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, - WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, - WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, - WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, - WarningCode.INVALID_VISIBILITY_ANNOTATION, - WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, - WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, - WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_THREE_PLUS, - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO, - WarningCode.MISSING_REQUIRED_PARAM, - WarningCode.MISSING_REQUIRED_PARAM_WITH_DETAILS, - WarningCode.MIXIN_ON_SEALED_CLASS, - WarningCode.MULTIPLE_COMBINATORS, - WarningCode.MUST_BE_IMMUTABLE, - WarningCode.MUST_CALL_SUPER, - WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, - WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, - WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR_USING_NEW, - WarningCode.NON_NULLABLE_EQUALS_PARAMETER, - WarningCode.NULLABLE_TYPE_IN_CATCH_CLAUSE, - WarningCode.NULL_ARGUMENT_TO_NON_NULL_TYPE, - WarningCode.NULL_CHECK_ALWAYS_FAILS, - WarningCode.OVERRIDE_ON_NON_OVERRIDING_FIELD, - WarningCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, - WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, - WarningCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, - WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, - WarningCode.RECEIVER_OF_TYPE_NEVER, - WarningCode.REDECLARE_ON_NON_REDECLARING_MEMBER, - WarningCode.REMOVED_LINT_USE, - WarningCode.REPLACED_LINT_USE, - WarningCode.RETURN_OF_DO_NOT_STORE, - WarningCode.RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR, - WarningCode.RETURN_TYPE_INVALID_FOR_CATCH_ERROR, - WarningCode.SDK_VERSION_CONSTRUCTOR_TEAROFFS, - WarningCode.SDK_VERSION_GT_GT_GT_OPERATOR, - WarningCode.SDK_VERSION_SINCE, - WarningCode.STRICT_RAW_TYPE, - WarningCode.SUBTYPE_OF_SEALED_CLASS, - WarningCode.TEXT_DIRECTION_CODE_POINT_IN_COMMENT, - WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, - WarningCode.TYPE_CHECK_IS_NOT_NULL, - WarningCode.TYPE_CHECK_IS_NULL, - WarningCode.UNDEFINED_HIDDEN_NAME, - WarningCode.UNDEFINED_REFERENCED_PARAMETER, - WarningCode.UNDEFINED_SHOWN_NAME, - WarningCode.UNIGNORABLE_IGNORE, - WarningCode.UNNECESSARY_CAST, - WarningCode.UNNECESSARY_CAST_PATTERN, - WarningCode.UNNECESSARY_FINAL, - WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE, - WarningCode.UNNECESSARY_NAN_COMPARISON_TRUE, - WarningCode.UNNECESSARY_NO_SUCH_METHOD, - WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE, - WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE, - WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE, - WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE, - WarningCode.UNNECESSARY_QUESTION_MARK, - WarningCode.UNNECESSARY_SET_LITERAL, - WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, - WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, - WarningCode.UNNECESSARY_WILDCARD_PATTERN, - WarningCode.UNREACHABLE_SWITCH_CASE, - WarningCode.UNREACHABLE_SWITCH_DEFAULT, - WarningCode.UNUSED_CATCH_CLAUSE, - WarningCode.UNUSED_CATCH_STACK, - WarningCode.UNUSED_ELEMENT, - WarningCode.UNUSED_ELEMENT_PARAMETER, - WarningCode.UNUSED_FIELD, - WarningCode.UNUSED_IMPORT, - WarningCode.UNUSED_LABEL, - WarningCode.UNUSED_LOCAL_VARIABLE, - WarningCode.UNUSED_RESULT, - WarningCode.UNUSED_RESULT_WITH_MESSAGE, - WarningCode.UNUSED_SHOWN_NAME, - WarningCode.URI_DOES_NOT_EXIST_IN_DOC_IMPORT, + AnalysisOptionsErrorCode.includedFileParseError, + AnalysisOptionsErrorCode.parseError, + AnalysisOptionsWarningCode.analysisOptionDeprecated, + AnalysisOptionsWarningCode.analysisOptionDeprecatedWithReplacement, + AnalysisOptionsWarningCode.deprecatedLint, + AnalysisOptionsWarningCode.deprecatedLintWithReplacement, + AnalysisOptionsWarningCode.duplicateRule, + AnalysisOptionsWarningCode.includedFileWarning, + AnalysisOptionsWarningCode.includeFileNotFound, + AnalysisOptionsWarningCode.incompatibleLint, + AnalysisOptionsWarningCode.invalidOption, + AnalysisOptionsWarningCode.invalidSectionFormat, + AnalysisOptionsWarningCode.multiplePlugins, + AnalysisOptionsWarningCode.recursiveIncludeFile, + AnalysisOptionsWarningCode.removedLint, + AnalysisOptionsWarningCode.replacedLint, + AnalysisOptionsWarningCode.undefinedLint, + AnalysisOptionsWarningCode.unrecognizedErrorCode, + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues, + AnalysisOptionsWarningCode.unsupportedOptionWithLegalValue, + AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues, + AnalysisOptionsWarningCode.unsupportedValue, + CompileTimeErrorCode.abstractFieldConstructorInitializer, + CompileTimeErrorCode.abstractFieldInitializer, + CompileTimeErrorCode.abstractSuperMemberReference, + CompileTimeErrorCode.ambiguousExport, + CompileTimeErrorCode.ambiguousExtensionMemberAccessThreeOrMore, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, + CompileTimeErrorCode.ambiguousImport, + CompileTimeErrorCode.ambiguousSetOrMapLiteralBoth, + CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, + CompileTimeErrorCode.argumentTypeNotAssignable, + CompileTimeErrorCode.assertInRedirectingConstructor, + CompileTimeErrorCode.assignmentToConst, + CompileTimeErrorCode.assignmentToFinal, + CompileTimeErrorCode.assignmentToFinalLocal, + CompileTimeErrorCode.assignmentToFinalNoSetter, + CompileTimeErrorCode.assignmentToFunction, + CompileTimeErrorCode.assignmentToMethod, + CompileTimeErrorCode.assignmentToType, + CompileTimeErrorCode.asyncForInWrongContext, + CompileTimeErrorCode.augmentationExtendsClauseAlreadyPresent, + CompileTimeErrorCode.augmentationModifierExtra, + CompileTimeErrorCode.augmentationModifierMissing, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, + CompileTimeErrorCode.augmentationTypeParameterBound, + CompileTimeErrorCode.augmentationTypeParameterCount, + CompileTimeErrorCode.augmentationTypeParameterName, + CompileTimeErrorCode.augmentationWithoutDeclaration, + CompileTimeErrorCode.augmentedExpressionIsNotSetter, + CompileTimeErrorCode.augmentedExpressionIsSetter, + CompileTimeErrorCode.augmentedExpressionNotOperator, + CompileTimeErrorCode.awaitInLateLocalVariableInitializer, + CompileTimeErrorCode.awaitInWrongContext, + CompileTimeErrorCode.awaitOfIncompatibleType, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, + CompileTimeErrorCode.bodyMightCompleteNormally, + CompileTimeErrorCode.breakLabelOnSwitchMember, + CompileTimeErrorCode.builtInIdentifierAsExtensionName, + CompileTimeErrorCode.builtInIdentifierAsExtensionTypeName, + CompileTimeErrorCode.builtInIdentifierAsPrefixName, + CompileTimeErrorCode.builtInIdentifierAsType, + CompileTimeErrorCode.builtInIdentifierAsTypedefName, + CompileTimeErrorCode.builtInIdentifierAsTypeName, + CompileTimeErrorCode.builtInIdentifierAsTypeParameterName, + CompileTimeErrorCode.caseExpressionTypeImplementsEquals, + CompileTimeErrorCode.caseExpressionTypeIsNotSwitchExpressionSubtype, + CompileTimeErrorCode.castToNonType, + CompileTimeErrorCode.classInstantiationAccessToInstanceMember, + CompileTimeErrorCode.classInstantiationAccessToStaticMember, + CompileTimeErrorCode.classInstantiationAccessToUnknownMember, + CompileTimeErrorCode.classUsedAsMixin, + CompileTimeErrorCode.concreteClassHasEnumSuperinterface, + CompileTimeErrorCode.concreteClassWithAbstractMember, + CompileTimeErrorCode.conflictingConstructorAndStaticField, + CompileTimeErrorCode.conflictingConstructorAndStaticGetter, + CompileTimeErrorCode.conflictingConstructorAndStaticMethod, + CompileTimeErrorCode.conflictingConstructorAndStaticSetter, + CompileTimeErrorCode.conflictingFieldAndMethod, + CompileTimeErrorCode.conflictingGenericInterfaces, + CompileTimeErrorCode.conflictingInheritedMethodAndSetter, + CompileTimeErrorCode.conflictingMethodAndField, + CompileTimeErrorCode.conflictingStaticAndInstance, + CompileTimeErrorCode.conflictingTypeVariableAndClass, + CompileTimeErrorCode.conflictingTypeVariableAndEnum, + CompileTimeErrorCode.conflictingTypeVariableAndExtension, + CompileTimeErrorCode.conflictingTypeVariableAndExtensionType, + CompileTimeErrorCode.conflictingTypeVariableAndMemberClass, + CompileTimeErrorCode.conflictingTypeVariableAndMemberEnum, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtension, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtensionType, + CompileTimeErrorCode.conflictingTypeVariableAndMemberMixin, + CompileTimeErrorCode.conflictingTypeVariableAndMixin, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, + CompileTimeErrorCode.constConstructorConstantFromDeferredLibrary, + CompileTimeErrorCode.constConstructorFieldTypeMismatch, + CompileTimeErrorCode.constConstructorParamTypeMismatch, + CompileTimeErrorCode.constConstructorThrowsException, + CompileTimeErrorCode.constConstructorWithFieldInitializedByNonConst, + CompileTimeErrorCode.constConstructorWithMixinWithField, + CompileTimeErrorCode.constConstructorWithMixinWithFields, + CompileTimeErrorCode.constConstructorWithNonConstSuper, + CompileTimeErrorCode.constConstructorWithNonFinalField, + CompileTimeErrorCode.constDeferredClass, + CompileTimeErrorCode.constEvalAssertionFailure, + CompileTimeErrorCode.constEvalAssertionFailureWithMessage, + CompileTimeErrorCode.constEvalExtensionMethod, + CompileTimeErrorCode.constEvalExtensionTypeMethod, + CompileTimeErrorCode.constEvalForElement, + CompileTimeErrorCode.constEvalMethodInvocation, + CompileTimeErrorCode.constEvalPrimitiveEquality, + CompileTimeErrorCode.constEvalPropertyAccess, + CompileTimeErrorCode.constEvalThrowsException, + CompileTimeErrorCode.constEvalThrowsIdbze, + CompileTimeErrorCode.constEvalTypeBool, + CompileTimeErrorCode.constEvalTypeBoolInt, + CompileTimeErrorCode.constEvalTypeBoolNumString, + CompileTimeErrorCode.constEvalTypeInt, + CompileTimeErrorCode.constEvalTypeNum, + CompileTimeErrorCode.constEvalTypeNumString, + CompileTimeErrorCode.constEvalTypeString, + CompileTimeErrorCode.constEvalTypeType, + CompileTimeErrorCode.constFieldInitializerNotAssignable, + CompileTimeErrorCode.constInitializedWithNonConstantValue, + CompileTimeErrorCode.constInitializedWithNonConstantValueFromDeferredLibrary, + CompileTimeErrorCode.constInstanceField, + CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, + CompileTimeErrorCode.constNotInitialized, + CompileTimeErrorCode.constSetElementNotPrimitiveEquality, + CompileTimeErrorCode.constSpreadExpectedListOrSet, + CompileTimeErrorCode.constSpreadExpectedMap, + CompileTimeErrorCode.constTypeParameter, + CompileTimeErrorCode.constWithNonConst, + CompileTimeErrorCode.constWithNonConstantArgument, + CompileTimeErrorCode.constWithNonType, + CompileTimeErrorCode.constWithTypeParameters, + CompileTimeErrorCode.constWithTypeParametersConstructorTearoff, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, + CompileTimeErrorCode.constWithUndefinedConstructor, + CompileTimeErrorCode.constWithUndefinedConstructorDefault, + CompileTimeErrorCode.continueLabelInvalid, + CompileTimeErrorCode.couldNotInfer, + CompileTimeErrorCode.defaultValueInRedirectingFactoryConstructor, + CompileTimeErrorCode.defaultValueOnRequiredParameter, + CompileTimeErrorCode.deferredImportOfExtension, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, + CompileTimeErrorCode.dotShorthandMissingContext, + CompileTimeErrorCode.dotShorthandUndefinedGetter, + CompileTimeErrorCode.dotShorthandUndefinedInvocation, + CompileTimeErrorCode.duplicateConstructorDefault, + CompileTimeErrorCode.duplicateConstructorName, + CompileTimeErrorCode.duplicateDefinition, + CompileTimeErrorCode.duplicateFieldFormalParameter, + CompileTimeErrorCode.duplicateFieldName, + CompileTimeErrorCode.duplicateNamedArgument, + CompileTimeErrorCode.duplicatePart, + CompileTimeErrorCode.duplicatePatternAssignmentVariable, + CompileTimeErrorCode.duplicatePatternField, + CompileTimeErrorCode.duplicateRestElementInPattern, + CompileTimeErrorCode.duplicateVariablePattern, + CompileTimeErrorCode.emptyMapPattern, + CompileTimeErrorCode.enumConstantInvokesFactoryConstructor, + CompileTimeErrorCode.enumConstantSameNameAsEnclosing, + CompileTimeErrorCode.enumInstantiatedToBoundsIsNotWellBounded, + CompileTimeErrorCode.enumMixinWithInstanceVariable, + CompileTimeErrorCode.enumWithoutConstants, + CompileTimeErrorCode.enumWithAbstractMember, + CompileTimeErrorCode.enumWithNameValues, + CompileTimeErrorCode.equalElementsInConstSet, + CompileTimeErrorCode.equalKeysInConstMap, + CompileTimeErrorCode.equalKeysInMapPattern, + CompileTimeErrorCode.expectedOneListPatternTypeArguments, + CompileTimeErrorCode.expectedOneListTypeArguments, + CompileTimeErrorCode.expectedOneSetTypeArguments, + CompileTimeErrorCode.expectedTwoMapPatternTypeArguments, + CompileTimeErrorCode.expectedTwoMapTypeArguments, + CompileTimeErrorCode.exportInternalLibrary, + CompileTimeErrorCode.exportOfNonLibrary, + CompileTimeErrorCode.expressionInMap, + CompileTimeErrorCode.extendsDeferredClass, + CompileTimeErrorCode.extendsDisallowedClass, + CompileTimeErrorCode.extendsNonClass, + CompileTimeErrorCode.extendsTypeAliasExpandsToTypeParameter, + CompileTimeErrorCode.extensionAsExpression, + CompileTimeErrorCode.extensionConflictingStaticAndInstance, + CompileTimeErrorCode.extensionDeclaresInstanceField, + CompileTimeErrorCode.extensionDeclaresMemberOfObject, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, + CompileTimeErrorCode.extensionOverrideArgumentNotAssignable, + CompileTimeErrorCode.extensionOverrideWithoutAccess, + CompileTimeErrorCode.extensionOverrideWithCascade, + CompileTimeErrorCode.extensionTypeConstructorWithSuperFormalParameter, + CompileTimeErrorCode.extensionTypeConstructorWithSuperInvocation, + CompileTimeErrorCode.extensionTypeDeclaresInstanceField, + CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, + CompileTimeErrorCode.extensionTypeImplementsItself, + CompileTimeErrorCode.extensionTypeImplementsNotSupertype, + CompileTimeErrorCode.extensionTypeImplementsRepresentationNotSupertype, + CompileTimeErrorCode.extensionTypeInheritedMemberConflict, + CompileTimeErrorCode.extensionTypeRepresentationDependsOnItself, + CompileTimeErrorCode.extensionTypeRepresentationTypeBottom, + CompileTimeErrorCode.extensionTypeWithAbstractMember, + CompileTimeErrorCode.externalFieldConstructorInitializer, + CompileTimeErrorCode.externalFieldInitializer, + CompileTimeErrorCode.externalVariableInitializer, + CompileTimeErrorCode.extraPositionalArguments, + CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, + CompileTimeErrorCode.fieldInitializedByMultipleInitializers, + CompileTimeErrorCode.fieldInitializedInInitializerAndDeclaration, + CompileTimeErrorCode.fieldInitializedInParameterAndInitializer, + CompileTimeErrorCode.fieldInitializerFactoryConstructor, + CompileTimeErrorCode.fieldInitializerNotAssignable, + CompileTimeErrorCode.fieldInitializerOutsideConstructor, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, + CompileTimeErrorCode.fieldInitializingFormalNotAssignable, + CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, + CompileTimeErrorCode.finalClassUsedAsMixinConstraintOutsideOfLibrary, + CompileTimeErrorCode.finalInitializedInDeclarationAndConstructor, + CompileTimeErrorCode.finalNotInitialized, + CompileTimeErrorCode.finalNotInitializedConstructor1, + CompileTimeErrorCode.finalNotInitializedConstructor2, + CompileTimeErrorCode.finalNotInitializedConstructor3Plus, + CompileTimeErrorCode.forInOfInvalidElementType, + CompileTimeErrorCode.forInOfInvalidType, + CompileTimeErrorCode.forInWithConstVariable, + CompileTimeErrorCode.genericFunctionTypeCannotBeBound, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, + CompileTimeErrorCode.genericMethodTypeInstantiationOnDynamic, + CompileTimeErrorCode.getterNotAssignableSetterTypes, + CompileTimeErrorCode.getterNotSubtypeSetterTypes, + CompileTimeErrorCode.ifElementConditionFromDeferredLibrary, + CompileTimeErrorCode.illegalAsyncGeneratorReturnType, + CompileTimeErrorCode.illegalAsyncReturnType, + CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, + CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, + CompileTimeErrorCode.illegalEnumValuesDeclaration, + CompileTimeErrorCode.illegalEnumValuesInheritance, + CompileTimeErrorCode.illegalLanguageVersionOverride, + CompileTimeErrorCode.illegalSyncGeneratorReturnType, + CompileTimeErrorCode.implementsDeferredClass, + CompileTimeErrorCode.implementsDisallowedClass, + CompileTimeErrorCode.implementsNonClass, + CompileTimeErrorCode.implementsRepeated, + CompileTimeErrorCode.implementsSuperClass, + CompileTimeErrorCode.implementsTypeAliasExpandsToTypeParameter, + CompileTimeErrorCode.implicitSuperInitializerMissingArguments, + CompileTimeErrorCode.implicitThisReferenceInInitializer, + CompileTimeErrorCode.importInternalLibrary, + CompileTimeErrorCode.importOfNonLibrary, + CompileTimeErrorCode.inconsistentCaseExpressionTypes, + CompileTimeErrorCode.inconsistentInheritance, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, + CompileTimeErrorCode.inconsistentLanguageVersionOverride, + CompileTimeErrorCode.inconsistentPatternVariableLogicalOr, + CompileTimeErrorCode.initializerForNonExistentField, + CompileTimeErrorCode.initializerForStaticField, + CompileTimeErrorCode.initializingFormalForNonExistentField, + CompileTimeErrorCode.instanceAccessToStaticMember, + CompileTimeErrorCode.instanceAccessToStaticMemberOfUnnamedExtension, + CompileTimeErrorCode.instanceMemberAccessFromFactory, + CompileTimeErrorCode.instanceMemberAccessFromStatic, + CompileTimeErrorCode.instantiateAbstractClass, + CompileTimeErrorCode.instantiateEnum, + CompileTimeErrorCode.instantiateTypeAliasExpandsToTypeParameter, + CompileTimeErrorCode.integerLiteralImpreciseAsDouble, + CompileTimeErrorCode.integerLiteralOutOfRange, + CompileTimeErrorCode.interfaceClassExtendedOutsideOfLibrary, + CompileTimeErrorCode.invalidAnnotation, + CompileTimeErrorCode.invalidAnnotationConstantValueFromDeferredLibrary, + CompileTimeErrorCode.invalidAnnotationFromDeferredLibrary, + CompileTimeErrorCode.invalidAssignment, + CompileTimeErrorCode.invalidCastFunction, + CompileTimeErrorCode.invalidCastFunctionExpr, + CompileTimeErrorCode.invalidCastLiteral, + CompileTimeErrorCode.invalidCastLiteralList, + CompileTimeErrorCode.invalidCastLiteralMap, + CompileTimeErrorCode.invalidCastLiteralSet, + CompileTimeErrorCode.invalidCastMethod, + CompileTimeErrorCode.invalidCastNewExpr, + CompileTimeErrorCode.invalidConstant, + CompileTimeErrorCode.invalidExtensionArgumentCount, + CompileTimeErrorCode.invalidFactoryNameNotAClass, + CompileTimeErrorCode.invalidFieldNameFromObject, + CompileTimeErrorCode.invalidFieldNamePositional, + CompileTimeErrorCode.invalidFieldNamePrivate, + CompileTimeErrorCode.invalidImplementationOverride, + CompileTimeErrorCode.invalidImplementationOverrideSetter, + CompileTimeErrorCode.invalidInlineFunctionType, + CompileTimeErrorCode.invalidModifierOnConstructor, + CompileTimeErrorCode.invalidModifierOnSetter, + CompileTimeErrorCode.invalidOverride, + CompileTimeErrorCode.invalidOverrideSetter, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, + CompileTimeErrorCode.invalidReferenceToThis, + CompileTimeErrorCode.invalidSuperFormalParameterLocation, + CompileTimeErrorCode.invalidTypeArgumentInConstList, + CompileTimeErrorCode.invalidTypeArgumentInConstMap, + CompileTimeErrorCode.invalidTypeArgumentInConstSet, + CompileTimeErrorCode.invalidUri, + CompileTimeErrorCode.invalidUseOfCovariant, + CompileTimeErrorCode.invalidUseOfNullValue, + CompileTimeErrorCode.invocationOfExtensionWithoutCall, + CompileTimeErrorCode.invocationOfNonFunction, + CompileTimeErrorCode.invocationOfNonFunctionExpression, + CompileTimeErrorCode.labelInOuterScope, + CompileTimeErrorCode.labelUndefined, + CompileTimeErrorCode.lateFinalFieldWithConstConstructor, + CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, + CompileTimeErrorCode.listElementTypeNotAssignable, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, + CompileTimeErrorCode.mainFirstPositionalParameterType, + CompileTimeErrorCode.mainHasRequiredNamedParameters, + CompileTimeErrorCode.mainHasTooManyRequiredPositionalParameters, + CompileTimeErrorCode.mainIsNotFunction, + CompileTimeErrorCode.mapEntryNotInMap, + CompileTimeErrorCode.mapKeyTypeNotAssignable, + CompileTimeErrorCode.mapKeyTypeNotAssignableNullability, + CompileTimeErrorCode.mapValueTypeNotAssignable, + CompileTimeErrorCode.mapValueTypeNotAssignableNullability, + CompileTimeErrorCode.missingConstInListLiteral, + CompileTimeErrorCode.missingConstInMapLiteral, + CompileTimeErrorCode.missingConstInSetLiteral, + CompileTimeErrorCode.missingDartLibrary, + CompileTimeErrorCode.missingDefaultValueForParameter, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, + CompileTimeErrorCode.missingDefaultValueForParameterWithAnnotation, + CompileTimeErrorCode.missingNamedPatternFieldName, + CompileTimeErrorCode.missingRequiredArgument, + CompileTimeErrorCode.missingVariablePattern, + CompileTimeErrorCode.mixinsSuperClass, + CompileTimeErrorCode.mixinApplicationConcreteSuperInvokedMemberType, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedMember, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedSetter, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, + CompileTimeErrorCode.mixinClassDeclaresConstructor, + CompileTimeErrorCode.mixinDeferredClass, + CompileTimeErrorCode.mixinInheritsFromNotObject, + CompileTimeErrorCode.mixinInstantiate, + CompileTimeErrorCode.mixinOfDisallowedClass, + CompileTimeErrorCode.mixinOfNonClass, + CompileTimeErrorCode.mixinOfTypeAliasExpandsToTypeParameter, + CompileTimeErrorCode.mixinOnTypeAliasExpandsToTypeParameter, + CompileTimeErrorCode.mixinSubtypeOfBaseIsNotBase, + CompileTimeErrorCode.mixinSubtypeOfFinalIsNotBase, + CompileTimeErrorCode.mixinSuperClassConstraintDeferredClass, + CompileTimeErrorCode.mixinSuperClassConstraintDisallowedClass, + CompileTimeErrorCode.mixinSuperClassConstraintNonInterface, + CompileTimeErrorCode.mixinWithNonClassSuperclass, + CompileTimeErrorCode.multipleRedirectingConstructorInvocations, + CompileTimeErrorCode.multipleSuperInitializers, + CompileTimeErrorCode.newWithNonType, + CompileTimeErrorCode.newWithUndefinedConstructor, + CompileTimeErrorCode.newWithUndefinedConstructorDefault, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFivePlus, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFour, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberThree, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberTwo, + CompileTimeErrorCode.nonBoolCondition, + CompileTimeErrorCode.nonBoolExpression, + CompileTimeErrorCode.nonBoolNegationExpression, + CompileTimeErrorCode.nonBoolOperand, + CompileTimeErrorCode.nonConstantAnnotationConstructor, + CompileTimeErrorCode.nonConstantCaseExpression, + CompileTimeErrorCode.nonConstantCaseExpressionFromDeferredLibrary, + CompileTimeErrorCode.nonConstantDefaultValue, + CompileTimeErrorCode.nonConstantDefaultValueFromDeferredLibrary, + CompileTimeErrorCode.nonConstantListElement, + CompileTimeErrorCode.nonConstantListElementFromDeferredLibrary, + CompileTimeErrorCode.nonConstantMapElement, + CompileTimeErrorCode.nonConstantMapKey, + CompileTimeErrorCode.nonConstantMapKeyFromDeferredLibrary, + CompileTimeErrorCode.nonConstantMapPatternKey, + CompileTimeErrorCode.nonConstantMapValue, + CompileTimeErrorCode.nonConstantMapValueFromDeferredLibrary, + CompileTimeErrorCode.nonConstantRecordField, + CompileTimeErrorCode.nonConstantRecordFieldFromDeferredLibrary, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, + CompileTimeErrorCode.nonConstantSetElement, + CompileTimeErrorCode.nonConstGenerativeEnumConstructor, + CompileTimeErrorCode.nonConstMapAsExpressionStatement, + CompileTimeErrorCode.nonCovariantTypeParameterPositionInRepresentationType, + CompileTimeErrorCode.nonExhaustiveSwitchExpression, + CompileTimeErrorCode.nonExhaustiveSwitchStatement, + CompileTimeErrorCode.nonFinalFieldInEnum, + CompileTimeErrorCode.nonGenerativeConstructor, + CompileTimeErrorCode.nonGenerativeImplicitConstructor, + CompileTimeErrorCode.nonSyncFactory, + CompileTimeErrorCode.nonTypeAsTypeArgument, + CompileTimeErrorCode.nonTypeInCatchClause, + CompileTimeErrorCode.nonVoidReturnForOperator, + CompileTimeErrorCode.nonVoidReturnForSetter, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, + CompileTimeErrorCode.notAType, + CompileTimeErrorCode.notBinaryOperator, + CompileTimeErrorCode.notEnoughPositionalArgumentsNamePlural, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, + CompileTimeErrorCode.notEnoughPositionalArgumentsPlural, + CompileTimeErrorCode.notEnoughPositionalArgumentsSingular, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, + CompileTimeErrorCode.notInitializedNonNullableInstanceFieldConstructor, + CompileTimeErrorCode.notInitializedNonNullableVariable, + CompileTimeErrorCode.notInstantiatedBound, + CompileTimeErrorCode.notIterableSpread, + CompileTimeErrorCode.notMapSpread, + CompileTimeErrorCode.notNullAwareNullSpread, + CompileTimeErrorCode.noAnnotationConstructorArguments, + CompileTimeErrorCode.noCombinedSuperSignature, + CompileTimeErrorCode.noDefaultSuperConstructorExplicit, + CompileTimeErrorCode.noDefaultSuperConstructorImplicit, + CompileTimeErrorCode.noGenerativeConstructorsInSuperclass, + CompileTimeErrorCode.nullableTypeInExtendsClause, + CompileTimeErrorCode.nullableTypeInImplementsClause, + CompileTimeErrorCode.nullableTypeInOnClause, + CompileTimeErrorCode.nullableTypeInWithClause, + CompileTimeErrorCode.objectCannotExtendAnotherClass, + CompileTimeErrorCode.obsoleteColonForDefaultValue, + CompileTimeErrorCode.onRepeated, + CompileTimeErrorCode.optionalParameterInOperator, + CompileTimeErrorCode.partOfDifferentLibrary, + CompileTimeErrorCode.partOfNonPart, + CompileTimeErrorCode.partOfUnnamedLibrary, + CompileTimeErrorCode.patternAssignmentNotLocalVariable, + CompileTimeErrorCode.patternConstantFromDeferredLibrary, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, + CompileTimeErrorCode.patternVariableAssignmentInsideGuard, + CompileTimeErrorCode.patternVariableSharedCaseScopeDifferentFinalityOrType, + CompileTimeErrorCode.patternVariableSharedCaseScopeHasLabel, + CompileTimeErrorCode.patternVariableSharedCaseScopeNotAllCases, + CompileTimeErrorCode.positionalFieldInObjectPattern, + CompileTimeErrorCode.positionalSuperFormalParameterWithPositionalArgument, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, + CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, + CompileTimeErrorCode.prefixShadowedByLocalDeclaration, + CompileTimeErrorCode.privateCollisionInMixinApplication, + CompileTimeErrorCode.privateOptionalParameter, + CompileTimeErrorCode.privateSetter, + CompileTimeErrorCode.readPotentiallyUnassignedFinal, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, + CompileTimeErrorCode.recursiveCompileTimeConstant, + CompileTimeErrorCode.recursiveConstantConstructor, + CompileTimeErrorCode.recursiveConstructorRedirect, + CompileTimeErrorCode.recursiveFactoryRedirect, + CompileTimeErrorCode.recursiveInterfaceInheritance, + CompileTimeErrorCode.recursiveInterfaceInheritanceExtends, + CompileTimeErrorCode.recursiveInterfaceInheritanceImplements, + CompileTimeErrorCode.recursiveInterfaceInheritanceOn, + CompileTimeErrorCode.recursiveInterfaceInheritanceWith, + CompileTimeErrorCode.redirectGenerativeToMissingConstructor, + CompileTimeErrorCode.redirectGenerativeToNonGenerativeConstructor, + CompileTimeErrorCode.redirectToAbstractClassConstructor, + CompileTimeErrorCode.redirectToInvalidFunctionType, + CompileTimeErrorCode.redirectToInvalidReturnType, + CompileTimeErrorCode.redirectToMissingConstructor, + CompileTimeErrorCode.redirectToNonClass, + CompileTimeErrorCode.redirectToNonConstConstructor, + CompileTimeErrorCode.redirectToTypeAliasExpandsToTypeParameter, + CompileTimeErrorCode.referencedBeforeDeclaration, + CompileTimeErrorCode.refutablePatternInIrrefutableContext, + CompileTimeErrorCode.relationalPatternOperandTypeNotAssignable, + CompileTimeErrorCode.relationalPatternOperatorReturnTypeNotAssignableToBool, + CompileTimeErrorCode.restElementInMapPattern, + CompileTimeErrorCode.rethrowOutsideCatch, + CompileTimeErrorCode.returnInGenerativeConstructor, + CompileTimeErrorCode.returnInGenerator, + CompileTimeErrorCode.returnOfInvalidTypeFromClosure, + CompileTimeErrorCode.returnOfInvalidTypeFromConstructor, + CompileTimeErrorCode.returnOfInvalidTypeFromFunction, + CompileTimeErrorCode.returnOfInvalidTypeFromMethod, + CompileTimeErrorCode.returnWithoutValue, + CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, + CompileTimeErrorCode.setElementFromDeferredLibrary, + CompileTimeErrorCode.setElementTypeNotAssignable, + CompileTimeErrorCode.setElementTypeNotAssignableNullability, + CompileTimeErrorCode.sharedDeferredPrefix, + CompileTimeErrorCode.spreadExpressionFromDeferredLibrary, + CompileTimeErrorCode.staticAccessToInstanceMember, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, + CompileTimeErrorCode.superFormalParameterTypeIsNotSubtypeOfAssociated, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedNamed, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedPositional, + CompileTimeErrorCode.superInitializerInObject, + CompileTimeErrorCode.superInvocationNotLast, + CompileTimeErrorCode.superInEnumConstructor, + CompileTimeErrorCode.superInExtension, + CompileTimeErrorCode.superInExtensionType, + CompileTimeErrorCode.superInInvalidContext, + CompileTimeErrorCode.superInRedirectingConstructor, + CompileTimeErrorCode.switchCaseCompletesNormally, + CompileTimeErrorCode.tearoffOfGenerativeConstructorOfAbstractClass, + CompileTimeErrorCode.throwOfInvalidType, + CompileTimeErrorCode.topLevelCycle, + CompileTimeErrorCode.typeAliasCannotReferenceItself, + CompileTimeErrorCode.typeAnnotationDeferredClass, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, + CompileTimeErrorCode.typeParameterReferencedByStatic, + CompileTimeErrorCode.typeParameterSupertypeOfItsBound, + CompileTimeErrorCode.typeTestWithNonType, + CompileTimeErrorCode.typeTestWithUndefinedName, + CompileTimeErrorCode.uncheckedInvocationOfNullableValue, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsIterator, + CompileTimeErrorCode.uncheckedUseOfNullableValueInSpread, + CompileTimeErrorCode.uncheckedUseOfNullableValueInYieldEach, + CompileTimeErrorCode.undefinedAnnotation, + CompileTimeErrorCode.undefinedClass, + CompileTimeErrorCode.undefinedClassBoolean, + CompileTimeErrorCode.undefinedConstructorInInitializer, + CompileTimeErrorCode.undefinedConstructorInInitializerDefault, + CompileTimeErrorCode.undefinedEnumConstant, + CompileTimeErrorCode.undefinedEnumConstructorNamed, + CompileTimeErrorCode.undefinedEnumConstructorUnnamed, + CompileTimeErrorCode.undefinedExtensionGetter, + CompileTimeErrorCode.undefinedExtensionMethod, + CompileTimeErrorCode.undefinedExtensionOperator, + CompileTimeErrorCode.undefinedExtensionSetter, + CompileTimeErrorCode.undefinedFunction, + CompileTimeErrorCode.undefinedGetter, + CompileTimeErrorCode.undefinedGetterOnFunctionType, + CompileTimeErrorCode.undefinedIdentifier, + CompileTimeErrorCode.undefinedIdentifierAwait, + CompileTimeErrorCode.undefinedMethod, + CompileTimeErrorCode.undefinedMethodOnFunctionType, + CompileTimeErrorCode.undefinedNamedParameter, + CompileTimeErrorCode.undefinedOperator, + CompileTimeErrorCode.undefinedPrefixedName, + CompileTimeErrorCode.undefinedSetter, + CompileTimeErrorCode.undefinedSetterOnFunctionType, + CompileTimeErrorCode.undefinedSuperGetter, + CompileTimeErrorCode.undefinedSuperMethod, + CompileTimeErrorCode.undefinedSuperOperator, + CompileTimeErrorCode.undefinedSuperSetter, + CompileTimeErrorCode.unqualifiedReferenceToNonLocalStaticMember, + CompileTimeErrorCode.unqualifiedReferenceToStaticMemberOfExtendedType, + CompileTimeErrorCode.uriDoesNotExist, + CompileTimeErrorCode.uriHasNotBeenGenerated, + CompileTimeErrorCode.uriWithInterpolation, + CompileTimeErrorCode.useOfNativeExtension, + CompileTimeErrorCode.useOfVoidResult, + CompileTimeErrorCode.valuesDeclarationInEnum, + CompileTimeErrorCode.variableTypeMismatch, + CompileTimeErrorCode.wrongExplicitTypeParameterVarianceInSuperinterface, + CompileTimeErrorCode.wrongNumberOfParametersForOperator, + CompileTimeErrorCode.wrongNumberOfParametersForOperatorMinus, + CompileTimeErrorCode.wrongNumberOfTypeArguments, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsAnonymousFunction, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsDotShorthandConstructor, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsEnum, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsExtension, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, + CompileTimeErrorCode.wrongTypeParameterVariancePosition, + CompileTimeErrorCode.yieldEachInNonGenerator, + CompileTimeErrorCode.yieldEachOfInvalidType, + CompileTimeErrorCode.yieldInNonGenerator, + CompileTimeErrorCode.yieldOfInvalidType, + FfiCode.abiSpecificIntegerInvalid, + FfiCode.abiSpecificIntegerMappingExtra, + FfiCode.abiSpecificIntegerMappingMissing, + FfiCode.abiSpecificIntegerMappingUnsupported, + FfiCode.addressPosition, + FfiCode.addressReceiver, + FfiCode.annotationOnPointerField, + FfiCode.argumentMustBeAConstant, + FfiCode.argumentMustBeNative, + FfiCode.compoundImplementsFinalizable, + FfiCode.creationOfStructOrUnion, + FfiCode.emptyStruct, + FfiCode.extraAnnotationOnStructField, + FfiCode.extraSizeAnnotationCarray, + FfiCode.ffiNativeInvalidDuplicateDefaultAsset, + FfiCode.ffiNativeInvalidMultipleAnnotations, + FfiCode.ffiNativeMustBeExternal, + FfiCode.ffiNativeOnlyClassesExtendingNativefieldwrapperclass1CanBePointer, + FfiCode.ffiNativeUnexpectedNumberOfParameters, + FfiCode.ffiNativeUnexpectedNumberOfParametersWithReceiver, + FfiCode.fieldMustBeExternalInStruct, + FfiCode.genericStructSubclass, + FfiCode.invalidExceptionValue, + FfiCode.invalidFieldTypeInStruct, + FfiCode.leafCallMustNotReturnHandle, + FfiCode.leafCallMustNotTakeHandle, + FfiCode.mismatchedAnnotationOnStructField, + FfiCode.missingAnnotationOnStructField, + FfiCode.missingExceptionValue, + FfiCode.missingFieldTypeInStruct, + FfiCode.missingSizeAnnotationCarray, + FfiCode.mustBeANativeFunctionType, + FfiCode.mustBeASubtype, + FfiCode.mustReturnVoid, + FfiCode.nativeFieldInvalidType, + FfiCode.nativeFieldMissingType, + FfiCode.nativeFieldNotStatic, + FfiCode.nativeFunctionMissingType, + FfiCode.negativeVariableDimension, + FfiCode.nonConstantTypeArgument, + FfiCode.nonNativeFunctionTypeArgumentToPointer, + FfiCode.nonPositiveArrayDimension, + FfiCode.nonSizedTypeArgument, + FfiCode.packedAnnotation, + FfiCode.packedAnnotationAlignment, + FfiCode.sizeAnnotationDimensions, + FfiCode.subtypeOfStructClassInExtends, + FfiCode.subtypeOfStructClassInImplements, + FfiCode.subtypeOfStructClassInWith, + FfiCode.variableLengthArrayNotLast, + HintCode.deprecatedColonForDefaultValue, + HintCode.deprecatedMemberUse, + HintCode.deprecatedMemberUseFromSamePackage, + HintCode.deprecatedMemberUseFromSamePackageWithMessage, + HintCode.deprecatedMemberUseWithMessage, + HintCode.importDeferredLibraryWithLoadFunction, + HintCode.unnecessaryImport, + ManifestWarningCode.cameraPermissionsIncompatible, + ManifestWarningCode.nonResizableActivity, + ManifestWarningCode.noTouchscreenFeature, + ManifestWarningCode.permissionImpliesUnsupportedHardware, + ManifestWarningCode.settingOrientationOnActivity, + ManifestWarningCode.unsupportedChromeOsFeature, + ManifestWarningCode.unsupportedChromeOsHardware, + ParserErrorCode.abstractClassMember, + ParserErrorCode.abstractExternalField, + ParserErrorCode.abstractFinalBaseClass, + ParserErrorCode.abstractFinalInterfaceClass, + ParserErrorCode.abstractLateField, + ParserErrorCode.abstractSealedClass, + ParserErrorCode.abstractStaticField, + ParserErrorCode.abstractStaticMethod, + ParserErrorCode.annotationOnTypeArgument, + ParserErrorCode.annotationSpaceBeforeParenthesis, + ParserErrorCode.annotationWithTypeArguments, + ParserErrorCode.annotationWithTypeArgumentsUninstantiated, + ParserErrorCode.asyncKeywordUsedAsIdentifier, + ParserErrorCode.baseEnum, + ParserErrorCode.binaryOperatorWrittenOut, + ParserErrorCode.breakOutsideOfLoop, + ParserErrorCode.catchSyntax, + ParserErrorCode.catchSyntaxExtraParameters, + ParserErrorCode.classInClass, + ParserErrorCode.colonInPlaceOfIn, + ParserErrorCode.conflictingModifiers, + ParserErrorCode.constructorWithReturnType, + ParserErrorCode.constructorWithTypeArguments, + ParserErrorCode.constAndFinal, + ParserErrorCode.constClass, + ParserErrorCode.constConstructorWithBody, + ParserErrorCode.constFactory, + ParserErrorCode.constMethod, + ParserErrorCode.continueOutsideOfLoop, + ParserErrorCode.continueWithoutLabelInCase, + ParserErrorCode.covariantAndStatic, + ParserErrorCode.covariantConstructor, + ParserErrorCode.covariantMember, + ParserErrorCode.defaultInSwitchExpression, + ParserErrorCode.defaultValueInFunctionType, + ParserErrorCode.deferredAfterPrefix, + ParserErrorCode.directiveAfterDeclaration, + ParserErrorCode.duplicatedModifier, + ParserErrorCode.duplicateDeferred, + ParserErrorCode.duplicateLabelInSwitchStatement, + ParserErrorCode.duplicatePrefix, + ParserErrorCode.emptyEnumBody, + ParserErrorCode.emptyRecordLiteralWithComma, + ParserErrorCode.emptyRecordTypeNamedFieldsList, + ParserErrorCode.emptyRecordTypeWithComma, + ParserErrorCode.enumInClass, + ParserErrorCode.equalityCannotBeEqualityOperand, + ParserErrorCode.expectedCaseOrDefault, + ParserErrorCode.expectedCatchClauseBody, + ParserErrorCode.expectedClassBody, + ParserErrorCode.expectedClassMember, + ParserErrorCode.expectedElseOrComma, + ParserErrorCode.expectedExecutable, + ParserErrorCode.expectedExtensionBody, + ParserErrorCode.expectedExtensionTypeBody, + ParserErrorCode.expectedFinallyClauseBody, + ParserErrorCode.expectedIdentifierButGotKeyword, + ParserErrorCode.expectedInstead, + ParserErrorCode.expectedListOrMapLiteral, + ParserErrorCode.expectedMixinBody, + ParserErrorCode.expectedNamedTypeExtends, + ParserErrorCode.expectedNamedTypeImplements, + ParserErrorCode.expectedNamedTypeOn, + ParserErrorCode.expectedNamedTypeWith, + ParserErrorCode.expectedRepresentationField, + ParserErrorCode.expectedRepresentationType, + ParserErrorCode.expectedStringLiteral, + ParserErrorCode.expectedSwitchExpressionBody, + ParserErrorCode.expectedSwitchStatementBody, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedTryStatementBody, + ParserErrorCode.expectedTypeName, + ParserErrorCode.experimentNotEnabled, + ParserErrorCode.experimentNotEnabledOffByDefault, + ParserErrorCode.exportDirectiveAfterPartDirective, + ParserErrorCode.extensionAugmentationHasOnClause, + ParserErrorCode.extensionDeclaresAbstractMember, + ParserErrorCode.extensionDeclaresConstructor, + ParserErrorCode.extensionTypeExtends, + ParserErrorCode.extensionTypeWith, + ParserErrorCode.externalClass, + ParserErrorCode.externalConstructorWithBody, + ParserErrorCode.externalConstructorWithFieldInitializers, + ParserErrorCode.externalConstructorWithInitializer, + ParserErrorCode.externalEnum, + ParserErrorCode.externalFactoryRedirection, + ParserErrorCode.externalFactoryWithBody, + ParserErrorCode.externalField, + ParserErrorCode.externalGetterWithBody, + ParserErrorCode.externalLateField, + ParserErrorCode.externalMethodWithBody, + ParserErrorCode.externalOperatorWithBody, + ParserErrorCode.externalSetterWithBody, + ParserErrorCode.externalTypedef, + ParserErrorCode.extraneousModifier, + ParserErrorCode.extraneousModifierInExtensionType, + ParserErrorCode.extraneousModifierInPrimaryConstructor, + ParserErrorCode.factoryTopLevelDeclaration, + ParserErrorCode.factoryWithoutBody, + ParserErrorCode.factoryWithInitializers, + ParserErrorCode.fieldInitializedOutsideDeclaringClass, + ParserErrorCode.fieldInitializerOutsideConstructor, + ParserErrorCode.finalAndCovariant, + ParserErrorCode.finalAndCovariantLateWithInitializer, + ParserErrorCode.finalAndVar, + ParserErrorCode.finalConstructor, + ParserErrorCode.finalEnum, + ParserErrorCode.finalMethod, + ParserErrorCode.finalMixin, + ParserErrorCode.finalMixinClass, + ParserErrorCode.functionTypedParameterVar, + ParserErrorCode.getterConstructor, + ParserErrorCode.getterInFunction, + ParserErrorCode.getterWithParameters, + ParserErrorCode.illegalAssignmentToNonAssignable, + ParserErrorCode.illegalPatternAssignmentVariableName, + ParserErrorCode.illegalPatternIdentifierName, + ParserErrorCode.illegalPatternVariableName, + ParserErrorCode.implementsBeforeExtends, + ParserErrorCode.implementsBeforeOn, + ParserErrorCode.implementsBeforeWith, + ParserErrorCode.importDirectiveAfterPartDirective, + ParserErrorCode.initializedVariableInForEach, + ParserErrorCode.interfaceEnum, + ParserErrorCode.interfaceMixin, + ParserErrorCode.interfaceMixinClass, + ParserErrorCode.invalidAwaitInFor, + ParserErrorCode.invalidCodePoint, + ParserErrorCode.invalidCommentReference, + ParserErrorCode.invalidConstantConstPrefix, + ParserErrorCode.invalidConstantPatternBinary, + ParserErrorCode.invalidConstantPatternDuplicateConst, + ParserErrorCode.invalidConstantPatternEmptyRecordLiteral, + ParserErrorCode.invalidConstantPatternGeneric, + ParserErrorCode.invalidConstantPatternNegation, + ParserErrorCode.invalidConstantPatternUnary, + ParserErrorCode.invalidConstructorName, + ParserErrorCode.invalidGenericFunctionType, + ParserErrorCode.invalidHexEscape, + ParserErrorCode.invalidInitializer, + ParserErrorCode.invalidInsideUnaryPattern, + ParserErrorCode.invalidLiteralInConfiguration, + ParserErrorCode.invalidOperator, + ParserErrorCode.invalidOperatorForSuper, + ParserErrorCode.invalidOperatorQuestionmarkPeriodForSuper, + ParserErrorCode.invalidStarAfterAsync, + ParserErrorCode.invalidSuperInInitializer, + ParserErrorCode.invalidSync, + ParserErrorCode.invalidThisInInitializer, + ParserErrorCode.invalidUnicodeEscapeStarted, + ParserErrorCode.invalidUnicodeEscapeUBracket, + ParserErrorCode.invalidUnicodeEscapeUNoBracket, + ParserErrorCode.invalidUnicodeEscapeUStarted, + ParserErrorCode.invalidUseOfCovariantInExtension, + ParserErrorCode.invalidUseOfIdentifierAugmented, + ParserErrorCode.latePatternVariableDeclaration, + ParserErrorCode.libraryDirectiveNotFirst, + ParserErrorCode.literalWithClass, + ParserErrorCode.literalWithClassAndNew, + ParserErrorCode.literalWithNew, + ParserErrorCode.localFunctionDeclarationModifier, + ParserErrorCode.memberWithClassName, + ParserErrorCode.missingAssignableSelector, + ParserErrorCode.missingAssignmentInInitializer, + ParserErrorCode.missingCatchOrFinally, + ParserErrorCode.missingClosingParenthesis, + ParserErrorCode.missingConstFinalVarOrType, + ParserErrorCode.missingEnumBody, + ParserErrorCode.missingExpressionInInitializer, + ParserErrorCode.missingExpressionInThrow, + ParserErrorCode.missingFunctionBody, + ParserErrorCode.missingFunctionKeyword, + ParserErrorCode.missingFunctionParameters, + ParserErrorCode.missingGet, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingInitializer, + ParserErrorCode.missingKeywordOperator, + ParserErrorCode.missingMethodParameters, + ParserErrorCode.missingNameForNamedParameter, + ParserErrorCode.missingNameInLibraryDirective, + ParserErrorCode.missingNameInPartOfDirective, + ParserErrorCode.missingPrefixInDeferredImport, + ParserErrorCode.missingPrimaryConstructor, + ParserErrorCode.missingPrimaryConstructorParameters, + ParserErrorCode.missingStarAfterSync, + ParserErrorCode.missingStatement, + ParserErrorCode.missingTerminatorForParameterGroup, + ParserErrorCode.missingTypedefParameters, + ParserErrorCode.missingVariableInForEach, + ParserErrorCode.mixedParameterGroups, + ParserErrorCode.mixinDeclaresConstructor, + ParserErrorCode.mixinWithClause, + ParserErrorCode.modifierOutOfOrder, + ParserErrorCode.multipleClauses, + ParserErrorCode.multipleExtendsClauses, + ParserErrorCode.multipleImplementsClauses, + ParserErrorCode.multipleLibraryDirectives, + ParserErrorCode.multipleNamedParameterGroups, + ParserErrorCode.multipleOnClauses, + ParserErrorCode.multiplePartOfDirectives, + ParserErrorCode.multiplePositionalParameterGroups, + ParserErrorCode.multipleRepresentationFields, + ParserErrorCode.multipleVariablesInForEach, + ParserErrorCode.multipleVarianceModifiers, + ParserErrorCode.multipleWithClauses, + ParserErrorCode.namedFunctionExpression, + ParserErrorCode.namedFunctionType, + ParserErrorCode.namedParameterOutsideGroup, + ParserErrorCode.nativeClauseInNonSdkCode, + ParserErrorCode.nativeClauseShouldBeAnnotation, + ParserErrorCode.nativeFunctionBodyInNonSdkCode, + ParserErrorCode.nonConstructorFactory, + ParserErrorCode.nonIdentifierLibraryName, + ParserErrorCode.nonPartOfDirectiveInPart, + ParserErrorCode.nonStringLiteralAsUri, + ParserErrorCode.nonUserDefinableOperator, + ParserErrorCode.normalBeforeOptionalParameters, + ParserErrorCode.nullAwareCascadeOutOfOrder, + ParserErrorCode.outOfOrderClauses, + ParserErrorCode.partOfName, + ParserErrorCode.patternAssignmentDeclaresVariable, + ParserErrorCode.patternVariableDeclarationOutsideFunctionOrMethod, + ParserErrorCode.positionalAfterNamedArgument, + ParserErrorCode.positionalParameterOutsideGroup, + ParserErrorCode.prefixAfterCombinator, + ParserErrorCode.recordLiteralOnePositionalNoTrailingComma, + ParserErrorCode.recordTypeOnePositionalNoTrailingComma, + ParserErrorCode.redirectingConstructorWithBody, + ParserErrorCode.redirectionInNonFactoryConstructor, + ParserErrorCode.representationFieldModifier, + ParserErrorCode.representationFieldTrailingComma, + ParserErrorCode.sealedEnum, + ParserErrorCode.sealedMixin, + ParserErrorCode.sealedMixinClass, + ParserErrorCode.setterConstructor, + ParserErrorCode.setterInFunction, + ParserErrorCode.stackOverflow, + ParserErrorCode.staticConstructor, + ParserErrorCode.staticGetterWithoutBody, + ParserErrorCode.staticOperator, + ParserErrorCode.staticSetterWithoutBody, + ParserErrorCode.switchHasCaseAfterDefaultCase, + ParserErrorCode.switchHasMultipleDefaultCases, + ParserErrorCode.topLevelOperator, + ParserErrorCode.typedefInClass, + ParserErrorCode.typeArgumentsOnTypeVariable, + ParserErrorCode.typeBeforeFactory, + ParserErrorCode.typeParameterOnConstructor, + ParserErrorCode.typeParameterOnOperator, + ParserErrorCode.unexpectedTerminatorForParameterGroup, + ParserErrorCode.unexpectedToken, + ParserErrorCode.unexpectedTokens, + ParserErrorCode.variablePatternKeywordInDeclarationContext, + ParserErrorCode.varAndType, + ParserErrorCode.varAsTypeName, + ParserErrorCode.varClass, + ParserErrorCode.varEnum, + ParserErrorCode.varReturnType, + ParserErrorCode.varTypedef, + ParserErrorCode.voidWithTypeArguments, + ParserErrorCode.withBeforeExtends, + ParserErrorCode.wrongNumberOfParametersForSetter, + ParserErrorCode.wrongSeparatorForPositionalParameter, + ParserErrorCode.wrongTerminatorForParameterGroup, + PubspecWarningCode.assetDirectoryDoesNotExist, + PubspecWarningCode.assetDoesNotExist, + PubspecWarningCode.assetFieldNotList, + PubspecWarningCode.assetMissingPath, + PubspecWarningCode.assetNotString, + PubspecWarningCode.assetNotStringOrMap, + PubspecWarningCode.assetPathNotString, + PubspecWarningCode.dependenciesFieldNotMap, + PubspecWarningCode.deprecatedField, + PubspecWarningCode.flutterFieldNotMap, + PubspecWarningCode.invalidDependency, + PubspecWarningCode.invalidPlatformsField, + PubspecWarningCode.missingDependency, + PubspecWarningCode.missingName, + PubspecWarningCode.nameNotString, + PubspecWarningCode.pathDoesNotExist, + PubspecWarningCode.pathNotPosix, + PubspecWarningCode.pathPubspecDoesNotExist, + PubspecWarningCode.platformValueDisallowed, + PubspecWarningCode.unknownPlatform, + PubspecWarningCode.unnecessaryDevDependency, + PubspecWarningCode.workspaceFieldNotList, + PubspecWarningCode.workspaceValueNotString, + PubspecWarningCode.workspaceValueNotSubdirectory, + ScannerErrorCode.expectedToken, + ScannerErrorCode.illegalCharacter, + ScannerErrorCode.missingDigit, + ScannerErrorCode.missingHexDigit, + ScannerErrorCode.missingIdentifier, + ScannerErrorCode.missingQuote, + ScannerErrorCode.unableGetContent, + ScannerErrorCode.unexpectedDollarInString, + ScannerErrorCode.unexpectedSeparatorInNumber, + ScannerErrorCode.unsupportedOperator, + ScannerErrorCode.unterminatedMultiLineComment, + ScannerErrorCode.unterminatedStringLiteral, + StaticWarningCode.deadNullAwareExpression, + StaticWarningCode.invalidNullAwareElement, + StaticWarningCode.invalidNullAwareMapEntryKey, + StaticWarningCode.invalidNullAwareMapEntryValue, + StaticWarningCode.invalidNullAwareOperator, + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit, + StaticWarningCode.missingEnumConstantInSwitch, + StaticWarningCode.unnecessaryNonNullAssertion, + StaticWarningCode.unnecessaryNullAssertPattern, + StaticWarningCode.unnecessaryNullCheckPattern, + TodoCode.fixme, + TodoCode.hack, + TodoCode.todo, + TodoCode.undone, + WarningCode.argumentTypeNotAssignableToErrorHandler, + WarningCode.assignmentOfDoNotStore, + WarningCode.bodyMightCompleteNormallyCatchError, + WarningCode.bodyMightCompleteNormallyNullable, + WarningCode.castFromNullableAlwaysFails, + WarningCode.castFromNullAlwaysFails, + WarningCode.constantPatternNeverMatchesValueType, + WarningCode.deadCode, + WarningCode.deadCodeCatchFollowingCatch, + WarningCode.deadCodeLateWildcardVariableInitializer, + WarningCode.deadCodeOnCatchSubtype, + WarningCode.deprecatedExportUse, + WarningCode.deprecatedExtend, + WarningCode.deprecatedExtendsFunction, + WarningCode.deprecatedImplement, + WarningCode.deprecatedImplementsFunction, + WarningCode.deprecatedMixinFunction, + WarningCode.deprecatedNewInCommentReference, + WarningCode.deprecatedSubclass, + WarningCode.docDirectiveArgumentWrongFormat, + WarningCode.docDirectiveHasExtraArguments, + WarningCode.docDirectiveHasUnexpectedNamedArgument, + WarningCode.docDirectiveMissingClosingBrace, + WarningCode.docDirectiveMissingClosingTag, + WarningCode.docDirectiveMissingOneArgument, + WarningCode.docDirectiveMissingOpeningTag, + WarningCode.docDirectiveMissingThreeArguments, + WarningCode.docDirectiveMissingTwoArguments, + WarningCode.docDirectiveUnknown, + WarningCode.docImportCannotBeDeferred, + WarningCode.docImportCannotHaveCombinators, + WarningCode.docImportCannotHaveConfigurations, + WarningCode.docImportCannotHavePrefix, + WarningCode.duplicateExport, + WarningCode.duplicateHiddenName, + WarningCode.duplicateIgnore, + WarningCode.duplicateImport, + WarningCode.duplicateShownName, + WarningCode.equalElementsInSet, + WarningCode.equalKeysInMap, + WarningCode.inferenceFailureOnCollectionLiteral, + WarningCode.inferenceFailureOnFunctionInvocation, + WarningCode.inferenceFailureOnFunctionReturnType, + WarningCode.inferenceFailureOnGenericInvocation, + WarningCode.inferenceFailureOnInstanceCreation, + WarningCode.inferenceFailureOnUninitializedVariable, + WarningCode.inferenceFailureOnUntypedParameter, + WarningCode.invalidAnnotationTarget, + WarningCode.invalidAwaitNotRequiredAnnotation, + WarningCode.invalidDeprecatedExtendAnnotation, + WarningCode.invalidDeprecatedImplementAnnotation, + WarningCode.invalidDeprecatedSubclassAnnotation, + WarningCode.invalidExportOfInternalElement, + WarningCode.invalidExportOfInternalElementIndirectly, + WarningCode.invalidFactoryMethodDecl, + WarningCode.invalidFactoryMethodImpl, + WarningCode.invalidInternalAnnotation, + WarningCode.invalidLanguageVersionOverrideAtSign, + WarningCode.invalidLanguageVersionOverrideEquals, + WarningCode.invalidLanguageVersionOverrideGreater, + WarningCode.invalidLanguageVersionOverrideLocation, + WarningCode.invalidLanguageVersionOverrideLowerCase, + WarningCode.invalidLanguageVersionOverrideNumber, + WarningCode.invalidLanguageVersionOverridePrefix, + WarningCode.invalidLanguageVersionOverrideTrailingCharacters, + WarningCode.invalidLanguageVersionOverrideTwoSlashes, + WarningCode.invalidLiteralAnnotation, + WarningCode.invalidNonVirtualAnnotation, + WarningCode.invalidOverrideOfNonVirtualMember, + WarningCode.invalidReopenAnnotation, + WarningCode.invalidRequiredNamedParam, + WarningCode.invalidRequiredOptionalPositionalParam, + WarningCode.invalidRequiredPositionalParam, + WarningCode.invalidUseOfDoNotSubmitMember, + WarningCode.invalidUseOfInternalMember, + WarningCode.invalidUseOfProtectedMember, + WarningCode.invalidUseOfVisibleForOverridingMember, + WarningCode.invalidUseOfVisibleForTemplateMember, + WarningCode.invalidUseOfVisibleForTestingMember, + WarningCode.invalidVisibilityAnnotation, + WarningCode.invalidVisibleForOverridingAnnotation, + WarningCode.invalidVisibleOutsideTemplateAnnotation, + WarningCode.invalidWidgetPreviewApplication, + WarningCode.invalidWidgetPreviewPrivateArgument, + WarningCode.missingOverrideOfMustBeOverriddenOne, + WarningCode.missingOverrideOfMustBeOverriddenThreePlus, + WarningCode.missingOverrideOfMustBeOverriddenTwo, + WarningCode.missingRequiredParam, + WarningCode.missingRequiredParamWithDetails, + WarningCode.mixinOnSealedClass, + WarningCode.multipleCombinators, + WarningCode.mustBeImmutable, + WarningCode.mustCallSuper, + WarningCode.nonConstArgumentForConstParameter, + WarningCode.nonConstCallToLiteralConstructor, + WarningCode.nonConstCallToLiteralConstructorUsingNew, + WarningCode.nonNullableEqualsParameter, + WarningCode.nullableTypeInCatchClause, + WarningCode.nullArgumentToNonNullType, + WarningCode.nullCheckAlwaysFails, + WarningCode.overrideOnNonOverridingField, + WarningCode.overrideOnNonOverridingGetter, + WarningCode.overrideOnNonOverridingMethod, + WarningCode.overrideOnNonOverridingSetter, + WarningCode.patternNeverMatchesValueType, + WarningCode.receiverOfTypeNever, + WarningCode.redeclareOnNonRedeclaringMember, + WarningCode.removedLintUse, + WarningCode.replacedLintUse, + WarningCode.returnOfDoNotStore, + WarningCode.returnOfInvalidTypeFromCatchError, + WarningCode.returnTypeInvalidForCatchError, + WarningCode.sdkVersionConstructorTearoffs, + WarningCode.sdkVersionGtGtGtOperator, + WarningCode.sdkVersionSince, + WarningCode.strictRawType, + WarningCode.subtypeOfSealedClass, + WarningCode.textDirectionCodePointInComment, + WarningCode.textDirectionCodePointInLiteral, + WarningCode.typeCheckIsNotNull, + WarningCode.typeCheckIsNull, + WarningCode.undefinedHiddenName, + WarningCode.undefinedReferencedParameter, + WarningCode.undefinedShownName, + WarningCode.unignorableIgnore, + WarningCode.unnecessaryCast, + WarningCode.unnecessaryCastPattern, + WarningCode.unnecessaryFinal, + WarningCode.unnecessaryNanComparisonFalse, + WarningCode.unnecessaryNanComparisonTrue, + WarningCode.unnecessaryNoSuchMethod, + WarningCode.unnecessaryNullComparisonAlwaysNullFalse, + WarningCode.unnecessaryNullComparisonAlwaysNullTrue, + WarningCode.unnecessaryNullComparisonNeverNullFalse, + WarningCode.unnecessaryNullComparisonNeverNullTrue, + WarningCode.unnecessaryQuestionMark, + WarningCode.unnecessarySetLiteral, + WarningCode.unnecessaryTypeCheckFalse, + WarningCode.unnecessaryTypeCheckTrue, + WarningCode.unnecessaryWildcardPattern, + WarningCode.unreachableSwitchCase, + WarningCode.unreachableSwitchDefault, + WarningCode.unusedCatchClause, + WarningCode.unusedCatchStack, + WarningCode.unusedElement, + WarningCode.unusedElementParameter, + WarningCode.unusedField, + WarningCode.unusedImport, + WarningCode.unusedLabel, + WarningCode.unusedLocalVariable, + WarningCode.unusedResult, + WarningCode.unusedResultWithMessage, + WarningCode.unusedShownName, + WarningCode.uriDoesNotExistInDocImport, ]; @AnalyzerPublicApi(message: 'exported by lib/error/error.dart') diff --git a/pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart b/pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart index 209856d9a8a..739977f167e 100644 --- a/pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart +++ b/pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart @@ -30,8 +30,7 @@ class DiagnosticFactory { source: source, offset: duplicate.offset, length: duplicate.length, - diagnosticCode: - CompileTimeErrorCode.DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE, + diagnosticCode: CompileTimeErrorCode.duplicatePatternAssignmentVariable, arguments: [variable.name!], contextMessages: [ DiagnosticMessageImpl( @@ -112,7 +111,7 @@ class DiagnosticFactory { source: source, offset: duplicateNode.offset, length: duplicateNode.length, - diagnosticCode: CompileTimeErrorCode.DUPLICATE_FIELD_NAME, + diagnosticCode: CompileTimeErrorCode.duplicateFieldName, arguments: [duplicateName], contextMessages: [ DiagnosticMessageImpl( @@ -142,7 +141,7 @@ class DiagnosticFactory { source: source, offset: duplicateNode.offset, length: duplicateNode.length, - diagnosticCode: CompileTimeErrorCode.DUPLICATE_FIELD_NAME, + diagnosticCode: CompileTimeErrorCode.duplicateFieldName, arguments: [duplicateName], contextMessages: [ DiagnosticMessageImpl( @@ -172,7 +171,7 @@ class DiagnosticFactory { source: source, offset: duplicateTarget.offset, length: duplicateTarget.length, - diagnosticCode: CompileTimeErrorCode.DUPLICATE_PATTERN_FIELD, + diagnosticCode: CompileTimeErrorCode.duplicatePatternField, arguments: [name], contextMessages: [ DiagnosticMessageImpl( @@ -197,7 +196,7 @@ class DiagnosticFactory { source: source, offset: duplicateElement.offset, length: duplicateElement.length, - diagnosticCode: CompileTimeErrorCode.DUPLICATE_REST_ELEMENT_IN_PATTERN, + diagnosticCode: CompileTimeErrorCode.duplicateRestElementInPattern, contextMessages: [ DiagnosticMessageImpl( filePath: source.fullName, @@ -221,7 +220,7 @@ class DiagnosticFactory { source: source, offset: duplicateElement.offset, length: duplicateElement.length, - diagnosticCode: CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + diagnosticCode: CompileTimeErrorCode.equalElementsInConstSet, contextMessages: [ DiagnosticMessageImpl( filePath: source.fullName, @@ -245,7 +244,7 @@ class DiagnosticFactory { source: source, offset: duplicateKey.offset, length: duplicateKey.length, - diagnosticCode: CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + diagnosticCode: CompileTimeErrorCode.equalKeysInConstMap, contextMessages: [ DiagnosticMessageImpl( filePath: source.fullName, @@ -269,7 +268,7 @@ class DiagnosticFactory { source: source, offset: duplicateKey.offset, length: duplicateKey.length, - diagnosticCode: CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + diagnosticCode: CompileTimeErrorCode.equalKeysInMapPattern, contextMessages: [ DiagnosticMessageImpl( filePath: source.fullName, @@ -295,7 +294,7 @@ class DiagnosticFactory { offset: offset, length: length, diagnosticCode: - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit, arguments: arguments, contextMessages: [ DiagnosticMessageImpl( @@ -341,7 +340,7 @@ class DiagnosticFactory { // INVALID_IMPLEMENTATION_OVERRIDE may provide the subclass as superMember // if the subclass has an abstract member and the superclass has the // concrete). - if (code == CompileTimeErrorCode.INVALID_OVERRIDE) + if (code == CompileTimeErrorCode.invalidOverride) DiagnosticMessageImpl( filePath: superFragment.libraryFragment!.source.fullName, message: "The member being overridden.", @@ -349,7 +348,7 @@ class DiagnosticFactory { length: superFragment.name!.length, url: null, ), - if (code == CompileTimeErrorCode.INVALID_OVERRIDE_SETTER) + if (code == CompileTimeErrorCode.invalidOverrideSetter) DiagnosticMessageImpl( filePath: superFragment.libraryFragment!.source.fullName, message: "The setter being overridden.", @@ -386,7 +385,7 @@ class DiagnosticFactory { source: source, offset: nameToken.offset, length: nameToken.length, - diagnosticCode: CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + diagnosticCode: CompileTimeErrorCode.referencedBeforeDeclaration, arguments: [name], contextMessages: contextMessages ?? const [], ); diff --git a/pkg/analyzer/lib/src/error/annotation_verifier.dart b/pkg/analyzer/lib/src/error/annotation_verifier.dart index df226fe967e..b8b17796051 100644 --- a/pkg/analyzer/lib/src/error/annotation_verifier.dart +++ b/pkg/analyzer/lib/src/error/annotation_verifier.dart @@ -87,7 +87,7 @@ class AnnotationVerifier { _diagnosticReporter.atNode( errorNode ?? node.name, - WarningCode.INVALID_AWAIT_NOT_REQUIRED_ANNOTATION, + WarningCode.invalidAwaitNotRequiredAnnotation, ); } @@ -164,7 +164,7 @@ class AnnotationVerifier { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_DEPRECATED_EXTEND_ANNOTATION, + WarningCode.invalidDeprecatedExtendAnnotation, ); } @@ -190,7 +190,7 @@ class AnnotationVerifier { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_DEPRECATED_IMPLEMENT_ANNOTATION, + WarningCode.invalidDeprecatedImplementAnnotation, ); } @@ -217,7 +217,7 @@ class AnnotationVerifier { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_DEPRECATED_SUBCLASS_ANNOTATION, + WarningCode.invalidDeprecatedSubclassAnnotation, ); } @@ -233,7 +233,7 @@ class AnnotationVerifier { if (returnType is VoidType) { _diagnosticReporter.atToken( parent.name, - WarningCode.INVALID_FACTORY_METHOD_DECL, + WarningCode.invalidFactoryMethodDecl, arguments: [parent.name.lexeme], ); return; @@ -263,7 +263,7 @@ class AnnotationVerifier { _diagnosticReporter.atToken( parent.name, - WarningCode.INVALID_FACTORY_METHOD_IMPL, + WarningCode.invalidFactoryMethodImpl, arguments: [parent.name.lexeme], ); } @@ -281,7 +281,7 @@ class AnnotationVerifier { if (element.isPrivate) { _diagnosticReporter.atNode( variable, - WarningCode.INVALID_INTERNAL_ANNOTATION, + WarningCode.invalidInternalAnnotation, ); } } @@ -291,7 +291,7 @@ class AnnotationVerifier { if (element.isPrivate) { _diagnosticReporter.atNode( variable, - WarningCode.INVALID_INTERNAL_ANNOTATION, + WarningCode.invalidInternalAnnotation, ); } } @@ -301,18 +301,18 @@ class AnnotationVerifier { if (class_.isPrivate || parentElementIsPrivate) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_INTERNAL_ANNOTATION, + WarningCode.invalidInternalAnnotation, ); } } else if (parentElementIsPrivate) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_INTERNAL_ANNOTATION, + WarningCode.invalidInternalAnnotation, ); } else if (_inPackagePublicApi) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_INTERNAL_ANNOTATION, + WarningCode.invalidInternalAnnotation, ); } } @@ -336,7 +336,7 @@ class AnnotationVerifier { var validKinds = kindNames.commaSeparatedWithOr; _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_ANNOTATION_TARGET, + WarningCode.invalidAnnotationTarget, arguments: [name!, validKinds], ); return; @@ -351,7 +351,7 @@ class AnnotationVerifier { if (parent is! ConstructorDeclaration || parent.constKeyword == null) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_LITERAL_ANNOTATION, + WarningCode.invalidLiteralAnnotation, ); } } @@ -364,7 +364,7 @@ class AnnotationVerifier { if (parent.isStatic) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, + WarningCode.invalidNonVirtualAnnotation, ); } } else if (parent is MethodDeclaration) { @@ -374,13 +374,13 @@ class AnnotationVerifier { parent.isAbstract) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, + WarningCode.invalidNonVirtualAnnotation, ); } } else { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, + WarningCode.invalidNonVirtualAnnotation, ); } } @@ -393,7 +393,7 @@ class AnnotationVerifier { parent is MethodDeclaration && parent.isStatic) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_ANNOTATION_TARGET, + WarningCode.invalidAnnotationTarget, arguments: [node.name.name, 'instance members of extension types'], ); } @@ -429,14 +429,14 @@ class AnnotationVerifier { classElement.isSealed) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_REOPEN_ANNOTATION, + WarningCode.invalidReopenAnnotation, ); return; } if (classElement.library != superElement.library) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_REOPEN_ANNOTATION, + WarningCode.invalidReopenAnnotation, ); return; } @@ -444,7 +444,7 @@ class AnnotationVerifier { if (!superElement.isFinal && !superElement.isInterface) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_REOPEN_ANNOTATION, + WarningCode.invalidReopenAnnotation, ); return; } @@ -455,7 +455,7 @@ class AnnotationVerifier { if (!superElement.isInterface) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_REOPEN_ANNOTATION, + WarningCode.invalidReopenAnnotation, ); return; } @@ -485,7 +485,7 @@ class AnnotationVerifier { : undefinedParameter.correspondingParameter?.name; _diagnosticReporter.atNode( undefinedParameter, - WarningCode.UNDEFINED_REFERENCED_PARAMETER, + WarningCode.undefinedReferencedParameter, arguments: [parameterName ?? undefinedParameter, name], ); } @@ -503,7 +503,7 @@ class AnnotationVerifier { // assume that `declaredElement.name` is non-`null`. _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_VISIBILITY_ANNOTATION, + WarningCode.invalidVisibilityAnnotation, arguments: [name, node.name.name], ); } @@ -511,7 +511,7 @@ class AnnotationVerifier { void reportInvalidVisibleForOverriding() { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, + WarningCode.invalidVisibleForOverridingAnnotation, ); } @@ -567,7 +567,7 @@ class AnnotationVerifier { void reportError() { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, + WarningCode.invalidVisibleOutsideTemplateAnnotation, ); } diff --git a/pkg/analyzer/lib/src/error/assignment_verifier.dart b/pkg/analyzer/lib/src/error/assignment_verifier.dart index 6851a6d0cbd..635e53ec69b 100644 --- a/pkg/analyzer/lib/src/error/assignment_verifier.dart +++ b/pkg/analyzer/lib/src/error/assignment_verifier.dart @@ -25,8 +25,8 @@ class AssignmentVerifier { /// a good error about this. /// /// When the [receiverType] is not `null`, we report - /// [CompileTimeErrorCode.UNDEFINED_SETTER] instead of a more generic - /// [CompileTimeErrorCode.UNDEFINED_IDENTIFIER]. + /// [CompileTimeErrorCode.undefinedSetter] instead of a more generic + /// [CompileTimeErrorCode.undefinedIdentifier]. void verify({ required SimpleIdentifier node, required Element? requested, @@ -38,7 +38,7 @@ class AssignmentVerifier { if (requested.isConst) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.ASSIGNMENT_TO_CONST, + CompileTimeErrorCode.assignmentToConst, ); } } @@ -49,23 +49,20 @@ class AssignmentVerifier { recovery is InterfaceElement || recovery is TypeAliasElement || recovery is TypeParameterElement) { - _diagnosticReporter.atNode(node, CompileTimeErrorCode.ASSIGNMENT_TO_TYPE); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.assignmentToType); } else if (recovery is LocalFunctionElement || recovery is TopLevelFunctionElement) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.ASSIGNMENT_TO_FUNCTION, + CompileTimeErrorCode.assignmentToFunction, ); } else if (recovery is MethodElement) { - _diagnosticReporter.atNode( - node, - CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, - ); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.assignmentToMethod); } else if (recovery is PrefixElement) { if (recovery.name case var prefixName?) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, + CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, arguments: [prefixName], ); } @@ -79,18 +76,18 @@ class AssignmentVerifier { if (variable.isConst) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.ASSIGNMENT_TO_CONST, + CompileTimeErrorCode.assignmentToConst, ); } else if (variable is FieldElement && variable.isSynthetic) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, + CompileTimeErrorCode.assignmentToFinalNoSetter, arguments: [variableName, variable.enclosingElement.displayName], ); } else { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, + CompileTimeErrorCode.assignmentToFinal, arguments: [variableName], ); } @@ -103,13 +100,13 @@ class AssignmentVerifier { if (receiverType != null) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_SETTER, + CompileTimeErrorCode.undefinedSetter, arguments: [node.name, receiverType], ); } else { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER, + CompileTimeErrorCode.undefinedIdentifier, arguments: [node.name], ); } diff --git a/pkg/analyzer/lib/src/error/base_or_final_type_verifier.dart b/pkg/analyzer/lib/src/error/base_or_final_type_verifier.dart index 80d2a6b5fa5..b270d80cb5e 100644 --- a/pkg/analyzer/lib/src/error/base_or_final_type_verifier.dart +++ b/pkg/analyzer/lib/src/error/base_or_final_type_verifier.dart @@ -28,9 +28,9 @@ class BaseOrFinalTypeVerifier { /// final, or sealed and that base elements are not implemented outside of its /// library. Otherwise, an error is reported on that element. /// - /// See [CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED], - /// [CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED], - /// [CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY]. + /// See [CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed], + /// [CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed], + /// [CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary]. void checkElement( InterfaceElementImpl element, ImplementsClause? implementsClause, @@ -239,9 +239,8 @@ class BaseOrFinalTypeVerifier { if (baseOrFinalSuperElement.isBase) { var errorCode = baseOrFinalSuperElement is MixinElement - ? CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY - : CompileTimeErrorCode - .BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY; + ? CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary + : CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary; _diagnosticReporter.atNode( implementsNamedType, errorCode, @@ -276,9 +275,8 @@ class BaseOrFinalTypeVerifier { } var errorCode = element is MixinElement - ? CompileTimeErrorCode.MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE - : CompileTimeErrorCode - .SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED; + ? CompileTimeErrorCode.mixinSubtypeOfFinalIsNotBase + : CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed; _diagnosticReporter.atElement2( element, errorCode, @@ -289,9 +287,8 @@ class BaseOrFinalTypeVerifier { } else if (baseOrFinalSuperElement.isBase) { var errorCode = element is MixinElement - ? CompileTimeErrorCode.MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE - : CompileTimeErrorCode - .SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED; + ? CompileTimeErrorCode.mixinSubtypeOfBaseIsNotBase + : CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed; _diagnosticReporter.atElement2( element, errorCode, diff --git a/pkg/analyzer/lib/src/error/best_practices_verifier.dart b/pkg/analyzer/lib/src/error/best_practices_verifier.dart index 5e6559e7ab8..6fdad49fc20 100644 --- a/pkg/analyzer/lib/src/error/best_practices_verifier.dart +++ b/pkg/analyzer/lib/src/error/best_practices_verifier.dart @@ -159,13 +159,13 @@ class BestPracticesVerifier extends RecursiveAstVisitor { @override void visitAsExpression(AsExpression node) { if (_isUnnecessaryCast(node, _typeSystem)) { - _diagnosticReporter.atNode(node, WarningCode.UNNECESSARY_CAST); + _diagnosticReporter.atNode(node, WarningCode.unnecessaryCast); } var type = node.type.type; if (type != null && _typeSystem.isNonNullable(type) && node.expression.typeOrThrow.isDartCoreNull) { - _diagnosticReporter.atNode(node, WarningCode.CAST_FROM_NULL_ALWAYS_FAILS); + _diagnosticReporter.atNode(node, WarningCode.castFromNullAlwaysFails); } super.visitAsExpression(node); } @@ -193,7 +193,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { _typeSystem.isNonNullable(type) && matchedValueType != null && matchedValueType.isDartCoreNull) { - _diagnosticReporter.atNode(node, WarningCode.CAST_FROM_NULL_ALWAYS_FAILS); + _diagnosticReporter.atNode(node, WarningCode.castFromNullAlwaysFails); } super.visitCastPattern(node); } @@ -264,7 +264,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { _currentLibrary.featureSet.isEnabled(Feature.constructor_tearoffs)) { _diagnosticReporter.atToken( newKeyword, - WarningCode.DEPRECATED_NEW_IN_COMMENT_REFERENCE, + WarningCode.deprecatedNewInCommentReference, ); } super.visitCommentReference(node); @@ -275,7 +275,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (node.expression.isDoubleNan) { _diagnosticReporter.atNode( node, - WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE, + WarningCode.unnecessaryNanComparisonFalse, ); } super.visitConstantPattern(node); @@ -314,12 +314,12 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (_currentLibrary.languageVersion.effective.major < 3) { _diagnosticReporter.atToken( separator, - HintCode.DEPRECATED_COLON_FOR_DEFAULT_VALUE, + HintCode.deprecatedColonForDefaultValue, ); } else { _diagnosticReporter.atToken( separator, - CompileTimeErrorCode.OBSOLETE_COLON_FOR_DEFAULT_VALUE, + CompileTimeErrorCode.obsoleteColonForDefaultValue, ); } } @@ -440,7 +440,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { // `overriddenElement.enclosingElement3.name` is non-`null`. _diagnosticReporter.atToken( field.name, - WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, + WarningCode.invalidOverrideOfNonVirtualMember, arguments: [ field.name.lexeme, overriddenElement.enclosingElement!.displayName, @@ -651,7 +651,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { // `overriddenElement.enclosingElement3.name` is non-`null`. _diagnosticReporter.atToken( node.name, - WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, + WarningCode.invalidOverrideOfNonVirtualMember, arguments: [ node.name.lexeme, overriddenElement.enclosingElement!.displayName, @@ -709,7 +709,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { type.alias == null) { _diagnosticReporter.atToken( question, - WarningCode.UNNECESSARY_QUESTION_MARK, + WarningCode.unnecessaryQuestionMark, arguments: [node.qualifiedName], ); } @@ -729,7 +729,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { _deprecatedMemberUseVerifier.postfixExpression(node); if (node.operator.type == TokenType.BANG && node.operand.typeOrThrow.isDartCoreNull) { - _diagnosticReporter.atNode(node, WarningCode.NULL_CHECK_ALWAYS_FAILS); + _diagnosticReporter.atNode(node, WarningCode.nullCheckAlwaysFails); } super.visitPostfixExpression(node); } @@ -806,10 +806,10 @@ class BestPracticesVerifier extends RecursiveAstVisitor { /// [IsExpression]. /// /// Returns `true` if a warning code is generated on [node]. - /// See [WarningCode.TYPE_CHECK_IS_NOT_NULL], - /// [WarningCode.TYPE_CHECK_IS_NULL], - /// [WarningCode.UNNECESSARY_TYPE_CHECK_TRUE], and - /// [WarningCode.UNNECESSARY_TYPE_CHECK_FALSE]. + /// See [WarningCode.typeCheckIsNotNull], + /// [WarningCode.typeCheckIsNull], + /// [WarningCode.unnecessaryTypeCheckTrue], and + /// [WarningCode.unnecessaryTypeCheckFalse]. bool _checkAllTypeChecks(IsExpressionImpl node) { var leftNode = node.expression; var leftType = leftNode.typeOrThrow; @@ -821,8 +821,8 @@ class BestPracticesVerifier extends RecursiveAstVisitor { _diagnosticReporter.atNode( node, node.notOperator == null - ? WarningCode.UNNECESSARY_TYPE_CHECK_TRUE - : WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, + ? WarningCode.unnecessaryTypeCheckTrue + : WarningCode.unnecessaryTypeCheckFalse, ); } @@ -850,8 +850,8 @@ class BestPracticesVerifier extends RecursiveAstVisitor { _diagnosticReporter.atNode( node, node.notOperator == null - ? WarningCode.TYPE_CHECK_IS_NULL - : WarningCode.TYPE_CHECK_IS_NOT_NULL, + ? WarningCode.typeCheckIsNull + : WarningCode.typeCheckIsNotNull, ); } return true; @@ -867,7 +867,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { void _checkFinalParameter(FormalParameter node, Token? keyword) { if (node.isFinal) { - _diagnosticReporter.atToken(keyword!, WarningCode.UNNECESSARY_FINAL); + _diagnosticReporter.atToken(keyword!, WarningCode.unnecessaryFinal); } } @@ -879,7 +879,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { // non-`null`. _diagnosticReporter.atNode( entry.key, - WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, + WarningCode.assignmentOfDoNotStore, arguments: [entry.value.name!], ); } @@ -907,8 +907,8 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (value != null && !alreadySeen.add(value)) { var errorCode = node.isSet - ? WarningCode.EQUAL_ELEMENTS_IN_SET - : WarningCode.EQUAL_KEYS_IN_MAP; + ? WarningCode.equalElementsInSet + : WarningCode.equalKeysInMap; _diagnosticReporter.atNode(expression, errorCode); } } @@ -992,7 +992,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (nonFinalFields.isNotEmpty) { _diagnosticReporter.atToken( node.name, - WarningCode.MUST_BE_IMMUTABLE, + WarningCode.mustBeImmutable, arguments: [nonFinalFields.join(', ')], ); } @@ -1013,7 +1013,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (libraryElement.metadata.hasInternal) { _diagnosticReporter.atNode( node, - WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, + WarningCode.invalidExportOfInternalElement, arguments: [libraryElement.displayName], ); } @@ -1024,7 +1024,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (element.metadata.hasInternal) { _diagnosticReporter.atNode( node, - WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, + WarningCode.invalidExportOfInternalElement, arguments: [element.displayName], ); return; @@ -1040,7 +1040,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (aliasElement != null && aliasElement.metadata.hasInternal) { _diagnosticReporter.atNode( node, - WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY, + WarningCode.invalidExportOfInternalElementIndirectly, arguments: [aliasElement.name!, element.displayName], ); } @@ -1071,14 +1071,14 @@ class BestPracticesVerifier extends RecursiveAstVisitor { // requiring specific messaging. _diagnosticReporter.atNode( node, - WarningCode.MIXIN_ON_SEALED_CLASS, + WarningCode.mixinOnSealedClass, arguments: [superclass.name.toString()], ); } else { // This is a regular violation of the sealed class contract. _diagnosticReporter.atNode( node, - WarningCode.SUBTYPE_OF_SEALED_CLASS, + WarningCode.subtypeOfSealedClass, arguments: [superclass.name.toString()], ); } @@ -1110,18 +1110,18 @@ class BestPracticesVerifier extends RecursiveAstVisitor { } if (node.operator.type == TokenType.BANG_EQ) { - checkLeftRight(WarningCode.UNNECESSARY_NAN_COMPARISON_TRUE); + checkLeftRight(WarningCode.unnecessaryNanComparisonTrue); } else if (node.operator.type == TokenType.EQ_EQ) { - checkLeftRight(WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE); + checkLeftRight(WarningCode.unnecessaryNanComparisonFalse); } } void _checkForInvariantNullComparison(BinaryExpression node) { WarningCode errorCode; if (node.operator.type == TokenType.BANG_EQ) { - errorCode = WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE; + errorCode = WarningCode.unnecessaryNullComparisonNeverNullTrue; } else if (node.operator.type == TokenType.EQ_EQ) { - errorCode = WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE; + errorCode = WarningCode.unnecessaryNullComparisonNeverNullFalse; } else { return; } @@ -1170,8 +1170,8 @@ class BestPracticesVerifier extends RecursiveAstVisitor { } var warning = node.keyword?.keyword == Keyword.NEW - ? WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR_USING_NEW - : WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR; + ? WarningCode.nonConstCallToLiteralConstructorUsingNew + : WarningCode.nonConstCallToLiteralConstructor; _diagnosticReporter.atNode( node, warning, @@ -1183,7 +1183,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { /// Report a warning if the dot shorthand constructor is marked with [literal] /// and is not const. /// - /// See [WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR]. + /// See [WarningCode.nonConstCallToLiteralConstructor]. void _checkForLiteralConstructorUseInDotShorthand( DotShorthandConstructorInvocation node, ) { @@ -1192,7 +1192,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (!node.isConst && constructor.metadata.hasLiteral && node.canBeConst) { _diagnosticReporter.atNode( node, - WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, + WarningCode.nonConstCallToLiteralConstructor, arguments: [constructor.displayName], ); } @@ -1205,7 +1205,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { /// @param importElement the [LibraryImport] retrieved from the node /// @return `true` if and only if an error code is generated on the passed /// node - /// See [HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION]. + /// See [HintCode.importDeferredLibraryWithLoadFunction]. bool _checkForLoadLibraryFunction( ImportDirective node, LibraryImport importElement, @@ -1227,7 +1227,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (loadLibraryElement != null) { _diagnosticReporter.atNode( node, - HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION, + HintCode.importDeferredLibraryWithLoadFunction, ); return true; } @@ -1261,7 +1261,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (_typeSystem.isNullable(parameterElement.type)) { _diagnosticReporter.atToken( node.name, - WarningCode.NON_NULLABLE_EQUALS_PARAMETER, + WarningCode.nonNullableEqualsParameter, ); } } @@ -1280,7 +1280,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (_typeSystem.isPotentiallyNullable(typeObj)) { _diagnosticReporter.atNode( typeNode, - WarningCode.NULLABLE_TYPE_IN_CATCH_CLAUSE, + WarningCode.nullableTypeInCatchClause, ); } } @@ -1305,7 +1305,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { // non-`null`. _diagnosticReporter.atNode( entry.key, - WarningCode.RETURN_OF_DO_NOT_STORE, + WarningCode.returnOfDoNotStore, arguments: [ entry.value.name!, parent.declaredFragment!.element.displayName, @@ -1344,7 +1344,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (isNonObjectNoSuchMethodInvocation(body.expression)) { _diagnosticReporter.atToken( node.name, - WarningCode.UNNECESSARY_NO_SUCH_METHOD, + WarningCode.unnecessaryNoSuchMethod, ); return true; } @@ -1356,7 +1356,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { isNonObjectNoSuchMethodInvocation(returnStatement.expression)) { _diagnosticReporter.atToken( node.name, - WarningCode.UNNECESSARY_NO_SUCH_METHOD, + WarningCode.unnecessaryNoSuchMethod, ); return true; } @@ -1401,7 +1401,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { if (expression is SetOrMapLiteralImpl && expression.isSet) { _diagnosticReporter.atNode( expression, - WarningCode.UNNECESSARY_SET_LITERAL, + WarningCode.unnecessarySetLiteral, ); } } @@ -1421,21 +1421,21 @@ class BestPracticesVerifier extends RecursiveAstVisitor { for (var param in nonNamedParamsWithRequired.where((p) => p.isOptional)) { _diagnosticReporter.atNode( param, - WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM, + WarningCode.invalidRequiredOptionalPositionalParam, arguments: [_formalParameterNameOrEmpty(param)], ); } for (var param in nonNamedParamsWithRequired.where((p) => p.isRequired)) { _diagnosticReporter.atNode( param, - WarningCode.INVALID_REQUIRED_POSITIONAL_PARAM, + WarningCode.invalidRequiredPositionalParam, arguments: [_formalParameterNameOrEmpty(param)], ); } for (var param in namedParamsWithRequiredAndDefault) { _diagnosticReporter.atNode( param, - WarningCode.INVALID_REQUIRED_NAMED_PARAM, + WarningCode.invalidRequiredNamedParam, arguments: [_formalParameterNameOrEmpty(param)], ); } @@ -1493,7 +1493,7 @@ class BestPracticesVerifier extends RecursiveAstVisitor { var element = parameter.declaredFragment!.element; _diagnosticReporter.atNode( parameter, - WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, + WarningCode.inferenceFailureOnUntypedParameter, arguments: [element.displayName], ); } @@ -1513,19 +1513,19 @@ class BestPracticesVerifier extends RecursiveAstVisitor { case MethodDeclaration(): _diagnosticReporter.atToken( reportNode.name, - WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, + WarningCode.inferenceFailureOnFunctionReturnType, arguments: [displayName], ); case FunctionDeclaration(): _diagnosticReporter.atToken( reportNode.name, - WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, + WarningCode.inferenceFailureOnFunctionReturnType, arguments: [displayName], ); case _: _diagnosticReporter.atNode( reportNode, - WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, + WarningCode.inferenceFailureOnFunctionReturnType, arguments: [displayName], ); } @@ -1615,11 +1615,11 @@ class BestPracticesVerifier extends RecursiveAstVisitor { return element.metadata.hasNonVirtual; } - /// Checks for the passed as expression for the [WarningCode.UNNECESSARY_CAST] + /// Checks for the passed as expression for the [WarningCode.unnecessaryCast] /// hint code. /// /// Returns `true` if and only if an unnecessary cast hint should be generated - /// on [node]. See [WarningCode.UNNECESSARY_CAST]. + /// on [node]. See [WarningCode.unnecessaryCast]. static bool _isUnnecessaryCast(AsExpression node, TypeSystemImpl typeSystem) { var leftType = node.expression.typeOrThrow; var rightType = node.type.typeOrThrow; @@ -1747,7 +1747,7 @@ class _InvalidAccessVerifier { _errorReporter.atToken( operator, - WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, + WarningCode.invalidUseOfVisibleForOverridingMember, arguments: [operator.type.lexeme], ); } @@ -1764,7 +1764,7 @@ class _InvalidAccessVerifier { // safely assume `node.uri.stringValue` is non-`null`. _errorReporter.atNode( node, - WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, + WarningCode.invalidUseOfInternalMember, arguments: [node.uri.stringValue!], ); } @@ -1817,7 +1817,7 @@ class _InvalidAccessVerifier { _errorReporter.atEntity( errorEntity, - WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, + WarningCode.invalidUseOfInternalMember, arguments: [element.displayName], ); } @@ -1836,7 +1836,7 @@ class _InvalidAccessVerifier { !_isLibraryInWorkspacePackage(element.library)) { _errorReporter.atNode( node, - WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, + WarningCode.invalidUseOfInternalMember, arguments: [element.name!], ); } @@ -1871,7 +1871,7 @@ class _InvalidAccessVerifier { _errorReporter.atOffset( offset: errorEntity.offset, length: errorEntity.length, - diagnosticCode: WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, + diagnosticCode: WarningCode.invalidUseOfDoNotSubmitMember, arguments: [name], ); } @@ -1916,14 +1916,14 @@ class _InvalidAccessVerifier { _errorReporter.atOffset( offset: errorEntity.offset, length: errorEntity.length, - diagnosticCode: WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, + diagnosticCode: WarningCode.invalidUseOfDoNotSubmitMember, arguments: [name], ); } else { // For positional arguments. _errorReporter.atNode( argument, - WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, + WarningCode.invalidUseOfDoNotSubmitMember, arguments: [element.displayName], ); } @@ -1952,7 +1952,7 @@ class _InvalidAccessVerifier { _errorReporter.atEntity( node, - WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, + WarningCode.invalidUseOfInternalMember, arguments: [name], ); } @@ -2009,7 +2009,7 @@ class _InvalidAccessVerifier { if (hasProtected) { _errorReporter.atEntity( errorEntity, - WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, + WarningCode.invalidUseOfProtectedMember, arguments: [name, definingClass.displayName], ); } @@ -2018,7 +2018,7 @@ class _InvalidAccessVerifier { var libraryFragment = definingClass.firstFragment.libraryFragment!; _errorReporter.atEntity( errorEntity, - WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, + WarningCode.invalidUseOfVisibleForTemplateMember, arguments: [name, libraryFragment.source.uri], ); } @@ -2027,7 +2027,7 @@ class _InvalidAccessVerifier { var libraryFragment = definingClass.firstFragment.libraryFragment!; _errorReporter.atEntity( errorEntity, - WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, + WarningCode.invalidUseOfVisibleForTestingMember, arguments: [name, libraryFragment.source.uri], ); } @@ -2035,7 +2035,7 @@ class _InvalidAccessVerifier { if (hasVisibleForOverriding) { _errorReporter.atEntity( errorEntity, - WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, + WarningCode.invalidUseOfVisibleForOverridingMember, arguments: [name], ); } diff --git a/pkg/analyzer/lib/src/error/bool_expression_verifier.dart b/pkg/analyzer/lib/src/error/bool_expression_verifier.dart index 83d54415058..bb287c3c8db 100644 --- a/pkg/analyzer/lib/src/error/bool_expression_verifier.dart +++ b/pkg/analyzer/lib/src/error/bool_expression_verifier.dart @@ -33,14 +33,14 @@ class BoolExpressionVerifier { /// Check to ensure that the [condition] is of type bool, are. Otherwise an /// error is reported on the expression. /// - /// See [CompileTimeErrorCode.NON_BOOL_CONDITION]. + /// See [CompileTimeErrorCode.nonBoolCondition]. void checkForNonBoolCondition( Expression condition, { required Map Function()? whyNotPromoted, }) { checkForNonBoolExpression( condition, - diagnosticCode: CompileTimeErrorCode.NON_BOOL_CONDITION, + diagnosticCode: CompileTimeErrorCode.nonBoolCondition, whyNotPromoted: whyNotPromoted, ); } @@ -63,7 +63,7 @@ class BoolExpressionVerifier { )) { if (type.isDartCoreBool) { _nullableDereferenceVerifier.report( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, expression, type, messages: _resolver.computeWhyNotPromotedMessages( @@ -88,7 +88,7 @@ class BoolExpressionVerifier { }) { checkForNonBoolExpression( expression, - diagnosticCode: CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, + diagnosticCode: CompileTimeErrorCode.nonBoolNegationExpression, whyNotPromoted: whyNotPromoted, ); } @@ -106,12 +106,12 @@ class BoolExpressionVerifier { SimpleIdentifier methodName = expression.methodName; _diagnosticReporter.atNode( methodName, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } else { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } diff --git a/pkg/analyzer/lib/src/error/codes.g.dart b/pkg/analyzer/lib/src/error/codes.g.dart index da523d06832..ad974b9876b 100644 --- a/pkg/analyzer/lib/src/error/codes.g.dart +++ b/pkg/analyzer/lib/src/error/codes.g.dart @@ -29,7 +29,7 @@ import "package:_fe_analyzer_shared/src/base/errors.dart"; class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - ABSTRACT_FIELD_CONSTRUCTOR_INITIALIZER = CompileTimeErrorCode( + abstractFieldConstructorInitializer = CompileTimeErrorCode( 'ABSTRACT_FIELD_INITIALIZER', "Abstract fields can't have initializers.", correctionMessage: @@ -40,7 +40,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ABSTRACT_FIELD_INITIALIZER = + static const CompileTimeErrorCode abstractFieldInitializer = CompileTimeErrorCode( 'ABSTRACT_FIELD_INITIALIZER', "Abstract fields can't have initializers.", @@ -52,7 +52,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the display name for the kind of the found abstract member /// String p1: the name of the member - static const CompileTimeErrorCode ABSTRACT_SUPER_MEMBER_REFERENCE = + static const CompileTimeErrorCode abstractSuperMemberReference = CompileTimeErrorCode( 'ABSTRACT_SUPER_MEMBER_REFERENCE', "The {0} '{1}' is always abstract in the supertype.", @@ -63,7 +63,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the ambiguous element /// Uri p1: the name of the first library in which the type is found /// Uri p2: the name of the second library in which the type is found - static const CompileTimeErrorCode AMBIGUOUS_EXPORT = CompileTimeErrorCode( + static const CompileTimeErrorCode ambiguousExport = CompileTimeErrorCode( 'AMBIGUOUS_EXPORT', "The name '{0}' is defined in the libraries '{1}' and '{2}'.", correctionMessage: @@ -76,7 +76,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the member /// String p1: the names of the declaring extensions static const CompileTimeErrorCode - AMBIGUOUS_EXTENSION_MEMBER_ACCESS_THREE_OR_MORE = CompileTimeErrorCode( + ambiguousExtensionMemberAccessThreeOrMore = CompileTimeErrorCode( 'AMBIGUOUS_EXTENSION_MEMBER_ACCESS', "A member named '{0}' is defined in {1}, and none are more specific.", correctionMessage: @@ -91,7 +91,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Element p1: the name of the first declaring extension /// Element p2: the names of the second declaring extension static const CompileTimeErrorCode - AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO = CompileTimeErrorCode( + ambiguousExtensionMemberAccessTwo = CompileTimeErrorCode( 'AMBIGUOUS_EXTENSION_MEMBER_ACCESS', "A member named '{0}' is defined in '{1}' and '{2}', and neither is more " "specific.", @@ -105,7 +105,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the ambiguous type /// String p1: the names of the libraries that the type is found - static const CompileTimeErrorCode AMBIGUOUS_IMPORT = CompileTimeErrorCode( + static const CompileTimeErrorCode ambiguousImport = CompileTimeErrorCode( 'AMBIGUOUS_IMPORT', "The name '{0}' is defined in the libraries {1}.", correctionMessage: @@ -116,7 +116,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH = CompileTimeErrorCode( + ambiguousSetOrMapLiteralBoth = CompileTimeErrorCode( 'AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH', "The literal can't be either a map or a set because it contains at least " "one literal map entry or a spread operator spreading a 'Map', and at " @@ -129,7 +129,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER = CompileTimeErrorCode( + ambiguousSetOrMapLiteralEither = CompileTimeErrorCode( 'AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER', "This literal must be either a map or a set, but the elements don't have " "enough information for type inference to work.", @@ -145,7 +145,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p2: additional information, if any, when problem is associated with /// records static const CompileTimeErrorCode - ARGUMENT_TYPE_NOT_ASSIGNABLE = CompileTimeErrorCode( + argumentTypeNotAssignable = CompileTimeErrorCode( 'ARGUMENT_TYPE_NOT_ASSIGNABLE', "The argument type '{0}' can't be assigned to the parameter type '{1}'. " "{2}", @@ -153,7 +153,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ASSERT_IN_REDIRECTING_CONSTRUCTOR = + static const CompileTimeErrorCode assertInRedirectingConstructor = CompileTimeErrorCode( 'ASSERT_IN_REDIRECTING_CONSTRUCTOR', "A redirecting constructor can't have an 'assert' initializer.", @@ -161,7 +161,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ASSIGNMENT_TO_CONST = CompileTimeErrorCode( + static const CompileTimeErrorCode assignmentToConst = CompileTimeErrorCode( 'ASSIGNMENT_TO_CONST', "Constant variables can't be assigned a value after initialization.", correctionMessage: @@ -172,7 +172,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the final variable - static const CompileTimeErrorCode ASSIGNMENT_TO_FINAL = CompileTimeErrorCode( + static const CompileTimeErrorCode assignmentToFinal = CompileTimeErrorCode( 'ASSIGNMENT_TO_FINAL', "'{0}' can't be used as a setter because it's final.", correctionMessage: @@ -182,7 +182,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the variable - static const CompileTimeErrorCode ASSIGNMENT_TO_FINAL_LOCAL = + static const CompileTimeErrorCode assignmentToFinalLocal = CompileTimeErrorCode( 'ASSIGNMENT_TO_FINAL_LOCAL', "The final variable '{0}' can only be set once.", @@ -194,7 +194,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the reference /// String p1: the name of the class static const CompileTimeErrorCode - ASSIGNMENT_TO_FINAL_NO_SETTER = CompileTimeErrorCode( + assignmentToFinalNoSetter = CompileTimeErrorCode( 'ASSIGNMENT_TO_FINAL_NO_SETTER', "There isn't a setter named '{0}' in class '{1}'.", correctionMessage: @@ -204,29 +204,28 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ASSIGNMENT_TO_FUNCTION = - CompileTimeErrorCode( - 'ASSIGNMENT_TO_FUNCTION', - "Functions can't be assigned a value.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode assignmentToFunction = CompileTimeErrorCode( + 'ASSIGNMENT_TO_FUNCTION', + "Functions can't be assigned a value.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode ASSIGNMENT_TO_METHOD = CompileTimeErrorCode( + static const CompileTimeErrorCode assignmentToMethod = CompileTimeErrorCode( 'ASSIGNMENT_TO_METHOD', "Methods can't be assigned a value.", hasPublishedDocs: true, ); /// No parameters. - static const CompileTimeErrorCode ASSIGNMENT_TO_TYPE = CompileTimeErrorCode( + static const CompileTimeErrorCode assignmentToType = CompileTimeErrorCode( 'ASSIGNMENT_TO_TYPE', "Types can't be assigned a value.", hasPublishedDocs: true, ); /// No parameters. - static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT = + static const CompileTimeErrorCode asyncForInWrongContext = CompileTimeErrorCode( 'ASYNC_FOR_IN_WRONG_CONTEXT', "The async for-in loop can only be used in an async function.", @@ -238,7 +237,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - AUGMENTATION_EXTENDS_CLAUSE_ALREADY_PRESENT = CompileTimeErrorCode( + augmentationExtendsClauseAlreadyPresent = CompileTimeErrorCode( 'AUGMENTATION_EXTENDS_CLAUSE_ALREADY_PRESENT', "The augmentation has an 'extends' clause, but an augmentation target " "already includes an 'extends' clause and it isn't allowed to be " @@ -250,7 +249,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the lexeme of the modifier. - static const CompileTimeErrorCode AUGMENTATION_MODIFIER_EXTRA = + static const CompileTimeErrorCode augmentationModifierExtra = CompileTimeErrorCode( 'AUGMENTATION_MODIFIER_EXTRA', "The augmentation has the '{0}' modifier that the declaration doesn't " @@ -262,7 +261,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the lexeme of the modifier. static const CompileTimeErrorCode - AUGMENTATION_MODIFIER_MISSING = CompileTimeErrorCode( + augmentationModifierMissing = CompileTimeErrorCode( 'AUGMENTATION_MODIFIER_MISSING', "The augmentation is missing the '{0}' modifier that the declaration has.", correctionMessage: @@ -272,7 +271,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the declaration kind. /// Object p1: the name of the augmentation kind. - static const CompileTimeErrorCode AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND = + static const CompileTimeErrorCode augmentationOfDifferentDeclarationKind = CompileTimeErrorCode( 'AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND', "Can't augment a {0} with a {1}.", @@ -281,7 +280,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode AUGMENTATION_TYPE_PARAMETER_BOUND = + static const CompileTimeErrorCode augmentationTypeParameterBound = CompileTimeErrorCode( 'AUGMENTATION_TYPE_PARAMETER_BOUND', "The augmentation type parameter must have the same bound as the " @@ -292,7 +291,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode AUGMENTATION_TYPE_PARAMETER_COUNT = + static const CompileTimeErrorCode augmentationTypeParameterCount = CompileTimeErrorCode( 'AUGMENTATION_TYPE_PARAMETER_COUNT', "The augmentation must have the same number of type parameters as the " @@ -303,7 +302,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode AUGMENTATION_TYPE_PARAMETER_NAME = + static const CompileTimeErrorCode augmentationTypeParameterName = CompileTimeErrorCode( 'AUGMENTATION_TYPE_PARAMETER_NAME', "The augmentation type parameter must have the same name as the " @@ -314,7 +313,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode AUGMENTATION_WITHOUT_DECLARATION = + static const CompileTimeErrorCode augmentationWithoutDeclaration = CompileTimeErrorCode( 'AUGMENTATION_WITHOUT_DECLARATION', "The declaration being augmented doesn't exist.", @@ -324,7 +323,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - AUGMENTED_EXPRESSION_IS_NOT_SETTER = CompileTimeErrorCode( + augmentedExpressionIsNotSetter = CompileTimeErrorCode( 'AUGMENTED_EXPRESSION_IS_NOT_SETTER', "The augmented declaration is not a setter, it can't be used to write a " "value.", @@ -333,7 +332,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - AUGMENTED_EXPRESSION_IS_SETTER = CompileTimeErrorCode( + augmentedExpressionIsSetter = CompileTimeErrorCode( 'AUGMENTED_EXPRESSION_IS_SETTER', "The augmented declaration is a setter, it can't be used to read a value.", correctionMessage: "Try assigning a value to the augmented setter.", @@ -341,7 +340,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the lexeme of the operator. - static const CompileTimeErrorCode AUGMENTED_EXPRESSION_NOT_OPERATOR = + static const CompileTimeErrorCode augmentedExpressionNotOperator = CompileTimeErrorCode( 'AUGMENTED_EXPRESSION_NOT_OPERATOR', "The enclosing augmentation doesn't augment the operator '{0}'.", @@ -349,7 +348,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode AWAIT_IN_LATE_LOCAL_VARIABLE_INITIALIZER = + static const CompileTimeErrorCode awaitInLateLocalVariableInitializer = CompileTimeErrorCode( 'AWAIT_IN_LATE_LOCAL_VARIABLE_INITIALIZER', "The 'await' expression can't be used in a 'late' local variable's " @@ -365,17 +364,16 @@ class CompileTimeErrorCode extends DiagnosticCode { /// await expression.) /// /// No parameters. - static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT = - CompileTimeErrorCode( - 'AWAIT_IN_WRONG_CONTEXT', - "The await expression can only be used in an async function.", - correctionMessage: - "Try marking the function body with either 'async' or 'async*'.", - ); + static const CompileTimeErrorCode awaitInWrongContext = CompileTimeErrorCode( + 'AWAIT_IN_WRONG_CONTEXT', + "The await expression can only be used in an async function.", + correctionMessage: + "Try marking the function body with either 'async' or 'async*'.", + ); /// No parameters. static const CompileTimeErrorCode - AWAIT_OF_INCOMPATIBLE_TYPE = CompileTimeErrorCode( + awaitOfIncompatibleType = CompileTimeErrorCode( 'AWAIT_OF_INCOMPATIBLE_TYPE', "The 'await' expression can't be used for an expression with an extension " "type that is not a subtype of 'Future'.", @@ -388,7 +386,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the base class being implemented static const CompileTimeErrorCode - BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY = CompileTimeErrorCode( + baseClassImplementedOutsideOfLibrary = CompileTimeErrorCode( 'INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY', "The class '{0}' can't be implemented outside of its library because it's " "a base class.", @@ -399,7 +397,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the base mixin being implemented static const CompileTimeErrorCode - BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY = CompileTimeErrorCode( + baseMixinImplementedOutsideOfLibrary = CompileTimeErrorCode( 'INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY', "The mixin '{0}' can't be implemented outside of its library because it's " "a base mixin.", @@ -410,7 +408,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the name of the return type static const CompileTimeErrorCode - BODY_MIGHT_COMPLETE_NORMALLY = CompileTimeErrorCode( + bodyMightCompleteNormally = CompileTimeErrorCode( 'BODY_MIGHT_COMPLETE_NORMALLY', "The body might complete normally, causing 'null' to be returned, but the " "return type, '{0}', is a potentially non-nullable type.", @@ -420,7 +418,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode BREAK_LABEL_ON_SWITCH_MEMBER = + static const CompileTimeErrorCode breakLabelOnSwitchMember = CompileTimeErrorCode( 'BREAK_LABEL_ON_SWITCH_MEMBER', "A break label resolves to the 'case' or 'default' statement.", @@ -429,7 +427,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the built-in identifier that is being used - static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_EXTENSION_NAME = + static const CompileTimeErrorCode builtInIdentifierAsExtensionName = CompileTimeErrorCode( 'BUILT_IN_IDENTIFIER_IN_DECLARATION', "The built-in identifier '{0}' can't be used as an extension name.", @@ -441,7 +439,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the built-in identifier that is being used static const CompileTimeErrorCode - BUILT_IN_IDENTIFIER_AS_EXTENSION_TYPE_NAME = CompileTimeErrorCode( + builtInIdentifierAsExtensionTypeName = CompileTimeErrorCode( 'BUILT_IN_IDENTIFIER_IN_DECLARATION', "The built-in identifier '{0}' can't be used as an extension type name.", correctionMessage: "Try choosing a different name for the extension type.", @@ -451,7 +449,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the built-in identifier that is being used - static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_PREFIX_NAME = + static const CompileTimeErrorCode builtInIdentifierAsPrefixName = CompileTimeErrorCode( 'BUILT_IN_IDENTIFIER_IN_DECLARATION', "The built-in identifier '{0}' can't be used as a prefix name.", @@ -462,7 +460,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the built-in identifier that is being used - static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = + static const CompileTimeErrorCode builtInIdentifierAsType = CompileTimeErrorCode( 'BUILT_IN_IDENTIFIER_AS_TYPE', "The built-in identifier '{0}' can't be used as a type.", @@ -472,7 +470,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the built-in identifier that is being used - static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = + static const CompileTimeErrorCode builtInIdentifierAsTypedefName = CompileTimeErrorCode( 'BUILT_IN_IDENTIFIER_IN_DECLARATION', "The built-in identifier '{0}' can't be used as a typedef name.", @@ -483,7 +481,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the built-in identifier that is being used - static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = + static const CompileTimeErrorCode builtInIdentifierAsTypeName = CompileTimeErrorCode( 'BUILT_IN_IDENTIFIER_IN_DECLARATION', "The built-in identifier '{0}' can't be used as a type name.", @@ -494,7 +492,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the built-in identifier that is being used - static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = + static const CompileTimeErrorCode builtInIdentifierAsTypeParameterName = CompileTimeErrorCode( 'BUILT_IN_IDENTIFIER_IN_DECLARATION', "The built-in identifier '{0}' can't be used as a type parameter name.", @@ -507,7 +505,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the this of the switch case expression static const CompileTimeErrorCode - CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = CompileTimeErrorCode( + caseExpressionTypeImplementsEquals = CompileTimeErrorCode( 'CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', "The switch case expression type '{0}' can't override the '==' operator.", hasPublishedDocs: true, @@ -517,7 +515,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the type of the case expression /// Type p1: the type of the switch expression static const CompileTimeErrorCode - CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE = CompileTimeErrorCode( + caseExpressionTypeIsNotSwitchExpressionSubtype = CompileTimeErrorCode( 'CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE', "The switch case expression type '{0}' must be a subtype of the switch " "expression type '{1}'.", @@ -526,7 +524,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type - static const CompileTimeErrorCode CAST_TO_NON_TYPE = CompileTimeErrorCode( + static const CompileTimeErrorCode castToNonType = CompileTimeErrorCode( 'CAST_TO_NON_TYPE', "The name '{0}' isn't a type, so it can't be used in an 'as' expression.", correctionMessage: @@ -537,19 +535,19 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member - static const CompileTimeErrorCode - CLASS_INSTANTIATION_ACCESS_TO_INSTANCE_MEMBER = CompileTimeErrorCode( - 'CLASS_INSTANTIATION_ACCESS_TO_MEMBER', - "The instance member '{0}' can't be accessed on a class instantiation.", - correctionMessage: - "Try changing the member name to the name of a constructor.", - uniqueName: 'CLASS_INSTANTIATION_ACCESS_TO_INSTANCE_MEMBER', - ); + static const CompileTimeErrorCode classInstantiationAccessToInstanceMember = + CompileTimeErrorCode( + 'CLASS_INSTANTIATION_ACCESS_TO_MEMBER', + "The instance member '{0}' can't be accessed on a class instantiation.", + correctionMessage: + "Try changing the member name to the name of a constructor.", + uniqueName: 'CLASS_INSTANTIATION_ACCESS_TO_INSTANCE_MEMBER', + ); /// Parameters: /// String p0: the name of the member static const CompileTimeErrorCode - CLASS_INSTANTIATION_ACCESS_TO_STATIC_MEMBER = CompileTimeErrorCode( + classInstantiationAccessToStaticMember = CompileTimeErrorCode( 'CLASS_INSTANTIATION_ACCESS_TO_MEMBER', "The static member '{0}' can't be accessed on a class instantiation.", correctionMessage: @@ -562,7 +560,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the class /// String p1: the name of the member static const CompileTimeErrorCode - CLASS_INSTANTIATION_ACCESS_TO_UNKNOWN_MEMBER = CompileTimeErrorCode( + classInstantiationAccessToUnknownMember = CompileTimeErrorCode( 'CLASS_INSTANTIATION_ACCESS_TO_MEMBER', "The class '{0}' doesn't have a constructor named '{1}'.", correctionMessage: @@ -573,7 +571,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the class being used as a mixin - static const CompileTimeErrorCode CLASS_USED_AS_MIXIN = CompileTimeErrorCode( + static const CompileTimeErrorCode classUsedAsMixin = CompileTimeErrorCode( 'CLASS_USED_AS_MIXIN', "The class '{0}' can't be used as a mixin because it's neither a mixin " "class nor a mixin.", @@ -581,7 +579,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE = + static const CompileTimeErrorCode concreteClassHasEnumSuperinterface = CompileTimeErrorCode( 'CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE', "Concrete classes can't have 'Enum' as a superinterface.", @@ -593,7 +591,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the abstract method /// String p1: the name of the enclosing class - static const CompileTimeErrorCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = + static const CompileTimeErrorCode concreteClassWithAbstractMember = CompileTimeErrorCode( 'CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', "'{0}' must have a method body because '{1}' isn't abstract.", @@ -605,7 +603,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the constructor and field static const CompileTimeErrorCode - CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD = CompileTimeErrorCode( + conflictingConstructorAndStaticField = CompileTimeErrorCode( 'CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER', "'{0}' can't be used to name both a constructor and a static field in this " "class.", @@ -616,7 +614,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the constructor and getter - static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_AND_STATIC_GETTER = + static const CompileTimeErrorCode conflictingConstructorAndStaticGetter = CompileTimeErrorCode( 'CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER', "'{0}' can't be used to name both a constructor and a static getter in " @@ -628,7 +626,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the constructor - static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD = + static const CompileTimeErrorCode conflictingConstructorAndStaticMethod = CompileTimeErrorCode( 'CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER', "'{0}' can't be used to name both a constructor and a static method in " @@ -640,7 +638,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the constructor and setter - static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_AND_STATIC_SETTER = + static const CompileTimeErrorCode conflictingConstructorAndStaticSetter = CompileTimeErrorCode( 'CONFLICTING_CONSTRUCTOR_AND_STATIC_MEMBER', "'{0}' can't be used to name both a constructor and a static setter in " @@ -660,7 +658,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p2: the name of the class defining the method with which the field /// conflicts static const CompileTimeErrorCode - CONFLICTING_FIELD_AND_METHOD = CompileTimeErrorCode( + conflictingFieldAndMethod = CompileTimeErrorCode( 'CONFLICTING_FIELD_AND_METHOD', "Class '{0}' can't define field '{1}' and have method '{2}.{1}' with the " "same name.", @@ -675,7 +673,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the element implementing the conflicting interface /// String p2: the first conflicting type /// String p3: the second conflicting type - static const CompileTimeErrorCode CONFLICTING_GENERIC_INTERFACES = + static const CompileTimeErrorCode conflictingGenericInterfaces = CompileTimeErrorCode( 'CONFLICTING_GENERIC_INTERFACES', "The {0} '{1}' can't implement both '{2}' and '{3}' because the type " @@ -692,7 +690,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// etc /// String p1: the name of the enclosing element /// String p2: the name of the conflicting method / setter - static const CompileTimeErrorCode CONFLICTING_INHERITED_METHOD_AND_SETTER = + static const CompileTimeErrorCode conflictingInheritedMethodAndSetter = CompileTimeErrorCode( 'CONFLICTING_INHERITED_METHOD_AND_SETTER', "The {0} '{1}' can't inherit both a method and a setter named '{2}'.", @@ -708,7 +706,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p2: the name of the class defining the field with which the method /// conflicts static const CompileTimeErrorCode - CONFLICTING_METHOD_AND_FIELD = CompileTimeErrorCode( + conflictingMethodAndField = CompileTimeErrorCode( 'CONFLICTING_METHOD_AND_FIELD', "Class '{0}' can't define method '{1}' and have field '{2}.{1}' with the " "same name.", @@ -726,7 +724,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the conflicting static member /// String p2: the name of the class defining the field with which the method /// conflicts - static const CompileTimeErrorCode CONFLICTING_STATIC_AND_INSTANCE = + static const CompileTimeErrorCode conflictingStaticAndInstance = CompileTimeErrorCode( 'CONFLICTING_STATIC_AND_INSTANCE', "Class '{0}' can't define static member '{1}' and have instance member " @@ -738,7 +736,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_CLASS = CompileTimeErrorCode( + conflictingTypeVariableAndClass = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_CONTAINER', "'{0}' can't be used to name both a type parameter and the class in which " "the type parameter is defined.", @@ -750,7 +748,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_ENUM = CompileTimeErrorCode( + conflictingTypeVariableAndEnum = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_CONTAINER', "'{0}' can't be used to name both a type parameter and the enum in which " "the type parameter is defined.", @@ -762,7 +760,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_EXTENSION = CompileTimeErrorCode( + conflictingTypeVariableAndExtension = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_CONTAINER', "'{0}' can't be used to name both a type parameter and the extension in " "which the type parameter is defined.", @@ -775,7 +773,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_EXTENSION_TYPE = CompileTimeErrorCode( + conflictingTypeVariableAndExtensionType = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_CONTAINER', "'{0}' can't be used to name both a type parameter and the extension type " "in which the type parameter is defined.", @@ -788,7 +786,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS = CompileTimeErrorCode( + conflictingTypeVariableAndMemberClass = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_MEMBER', "'{0}' can't be used to name both a type parameter and a member in this " "class.", @@ -800,7 +798,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_MEMBER_ENUM = CompileTimeErrorCode( + conflictingTypeVariableAndMemberEnum = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_MEMBER', "'{0}' can't be used to name both a type parameter and a member in this " "enum.", @@ -812,7 +810,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION = CompileTimeErrorCode( + conflictingTypeVariableAndMemberExtension = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_MEMBER', "'{0}' can't be used to name both a type parameter and a member in this " "extension.", @@ -824,7 +822,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION_TYPE = CompileTimeErrorCode( + conflictingTypeVariableAndMemberExtensionType = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_MEMBER', "'{0}' can't be used to name both a type parameter and a member in this " "extension type.", @@ -836,7 +834,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_MEMBER_MIXIN = CompileTimeErrorCode( + conflictingTypeVariableAndMemberMixin = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_MEMBER', "'{0}' can't be used to name both a type parameter and a member in this " "mixin.", @@ -848,7 +846,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - CONFLICTING_TYPE_VARIABLE_AND_MIXIN = CompileTimeErrorCode( + conflictingTypeVariableAndMixin = CompileTimeErrorCode( 'CONFLICTING_TYPE_VARIABLE_AND_CONTAINER', "'{0}' can't be used to name both a type parameter and the mixin in which " "the type parameter is defined.", @@ -858,17 +856,17 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION = CompileTimeErrorCode( - 'CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION', - "The expression of a constant pattern must be a valid constant.", - correctionMessage: "Try making the expression a valid constant.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode constantPatternWithNonConstantExpression = + CompileTimeErrorCode( + 'CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION', + "The expression of a constant pattern must be a valid constant.", + correctionMessage: "Try making the expression a valid constant.", + hasPublishedDocs: true, + ); /// No parameters. static const CompileTimeErrorCode - CONST_CONSTRUCTOR_CONSTANT_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( + constConstructorConstantFromDeferredLibrary = CompileTimeErrorCode( 'COLLECTION_ELEMENT_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as values in a " "'const' constructor.", @@ -887,7 +885,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p1: the name of the field /// Object p2: the type of the field static const CompileTimeErrorCode - CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH = CompileTimeErrorCode( + constConstructorFieldTypeMismatch = CompileTimeErrorCode( 'CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH', "In a const constructor, a value of type '{0}' can't be assigned to the " "field '{1}', which has type '{2}'.", @@ -898,7 +896,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the type of the runtime value of the argument /// String p1: the static type of the parameter static const CompileTimeErrorCode - CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH = CompileTimeErrorCode( + constConstructorParamTypeMismatch = CompileTimeErrorCode( 'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH', "A value of type '{0}' can't be assigned to a parameter of type '{1}' in a " "const constructor.", @@ -911,7 +909,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// No parameters. static const CompileTimeErrorCode - CONST_CONSTRUCTOR_THROWS_EXCEPTION = CompileTimeErrorCode( + constConstructorThrowsException = CompileTimeErrorCode( 'CONST_CONSTRUCTOR_THROWS_EXCEPTION', "Const constructors can't throw exceptions.", correctionMessage: @@ -921,7 +919,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the field static const CompileTimeErrorCode - CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST = CompileTimeErrorCode( + constConstructorWithFieldInitializedByNonConst = CompileTimeErrorCode( 'CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST', "Can't define the 'const' constructor because the field '{0}' is " "initialized with a non-constant value.", @@ -944,7 +942,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the instance field. static const CompileTimeErrorCode - CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD = CompileTimeErrorCode( + constConstructorWithMixinWithField = CompileTimeErrorCode( 'CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD', "This constructor can't be declared 'const' because a mixin adds the " "instance field: {0}.", @@ -966,7 +964,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the names of the instance fields. static const CompileTimeErrorCode - CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELDS = CompileTimeErrorCode( + constConstructorWithMixinWithFields = CompileTimeErrorCode( 'CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD', "This constructor can't be declared 'const' because the mixins add the " "instance fields: {0}.", @@ -979,7 +977,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the superclass static const CompileTimeErrorCode - CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = CompileTimeErrorCode( + constConstructorWithNonConstSuper = CompileTimeErrorCode( 'CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', "A constant constructor can't call a non-constant super constructor of " "'{0}'.", @@ -991,7 +989,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = CompileTimeErrorCode( + constConstructorWithNonFinalField = CompileTimeErrorCode( 'CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', "Can't define a const constructor for a class with non-final fields.", correctionMessage: @@ -1001,7 +999,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_DEFERRED_CLASS = CompileTimeErrorCode( + static const CompileTimeErrorCode constDeferredClass = CompileTimeErrorCode( 'CONST_DEFERRED_CLASS', "Deferred classes can't be created with 'const'.", correctionMessage: @@ -1011,7 +1009,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_ASSERTION_FAILURE = + static const CompileTimeErrorCode constEvalAssertionFailure = CompileTimeErrorCode( 'CONST_EVAL_ASSERTION_FAILURE', "The assertion in this constant expression failed.", @@ -1019,29 +1017,28 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the message of the assertion - static const CompileTimeErrorCode CONST_EVAL_ASSERTION_FAILURE_WITH_MESSAGE = + static const CompileTimeErrorCode constEvalAssertionFailureWithMessage = CompileTimeErrorCode( 'CONST_EVAL_ASSERTION_FAILURE_WITH_MESSAGE', "An assertion failed with message '{0}'.", ); /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_EXTENSION_METHOD = + static const CompileTimeErrorCode constEvalExtensionMethod = CompileTimeErrorCode( 'CONST_EVAL_EXTENSION_METHOD', "Extension methods can't be used in constant expressions.", ); /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_EXTENSION_TYPE_METHOD = + static const CompileTimeErrorCode constEvalExtensionTypeMethod = CompileTimeErrorCode( 'CONST_EVAL_EXTENSION_TYPE_METHOD', "Extension type methods can't be used in constant expressions.", ); /// No parameters. - static const CompileTimeErrorCode - CONST_EVAL_FOR_ELEMENT = CompileTimeErrorCode( + static const CompileTimeErrorCode constEvalForElement = CompileTimeErrorCode( 'CONST_EVAL_FOR_ELEMENT', "Constant expressions don't support 'for' elements.", correctionMessage: @@ -1049,7 +1046,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_METHOD_INVOCATION = + static const CompileTimeErrorCode constEvalMethodInvocation = CompileTimeErrorCode( 'CONST_EVAL_METHOD_INVOCATION', "Methods can't be invoked in constant expressions.", @@ -1059,7 +1056,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// for text about "An expression of the form e1 == e2". /// /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_PRIMITIVE_EQUALITY = + static const CompileTimeErrorCode constEvalPrimitiveEquality = CompileTimeErrorCode( 'CONST_EVAL_PRIMITIVE_EQUALITY', "In constant expressions, operands of the equality operator must have " @@ -1069,7 +1066,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the property being accessed /// String p1: the type with the property being accessed - static const CompileTimeErrorCode CONST_EVAL_PROPERTY_ACCESS = + static const CompileTimeErrorCode constEvalPropertyAccess = CompileTimeErrorCode( 'CONST_EVAL_PROPERTY_ACCESS', "The property '{0}' can't be accessed on the type '{1}' in a constant " @@ -1080,7 +1077,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// object results in an uncaught exception being thrown. /// /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = + static const CompileTimeErrorCode constEvalThrowsException = CompileTimeErrorCode( 'CONST_EVAL_THROWS_EXCEPTION', "Evaluation of this constant expression throws an exception.", @@ -1090,19 +1087,18 @@ class CompileTimeErrorCode extends DiagnosticCode { /// object results in an uncaught exception being thrown. /// /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = - CompileTimeErrorCode( - 'CONST_EVAL_THROWS_IDBZE', - "Evaluation of this constant expression throws an " - "IntegerDivisionByZeroException.", - ); + static const CompileTimeErrorCode constEvalThrowsIdbze = CompileTimeErrorCode( + 'CONST_EVAL_THROWS_IDBZE', + "Evaluation of this constant expression throws an " + "IntegerDivisionByZeroException.", + ); /// See https://spec.dart.dev/DartLangSpecDraft.pdf#constants, "Constants", /// for text about "An expression of the form !e1", "An expression of the form /// e1 && e2", and "An expression of the form e1 || e2". /// /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = CompileTimeErrorCode( + static const CompileTimeErrorCode constEvalTypeBool = CompileTimeErrorCode( 'CONST_EVAL_TYPE_BOOL', "In constant expressions, operands of this operator must be of type " "'bool'.", @@ -1112,8 +1108,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// for text about "An expression of the form e1 & e2". /// /// No parameters. - static const CompileTimeErrorCode - CONST_EVAL_TYPE_BOOL_INT = CompileTimeErrorCode( + static const CompileTimeErrorCode constEvalTypeBoolInt = CompileTimeErrorCode( 'CONST_EVAL_TYPE_BOOL_INT', "In constant expressions, operands of this operator must be of type 'bool' " "or 'int'.", @@ -1123,7 +1118,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// for text about "A literal string". /// /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = + static const CompileTimeErrorCode constEvalTypeBoolNumString = CompileTimeErrorCode( 'CONST_EVAL_TYPE_BOOL_NUM_STRING', "In constant expressions, operands of this operator must be of type " @@ -1135,7 +1130,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// the forms e1 >> e2". /// /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = CompileTimeErrorCode( + static const CompileTimeErrorCode constEvalTypeInt = CompileTimeErrorCode( 'CONST_EVAL_TYPE_INT', "In constant expressions, operands of this operator must be of type 'int'.", ); @@ -1144,7 +1139,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// for text about "An expression of the form e1 - e2". /// /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = CompileTimeErrorCode( + static const CompileTimeErrorCode constEvalTypeNum = CompileTimeErrorCode( 'CONST_EVAL_TYPE_NUM', "In constant expressions, operands of this operator must be of type 'num'.", ); @@ -1154,22 +1149,21 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// No parameters. static const CompileTimeErrorCode - CONST_EVAL_TYPE_NUM_STRING = CompileTimeErrorCode( + constEvalTypeNumString = CompileTimeErrorCode( 'CONST_EVAL_TYPE_NUM_STRING', "In constant expressions, operands of this operator must be of type 'num' " "or 'String'.", ); /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_TYPE_STRING = - CompileTimeErrorCode( - 'CONST_EVAL_TYPE_STRING', - "In constant expressions, operands of this operator must be of type " - "'String'.", - ); + static const CompileTimeErrorCode constEvalTypeString = CompileTimeErrorCode( + 'CONST_EVAL_TYPE_STRING', + "In constant expressions, operands of this operator must be of type " + "'String'.", + ); /// No parameters. - static const CompileTimeErrorCode CONST_EVAL_TYPE_TYPE = CompileTimeErrorCode( + static const CompileTimeErrorCode constEvalTypeType = CompileTimeErrorCode( 'CONST_EVAL_TYPE_TYPE', "In constant expressions, operands of this operator must be of type " "'Type'.", @@ -1179,7 +1173,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the name of the type of the initializer expression /// Type p1: the name of the type of the field static const CompileTimeErrorCode - CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = CompileTimeErrorCode( + constFieldInitializerNotAssignable = CompileTimeErrorCode( 'FIELD_INITIALIZER_NOT_ASSIGNABLE', "The initializer type '{0}' can't be assigned to the field type '{1}' in a " "const constructor.", @@ -1189,7 +1183,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = + static const CompileTimeErrorCode constInitializedWithNonConstantValue = CompileTimeErrorCode( 'CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', "Const variables must be initialized with a constant value.", @@ -1200,7 +1194,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY = + constInitializedWithNonConstantValueFromDeferredLibrary = CompileTimeErrorCode( 'CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used to initialize a " @@ -1212,7 +1206,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_INSTANCE_FIELD = CompileTimeErrorCode( + static const CompileTimeErrorCode constInstanceField = CompileTimeErrorCode( 'CONST_INSTANCE_FIELD', "Only static fields can be declared as const.", correctionMessage: @@ -1223,7 +1217,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the type of the entry's key static const CompileTimeErrorCode - CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY = CompileTimeErrorCode( + constMapKeyNotPrimitiveEquality = CompileTimeErrorCode( 'CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY', "The type of a key in a constant map can't override the '==' operator, or " "'hashCode', but the class '{0}' does.", @@ -1235,18 +1229,17 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the uninitialized final variable - static const CompileTimeErrorCode CONST_NOT_INITIALIZED = - CompileTimeErrorCode( - 'CONST_NOT_INITIALIZED', - "The constant '{0}' must be initialized.", - correctionMessage: "Try adding an initialization to the declaration.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode constNotInitialized = CompileTimeErrorCode( + 'CONST_NOT_INITIALIZED', + "The constant '{0}' must be initialized.", + correctionMessage: "Try adding an initialization to the declaration.", + hasPublishedDocs: true, + ); /// Parameters: /// Type p0: the type of the element static const CompileTimeErrorCode - CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY = CompileTimeErrorCode( + constSetElementNotPrimitiveEquality = CompileTimeErrorCode( 'CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY', "An element in a constant set can't override the '==' operator, or " "'hashCode', but the type '{0}' does.", @@ -1257,7 +1250,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_SPREAD_EXPECTED_LIST_OR_SET = + static const CompileTimeErrorCode constSpreadExpectedListOrSet = CompileTimeErrorCode( 'CONST_SPREAD_EXPECTED_LIST_OR_SET', "A list or a set is expected in this spread.", @@ -1265,7 +1258,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_SPREAD_EXPECTED_MAP = + static const CompileTimeErrorCode constSpreadExpectedMap = CompileTimeErrorCode( 'CONST_SPREAD_EXPECTED_MAP', "A map is expected in this spread.", @@ -1273,7 +1266,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_TYPE_PARAMETER = CompileTimeErrorCode( + static const CompileTimeErrorCode constTypeParameter = CompileTimeErrorCode( 'CONST_TYPE_PARAMETER', "Type parameters can't be used in a constant expression.", correctionMessage: @@ -1281,7 +1274,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_WITH_NON_CONST = CompileTimeErrorCode( + static const CompileTimeErrorCode constWithNonConst = CompileTimeErrorCode( 'CONST_WITH_NON_CONST', "The constructor being called isn't a const constructor.", correctionMessage: "Try removing 'const' from the constructor invocation.", @@ -1290,7 +1283,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - CONST_WITH_NON_CONSTANT_ARGUMENT = CompileTimeErrorCode( + constWithNonConstantArgument = CompileTimeErrorCode( 'CONST_WITH_NON_CONSTANT_ARGUMENT', "Arguments of a constant creation must be constant expressions.", correctionMessage: @@ -1301,7 +1294,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the non-type element - static const CompileTimeErrorCode CONST_WITH_NON_TYPE = CompileTimeErrorCode( + static const CompileTimeErrorCode constWithNonType = CompileTimeErrorCode( 'CREATION_WITH_NON_TYPE', "The name '{0}' isn't a class.", correctionMessage: "Try correcting the name to match an existing class.", @@ -1311,7 +1304,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = + static const CompileTimeErrorCode constWithTypeParameters = CompileTimeErrorCode( 'CONST_WITH_TYPE_PARAMETERS', "A constant creation can't use a type parameter as a type argument.", @@ -1321,28 +1314,28 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF = CompileTimeErrorCode( - 'CONST_WITH_TYPE_PARAMETERS', - "A constant constructor tearoff can't use a type parameter as a type " - "argument.", - correctionMessage: - "Try replacing the type parameter with a different type.", - hasPublishedDocs: true, - uniqueName: 'CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF', - ); + static const CompileTimeErrorCode constWithTypeParametersConstructorTearoff = + CompileTimeErrorCode( + 'CONST_WITH_TYPE_PARAMETERS', + "A constant constructor tearoff can't use a type parameter as a type " + "argument.", + correctionMessage: + "Try replacing the type parameter with a different type.", + hasPublishedDocs: true, + uniqueName: 'CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF', + ); /// No parameters. - static const CompileTimeErrorCode - CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF = CompileTimeErrorCode( - 'CONST_WITH_TYPE_PARAMETERS', - "A constant function tearoff can't use a type parameter as a type " - "argument.", - correctionMessage: - "Try replacing the type parameter with a different type.", - hasPublishedDocs: true, - uniqueName: 'CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF', - ); + static const CompileTimeErrorCode constWithTypeParametersFunctionTearoff = + CompileTimeErrorCode( + 'CONST_WITH_TYPE_PARAMETERS', + "A constant function tearoff can't use a type parameter as a type " + "argument.", + correctionMessage: + "Try replacing the type parameter with a different type.", + hasPublishedDocs: true, + uniqueName: 'CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF', + ); /// 16.12.2 Const: It is a compile-time error if T.id is not the name of /// a constant constructor declared by the type T. @@ -1350,7 +1343,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the type /// String p1: the name of the requested constant constructor - static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = + static const CompileTimeErrorCode constWithUndefinedConstructor = CompileTimeErrorCode( 'CONST_WITH_UNDEFINED_CONSTRUCTOR', "The class '{0}' doesn't have a constant constructor '{1}'.", @@ -1362,7 +1355,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the type - static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = + static const CompileTimeErrorCode constWithUndefinedConstructorDefault = CompileTimeErrorCode( 'CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', "The class '{0}' doesn't have an unnamed constant constructor.", @@ -1370,8 +1363,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - CONTINUE_LABEL_INVALID = CompileTimeErrorCode( + static const CompileTimeErrorCode continueLabelInvalid = CompileTimeErrorCode( 'CONTINUE_LABEL_INVALID', "The label used in a 'continue' statement must be defined on either a loop " "or a switch member.", @@ -1381,14 +1373,14 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter /// String p1: detail text explaining why the type could not be inferred - static const CompileTimeErrorCode COULD_NOT_INFER = CompileTimeErrorCode( + static const CompileTimeErrorCode couldNotInfer = CompileTimeErrorCode( 'COULD_NOT_INFER', "Couldn't infer type parameter '{0}'.{1}", ); /// No parameters. static const CompileTimeErrorCode - DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR = CompileTimeErrorCode( + defaultValueInRedirectingFactoryConstructor = CompileTimeErrorCode( 'DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR', "Default values aren't allowed in factory constructors that redirect to " "another constructor.", @@ -1397,7 +1389,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode DEFAULT_VALUE_ON_REQUIRED_PARAMETER = + static const CompileTimeErrorCode defaultValueOnRequiredParameter = CompileTimeErrorCode( 'DEFAULT_VALUE_ON_REQUIRED_PARAMETER', "Required named parameters can't have a default value.", @@ -1407,7 +1399,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode DEFERRED_IMPORT_OF_EXTENSION = + static const CompileTimeErrorCode deferredImportOfExtension = CompileTimeErrorCode( 'DEFERRED_IMPORT_OF_EXTENSION', "Imports of deferred libraries must hide all extensions.", @@ -1419,7 +1411,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the variable that is invalid - static const CompileTimeErrorCode DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE = + static const CompileTimeErrorCode definitelyUnassignedLateLocalVariable = CompileTimeErrorCode( 'DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE', "The late local variable '{0}' is definitely unassigned at this point.", @@ -1430,7 +1422,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - DISALLOWED_TYPE_INSTANTIATION_EXPRESSION = CompileTimeErrorCode( + disallowedTypeInstantiationExpression = CompileTimeErrorCode( 'DISALLOWED_TYPE_INSTANTIATION_EXPRESSION', "Only a generic type, generic function, generic instance method, or " "generic constructor can have type arguments.", @@ -1442,7 +1434,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode DOT_SHORTHAND_MISSING_CONTEXT = + static const CompileTimeErrorCode dotShorthandMissingContext = CompileTimeErrorCode( 'DOT_SHORTHAND_MISSING_CONTEXT', "A dot shorthand can't be used where there is no context type.", @@ -1454,7 +1446,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the enclosing type where the getter is being looked /// for static const CompileTimeErrorCode - DOT_SHORTHAND_UNDEFINED_GETTER = CompileTimeErrorCode( + dotShorthandUndefinedGetter = CompileTimeErrorCode( 'DOT_SHORTHAND_UNDEFINED_MEMBER', "The static getter '{0}' isn't defined for the context type '{1}'.", correctionMessage: @@ -1469,7 +1461,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the enclosing type where the method or constructor /// is being looked for static const CompileTimeErrorCode - DOT_SHORTHAND_UNDEFINED_INVOCATION = CompileTimeErrorCode( + dotShorthandUndefinedInvocation = CompileTimeErrorCode( 'DOT_SHORTHAND_UNDEFINED_MEMBER', "The static method or constructor '{0}' isn't defined for the context type " "'{1}'.", @@ -1481,7 +1473,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = + static const CompileTimeErrorCode duplicateConstructorDefault = CompileTimeErrorCode( 'DUPLICATE_CONSTRUCTOR', "The unnamed constructor is already defined.", @@ -1492,7 +1484,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the duplicate entity - static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = + static const CompileTimeErrorCode duplicateConstructorName = CompileTimeErrorCode( 'DUPLICATE_CONSTRUCTOR', "The constructor with name '{0}' is already defined.", @@ -1503,7 +1495,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the duplicate entity - static const CompileTimeErrorCode DUPLICATE_DEFINITION = CompileTimeErrorCode( + static const CompileTimeErrorCode duplicateDefinition = CompileTimeErrorCode( 'DUPLICATE_DEFINITION', "The name '{0}' is already defined.", correctionMessage: "Try renaming one of the declarations.", @@ -1513,7 +1505,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the field static const CompileTimeErrorCode - DUPLICATE_FIELD_FORMAL_PARAMETER = CompileTimeErrorCode( + duplicateFieldFormalParameter = CompileTimeErrorCode( 'DUPLICATE_FIELD_FORMAL_PARAMETER', "The field '{0}' can't be initialized by multiple parameters in the same " "constructor.", @@ -1524,7 +1516,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the duplicated name - static const CompileTimeErrorCode DUPLICATE_FIELD_NAME = CompileTimeErrorCode( + static const CompileTimeErrorCode duplicateFieldName = CompileTimeErrorCode( 'DUPLICATE_FIELD_NAME', "The field name '{0}' is already used in this record.", correctionMessage: "Try renaming the field.", @@ -1533,7 +1525,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the parameter that was duplicated - static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = + static const CompileTimeErrorCode duplicateNamedArgument = CompileTimeErrorCode( 'DUPLICATE_NAMED_ARGUMENT', "The argument for the named parameter '{0}' was already specified.", @@ -1545,7 +1537,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Uri p0: the URI of the duplicate part - static const CompileTimeErrorCode DUPLICATE_PART = CompileTimeErrorCode( + static const CompileTimeErrorCode duplicatePart = CompileTimeErrorCode( 'DUPLICATE_PART', "The library already contains a part with the URI '{0}'.", correctionMessage: @@ -1555,7 +1547,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the variable - static const CompileTimeErrorCode DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE = + static const CompileTimeErrorCode duplicatePatternAssignmentVariable = CompileTimeErrorCode( 'DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE', "The variable '{0}' is already assigned in this pattern.", @@ -1565,7 +1557,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the field - static const CompileTimeErrorCode DUPLICATE_PATTERN_FIELD = + static const CompileTimeErrorCode duplicatePatternField = CompileTimeErrorCode( 'DUPLICATE_PATTERN_FIELD', "The field '{0}' is already matched in this pattern.", @@ -1574,7 +1566,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode DUPLICATE_REST_ELEMENT_IN_PATTERN = + static const CompileTimeErrorCode duplicateRestElementInPattern = CompileTimeErrorCode( 'DUPLICATE_REST_ELEMENT_IN_PATTERN', "At most one rest element is allowed in a list or map pattern.", @@ -1584,7 +1576,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the variable - static const CompileTimeErrorCode DUPLICATE_VARIABLE_PATTERN = + static const CompileTimeErrorCode duplicateVariablePattern = CompileTimeErrorCode( 'DUPLICATE_VARIABLE_PATTERN', "The variable '{0}' is already defined in this pattern.", @@ -1593,7 +1585,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EMPTY_MAP_PATTERN = CompileTimeErrorCode( + static const CompileTimeErrorCode emptyMapPattern = CompileTimeErrorCode( 'EMPTY_MAP_PATTERN', "A map pattern must have at least one entry.", correctionMessage: "Try replacing it with an object pattern 'Map()'.", @@ -1601,7 +1593,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR = + static const CompileTimeErrorCode enumConstantInvokesFactoryConstructor = CompileTimeErrorCode( 'ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR', "An enum value can't invoke a factory constructor.", @@ -1609,7 +1601,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING = + static const CompileTimeErrorCode enumConstantSameNameAsEnclosing = CompileTimeErrorCode( 'ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING', "The name of the enum value can't be the same as the enum's name.", @@ -1618,15 +1610,15 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - ENUM_INSTANTIATED_TO_BOUNDS_IS_NOT_WELL_BOUNDED = CompileTimeErrorCode( - 'ENUM_INSTANTIATED_TO_BOUNDS_IS_NOT_WELL_BOUNDED', - "The result of instantiating the enum to bounds is not well-bounded.", - correctionMessage: "Try using different bounds for type parameters.", - ); + static const CompileTimeErrorCode enumInstantiatedToBoundsIsNotWellBounded = + CompileTimeErrorCode( + 'ENUM_INSTANTIATED_TO_BOUNDS_IS_NOT_WELL_BOUNDED', + "The result of instantiating the enum to bounds is not well-bounded.", + correctionMessage: "Try using different bounds for type parameters.", + ); /// No parameters. - static const CompileTimeErrorCode ENUM_MIXIN_WITH_INSTANCE_VARIABLE = + static const CompileTimeErrorCode enumMixinWithInstanceVariable = CompileTimeErrorCode( 'ENUM_MIXIN_WITH_INSTANCE_VARIABLE', "Mixins applied to enums can't have instance variables.", @@ -1635,17 +1627,16 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ENUM_WITHOUT_CONSTANTS = - CompileTimeErrorCode( - 'ENUM_WITHOUT_CONSTANTS', - "The enum must have at least one enum constant.", - correctionMessage: "Try declaring an enum constant.", - ); + static const CompileTimeErrorCode enumWithoutConstants = CompileTimeErrorCode( + 'ENUM_WITHOUT_CONSTANTS', + "The enum must have at least one enum constant.", + correctionMessage: "Try declaring an enum constant.", + ); /// Parameters: /// String p0: the name of the abstract method /// String p1: the name of the enclosing enum - static const CompileTimeErrorCode ENUM_WITH_ABSTRACT_MEMBER = + static const CompileTimeErrorCode enumWithAbstractMember = CompileTimeErrorCode( 'ENUM_WITH_ABSTRACT_MEMBER', "'{0}' must have a method body because '{1}' is an enum.", @@ -1654,16 +1645,15 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ENUM_WITH_NAME_VALUES = - CompileTimeErrorCode( - 'ENUM_WITH_NAME_VALUES', - "The name 'values' is not a valid name for an enum.", - correctionMessage: "Try using a different name.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode enumWithNameValues = CompileTimeErrorCode( + 'ENUM_WITH_NAME_VALUES', + "The name 'values' is not a valid name for an enum.", + correctionMessage: "Try using a different name.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode EQUAL_ELEMENTS_IN_CONST_SET = + static const CompileTimeErrorCode equalElementsInConstSet = CompileTimeErrorCode( 'EQUAL_ELEMENTS_IN_CONST_SET', "Two elements in a constant set literal can't be equal.", @@ -1672,16 +1662,15 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EQUAL_KEYS_IN_CONST_MAP = - CompileTimeErrorCode( - 'EQUAL_KEYS_IN_CONST_MAP', - "Two keys in a constant map literal can't be equal.", - correctionMessage: "Change or remove the duplicate key.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode equalKeysInConstMap = CompileTimeErrorCode( + 'EQUAL_KEYS_IN_CONST_MAP', + "Two keys in a constant map literal can't be equal.", + correctionMessage: "Change or remove the duplicate key.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode EQUAL_KEYS_IN_MAP_PATTERN = + static const CompileTimeErrorCode equalKeysInMapPattern = CompileTimeErrorCode( 'EQUAL_KEYS_IN_MAP_PATTERN', "Two keys in a map pattern can't be equal.", @@ -1691,7 +1680,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// int p0: the number of provided type arguments - static const CompileTimeErrorCode EXPECTED_ONE_LIST_PATTERN_TYPE_ARGUMENTS = + static const CompileTimeErrorCode expectedOneListPatternTypeArguments = CompileTimeErrorCode( 'EXPECTED_ONE_LIST_PATTERN_TYPE_ARGUMENTS', "List patterns require one type argument or none, but {0} found.", @@ -1701,7 +1690,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// int p0: the number of provided type arguments - static const CompileTimeErrorCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = + static const CompileTimeErrorCode expectedOneListTypeArguments = CompileTimeErrorCode( 'EXPECTED_ONE_LIST_TYPE_ARGUMENTS', "List literals require one type argument or none, but {0} found.", @@ -1711,7 +1700,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// int p0: the number of provided type arguments - static const CompileTimeErrorCode EXPECTED_ONE_SET_TYPE_ARGUMENTS = + static const CompileTimeErrorCode expectedOneSetTypeArguments = CompileTimeErrorCode( 'EXPECTED_ONE_SET_TYPE_ARGUMENTS', "Set literals require one type argument or none, but {0} were found.", @@ -1721,7 +1710,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// int p0: the number of provided type arguments - static const CompileTimeErrorCode EXPECTED_TWO_MAP_PATTERN_TYPE_ARGUMENTS = + static const CompileTimeErrorCode expectedTwoMapPatternTypeArguments = CompileTimeErrorCode( 'EXPECTED_TWO_MAP_PATTERN_TYPE_ARGUMENTS', "Map patterns require two type arguments or none, but {0} found.", @@ -1731,7 +1720,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// int p0: the number of provided type arguments - static const CompileTimeErrorCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = + static const CompileTimeErrorCode expectedTwoMapTypeArguments = CompileTimeErrorCode( 'EXPECTED_TWO_MAP_TYPE_ARGUMENTS', "Map literals require two type arguments or none, but {0} found.", @@ -1741,7 +1730,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the URI pointing to a library - static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = + static const CompileTimeErrorCode exportInternalLibrary = CompileTimeErrorCode( 'EXPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and can't be exported.", @@ -1750,17 +1739,15 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the URI pointing to a non-library declaration - static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = - CompileTimeErrorCode( - 'EXPORT_OF_NON_LIBRARY', - "The exported library '{0}' can't have a part-of directive.", - correctionMessage: - "Try exporting the library that the part is a part of.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode exportOfNonLibrary = CompileTimeErrorCode( + 'EXPORT_OF_NON_LIBRARY', + "The exported library '{0}' can't have a part-of directive.", + correctionMessage: "Try exporting the library that the part is a part of.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode EXPRESSION_IN_MAP = CompileTimeErrorCode( + static const CompileTimeErrorCode expressionInMap = CompileTimeErrorCode( 'EXPRESSION_IN_MAP', "Expressions can't be used in a map literal.", correctionMessage: @@ -1769,20 +1756,19 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = - CompileTimeErrorCode( - 'SUBTYPE_OF_DEFERRED_CLASS', - "Classes can't extend deferred classes.", - correctionMessage: - "Try specifying a different superclass, or removing the extends " - "clause.", - hasPublishedDocs: true, - uniqueName: 'EXTENDS_DEFERRED_CLASS', - ); + static const CompileTimeErrorCode extendsDeferredClass = CompileTimeErrorCode( + 'SUBTYPE_OF_DEFERRED_CLASS', + "Classes can't extend deferred classes.", + correctionMessage: + "Try specifying a different superclass, or removing the extends " + "clause.", + hasPublishedDocs: true, + uniqueName: 'EXTENDS_DEFERRED_CLASS', + ); /// Parameters: /// Type p0: the name of the disallowed type - static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = + static const CompileTimeErrorCode extendsDisallowedClass = CompileTimeErrorCode( 'SUBTYPE_OF_DISALLOWED_TYPE', "Classes can't extend '{0}'.", @@ -1794,7 +1780,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTENDS_NON_CLASS = CompileTimeErrorCode( + static const CompileTimeErrorCode extendsNonClass = CompileTimeErrorCode( 'EXTENDS_NON_CLASS', "Classes can only extend other classes.", correctionMessage: @@ -1805,21 +1791,21 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - EXTENDS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER = CompileTimeErrorCode( - 'SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER', - "A type alias that expands to a type parameter can't be used as a " - "superclass.", - correctionMessage: - "Try specifying a different superclass, or removing the extends " - "clause.", - hasPublishedDocs: true, - uniqueName: 'EXTENDS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', - ); + static const CompileTimeErrorCode extendsTypeAliasExpandsToTypeParameter = + CompileTimeErrorCode( + 'SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER', + "A type alias that expands to a type parameter can't be used as a " + "superclass.", + correctionMessage: + "Try specifying a different superclass, or removing the extends " + "clause.", + hasPublishedDocs: true, + uniqueName: 'EXTENDS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', + ); /// Parameters: /// String p0: the name of the extension - static const CompileTimeErrorCode EXTENSION_AS_EXPRESSION = + static const CompileTimeErrorCode extensionAsExpression = CompileTimeErrorCode( 'EXTENSION_AS_EXPRESSION', "Extension '{0}' can't be used as an expression.", @@ -1830,7 +1816,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the conflicting static member static const CompileTimeErrorCode - EXTENSION_CONFLICTING_STATIC_AND_INSTANCE = CompileTimeErrorCode( + extensionConflictingStaticAndInstance = CompileTimeErrorCode( 'EXTENSION_CONFLICTING_STATIC_AND_INSTANCE', "An extension can't define static member '{0}' and an instance member with " "the same name.", @@ -1840,7 +1826,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTENSION_DECLARES_INSTANCE_FIELD = + static const CompileTimeErrorCode extensionDeclaresInstanceField = CompileTimeErrorCode( 'EXTENSION_DECLARES_INSTANCE_FIELD', "Extensions can't declare instance fields.", @@ -1850,7 +1836,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - EXTENSION_DECLARES_MEMBER_OF_OBJECT = CompileTimeErrorCode( + extensionDeclaresMemberOfObject = CompileTimeErrorCode( 'EXTENSION_DECLARES_MEMBER_OF_OBJECT', "Extensions can't declare members with the same name as a member declared " "by 'Object'.", @@ -1859,7 +1845,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER = + static const CompileTimeErrorCode extensionOverrideAccessToStaticMember = CompileTimeErrorCode( 'EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER', "An extension override can't be used to access a static member from an " @@ -1872,7 +1858,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the type of the argument /// Type p1: the extended type static const CompileTimeErrorCode - EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE = CompileTimeErrorCode( + extensionOverrideArgumentNotAssignable = CompileTimeErrorCode( 'EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE', "The type of the argument to the extension override '{0}' isn't assignable " "to the extended type '{1}'.", @@ -1880,7 +1866,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTENSION_OVERRIDE_WITHOUT_ACCESS = + static const CompileTimeErrorCode extensionOverrideWithoutAccess = CompileTimeErrorCode( 'EXTENSION_OVERRIDE_WITHOUT_ACCESS', "An extension override can only be used to access instance members.", @@ -1890,7 +1876,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - EXTENSION_OVERRIDE_WITH_CASCADE = CompileTimeErrorCode( + extensionOverrideWithCascade = CompileTimeErrorCode( 'EXTENSION_OVERRIDE_WITH_CASCADE', "Extension overrides have no value so they can't be used as the receiver " "of a cascade expression.", @@ -1900,7 +1886,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_FORMAL_PARAMETER = CompileTimeErrorCode( + extensionTypeConstructorWithSuperFormalParameter = CompileTimeErrorCode( 'EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_FORMAL_PARAMETER', "Extension type constructors can't declare super formal parameters.", correctionMessage: "Try removing the super formal parameter declaration.", @@ -1909,7 +1895,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION = CompileTimeErrorCode( + extensionTypeConstructorWithSuperInvocation = CompileTimeErrorCode( 'EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION', "Extension type constructors can't include super initializers.", correctionMessage: "Try removing the super constructor invocation.", @@ -1917,7 +1903,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTENSION_TYPE_DECLARES_INSTANCE_FIELD = + static const CompileTimeErrorCode extensionTypeDeclaresInstanceField = CompileTimeErrorCode( 'EXTENSION_TYPE_DECLARES_INSTANCE_FIELD', "Extension types can't declare instance fields.", @@ -1926,7 +1912,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT = + static const CompileTimeErrorCode extensionTypeDeclaresMemberOfObject = CompileTimeErrorCode( 'EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT', "Extension types can't declare members with the same name as a member " @@ -1938,7 +1924,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the display string of the disallowed type static const CompileTimeErrorCode - EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE = CompileTimeErrorCode( + extensionTypeImplementsDisallowedType = CompileTimeErrorCode( 'EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE', "Extension types can't implement '{0}'.", correctionMessage: @@ -1948,7 +1934,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - EXTENSION_TYPE_IMPLEMENTS_ITSELF = CompileTimeErrorCode( + extensionTypeImplementsItself = CompileTimeErrorCode( 'EXTENSION_TYPE_IMPLEMENTS_ITSELF', "The extension type can't implement itself.", correctionMessage: @@ -1960,7 +1946,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the implemented not extension type /// Type p1: the ultimate representation type static const CompileTimeErrorCode - EXTENSION_TYPE_IMPLEMENTS_NOT_SUPERTYPE = CompileTimeErrorCode( + extensionTypeImplementsNotSupertype = CompileTimeErrorCode( 'EXTENSION_TYPE_IMPLEMENTS_NOT_SUPERTYPE', "'{0}' is not a supertype of '{1}', the representation type.", correctionMessage: @@ -1974,7 +1960,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p2: the representation type of the this extension type /// String p3: the name of the this extension type static const CompileTimeErrorCode - EXTENSION_TYPE_IMPLEMENTS_REPRESENTATION_NOT_SUPERTYPE = CompileTimeErrorCode( + extensionTypeImplementsRepresentationNotSupertype = CompileTimeErrorCode( 'EXTENSION_TYPE_IMPLEMENTS_REPRESENTATION_NOT_SUPERTYPE', "'{0}', the representation type of '{1}', is not a supertype of '{2}', the " "representation type of '{3}'.", @@ -1987,7 +1973,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the extension type /// String p1: the name of the conflicting member static const CompileTimeErrorCode - EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT = CompileTimeErrorCode( + extensionTypeInheritedMemberConflict = CompileTimeErrorCode( 'EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT', "The extension type '{0}' has more than one distinct member named '{1}' " "from implemented types.", @@ -1997,16 +1983,16 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF = CompileTimeErrorCode( - 'EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF', - "The extension type representation can't depend on itself.", - correctionMessage: "Try specifying a different type.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode extensionTypeRepresentationDependsOnItself = + CompileTimeErrorCode( + 'EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF', + "The extension type representation can't depend on itself.", + correctionMessage: "Try specifying a different type.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode EXTENSION_TYPE_REPRESENTATION_TYPE_BOTTOM = + static const CompileTimeErrorCode extensionTypeRepresentationTypeBottom = CompileTimeErrorCode( 'EXTENSION_TYPE_REPRESENTATION_TYPE_BOTTOM', "The representation type can't be a bottom type.", @@ -2017,7 +2003,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the abstract method /// String p1: the name of the enclosing extension type - static const CompileTimeErrorCode EXTENSION_TYPE_WITH_ABSTRACT_MEMBER = + static const CompileTimeErrorCode extensionTypeWithAbstractMember = CompileTimeErrorCode( 'EXTENSION_TYPE_WITH_ABSTRACT_MEMBER', "'{0}' must have a method body because '{1}' is an extension type.", @@ -2027,7 +2013,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER = CompileTimeErrorCode( + externalFieldConstructorInitializer = CompileTimeErrorCode( 'EXTERNAL_WITH_INITIALIZER', "External fields can't have initializers.", correctionMessage: @@ -2038,7 +2024,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTERNAL_FIELD_INITIALIZER = + static const CompileTimeErrorCode externalFieldInitializer = CompileTimeErrorCode( 'EXTERNAL_WITH_INITIALIZER', "External fields can't have initializers.", @@ -2049,7 +2035,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode EXTERNAL_VARIABLE_INITIALIZER = + static const CompileTimeErrorCode externalVariableInitializer = CompileTimeErrorCode( 'EXTERNAL_WITH_INITIALIZER', "External variables can't have initializers.", @@ -2062,7 +2048,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// int p0: the maximum number of positional arguments /// int p1: the actual number of positional arguments given - static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = + static const CompileTimeErrorCode extraPositionalArguments = CompileTimeErrorCode( 'EXTRA_POSITIONAL_ARGUMENTS', "Too many positional arguments: {0} expected, but {1} found.", @@ -2074,7 +2060,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// int p0: the maximum number of positional arguments /// int p1: the actual number of positional arguments given static const CompileTimeErrorCode - EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED = CompileTimeErrorCode( + extraPositionalArgumentsCouldBeNamed = CompileTimeErrorCode( 'EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED', "Too many positional arguments: {0} expected, but {1} found.", correctionMessage: @@ -2085,7 +2071,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the field being initialized multiple times - static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = + static const CompileTimeErrorCode fieldInitializedByMultipleInitializers = CompileTimeErrorCode( 'FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', "The field '{0}' can't be initialized twice in the same constructor.", @@ -2095,7 +2081,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = CompileTimeErrorCode( + fieldInitializedInInitializerAndDeclaration = CompileTimeErrorCode( 'FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', "Fields can't be initialized in the constructor if they are final and were " "already initialized at their declaration.", @@ -2104,17 +2090,17 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER = CompileTimeErrorCode( - 'FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', - "Fields can't be initialized in both the parameter list and the " - "initializers.", - correctionMessage: "Try removing one of the initializations.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode fieldInitializedInParameterAndInitializer = + CompileTimeErrorCode( + 'FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', + "Fields can't be initialized in both the parameter list and the " + "initializers.", + correctionMessage: "Try removing one of the initializations.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = + static const CompileTimeErrorCode fieldInitializerFactoryConstructor = CompileTimeErrorCode( 'FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', "Initializing formal parameters can't be used in factory constructors.", @@ -2125,7 +2111,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the name of the type of the initializer expression /// Type p1: the name of the type of the field - static const CompileTimeErrorCode FIELD_INITIALIZER_NOT_ASSIGNABLE = + static const CompileTimeErrorCode fieldInitializerNotAssignable = CompileTimeErrorCode( 'FIELD_INITIALIZER_NOT_ASSIGNABLE', "The initializer type '{0}' can't be assigned to the field type '{1}'.", @@ -2133,7 +2119,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = + static const CompileTimeErrorCode fieldInitializerOutsideConstructor = CompileTimeErrorCode( 'FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', "Initializing formal parameters can only be used in constructors.", @@ -2143,7 +2129,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = CompileTimeErrorCode( + fieldInitializerRedirectingConstructor = CompileTimeErrorCode( 'FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', "The redirecting constructor can't have a field initializer.", correctionMessage: @@ -2154,7 +2140,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the name of the type of the field formal parameter /// Type p1: the name of the type of the field - static const CompileTimeErrorCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = + static const CompileTimeErrorCode fieldInitializingFormalNotAssignable = CompileTimeErrorCode( 'FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', "The parameter type '{0}' is incompatible with the field type '{1}'.", @@ -2167,7 +2153,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the final class being extended. static const CompileTimeErrorCode - FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY = CompileTimeErrorCode( + finalClassExtendedOutsideOfLibrary = CompileTimeErrorCode( 'INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY', "The class '{0}' can't be extended outside of its library because it's a " "final class.", @@ -2178,7 +2164,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the final class being implemented. static const CompileTimeErrorCode - FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY = CompileTimeErrorCode( + finalClassImplementedOutsideOfLibrary = CompileTimeErrorCode( 'INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY', "The class '{0}' can't be implemented outside of its library because it's " "a final class.", @@ -2190,7 +2176,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the final class being used as a mixin superclass /// constraint. static const CompileTimeErrorCode - FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY = CompileTimeErrorCode( + finalClassUsedAsMixinConstraintOutsideOfLibrary = CompileTimeErrorCode( 'INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY', "The class '{0}' can't be used as a mixin superclass constraint outside of " "its library because it's a final class.", @@ -2201,7 +2187,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the field in question static const CompileTimeErrorCode - FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR = CompileTimeErrorCode( + finalInitializedInDeclarationAndConstructor = CompileTimeErrorCode( 'FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', "'{0}' is final and was given a value when it was declared, so it can't be " "set to a new value.", @@ -2211,17 +2197,16 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the uninitialized final variable - static const CompileTimeErrorCode FINAL_NOT_INITIALIZED = - CompileTimeErrorCode( - 'FINAL_NOT_INITIALIZED', - "The final variable '{0}' must be initialized.", - correctionMessage: "Try initializing the variable.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode finalNotInitialized = CompileTimeErrorCode( + 'FINAL_NOT_INITIALIZED', + "The final variable '{0}' must be initialized.", + correctionMessage: "Try initializing the variable.", + hasPublishedDocs: true, + ); /// Parameters: /// String p0: the name of the uninitialized final variable - static const CompileTimeErrorCode FINAL_NOT_INITIALIZED_CONSTRUCTOR_1 = + static const CompileTimeErrorCode finalNotInitializedConstructor1 = CompileTimeErrorCode( 'FINAL_NOT_INITIALIZED_CONSTRUCTOR', "All final variables must be initialized, but '{0}' isn't.", @@ -2233,7 +2218,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the uninitialized final variable /// String p1: the name of the uninitialized final variable - static const CompileTimeErrorCode FINAL_NOT_INITIALIZED_CONSTRUCTOR_2 = + static const CompileTimeErrorCode finalNotInitializedConstructor2 = CompileTimeErrorCode( 'FINAL_NOT_INITIALIZED_CONSTRUCTOR', "All final variables must be initialized, but '{0}' and '{1}' aren't.", @@ -2248,7 +2233,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// int p2: the number of additional not initialized variables that aren't /// listed static const CompileTimeErrorCode - FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS = CompileTimeErrorCode( + finalNotInitializedConstructor3Plus = CompileTimeErrorCode( 'FINAL_NOT_INITIALIZED_CONSTRUCTOR', "All final variables must be initialized, but '{0}', '{1}', and {2} others " "aren't.", @@ -2263,7 +2248,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// for`. /// Type p2: the loop variable type. static const CompileTimeErrorCode - FOR_IN_OF_INVALID_ELEMENT_TYPE = CompileTimeErrorCode( + forInOfInvalidElementType = CompileTimeErrorCode( 'FOR_IN_OF_INVALID_ELEMENT_TYPE', "The type '{0}' used in the 'for' loop must implement '{1}' with a type " "argument that can be assigned to '{2}'.", @@ -2274,15 +2259,14 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the type of the iterable expression. /// String p1: the sequence type -- Iterable for `for` or Stream for `await /// for`. - static const CompileTimeErrorCode FOR_IN_OF_INVALID_TYPE = - CompileTimeErrorCode( - 'FOR_IN_OF_INVALID_TYPE', - "The type '{0}' used in the 'for' loop must implement '{1}'.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode forInOfInvalidType = CompileTimeErrorCode( + 'FOR_IN_OF_INVALID_TYPE', + "The type '{0}' used in the 'for' loop must implement '{1}'.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode FOR_IN_WITH_CONST_VARIABLE = + static const CompileTimeErrorCode forInWithConstVariable = CompileTimeErrorCode( 'FOR_IN_WITH_CONST_VARIABLE', "A for-in loop variable can't be a 'const'.", @@ -2297,7 +2281,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// No parameters. static const CompileTimeErrorCode - GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND = CompileTimeErrorCode( + genericFunctionTypeCannotBeBound = CompileTimeErrorCode( 'GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND', "Generic function types can't be used as type parameter bounds.", correctionMessage: @@ -2310,7 +2294,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// No parameters. static const CompileTimeErrorCode - GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT = CompileTimeErrorCode( + genericFunctionTypeCannotBeTypeArgument = CompileTimeErrorCode( 'GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT', "A generic function type can't be a type argument.", correctionMessage: @@ -2320,7 +2304,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - GENERIC_METHOD_TYPE_INSTANTIATION_ON_DYNAMIC = CompileTimeErrorCode( + genericMethodTypeInstantiationOnDynamic = CompileTimeErrorCode( 'GENERIC_METHOD_TYPE_INSTANTIATION_ON_DYNAMIC', "A method tear-off on a receiver whose type is 'dynamic' can't have type " "arguments.", @@ -2336,7 +2320,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p2: the type of the setter /// Object p3: the name of the setter static const CompileTimeErrorCode - GETTER_NOT_ASSIGNABLE_SETTER_TYPES = CompileTimeErrorCode( + getterNotAssignableSetterTypes = CompileTimeErrorCode( 'GETTER_NOT_ASSIGNABLE_SETTER_TYPES', "The return type of getter '{0}' is '{1}' which isn't assignable to the " "type '{2}' of its setter '{3}'.", @@ -2348,7 +2332,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p1: the type of the getter /// Object p2: the type of the setter /// Object p3: the name of the setter - static const CompileTimeErrorCode GETTER_NOT_SUBTYPE_SETTER_TYPES = + static const CompileTimeErrorCode getterNotSubtypeSetterTypes = CompileTimeErrorCode( 'GETTER_NOT_SUBTYPE_SETTER_TYPES', "The return type of getter '{0}' is '{1}' which isn't a subtype of the " @@ -2360,7 +2344,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( + ifElementConditionFromDeferredLibrary = CompileTimeErrorCode( 'IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as values in an if " "condition inside a const collection literal.", @@ -2369,7 +2353,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE = CompileTimeErrorCode( + illegalAsyncGeneratorReturnType = CompileTimeErrorCode( 'ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE', "Functions marked 'async*' must have a return type that is a supertype of " "'Stream' for some type 'T'.", @@ -2381,7 +2365,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - ILLEGAL_ASYNC_RETURN_TYPE = CompileTimeErrorCode( + illegalAsyncReturnType = CompileTimeErrorCode( 'ILLEGAL_ASYNC_RETURN_TYPE', "Functions marked 'async' must have a return type which is a supertype of " "'Future'.", @@ -2394,7 +2378,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of member that cannot be declared static const CompileTimeErrorCode - ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION = CompileTimeErrorCode( + illegalConcreteEnumMemberDeclaration = CompileTimeErrorCode( 'ILLEGAL_CONCRETE_ENUM_MEMBER', "A concrete instance member named '{0}' can't be declared in a class that " "implements 'Enum'.", @@ -2407,7 +2391,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of member that cannot be inherited /// String p1: the name of the class that declares the member static const CompileTimeErrorCode - ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE = CompileTimeErrorCode( + illegalConcreteEnumMemberInheritance = CompileTimeErrorCode( 'ILLEGAL_CONCRETE_ENUM_MEMBER', "A concrete instance member named '{0}' can't be inherited from '{1}' in a " "class that implements 'Enum'.", @@ -2417,7 +2401,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode ILLEGAL_ENUM_VALUES_DECLARATION = + static const CompileTimeErrorCode illegalEnumValuesDeclaration = CompileTimeErrorCode( 'ILLEGAL_ENUM_VALUES', "An instance member named 'values' can't be declared in a class that " @@ -2429,7 +2413,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the class that declares 'values' - static const CompileTimeErrorCode ILLEGAL_ENUM_VALUES_INHERITANCE = + static const CompileTimeErrorCode illegalEnumValuesInheritance = CompileTimeErrorCode( 'ILLEGAL_ENUM_VALUES', "An instance member named 'values' can't be inherited from '{0}' in a " @@ -2442,7 +2426,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the required language version static const CompileTimeErrorCode - ILLEGAL_LANGUAGE_VERSION_OVERRIDE = CompileTimeErrorCode( + illegalLanguageVersionOverride = CompileTimeErrorCode( 'ILLEGAL_LANGUAGE_VERSION_OVERRIDE', "The language version must be {0}.", correctionMessage: @@ -2451,7 +2435,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - ILLEGAL_SYNC_GENERATOR_RETURN_TYPE = CompileTimeErrorCode( + illegalSyncGeneratorReturnType = CompileTimeErrorCode( 'ILLEGAL_SYNC_GENERATOR_RETURN_TYPE', "Functions marked 'sync*' must have a return type that is a supertype of " "'Iterable' for some type 'T'.", @@ -2462,7 +2446,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = + static const CompileTimeErrorCode implementsDeferredClass = CompileTimeErrorCode( 'SUBTYPE_OF_DEFERRED_CLASS', "Classes and mixins can't implement deferred classes.", @@ -2476,7 +2460,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the name of the disallowed type static const CompileTimeErrorCode - IMPLEMENTS_DISALLOWED_CLASS = CompileTimeErrorCode( + implementsDisallowedClass = CompileTimeErrorCode( 'SUBTYPE_OF_DISALLOWED_TYPE', "Classes and mixins can't implement '{0}'.", correctionMessage: @@ -2487,7 +2471,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = CompileTimeErrorCode( + static const CompileTimeErrorCode implementsNonClass = CompileTimeErrorCode( 'IMPLEMENTS_NON_CLASS', "Classes and mixins can only implement other classes and mixins.", correctionMessage: @@ -2497,7 +2481,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the interface that is implemented more than once - static const CompileTimeErrorCode IMPLEMENTS_REPEATED = CompileTimeErrorCode( + static const CompileTimeErrorCode implementsRepeated = CompileTimeErrorCode( 'IMPLEMENTS_REPEATED', "'{0}' can only be implemented once.", correctionMessage: "Try removing all but one occurrence of the class name.", @@ -2507,28 +2491,28 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Element p0: the name of the class that appears in both "extends" and /// "implements" clauses - static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = - CompileTimeErrorCode( - 'IMPLEMENTS_SUPER_CLASS', - "'{0}' can't be used in both the 'extends' and 'implements' clauses.", - correctionMessage: "Try removing one of the occurrences.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode implementsSuperClass = CompileTimeErrorCode( + 'IMPLEMENTS_SUPER_CLASS', + "'{0}' can't be used in both the 'extends' and 'implements' clauses.", + correctionMessage: "Try removing one of the occurrences.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode - IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER = CompileTimeErrorCode( - 'SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER', - "A type alias that expands to a type parameter can't be implemented.", - correctionMessage: "Try specifying a class or mixin, or removing the list.", - hasPublishedDocs: true, - uniqueName: 'IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', - ); + static const CompileTimeErrorCode implementsTypeAliasExpandsToTypeParameter = + CompileTimeErrorCode( + 'SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER', + "A type alias that expands to a type parameter can't be implemented.", + correctionMessage: + "Try specifying a class or mixin, or removing the list.", + hasPublishedDocs: true, + uniqueName: 'IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', + ); /// Parameters: /// Type p0: the name of the superclass static const CompileTimeErrorCode - IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS = CompileTimeErrorCode( + implicitSuperInitializerMissingArguments = CompileTimeErrorCode( 'IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS', "The implicitly invoked unnamed constructor from '{0}' has required " "parameters.", @@ -2540,7 +2524,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the instance member static const CompileTimeErrorCode - IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = CompileTimeErrorCode( + implicitThisReferenceInInitializer = CompileTimeErrorCode( 'IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', "The instance member '{0}' can't be accessed in an initializer.", correctionMessage: @@ -2551,23 +2535,25 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the URI pointing to a library - static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = + static const CompileTimeErrorCode importInternalLibrary = CompileTimeErrorCode( 'IMPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and can't be imported.", hasPublishedDocs: true, ); + @Deprecated("Please use importInternalLibrary") + static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = + importInternalLibrary; + /// Parameters: /// String p0: the URI pointing to a non-library declaration - static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = - CompileTimeErrorCode( - 'IMPORT_OF_NON_LIBRARY', - "The imported library '{0}' can't have a part-of directive.", - correctionMessage: - "Try importing the library that the part is a part of.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode importOfNonLibrary = CompileTimeErrorCode( + 'IMPORT_OF_NON_LIBRARY', + "The imported library '{0}' can't have a part-of directive.", + correctionMessage: "Try importing the library that the part is a part of.", + hasPublishedDocs: true, + ); /// 13.9 Switch: It is a compile-time error if values of the expressions /// ek are not instances of the same class C, for all @@ -2576,7 +2562,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the expression source code that is the unexpected type /// Object p1: the name of the expected type - static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = + static const CompileTimeErrorCode inconsistentCaseExpressionTypes = CompileTimeErrorCode( 'INCONSISTENT_CASE_EXPRESSION_TYPES', "Case expressions must have the same types, '{0}' isn't a '{1}'.", @@ -2586,7 +2572,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the instance member with inconsistent inheritance. /// String p1: the list of all inherited signatures for this member. static const CompileTimeErrorCode - INCONSISTENT_INHERITANCE = CompileTimeErrorCode( + inconsistentInheritance = CompileTimeErrorCode( 'INCONSISTENT_INHERITANCE', "Superinterfaces don't have a valid override for '{0}': {1}.", correctionMessage: @@ -2607,7 +2593,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// getter. /// String p2: the name of the superinterface that declares the name as a /// method. - static const CompileTimeErrorCode INCONSISTENT_INHERITANCE_GETTER_AND_METHOD = + static const CompileTimeErrorCode inconsistentInheritanceGetterAndMethod = CompileTimeErrorCode( 'INCONSISTENT_INHERITANCE_GETTER_AND_METHOD', "'{0}' is inherited as a getter (from '{1}') and also a method (from " @@ -2618,7 +2604,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INCONSISTENT_LANGUAGE_VERSION_OVERRIDE = + static const CompileTimeErrorCode inconsistentLanguageVersionOverride = CompileTimeErrorCode( 'INCONSISTENT_LANGUAGE_VERSION_OVERRIDE', "Parts must have exactly the same language version override as the " @@ -2629,7 +2615,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the pattern variable static const CompileTimeErrorCode - INCONSISTENT_PATTERN_VARIABLE_LOGICAL_OR = CompileTimeErrorCode( + inconsistentPatternVariableLogicalOr = CompileTimeErrorCode( 'INCONSISTENT_PATTERN_VARIABLE_LOGICAL_OR', "The variable '{0}' has a different type and/or finality in this branch of " "the logical-or pattern.", @@ -2642,7 +2628,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the initializing formal that is not an instance /// variable in the immediately enclosing class - static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = + static const CompileTimeErrorCode initializerForNonExistentField = CompileTimeErrorCode( 'INITIALIZER_FOR_NON_EXISTENT_FIELD', "'{0}' isn't a field in the enclosing class.", @@ -2656,7 +2642,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the initializing formal that is a static variable /// in the immediately enclosing class static const CompileTimeErrorCode - INITIALIZER_FOR_STATIC_FIELD = CompileTimeErrorCode( + initializerForStaticField = CompileTimeErrorCode( 'INITIALIZER_FOR_STATIC_FIELD', "'{0}' is a static field in the enclosing class. Fields initialized in a " "constructor can't be static.", @@ -2667,7 +2653,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the initializing formal that is not an instance /// variable in the immediately enclosing class - static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD = + static const CompileTimeErrorCode initializingFormalForNonExistentField = CompileTimeErrorCode( 'INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', "'{0}' isn't a field in the enclosing class.", @@ -2684,7 +2670,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p2: the name of the static member's enclosing element /// String p3: the kind of the static member's enclosing element (class, /// mixin, or extension) - static const CompileTimeErrorCode INSTANCE_ACCESS_TO_STATIC_MEMBER = + static const CompileTimeErrorCode instanceAccessToStaticMember = CompileTimeErrorCode( 'INSTANCE_ACCESS_TO_STATIC_MEMBER', "The static {1} '{0}' can't be accessed through an instance.", @@ -2692,12 +2678,16 @@ class CompileTimeErrorCode extends DiagnosticCode { hasPublishedDocs: true, ); + @Deprecated("Please use instanceAccessToStaticMember") + static const CompileTimeErrorCode INSTANCE_ACCESS_TO_STATIC_MEMBER = + instanceAccessToStaticMember; + /// Parameters: /// Object p0: the name of the static member /// Object p1: the kind of the static member (field, getter, setter, or /// method) static const CompileTimeErrorCode - INSTANCE_ACCESS_TO_STATIC_MEMBER_OF_UNNAMED_EXTENSION = CompileTimeErrorCode( + instanceAccessToStaticMemberOfUnnamedExtension = CompileTimeErrorCode( 'INSTANCE_ACCESS_TO_STATIC_MEMBER', "The static {1} '{0}' can't be accessed through an instance.", hasPublishedDocs: true, @@ -2705,7 +2695,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = + static const CompileTimeErrorCode instanceMemberAccessFromFactory = CompileTimeErrorCode( 'INSTANCE_MEMBER_ACCESS_FROM_FACTORY', "Instance members can't be accessed from a factory constructor.", @@ -2715,7 +2705,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - INSTANCE_MEMBER_ACCESS_FROM_STATIC = CompileTimeErrorCode( + instanceMemberAccessFromStatic = CompileTimeErrorCode( 'INSTANCE_MEMBER_ACCESS_FROM_STATIC', "Instance members can't be accessed from a static method.", correctionMessage: @@ -2725,7 +2715,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INSTANTIATE_ABSTRACT_CLASS = + static const CompileTimeErrorCode instantiateAbstractClass = CompileTimeErrorCode( 'INSTANTIATE_ABSTRACT_CLASS', "Abstract classes can't be instantiated.", @@ -2734,7 +2724,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INSTANTIATE_ENUM = CompileTimeErrorCode( + static const CompileTimeErrorCode instantiateEnum = CompileTimeErrorCode( 'INSTANTIATE_ENUM', "Enums can't be instantiated.", correctionMessage: "Try using one of the defined constants.", @@ -2742,19 +2732,19 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER = CompileTimeErrorCode( - 'INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', - "Type aliases that expand to a type parameter can't be instantiated.", - correctionMessage: "Try replacing it with a class.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode instantiateTypeAliasExpandsToTypeParameter = + CompileTimeErrorCode( + 'INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', + "Type aliases that expand to a type parameter can't be instantiated.", + correctionMessage: "Try replacing it with a class.", + hasPublishedDocs: true, + ); /// Parameters: /// String p0: the lexeme of the integer /// String p1: the closest valid double static const CompileTimeErrorCode - INTEGER_LITERAL_IMPRECISE_AS_DOUBLE = CompileTimeErrorCode( + integerLiteralImpreciseAsDouble = CompileTimeErrorCode( 'INTEGER_LITERAL_IMPRECISE_AS_DOUBLE', "The integer literal is being used as a double, but can't be represented " "as a 64-bit double without overflow or loss of precision: '{0}'.", @@ -2767,7 +2757,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the value of the literal static const CompileTimeErrorCode - INTEGER_LITERAL_OUT_OF_RANGE = CompileTimeErrorCode( + integerLiteralOutOfRange = CompileTimeErrorCode( 'INTEGER_LITERAL_OUT_OF_RANGE', "The integer literal {0} can't be represented in 64 bits.", correctionMessage: @@ -2779,7 +2769,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the interface class being extended. static const CompileTimeErrorCode - INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY = CompileTimeErrorCode( + interfaceClassExtendedOutsideOfLibrary = CompileTimeErrorCode( 'INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY', "The class '{0}' can't be extended outside of its library because it's an " "interface class.", @@ -2788,7 +2778,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INVALID_ANNOTATION = CompileTimeErrorCode( + static const CompileTimeErrorCode invalidAnnotation = CompileTimeErrorCode( 'INVALID_ANNOTATION', "Annotation must be either a const variable reference or const constructor " "invocation.", @@ -2797,18 +2787,17 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - INVALID_ANNOTATION_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY = - CompileTimeErrorCode( - 'INVALID_ANNOTATION_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY', - "Constant values from a deferred library can't be used in annotations.", - correctionMessage: - "Try moving the constant from the deferred library, or removing " - "'deferred' from the import.", - hasPublishedDocs: true, - ); + invalidAnnotationConstantValueFromDeferredLibrary = CompileTimeErrorCode( + 'INVALID_ANNOTATION_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY', + "Constant values from a deferred library can't be used in annotations.", + correctionMessage: + "Try moving the constant from the deferred library, or removing " + "'deferred' from the import.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = + static const CompileTimeErrorCode invalidAnnotationFromDeferredLibrary = CompileTimeErrorCode( 'INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as annotations.", @@ -2821,7 +2810,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the name of the right hand side type /// Type p1: the name of the left hand side type - static const CompileTimeErrorCode INVALID_ASSIGNMENT = CompileTimeErrorCode( + static const CompileTimeErrorCode invalidAssignment = CompileTimeErrorCode( 'INVALID_ASSIGNMENT', "A value of type '{0}' can't be assigned to a variable of type '{1}'.", correctionMessage: @@ -2836,8 +2825,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p0: the name of the function /// Object p1: the type of the function /// Object p2: the expected function type - static const CompileTimeErrorCode - INVALID_CAST_FUNCTION = CompileTimeErrorCode( + static const CompileTimeErrorCode invalidCastFunction = CompileTimeErrorCode( 'INVALID_CAST_FUNCTION', "The function '{0}' has type '{1}' that isn't of expected type '{2}'. This " "means its parameter or return type doesn't match what is expected.", @@ -2849,7 +2837,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p0: the type of the torn-off function expression /// Object p1: the expected function type static const CompileTimeErrorCode - INVALID_CAST_FUNCTION_EXPR = CompileTimeErrorCode( + invalidCastFunctionExpr = CompileTimeErrorCode( 'INVALID_CAST_FUNCTION_EXPR', "The function expression type '{0}' isn't of type '{1}'. This means its " "parameter or return type doesn't match what is expected. Consider " @@ -2862,7 +2850,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p0: the lexeme of the literal /// Object p1: the type of the literal /// Object p2: the expected type - static const CompileTimeErrorCode INVALID_CAST_LITERAL = CompileTimeErrorCode( + static const CompileTimeErrorCode invalidCastLiteral = CompileTimeErrorCode( 'INVALID_CAST_LITERAL', "The literal '{0}' with type '{1}' isn't of expected type '{2}'.", ); @@ -2873,7 +2861,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p0: the type of the list literal /// Object p1: the expected type static const CompileTimeErrorCode - INVALID_CAST_LITERAL_LIST = CompileTimeErrorCode( + invalidCastLiteralList = CompileTimeErrorCode( 'INVALID_CAST_LITERAL_LIST', "The list literal type '{0}' isn't of expected type '{1}'. The list's type " "can be changed with an explicit generic type argument or by changing " @@ -2886,7 +2874,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p0: the type of the map literal /// Object p1: the expected type static const CompileTimeErrorCode - INVALID_CAST_LITERAL_MAP = CompileTimeErrorCode( + invalidCastLiteralMap = CompileTimeErrorCode( 'INVALID_CAST_LITERAL_MAP', "The map literal type '{0}' isn't of expected type '{1}'. The map's type " "can be changed with an explicit generic type arguments or by changing " @@ -2899,7 +2887,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p0: the type of the set literal /// Object p1: the expected type static const CompileTimeErrorCode - INVALID_CAST_LITERAL_SET = CompileTimeErrorCode( + invalidCastLiteralSet = CompileTimeErrorCode( 'INVALID_CAST_LITERAL_SET', "The set literal type '{0}' isn't of expected type '{1}'. The set's type " "can be changed with an explicit generic type argument or by changing " @@ -2912,7 +2900,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p0: the name of the torn-off method /// Object p1: the type of the torn-off method /// Object p2: the expected function type - static const CompileTimeErrorCode INVALID_CAST_METHOD = CompileTimeErrorCode( + static const CompileTimeErrorCode invalidCastMethod = CompileTimeErrorCode( 'INVALID_CAST_METHOD', "The method tear-off '{0}' has type '{1}' that isn't of expected type " "'{2}'. This means its parameter or return type doesn't match what is " @@ -2924,11 +2912,10 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the type of the instantiated object /// Object p1: the expected type - static const CompileTimeErrorCode INVALID_CAST_NEW_EXPR = - CompileTimeErrorCode( - 'INVALID_CAST_NEW_EXPR', - "The constructor returns type '{0}' that isn't of expected type '{1}'.", - ); + static const CompileTimeErrorCode invalidCastNewExpr = CompileTimeErrorCode( + 'INVALID_CAST_NEW_EXPR', + "The constructor returns type '{0}' that isn't of expected type '{1}'.", + ); /// TODO(brianwilkerson): Remove this when we have decided on how to report /// errors in compile-time constants. Until then, this acts as a placeholder @@ -2937,14 +2924,14 @@ class CompileTimeErrorCode extends DiagnosticCode { /// See TODOs in ConstantVisitor /// /// No parameters. - static const CompileTimeErrorCode INVALID_CONSTANT = CompileTimeErrorCode( + static const CompileTimeErrorCode invalidConstant = CompileTimeErrorCode( 'INVALID_CONSTANT', "Invalid constant value.", ); /// No parameters. static const CompileTimeErrorCode - INVALID_EXTENSION_ARGUMENT_COUNT = CompileTimeErrorCode( + invalidExtensionArgumentCount = CompileTimeErrorCode( 'INVALID_EXTENSION_ARGUMENT_COUNT', "Extension overrides must have exactly one argument: the value of 'this' " "in the extension method.", @@ -2953,7 +2940,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = + static const CompileTimeErrorCode invalidFactoryNameNotAClass = CompileTimeErrorCode( 'INVALID_FACTORY_NAME_NOT_A_CLASS', "The name of a factory constructor must be the same as the name of the " @@ -2962,7 +2949,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INVALID_FIELD_NAME_FROM_OBJECT = + static const CompileTimeErrorCode invalidFieldNameFromObject = CompileTimeErrorCode( 'INVALID_FIELD_NAME', "Record field names can't be the same as a member from 'Object'.", @@ -2973,7 +2960,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - INVALID_FIELD_NAME_POSITIONAL = CompileTimeErrorCode( + invalidFieldNamePositional = CompileTimeErrorCode( 'INVALID_FIELD_NAME', "Record field names can't be a dollar sign followed by an integer when the " "integer is the index of a positional field.", @@ -2983,7 +2970,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INVALID_FIELD_NAME_PRIVATE = + static const CompileTimeErrorCode invalidFieldNamePrivate = CompileTimeErrorCode( 'INVALID_FIELD_NAME', "Record field names can't be private.", @@ -3001,7 +2988,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p2: the type of the declared member in the interface. /// Object p3: the name of the interface with the overridden member. /// Object p4: the type of the overridden member. - static const CompileTimeErrorCode INVALID_IMPLEMENTATION_OVERRIDE = + static const CompileTimeErrorCode invalidImplementationOverride = CompileTimeErrorCode( 'INVALID_IMPLEMENTATION_OVERRIDE', "'{1}.{0}' ('{2}') isn't a valid concrete implementation of '{3}.{0}' " @@ -3018,7 +3005,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p2: the type of the declared setter in the interface. /// Object p3: the name of the interface with the overridden setter. /// Object p4: the type of the overridden setter. - static const CompileTimeErrorCode INVALID_IMPLEMENTATION_OVERRIDE_SETTER = + static const CompileTimeErrorCode invalidImplementationOverrideSetter = CompileTimeErrorCode( 'INVALID_IMPLEMENTATION_OVERRIDE', "The setter '{1}.{0}' ('{2}') isn't a valid concrete implementation of " @@ -3029,7 +3016,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - INVALID_INLINE_FUNCTION_TYPE = CompileTimeErrorCode( + invalidInlineFunctionType = CompileTimeErrorCode( 'INVALID_INLINE_FUNCTION_TYPE', "Inline function types can't be used for parameters in a generic function " "type.", @@ -3041,7 +3028,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the invalid modifier - static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR = + static const CompileTimeErrorCode invalidModifierOnConstructor = CompileTimeErrorCode( 'INVALID_MODIFIER_ON_CONSTRUCTOR', "The modifier '{0}' can't be applied to the body of a constructor.", @@ -3050,7 +3037,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER = + static const CompileTimeErrorCode invalidModifierOnSetter = CompileTimeErrorCode( 'INVALID_MODIFIER_ON_SETTER', "Setters can't use 'async', 'async*', or 'sync*'.", @@ -3064,12 +3051,15 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p2: the type of the declared member in the interface. /// String p3: the name of the interface with the overridden member. /// Type p4: the type of the overridden member. - static const CompileTimeErrorCode INVALID_OVERRIDE = CompileTimeErrorCode( + static const CompileTimeErrorCode invalidOverride = CompileTimeErrorCode( 'INVALID_OVERRIDE', "'{1}.{0}' ('{2}') isn't a valid override of '{3}.{0}' ('{4}').", hasPublishedDocs: true, ); + @Deprecated("Please use invalidOverride") + static const CompileTimeErrorCode INVALID_OVERRIDE = invalidOverride; + /// Parameters: /// Object p0: the name of the declared setter that is not a valid override. /// Object p1: the name of the interface that declares the setter. @@ -3077,7 +3067,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p3: the name of the interface with the overridden setter. /// Object p4: the type of the overridden setter. static const CompileTimeErrorCode - INVALID_OVERRIDE_SETTER = CompileTimeErrorCode( + invalidOverrideSetter = CompileTimeErrorCode( 'INVALID_OVERRIDE', "The setter '{1}.{0}' ('{2}') isn't a valid override of '{3}.{0}' ('{4}').", hasPublishedDocs: true, @@ -3086,7 +3076,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR = CompileTimeErrorCode( + invalidReferenceToGenerativeEnumConstructor = CompileTimeErrorCode( 'INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR', "Generative enum constructors can only be used as targets of redirection.", correctionMessage: "Try using an enum value, or a factory constructor.", @@ -3094,7 +3084,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = + static const CompileTimeErrorCode invalidReferenceToThis = CompileTimeErrorCode( 'INVALID_REFERENCE_TO_THIS', "Invalid reference to 'this' expression.", @@ -3103,7 +3093,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - INVALID_SUPER_FORMAL_PARAMETER_LOCATION = CompileTimeErrorCode( + invalidSuperFormalParameterLocation = CompileTimeErrorCode( 'INVALID_SUPER_FORMAL_PARAMETER_LOCATION', "Super parameters can only be used in non-redirecting generative " "constructors.", @@ -3115,7 +3105,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the type parameter - static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = + static const CompileTimeErrorCode invalidTypeArgumentInConstList = CompileTimeErrorCode( 'INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL', "Constant list literals can't use a type parameter in a type argument, " @@ -3129,7 +3119,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the type parameter static const CompileTimeErrorCode - INVALID_TYPE_ARGUMENT_IN_CONST_MAP = CompileTimeErrorCode( + invalidTypeArgumentInConstMap = CompileTimeErrorCode( 'INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL', "Constant map literals can't use a type parameter in a type argument, such " "as '{0}'.", @@ -3142,7 +3132,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter static const CompileTimeErrorCode - INVALID_TYPE_ARGUMENT_IN_CONST_SET = CompileTimeErrorCode( + invalidTypeArgumentInConstSet = CompileTimeErrorCode( 'INVALID_TYPE_ARGUMENT_IN_CONST_LITERAL', "Constant set literals can't use a type parameter in a type argument, such " "as '{0}'.", @@ -3154,7 +3144,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the URI that is invalid - static const CompileTimeErrorCode INVALID_URI = CompileTimeErrorCode( + static const CompileTimeErrorCode invalidUri = CompileTimeErrorCode( 'INVALID_URI', "Invalid URI syntax: '{0}'.", hasPublishedDocs: true, @@ -3163,7 +3153,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// The 'covariant' keyword was found in an inappropriate location. /// /// No parameters. - static const CompileTimeErrorCode INVALID_USE_OF_COVARIANT = + static const CompileTimeErrorCode invalidUseOfCovariant = CompileTimeErrorCode( 'INVALID_USE_OF_COVARIANT', "The 'covariant' keyword can only be used for parameters in instance " @@ -3172,7 +3162,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode INVALID_USE_OF_NULL_VALUE = + static const CompileTimeErrorCode invalidUseOfNullValue = CompileTimeErrorCode( 'INVALID_USE_OF_NULL_VALUE', "An expression whose value is always 'null' can't be dereferenced.", @@ -3183,7 +3173,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the extension static const CompileTimeErrorCode - INVOCATION_OF_EXTENSION_WITHOUT_CALL = CompileTimeErrorCode( + invocationOfExtensionWithoutCall = CompileTimeErrorCode( 'INVOCATION_OF_EXTENSION_WITHOUT_CALL', "The extension '{0}' doesn't define a 'call' method so the override can't " "be used in an invocation.", @@ -3193,7 +3183,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the identifier that is not a function type static const CompileTimeErrorCode - INVOCATION_OF_NON_FUNCTION = CompileTimeErrorCode( + invocationOfNonFunction = CompileTimeErrorCode( 'INVOCATION_OF_NON_FUNCTION', "'{0}' isn't a function.", correctionMessage: @@ -3204,7 +3194,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - INVOCATION_OF_NON_FUNCTION_EXPRESSION = CompileTimeErrorCode( + invocationOfNonFunctionExpression = CompileTimeErrorCode( 'INVOCATION_OF_NON_FUNCTION_EXPRESSION', "The expression doesn't evaluate to a function, so it can't be invoked.", hasPublishedDocs: true, @@ -3212,7 +3202,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the unresolvable label - static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = CompileTimeErrorCode( + static const CompileTimeErrorCode labelInOuterScope = CompileTimeErrorCode( 'LABEL_IN_OUTER_SCOPE', "Can't reference label '{0}' declared in an outer method.", hasPublishedDocs: true, @@ -3220,7 +3210,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the unresolvable label - static const CompileTimeErrorCode LABEL_UNDEFINED = CompileTimeErrorCode( + static const CompileTimeErrorCode labelUndefined = CompileTimeErrorCode( 'LABEL_UNDEFINED', "Can't reference an undefined label '{0}'.", correctionMessage: @@ -3230,7 +3220,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode LATE_FINAL_FIELD_WITH_CONST_CONSTRUCTOR = + static const CompileTimeErrorCode lateFinalFieldWithConstConstructor = CompileTimeErrorCode( 'LATE_FINAL_FIELD_WITH_CONST_CONSTRUCTOR', "Can't have a late final field in a class with a generative const " @@ -3242,7 +3232,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode LATE_FINAL_LOCAL_ALREADY_ASSIGNED = + static const CompileTimeErrorCode lateFinalLocalAlreadyAssigned = CompileTimeErrorCode( 'LATE_FINAL_LOCAL_ALREADY_ASSIGNED', "The late final local variable is already assigned.", @@ -3254,7 +3244,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the actual type of the list element /// Type p1: the expected type of the list element - static const CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = + static const CompileTimeErrorCode listElementTypeNotAssignable = CompileTimeErrorCode( 'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', "The element type '{0}' can't be assigned to the list type '{1}'.", @@ -3264,17 +3254,17 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the actual type of the list element /// Type p1: the expected type of the list element - static const CompileTimeErrorCode - LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY = CompileTimeErrorCode( - 'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', - "The element type '{0}' can't be assigned to the list type '{1}'.", - hasPublishedDocs: true, - uniqueName: 'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY', - ); + static const CompileTimeErrorCode listElementTypeNotAssignableNullability = + CompileTimeErrorCode( + 'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', + "The element type '{0}' can't be assigned to the list type '{1}'.", + hasPublishedDocs: true, + uniqueName: 'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY', + ); /// No parameters. static const CompileTimeErrorCode - MAIN_FIRST_POSITIONAL_PARAMETER_TYPE = CompileTimeErrorCode( + mainFirstPositionalParameterType = CompileTimeErrorCode( 'MAIN_FIRST_POSITIONAL_PARAMETER_TYPE', "The type of the first positional parameter of the 'main' function must be " "a supertype of 'List'.", @@ -3283,7 +3273,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode MAIN_HAS_REQUIRED_NAMED_PARAMETERS = + static const CompileTimeErrorCode mainHasRequiredNamedParameters = CompileTimeErrorCode( 'MAIN_HAS_REQUIRED_NAMED_PARAMETERS', "The function 'main' can't have any required named parameters.", @@ -3294,19 +3284,19 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - MAIN_HAS_TOO_MANY_REQUIRED_POSITIONAL_PARAMETERS = CompileTimeErrorCode( - 'MAIN_HAS_TOO_MANY_REQUIRED_POSITIONAL_PARAMETERS', - "The function 'main' can't have more than two required positional " - "parameters.", - correctionMessage: - "Try using a different name for the function, or removing extra " - "parameters.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode mainHasTooManyRequiredPositionalParameters = + CompileTimeErrorCode( + 'MAIN_HAS_TOO_MANY_REQUIRED_POSITIONAL_PARAMETERS', + "The function 'main' can't have more than two required positional " + "parameters.", + correctionMessage: + "Try using a different name for the function, or removing extra " + "parameters.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode MAIN_IS_NOT_FUNCTION = CompileTimeErrorCode( + static const CompileTimeErrorCode mainIsNotFunction = CompileTimeErrorCode( 'MAIN_IS_NOT_FUNCTION', "The declaration named 'main' must be a function.", correctionMessage: "Try using a different name for this declaration.", @@ -3314,7 +3304,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode MAP_ENTRY_NOT_IN_MAP = CompileTimeErrorCode( + static const CompileTimeErrorCode mapEntryNotInMap = CompileTimeErrorCode( 'MAP_ENTRY_NOT_IN_MAP', "Map entries can only be used in a map literal.", correctionMessage: @@ -3325,7 +3315,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the type of the expression being used as a key /// Type p1: the type of keys declared for the map - static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = + static const CompileTimeErrorCode mapKeyTypeNotAssignable = CompileTimeErrorCode( 'MAP_KEY_TYPE_NOT_ASSIGNABLE', "The element type '{0}' can't be assigned to the map key type '{1}'.", @@ -3335,7 +3325,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the type of the expression being used as a key /// Type p1: the type of keys declared for the map - static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE_NULLABILITY = + static const CompileTimeErrorCode mapKeyTypeNotAssignableNullability = CompileTimeErrorCode( 'MAP_KEY_TYPE_NOT_ASSIGNABLE', "The element type '{0}' can't be assigned to the map key type '{1}'.", @@ -3346,7 +3336,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the type of the expression being used as a value /// Type p1: the type of values declared for the map - static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = + static const CompileTimeErrorCode mapValueTypeNotAssignable = CompileTimeErrorCode( 'MAP_VALUE_TYPE_NOT_ASSIGNABLE', "The element type '{0}' can't be assigned to the map value type '{1}'.", @@ -3356,7 +3346,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the type of the expression being used as a value /// Type p1: the type of values declared for the map - static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE_NULLABILITY = + static const CompileTimeErrorCode mapValueTypeNotAssignableNullability = CompileTimeErrorCode( 'MAP_VALUE_TYPE_NOT_ASSIGNABLE', "The element type '{0}' can't be assigned to the map value type '{1}'.", @@ -3370,7 +3360,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// to be documented. /// /// No parameters. - static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = + static const CompileTimeErrorCode missingConstInListLiteral = CompileTimeErrorCode( 'MISSING_CONST_IN_LIST_LITERAL', "Seeing this message constitutes a bug. Please report it.", @@ -3382,7 +3372,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// to be documented. /// /// No parameters. - static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = + static const CompileTimeErrorCode missingConstInMapLiteral = CompileTimeErrorCode( 'MISSING_CONST_IN_MAP_LITERAL', "Seeing this message constitutes a bug. Please report it.", @@ -3394,7 +3384,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// to be documented. /// /// No parameters. - static const CompileTimeErrorCode MISSING_CONST_IN_SET_LITERAL = + static const CompileTimeErrorCode missingConstInSetLiteral = CompileTimeErrorCode( 'MISSING_CONST_IN_SET_LITERAL', "Seeing this message constitutes a bug. Please report it.", @@ -3402,7 +3392,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the library - static const CompileTimeErrorCode MISSING_DART_LIBRARY = CompileTimeErrorCode( + static const CompileTimeErrorCode missingDartLibrary = CompileTimeErrorCode( 'MISSING_DART_LIBRARY', "Required library '{0}' is missing.", correctionMessage: "Re-install the Dart or Flutter SDK.", @@ -3412,7 +3402,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the parameter static const CompileTimeErrorCode - MISSING_DEFAULT_VALUE_FOR_PARAMETER = CompileTimeErrorCode( + missingDefaultValueForParameter = CompileTimeErrorCode( 'MISSING_DEFAULT_VALUE_FOR_PARAMETER', "The parameter '{0}' can't have a value of 'null' because of its type, but " "the implicit default value is 'null'.", @@ -3425,7 +3415,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the parameter static const CompileTimeErrorCode - MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL = CompileTimeErrorCode( + missingDefaultValueForParameterPositional = CompileTimeErrorCode( 'MISSING_DEFAULT_VALUE_FOR_PARAMETER', "The parameter '{0}' can't have a value of 'null' because of its type, but " "the implicit default value is 'null'.", @@ -3436,7 +3426,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - MISSING_DEFAULT_VALUE_FOR_PARAMETER_WITH_ANNOTATION = CompileTimeErrorCode( + missingDefaultValueForParameterWithAnnotation = CompileTimeErrorCode( 'MISSING_DEFAULT_VALUE_FOR_PARAMETER', "With null safety, use the 'required' keyword, not the '@required' " "annotation.", @@ -3446,7 +3436,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode MISSING_NAMED_PATTERN_FIELD_NAME = + static const CompileTimeErrorCode missingNamedPatternFieldName = CompileTimeErrorCode( 'MISSING_NAMED_PATTERN_FIELD_NAME', "The getter name is not specified explicitly, and the pattern is not a " @@ -3459,7 +3449,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the parameter - static const CompileTimeErrorCode MISSING_REQUIRED_ARGUMENT = + static const CompileTimeErrorCode missingRequiredArgument = CompileTimeErrorCode( 'MISSING_REQUIRED_ARGUMENT', "The named parameter '{0}' is required, but there's no corresponding " @@ -3470,7 +3460,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the variable pattern - static const CompileTimeErrorCode MISSING_VARIABLE_PATTERN = + static const CompileTimeErrorCode missingVariablePattern = CompileTimeErrorCode( 'MISSING_VARIABLE_PATTERN', "Variable pattern '{0}' is missing in this branch of the logical-or " @@ -3482,7 +3472,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Element p0: the name of the class that appears in both "extends" and /// "with" clauses - static const CompileTimeErrorCode MIXINS_SUPER_CLASS = CompileTimeErrorCode( + static const CompileTimeErrorCode mixinsSuperClass = CompileTimeErrorCode( 'IMPLEMENTS_SUPER_CLASS', "'{0}' can't be used in both the 'extends' and 'with' clauses.", correctionMessage: "Try removing one of the occurrences.", @@ -3496,7 +3486,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// mixin /// Type p2: the display name of the type of the concrete member in the class static const CompileTimeErrorCode - MIXIN_APPLICATION_CONCRETE_SUPER_INVOKED_MEMBER_TYPE = CompileTimeErrorCode( + mixinApplicationConcreteSuperInvokedMemberType = CompileTimeErrorCode( 'MIXIN_APPLICATION_CONCRETE_SUPER_INVOKED_MEMBER_TYPE', "The super-invoked member '{0}' has the type '{1}', and the concrete " "member in the class has the type '{2}'.", @@ -3508,7 +3498,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p1: the display name of the superclass /// Type p2: the display name of the type that is not implemented static const CompileTimeErrorCode - MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE = CompileTimeErrorCode( + mixinApplicationNotImplementedInterface = CompileTimeErrorCode( 'MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE', "'{0}' can't be mixed onto '{1}' because '{1}' doesn't implement '{2}'.", correctionMessage: "Try extending the class '{0}'.", @@ -3519,7 +3509,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the display name of the member without a concrete /// implementation static const CompileTimeErrorCode - MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER = CompileTimeErrorCode( + mixinApplicationNoConcreteSuperInvokedMember = CompileTimeErrorCode( 'MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER', "The class doesn't have a concrete implementation of the super-invoked " "member '{0}'.", @@ -3530,7 +3520,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the display name of the setter without a concrete /// implementation static const CompileTimeErrorCode - MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_SETTER = CompileTimeErrorCode( + mixinApplicationNoConcreteSuperInvokedSetter = CompileTimeErrorCode( 'MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER', "The class doesn't have a concrete implementation of the super-invoked " "setter '{0}'.", @@ -3540,7 +3530,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the mixin class that is invalid - static const CompileTimeErrorCode MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT = + static const CompileTimeErrorCode mixinClassDeclarationExtendsNotObject = CompileTimeErrorCode( 'MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT', "The class '{0}' can't be declared a mixin because it extends a class " @@ -3553,7 +3543,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the mixin that is invalid - static const CompileTimeErrorCode MIXIN_CLASS_DECLARES_CONSTRUCTOR = + static const CompileTimeErrorCode mixinClassDeclaresConstructor = CompileTimeErrorCode( 'MIXIN_CLASS_DECLARES_CONSTRUCTOR', "The class '{0}' can't be used as a mixin because it declares a " @@ -3562,7 +3552,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = CompileTimeErrorCode( + static const CompileTimeErrorCode mixinDeferredClass = CompileTimeErrorCode( 'SUBTYPE_OF_DEFERRED_CLASS', "Classes can't mixin deferred classes.", correctionMessage: "Try changing the import to not be deferred.", @@ -3573,7 +3563,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the mixin that is invalid static const CompileTimeErrorCode - MIXIN_INHERITS_FROM_NOT_OBJECT = CompileTimeErrorCode( + mixinInheritsFromNotObject = CompileTimeErrorCode( 'MIXIN_INHERITS_FROM_NOT_OBJECT', "The class '{0}' can't be used as a mixin because it extends a class other " "than 'Object'.", @@ -3581,7 +3571,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode MIXIN_INSTANTIATE = CompileTimeErrorCode( + static const CompileTimeErrorCode mixinInstantiate = CompileTimeErrorCode( 'MIXIN_INSTANTIATE', "Mixins can't be instantiated.", hasPublishedDocs: true, @@ -3589,7 +3579,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the name of the disallowed type - static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = + static const CompileTimeErrorCode mixinOfDisallowedClass = CompileTimeErrorCode( 'SUBTYPE_OF_DISALLOWED_TYPE', "Classes can't mixin '{0}'.", @@ -3601,35 +3591,35 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = CompileTimeErrorCode( + static const CompileTimeErrorCode mixinOfNonClass = CompileTimeErrorCode( 'MIXIN_OF_NON_CLASS', "Classes can only mix in mixins and classes.", hasPublishedDocs: true, ); /// No parameters. - static const CompileTimeErrorCode - MIXIN_OF_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER = CompileTimeErrorCode( - 'SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER', - "A type alias that expands to a type parameter can't be mixed in.", - hasPublishedDocs: true, - uniqueName: 'MIXIN_OF_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', - ); + static const CompileTimeErrorCode mixinOfTypeAliasExpandsToTypeParameter = + CompileTimeErrorCode( + 'SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER', + "A type alias that expands to a type parameter can't be mixed in.", + hasPublishedDocs: true, + uniqueName: 'MIXIN_OF_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', + ); /// No parameters. - static const CompileTimeErrorCode - MIXIN_ON_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER = CompileTimeErrorCode( - 'SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER', - "A type alias that expands to a type parameter can't be used as a " - "superclass constraint.", - hasPublishedDocs: true, - uniqueName: 'MIXIN_ON_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', - ); + static const CompileTimeErrorCode mixinOnTypeAliasExpandsToTypeParameter = + CompileTimeErrorCode( + 'SUPERTYPE_EXPANDS_TO_TYPE_PARAMETER', + "A type alias that expands to a type parameter can't be used as a " + "superclass constraint.", + hasPublishedDocs: true, + uniqueName: 'MIXIN_ON_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', + ); /// Parameters: /// String p0: the name of the mixin that is not 'base' /// String p1: the name of the 'base' supertype - static const CompileTimeErrorCode MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE = + static const CompileTimeErrorCode mixinSubtypeOfBaseIsNotBase = CompileTimeErrorCode( 'SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED', "The mixin '{0}' must be 'base' because the supertype '{1}' is 'base'.", @@ -3641,7 +3631,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the mixin that is not 'final' /// String p1: the name of the 'final' supertype static const CompileTimeErrorCode - MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE = CompileTimeErrorCode( + mixinSubtypeOfFinalIsNotBase = CompileTimeErrorCode( 'SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED', "The mixin '{0}' must be 'base' because the supertype '{1}' is 'final'.", hasPublishedDocs: true, @@ -3649,18 +3639,18 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - MIXIN_SUPER_CLASS_CONSTRAINT_DEFERRED_CLASS = CompileTimeErrorCode( - 'MIXIN_SUPER_CLASS_CONSTRAINT_DEFERRED_CLASS', - "Deferred classes can't be used as superclass constraints.", - correctionMessage: "Try changing the import to not be deferred.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode mixinSuperClassConstraintDeferredClass = + CompileTimeErrorCode( + 'MIXIN_SUPER_CLASS_CONSTRAINT_DEFERRED_CLASS', + "Deferred classes can't be used as superclass constraints.", + correctionMessage: "Try changing the import to not be deferred.", + hasPublishedDocs: true, + ); /// Parameters: /// Type p0: the name of the disallowed type static const CompileTimeErrorCode - MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS = CompileTimeErrorCode( + mixinSuperClassConstraintDisallowedClass = CompileTimeErrorCode( 'SUBTYPE_OF_DISALLOWED_TYPE', "'{0}' can't be used as a superclass constraint.", correctionMessage: @@ -3671,7 +3661,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE = + static const CompileTimeErrorCode mixinSuperClassConstraintNonInterface = CompileTimeErrorCode( 'MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE', "Only classes and mixins can be used as superclass constraints.", @@ -3682,23 +3672,23 @@ class CompileTimeErrorCode extends DiagnosticCode { /// denote a class available in the immediately enclosing scope. /// /// No parameters. - static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = + static const CompileTimeErrorCode mixinWithNonClassSuperclass = CompileTimeErrorCode( 'MIXIN_WITH_NON_CLASS_SUPERCLASS', "Mixin can only be applied to class.", ); /// No parameters. - static const CompileTimeErrorCode - MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = CompileTimeErrorCode( - 'MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', - "Constructors can have only one 'this' redirection, at most.", - correctionMessage: "Try removing all but one of the redirections.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode multipleRedirectingConstructorInvocations = + CompileTimeErrorCode( + 'MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', + "Constructors can have only one 'this' redirection, at most.", + correctionMessage: "Try removing all but one of the redirections.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = + static const CompileTimeErrorCode multipleSuperInitializers = CompileTimeErrorCode( 'MULTIPLE_SUPER_INITIALIZERS', "A constructor can have at most one 'super' initializer.", @@ -3709,7 +3699,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the non-type element - static const CompileTimeErrorCode NEW_WITH_NON_TYPE = CompileTimeErrorCode( + static const CompileTimeErrorCode newWithNonType = CompileTimeErrorCode( 'CREATION_WITH_NON_TYPE', "The name '{0}' isn't a class.", correctionMessage: "Try correcting the name to match an existing class.", @@ -3734,7 +3724,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the class being instantiated /// String p1: the name of the constructor static const CompileTimeErrorCode - NEW_WITH_UNDEFINED_CONSTRUCTOR = CompileTimeErrorCode( + newWithUndefinedConstructor = CompileTimeErrorCode( 'NEW_WITH_UNDEFINED_CONSTRUCTOR', "The class '{0}' doesn't have a constructor named '{1}'.", correctionMessage: @@ -3744,7 +3734,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the class being instantiated - static const CompileTimeErrorCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = + static const CompileTimeErrorCode newWithUndefinedConstructorDefault = CompileTimeErrorCode( 'NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', "The class '{0}' doesn't have an unnamed constructor.", @@ -3760,7 +3750,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p3: the name of the fourth member /// int p4: the number of additional missing members that aren't listed static const CompileTimeErrorCode - NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS = CompileTimeErrorCode( + nonAbstractClassInheritsAbstractMemberFivePlus = CompileTimeErrorCode( 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', "Missing concrete implementations of '{0}', '{1}', '{2}', '{3}', and {4} " "more.", @@ -3775,34 +3765,34 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the second member /// String p2: the name of the third member /// String p3: the name of the fourth member - static const CompileTimeErrorCode - NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR = CompileTimeErrorCode( - 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', - "Missing concrete implementations of '{0}', '{1}', '{2}', and '{3}'.", - correctionMessage: - "Try implementing the missing methods, or make the class abstract.", - hasPublishedDocs: true, - uniqueName: 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', - ); + static const CompileTimeErrorCode nonAbstractClassInheritsAbstractMemberFour = + CompileTimeErrorCode( + 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', + "Missing concrete implementations of '{0}', '{1}', '{2}', and '{3}'.", + correctionMessage: + "Try implementing the missing methods, or make the class abstract.", + hasPublishedDocs: true, + uniqueName: 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', + ); /// Parameters: /// String p0: the name of the member - static const CompileTimeErrorCode - NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = CompileTimeErrorCode( - 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', - "Missing concrete implementation of '{0}'.", - correctionMessage: - "Try implementing the missing method, or make the class abstract.", - hasPublishedDocs: true, - uniqueName: 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', - ); + static const CompileTimeErrorCode nonAbstractClassInheritsAbstractMemberOne = + CompileTimeErrorCode( + 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', + "Missing concrete implementation of '{0}'.", + correctionMessage: + "Try implementing the missing method, or make the class abstract.", + hasPublishedDocs: true, + uniqueName: 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', + ); /// Parameters: /// String p0: the name of the first member /// String p1: the name of the second member /// String p2: the name of the third member static const CompileTimeErrorCode - NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE = CompileTimeErrorCode( + nonAbstractClassInheritsAbstractMemberThree = CompileTimeErrorCode( 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', "Missing concrete implementations of '{0}', '{1}', and '{2}'.", correctionMessage: @@ -3814,18 +3804,18 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the first member /// String p1: the name of the second member - static const CompileTimeErrorCode - NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = CompileTimeErrorCode( - 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', - "Missing concrete implementations of '{0}' and '{1}'.", - correctionMessage: - "Try implementing the missing methods, or make the class abstract.", - hasPublishedDocs: true, - uniqueName: 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', - ); + static const CompileTimeErrorCode nonAbstractClassInheritsAbstractMemberTwo = + CompileTimeErrorCode( + 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER', + "Missing concrete implementations of '{0}' and '{1}'.", + correctionMessage: + "Try implementing the missing methods, or make the class abstract.", + hasPublishedDocs: true, + uniqueName: 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', + ); /// No parameters. - static const CompileTimeErrorCode NON_BOOL_CONDITION = CompileTimeErrorCode( + static const CompileTimeErrorCode nonBoolCondition = CompileTimeErrorCode( 'NON_BOOL_CONDITION', "Conditions must have a static type of 'bool'.", correctionMessage: "Try changing the condition.", @@ -3833,7 +3823,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_BOOL_EXPRESSION = CompileTimeErrorCode( + static const CompileTimeErrorCode nonBoolExpression = CompileTimeErrorCode( 'NON_BOOL_EXPRESSION', "The expression in an assert must be of type 'bool'.", correctionMessage: "Try changing the expression.", @@ -3841,7 +3831,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_BOOL_NEGATION_EXPRESSION = + static const CompileTimeErrorCode nonBoolNegationExpression = CompileTimeErrorCode( 'NON_BOOL_NEGATION_EXPRESSION', "A negation operand must have a static type of 'bool'.", @@ -3851,14 +3841,14 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the lexeme of the logical operator - static const CompileTimeErrorCode NON_BOOL_OPERAND = CompileTimeErrorCode( + static const CompileTimeErrorCode nonBoolOperand = CompileTimeErrorCode( 'NON_BOOL_OPERAND', "The operands of the operator '{0}' must be assignable to 'bool'.", hasPublishedDocs: true, ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = + static const CompileTimeErrorCode nonConstantAnnotationConstructor = CompileTimeErrorCode( 'NON_CONSTANT_ANNOTATION_CONSTRUCTOR', "Annotation creation can only call a const constructor.", @@ -3866,7 +3856,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = + static const CompileTimeErrorCode nonConstantCaseExpression = CompileTimeErrorCode( 'NON_CONSTANT_CASE_EXPRESSION', "Case expressions must be constant.", @@ -3875,7 +3865,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( + nonConstantCaseExpressionFromDeferredLibrary = CompileTimeErrorCode( 'NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as a case " "expression.", @@ -3886,7 +3876,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = + static const CompileTimeErrorCode nonConstantDefaultValue = CompileTimeErrorCode( 'NON_CONSTANT_DEFAULT_VALUE', "The default value of an optional parameter must be constant.", @@ -3894,19 +3884,19 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( - 'NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY', - "Constant values from a deferred library can't be used as a default " - "parameter value.", - correctionMessage: - "Try leaving the default as 'null' and initializing the parameter " - "inside the function body.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode nonConstantDefaultValueFromDeferredLibrary = + CompileTimeErrorCode( + 'NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY', + "Constant values from a deferred library can't be used as a default " + "parameter value.", + correctionMessage: + "Try leaving the default as 'null' and initializing the parameter " + "inside the function body.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = + static const CompileTimeErrorCode nonConstantListElement = CompileTimeErrorCode( 'NON_CONSTANT_LIST_ELEMENT', "The values in a const list literal must be constants.", @@ -3917,7 +3907,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( + nonConstantListElementFromDeferredLibrary = CompileTimeErrorCode( 'COLLECTION_ELEMENT_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as values in a " "'const' list literal.", @@ -3929,7 +3919,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_MAP_ELEMENT = + static const CompileTimeErrorCode nonConstantMapElement = CompileTimeErrorCode( 'NON_CONSTANT_MAP_ELEMENT', "The elements in a const map literal must be constant.", @@ -3939,7 +3929,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = CompileTimeErrorCode( + static const CompileTimeErrorCode nonConstantMapKey = CompileTimeErrorCode( 'NON_CONSTANT_MAP_KEY', "The keys in a const map literal must be constant.", correctionMessage: "Try removing the keyword 'const' from the map literal.", @@ -3948,7 +3938,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( + nonConstantMapKeyFromDeferredLibrary = CompileTimeErrorCode( 'COLLECTION_ELEMENT_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as keys in a " "'const' map literal.", @@ -3960,7 +3950,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_MAP_PATTERN_KEY = + static const CompileTimeErrorCode nonConstantMapPatternKey = CompileTimeErrorCode( 'NON_CONSTANT_MAP_PATTERN_KEY', "Key expressions in map patterns must be constants.", @@ -3969,18 +3959,16 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = - CompileTimeErrorCode( - 'NON_CONSTANT_MAP_VALUE', - "The values in a const map literal must be constant.", - correctionMessage: - "Try removing the keyword 'const' from the map literal.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode nonConstantMapValue = CompileTimeErrorCode( + 'NON_CONSTANT_MAP_VALUE', + "The values in a const map literal must be constant.", + correctionMessage: "Try removing the keyword 'const' from the map literal.", + hasPublishedDocs: true, + ); /// No parameters. static const CompileTimeErrorCode - NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( + nonConstantMapValueFromDeferredLibrary = CompileTimeErrorCode( 'COLLECTION_ELEMENT_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as values in a " "'const' map literal.", @@ -3992,7 +3980,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_RECORD_FIELD = + static const CompileTimeErrorCode nonConstantRecordField = CompileTimeErrorCode( 'NON_CONSTANT_RECORD_FIELD', "The fields in a const record literal must be constants.", @@ -4002,7 +3990,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - NON_CONSTANT_RECORD_FIELD_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( + nonConstantRecordFieldFromDeferredLibrary = CompileTimeErrorCode( 'NON_CONSTANT_RECORD_FIELD_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as fields in a " "'const' record literal.", @@ -4012,7 +4000,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION = + static const CompileTimeErrorCode nonConstantRelationalPatternExpression = CompileTimeErrorCode( 'NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION', "The relational pattern expression must be a constant.", @@ -4021,7 +4009,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONSTANT_SET_ELEMENT = + static const CompileTimeErrorCode nonConstantSetElement = CompileTimeErrorCode( 'NON_CONSTANT_SET_ELEMENT', "The values in a const set literal must be constants.", @@ -4031,7 +4019,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR = + static const CompileTimeErrorCode nonConstGenerativeEnumConstructor = CompileTimeErrorCode( 'NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR', "Generative enum constructors must be 'const'.", @@ -4045,7 +4033,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// No parameters. static const CompileTimeErrorCode - NON_CONST_MAP_AS_EXPRESSION_STATEMENT = CompileTimeErrorCode( + nonConstMapAsExpressionStatement = CompileTimeErrorCode( 'NON_CONST_MAP_AS_EXPRESSION_STATEMENT', "A non-constant map or set literal without type arguments can't be used as " "an expression statement.", @@ -4053,23 +4041,22 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - NON_COVARIANT_TYPE_PARAMETER_POSITION_IN_REPRESENTATION_TYPE = - CompileTimeErrorCode( - 'NON_COVARIANT_TYPE_PARAMETER_POSITION_IN_REPRESENTATION_TYPE', - "An extension type parameter can't be used in a non-covariant position of " - "its representation type.", - correctionMessage: - "Try removing the type parameters from function parameter types and " - "type parameter bounds.", - hasPublishedDocs: true, - ); + nonCovariantTypeParameterPositionInRepresentationType = CompileTimeErrorCode( + 'NON_COVARIANT_TYPE_PARAMETER_POSITION_IN_REPRESENTATION_TYPE', + "An extension type parameter can't be used in a non-covariant position of " + "its representation type.", + correctionMessage: + "Try removing the type parameters from function parameter types and " + "type parameter bounds.", + hasPublishedDocs: true, + ); /// Parameters: /// Type p0: the type of the switch scrutinee /// String p1: the witness pattern for the unmatched value /// String p2: the suggested pattern for the unmatched value static const CompileTimeErrorCode - NON_EXHAUSTIVE_SWITCH_EXPRESSION = CompileTimeErrorCode( + nonExhaustiveSwitchExpression = CompileTimeErrorCode( 'NON_EXHAUSTIVE_SWITCH_EXPRESSION', "The type '{0}' isn't exhaustively matched by the switch cases since it " "doesn't match the pattern '{1}'.", @@ -4083,7 +4070,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the witness pattern for the unmatched value /// String p2: the suggested pattern for the unmatched value static const CompileTimeErrorCode - NON_EXHAUSTIVE_SWITCH_STATEMENT = CompileTimeErrorCode( + nonExhaustiveSwitchStatement = CompileTimeErrorCode( 'NON_EXHAUSTIVE_SWITCH_STATEMENT', "The type '{0}' isn't exhaustively matched by the switch cases since it " "doesn't match the pattern '{1}'.", @@ -4092,18 +4079,17 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_FINAL_FIELD_IN_ENUM = - CompileTimeErrorCode( - 'NON_FINAL_FIELD_IN_ENUM', - "Enums can only declare final fields.", - correctionMessage: "Try making the field final.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode nonFinalFieldInEnum = CompileTimeErrorCode( + 'NON_FINAL_FIELD_IN_ENUM', + "Enums can only declare final fields.", + correctionMessage: "Try making the field final.", + hasPublishedDocs: true, + ); /// Parameters: /// Element p0: the non-generative constructor static const CompileTimeErrorCode - NON_GENERATIVE_CONSTRUCTOR = CompileTimeErrorCode( + nonGenerativeConstructor = CompileTimeErrorCode( 'NON_GENERATIVE_CONSTRUCTOR', "The generative constructor '{0}' is expected, but a factory was found.", correctionMessage: @@ -4117,7 +4103,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the current class /// Element p2: the implicitly called factory constructor of the superclass static const CompileTimeErrorCode - NON_GENERATIVE_IMPLICIT_CONSTRUCTOR = CompileTimeErrorCode( + nonGenerativeImplicitConstructor = CompileTimeErrorCode( 'NON_GENERATIVE_IMPLICIT_CONSTRUCTOR', "The unnamed constructor of superclass '{0}' (called by the default " "constructor of '{1}') must be a generative constructor, but factory " @@ -4130,7 +4116,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_SYNC_FACTORY = CompileTimeErrorCode( + static const CompileTimeErrorCode nonSyncFactory = CompileTimeErrorCode( 'NON_SYNC_FACTORY', "Factory bodies can't use 'async', 'async*', or 'sync*'.", hasPublishedDocs: true, @@ -4139,7 +4125,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name appearing where a type is expected static const CompileTimeErrorCode - NON_TYPE_AS_TYPE_ARGUMENT = CompileTimeErrorCode( + nonTypeAsTypeArgument = CompileTimeErrorCode( 'NON_TYPE_AS_TYPE_ARGUMENT', "The name '{0}' isn't a type, so it can't be used as a type argument.", correctionMessage: @@ -4151,17 +4137,15 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the non-type element - static const CompileTimeErrorCode NON_TYPE_IN_CATCH_CLAUSE = - CompileTimeErrorCode( - 'NON_TYPE_IN_CATCH_CLAUSE', - "The name '{0}' isn't a type and can't be used in an on-catch clause.", - correctionMessage: - "Try correcting the name to match an existing class.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode nonTypeInCatchClause = CompileTimeErrorCode( + 'NON_TYPE_IN_CATCH_CLAUSE', + "The name '{0}' isn't a type and can't be used in an on-catch clause.", + correctionMessage: "Try correcting the name to match an existing class.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode NON_VOID_RETURN_FOR_OPERATOR = + static const CompileTimeErrorCode nonVoidReturnForOperator = CompileTimeErrorCode( 'NON_VOID_RETURN_FOR_OPERATOR', "The return type of the operator []= must be 'void'.", @@ -4170,7 +4154,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NON_VOID_RETURN_FOR_SETTER = + static const CompileTimeErrorCode nonVoidReturnForSetter = CompileTimeErrorCode( 'NON_VOID_RETURN_FOR_SETTER', "The return type of the setter must be 'void' or absent.", @@ -4183,7 +4167,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the variable that is invalid static const CompileTimeErrorCode - NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE = CompileTimeErrorCode( + notAssignedPotentiallyNonNullableLocalVariable = CompileTimeErrorCode( 'NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE', "The non-nullable local variable '{0}' must be assigned before it can be " "used.", @@ -4195,7 +4179,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name that is not a type - static const CompileTimeErrorCode NOT_A_TYPE = CompileTimeErrorCode( + static const CompileTimeErrorCode notAType = CompileTimeErrorCode( 'NOT_A_TYPE', "{0} isn't a type.", correctionMessage: "Try correcting the name to match an existing type.", @@ -4204,7 +4188,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the operator that is not a binary operator. - static const CompileTimeErrorCode NOT_BINARY_OPERATOR = CompileTimeErrorCode( + static const CompileTimeErrorCode notBinaryOperator = CompileTimeErrorCode( 'NOT_BINARY_OPERATOR', "'{0}' isn't a binary operator.", hasPublishedDocs: true, @@ -4214,30 +4198,30 @@ class CompileTimeErrorCode extends DiagnosticCode { /// int p0: the expected number of required arguments /// int p1: the actual number of positional arguments given /// String p2: name of the function or method - static const CompileTimeErrorCode - NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL = CompileTimeErrorCode( - 'NOT_ENOUGH_POSITIONAL_ARGUMENTS', - "{0} positional arguments expected by '{2}', but {1} found.", - correctionMessage: "Try adding the missing arguments.", - hasPublishedDocs: true, - uniqueName: 'NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL', - ); + static const CompileTimeErrorCode notEnoughPositionalArgumentsNamePlural = + CompileTimeErrorCode( + 'NOT_ENOUGH_POSITIONAL_ARGUMENTS', + "{0} positional arguments expected by '{2}', but {1} found.", + correctionMessage: "Try adding the missing arguments.", + hasPublishedDocs: true, + uniqueName: 'NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL', + ); /// Parameters: /// String p0: name of the function or method - static const CompileTimeErrorCode - NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR = CompileTimeErrorCode( - 'NOT_ENOUGH_POSITIONAL_ARGUMENTS', - "1 positional argument expected by '{0}', but 0 found.", - correctionMessage: "Try adding the missing argument.", - hasPublishedDocs: true, - uniqueName: 'NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR', - ); + static const CompileTimeErrorCode notEnoughPositionalArgumentsNameSingular = + CompileTimeErrorCode( + 'NOT_ENOUGH_POSITIONAL_ARGUMENTS', + "1 positional argument expected by '{0}', but 0 found.", + correctionMessage: "Try adding the missing argument.", + hasPublishedDocs: true, + uniqueName: 'NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR', + ); /// Parameters: /// int p0: the expected number of required arguments /// int p1: the actual number of positional arguments given - static const CompileTimeErrorCode NOT_ENOUGH_POSITIONAL_ARGUMENTS_PLURAL = + static const CompileTimeErrorCode notEnoughPositionalArgumentsPlural = CompileTimeErrorCode( 'NOT_ENOUGH_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, but {1} found.", @@ -4247,7 +4231,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NOT_ENOUGH_POSITIONAL_ARGUMENTS_SINGULAR = + static const CompileTimeErrorCode notEnoughPositionalArgumentsSingular = CompileTimeErrorCode( 'NOT_ENOUGH_POSITIONAL_ARGUMENTS', "1 positional argument expected, but 0 found.", @@ -4258,20 +4242,20 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the field that is not initialized - static const CompileTimeErrorCode - NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD = CompileTimeErrorCode( - 'NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD', - "Non-nullable instance field '{0}' must be initialized.", - correctionMessage: - "Try adding an initializer expression, or a generative constructor " - "that initializes it, or mark it 'late'.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode notInitializedNonNullableInstanceField = + CompileTimeErrorCode( + 'NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD', + "Non-nullable instance field '{0}' must be initialized.", + correctionMessage: + "Try adding an initializer expression, or a generative constructor " + "that initializes it, or mark it 'late'.", + hasPublishedDocs: true, + ); /// Parameters: /// String p0: the name of the field that is not initialized static const CompileTimeErrorCode - NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR = CompileTimeErrorCode( + notInitializedNonNullableInstanceFieldConstructor = CompileTimeErrorCode( 'NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD', "Non-nullable instance field '{0}' must be initialized.", correctionMessage: @@ -4283,7 +4267,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the variable that is invalid - static const CompileTimeErrorCode NOT_INITIALIZED_NON_NULLABLE_VARIABLE = + static const CompileTimeErrorCode notInitializedNonNullableVariable = CompileTimeErrorCode( 'NOT_INITIALIZED_NON_NULLABLE_VARIABLE', "The non-nullable variable '{0}' must be initialized.", @@ -4292,37 +4276,35 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NOT_INSTANTIATED_BOUND = - CompileTimeErrorCode( - 'NOT_INSTANTIATED_BOUND', - "Type parameter bound types must be instantiated.", - correctionMessage: - "Try adding type arguments to the type parameter bound.", - ); + static const CompileTimeErrorCode notInstantiatedBound = CompileTimeErrorCode( + 'NOT_INSTANTIATED_BOUND', + "Type parameter bound types must be instantiated.", + correctionMessage: "Try adding type arguments to the type parameter bound.", + ); /// No parameters. - static const CompileTimeErrorCode NOT_ITERABLE_SPREAD = CompileTimeErrorCode( + static const CompileTimeErrorCode notIterableSpread = CompileTimeErrorCode( 'NOT_ITERABLE_SPREAD', "Spread elements in list or set literals must implement 'Iterable'.", hasPublishedDocs: true, ); /// No parameters. - static const CompileTimeErrorCode NOT_MAP_SPREAD = CompileTimeErrorCode( + static const CompileTimeErrorCode notMapSpread = CompileTimeErrorCode( 'NOT_MAP_SPREAD', "Spread elements in map literals must implement 'Map'.", hasPublishedDocs: true, ); /// No parameters. - static const CompileTimeErrorCode NOT_NULL_AWARE_NULL_SPREAD = + static const CompileTimeErrorCode notNullAwareNullSpread = CompileTimeErrorCode( 'NOT_NULL_AWARE_NULL_SPREAD', "The Null-typed expression can't be used with a non-null-aware spread.", ); /// No parameters. - static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = + static const CompileTimeErrorCode noAnnotationConstructorArguments = CompileTimeErrorCode( 'NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', "Annotation creation must have arguments.", @@ -4334,7 +4316,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the class where override error was detected /// String p1: the list of candidate signatures which cannot be combined static const CompileTimeErrorCode - NO_COMBINED_SUPER_SIGNATURE = CompileTimeErrorCode( + noCombinedSuperSignature = CompileTimeErrorCode( 'NO_COMBINED_SUPER_SIGNATURE', "Can't infer missing types in '{0}' from overridden methods: {1}.", correctionMessage: @@ -4346,7 +4328,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the superclass that does not define an implicitly /// invoked constructor - static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = + static const CompileTimeErrorCode noDefaultSuperConstructorExplicit = CompileTimeErrorCode( 'NO_DEFAULT_SUPER_CONSTRUCTOR', "The superclass '{0}' doesn't have a zero argument constructor.", @@ -4362,7 +4344,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the subclass that does not contain any explicit /// constructors static const CompileTimeErrorCode - NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = CompileTimeErrorCode( + noDefaultSuperConstructorImplicit = CompileTimeErrorCode( 'NO_DEFAULT_SUPER_CONSTRUCTOR', "The superclass '{0}' doesn't have a zero argument constructor.", correctionMessage: @@ -4375,7 +4357,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the subclass /// String p1: the name of the superclass static const CompileTimeErrorCode - NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS = CompileTimeErrorCode( + noGenerativeConstructorsInSuperclass = CompileTimeErrorCode( 'NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS', "The class '{0}' can't extend '{1}' because '{1}' only has factory " "constructors (no generative constructors), and '{0}' has at least one " @@ -4388,7 +4370,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NULLABLE_TYPE_IN_EXTENDS_CLAUSE = + static const CompileTimeErrorCode nullableTypeInExtendsClause = CompileTimeErrorCode( 'NULLABLE_TYPE_IN_EXTENDS_CLAUSE', "A class can't extend a nullable type.", @@ -4397,7 +4379,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE = + static const CompileTimeErrorCode nullableTypeInImplementsClause = CompileTimeErrorCode( 'NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE', "A class, mixin, or extension type can't implement a nullable type.", @@ -4406,7 +4388,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NULLABLE_TYPE_IN_ON_CLAUSE = + static const CompileTimeErrorCode nullableTypeInOnClause = CompileTimeErrorCode( 'NULLABLE_TYPE_IN_ON_CLAUSE', "A mixin can't have a nullable type as a superclass constraint.", @@ -4415,7 +4397,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode NULLABLE_TYPE_IN_WITH_CLAUSE = + static const CompileTimeErrorCode nullableTypeInWithClause = CompileTimeErrorCode( 'NULLABLE_TYPE_IN_WITH_CLAUSE', "A class or mixin can't mix in a nullable type.", @@ -4427,14 +4409,14 @@ class CompileTimeErrorCode extends DiagnosticCode { /// for class Object. /// /// No parameters. - static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = + static const CompileTimeErrorCode objectCannotExtendAnotherClass = CompileTimeErrorCode( 'OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', "The class 'Object' can't extend any other class.", ); /// No parameters. - static const CompileTimeErrorCode OBSOLETE_COLON_FOR_DEFAULT_VALUE = + static const CompileTimeErrorCode obsoleteColonForDefaultValue = CompileTimeErrorCode( 'OBSOLETE_COLON_FOR_DEFAULT_VALUE', "Using a colon as the separator before a default value is no longer " @@ -4445,7 +4427,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the interface that is implemented more than once - static const CompileTimeErrorCode ON_REPEATED = CompileTimeErrorCode( + static const CompileTimeErrorCode onRepeated = CompileTimeErrorCode( 'ON_REPEATED', "The type '{0}' can be included in the superclass constraints only once.", correctionMessage: @@ -4454,7 +4436,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = + static const CompileTimeErrorCode optionalParameterInOperator = CompileTimeErrorCode( 'OPTIONAL_PARAMETER_IN_OPERATOR', "Optional parameters aren't allowed when defining an operator.", @@ -4467,7 +4449,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the non-matching actual library name from the "part of" /// declaration static const CompileTimeErrorCode - PART_OF_DIFFERENT_LIBRARY = CompileTimeErrorCode( + partOfDifferentLibrary = CompileTimeErrorCode( 'PART_OF_DIFFERENT_LIBRARY', "Expected this library to be part of '{0}', not '{1}'.", correctionMessage: @@ -4478,7 +4460,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the URI pointing to a non-library declaration - static const CompileTimeErrorCode PART_OF_NON_PART = CompileTimeErrorCode( + static const CompileTimeErrorCode partOfNonPart = CompileTimeErrorCode( 'PART_OF_NON_PART', "The included part '{0}' must have a part-of directive.", correctionMessage: "Try adding a part-of directive to '{0}'.", @@ -4488,8 +4470,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the non-matching actual library name from the "part of" /// declaration - static const CompileTimeErrorCode - PART_OF_UNNAMED_LIBRARY = CompileTimeErrorCode( + static const CompileTimeErrorCode partOfUnnamedLibrary = CompileTimeErrorCode( 'PART_OF_UNNAMED_LIBRARY', "The library is unnamed. A URI is expected, not a library name '{0}', in " "the part-of directive.", @@ -4500,7 +4481,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE = + static const CompileTimeErrorCode patternAssignmentNotLocalVariable = CompileTimeErrorCode( 'PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE', "Only local variables can be assigned in pattern assignments.", @@ -4509,7 +4490,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY = + static const CompileTimeErrorCode patternConstantFromDeferredLibrary = CompileTimeErrorCode( 'PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used in patterns.", @@ -4522,7 +4503,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the matched type /// Type p1: the required type static const CompileTimeErrorCode - PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT = CompileTimeErrorCode( + patternTypeMismatchInIrrefutableContext = CompileTimeErrorCode( 'PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT', "The matched value of type '{0}' isn't assignable to the required type " "'{1}'.", @@ -4533,7 +4514,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD = + static const CompileTimeErrorCode patternVariableAssignmentInsideGuard = CompileTimeErrorCode( 'PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD', "Pattern variables can't be assigned inside the guard of the enclosing " @@ -4545,23 +4526,21 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the pattern variable static const CompileTimeErrorCode - PATTERN_VARIABLE_SHARED_CASE_SCOPE_DIFFERENT_FINALITY_OR_TYPE = - CompileTimeErrorCode( - 'INVALID_PATTERN_VARIABLE_IN_SHARED_CASE_SCOPE', - "The variable '{0}' doesn't have the same type and/or finality in all " - "cases that share this body.", - correctionMessage: - "Try declaring the variable pattern with the same type and finality in " - "all cases.", - hasPublishedDocs: true, - uniqueName: - 'PATTERN_VARIABLE_SHARED_CASE_SCOPE_DIFFERENT_FINALITY_OR_TYPE', - ); + patternVariableSharedCaseScopeDifferentFinalityOrType = CompileTimeErrorCode( + 'INVALID_PATTERN_VARIABLE_IN_SHARED_CASE_SCOPE', + "The variable '{0}' doesn't have the same type and/or finality in all " + "cases that share this body.", + correctionMessage: + "Try declaring the variable pattern with the same type and finality in " + "all cases.", + hasPublishedDocs: true, + uniqueName: 'PATTERN_VARIABLE_SHARED_CASE_SCOPE_DIFFERENT_FINALITY_OR_TYPE', + ); /// Parameters: /// String p0: the name of the pattern variable static const CompileTimeErrorCode - PATTERN_VARIABLE_SHARED_CASE_SCOPE_HAS_LABEL = CompileTimeErrorCode( + patternVariableSharedCaseScopeHasLabel = CompileTimeErrorCode( 'INVALID_PATTERN_VARIABLE_IN_SHARED_CASE_SCOPE', "The variable '{0}' is not available because there is a label or 'default' " "case.", @@ -4575,7 +4554,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the pattern variable static const CompileTimeErrorCode - PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES = CompileTimeErrorCode( + patternVariableSharedCaseScopeNotAllCases = CompileTimeErrorCode( 'INVALID_PATTERN_VARIABLE_IN_SHARED_CASE_SCOPE', "The variable '{0}' is available in some, but not all cases that share " "this body.", @@ -4587,7 +4566,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode POSITIONAL_FIELD_IN_OBJECT_PATTERN = + static const CompileTimeErrorCode positionalFieldInObjectPattern = CompileTimeErrorCode( 'POSITIONAL_FIELD_IN_OBJECT_PATTERN', "Object patterns can only use named fields.", @@ -4597,21 +4576,20 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - POSITIONAL_SUPER_FORMAL_PARAMETER_WITH_POSITIONAL_ARGUMENT = - CompileTimeErrorCode( - 'POSITIONAL_SUPER_FORMAL_PARAMETER_WITH_POSITIONAL_ARGUMENT', - "Positional super parameters can't be used when the super constructor " - "invocation has a positional argument.", - correctionMessage: - "Try making all the positional parameters passed to the super " - "constructor be either all super parameters or all normal parameters.", - hasPublishedDocs: true, - ); + positionalSuperFormalParameterWithPositionalArgument = CompileTimeErrorCode( + 'POSITIONAL_SUPER_FORMAL_PARAMETER_WITH_POSITIONAL_ARGUMENT', + "Positional super parameters can't be used when the super constructor " + "invocation has a positional argument.", + correctionMessage: + "Try making all the positional parameters passed to the super " + "constructor be either all super parameters or all normal parameters.", + hasPublishedDocs: true, + ); /// Parameters: /// Object p0: the name of the prefix static const CompileTimeErrorCode - PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = CompileTimeErrorCode( + prefixCollidesWithTopLevelMember = CompileTimeErrorCode( 'PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', "The name '{0}' is already used as an import prefix and can't be used to " "name a top-level element.", @@ -4623,7 +4601,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the prefix static const CompileTimeErrorCode - PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT = CompileTimeErrorCode( + prefixIdentifierNotFollowedByDot = CompileTimeErrorCode( 'PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT', "The name '{0}' refers to an import prefix, so it must be followed by '.'.", correctionMessage: @@ -4634,7 +4612,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the prefix being shadowed - static const CompileTimeErrorCode PREFIX_SHADOWED_BY_LOCAL_DECLARATION = + static const CompileTimeErrorCode prefixShadowedByLocalDeclaration = CompileTimeErrorCode( 'PREFIX_SHADOWED_BY_LOCAL_DECLARATION', "The prefix '{0}' can't be used here because it's shadowed by a local " @@ -4649,7 +4627,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the first mixin /// String p2: the name of the second mixin static const CompileTimeErrorCode - PRIVATE_COLLISION_IN_MIXIN_APPLICATION = CompileTimeErrorCode( + privateCollisionInMixinApplication = CompileTimeErrorCode( 'PRIVATE_COLLISION_IN_MIXIN_APPLICATION', "The private name '{0}', defined by '{1}', conflicts with the same name " "defined by '{2}'.", @@ -4658,7 +4636,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = + static const CompileTimeErrorCode privateOptionalParameter = CompileTimeErrorCode( 'PRIVATE_OPTIONAL_PARAMETER', "Named parameters can't start with an underscore.", @@ -4667,7 +4645,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the setter - static const CompileTimeErrorCode PRIVATE_SETTER = CompileTimeErrorCode( + static const CompileTimeErrorCode privateSetter = CompileTimeErrorCode( 'PRIVATE_SETTER', "The setter '{0}' is private and can't be accessed outside the library " "that declares it.", @@ -4677,7 +4655,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the variable - static const CompileTimeErrorCode READ_POTENTIALLY_UNASSIGNED_FINAL = + static const CompileTimeErrorCode readPotentiallyUnassignedFinal = CompileTimeErrorCode( 'READ_POTENTIALLY_UNASSIGNED_FINAL', "The final variable '{0}' can't be read because it's potentially " @@ -4691,7 +4669,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// No parameters. static const CompileTimeErrorCode - RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA = CompileTimeErrorCode( + recordLiteralOnePositionalNoTrailingComma = CompileTimeErrorCode( 'RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA', "A record literal with exactly one positional field requires a trailing " "comma.", @@ -4700,7 +4678,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = + static const CompileTimeErrorCode recursiveCompileTimeConstant = CompileTimeErrorCode( 'RECURSIVE_COMPILE_TIME_CONSTANT', "The compile-time constant expression depends on itself.", @@ -4708,7 +4686,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode RECURSIVE_CONSTANT_CONSTRUCTOR = + static const CompileTimeErrorCode recursiveConstantConstructor = CompileTimeErrorCode( 'RECURSIVE_CONSTANT_CONSTRUCTOR', "The constant constructor depends on itself.", @@ -4722,7 +4700,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// No parameters. static const CompileTimeErrorCode - RECURSIVE_CONSTRUCTOR_REDIRECT = CompileTimeErrorCode( + recursiveConstructorRedirect = CompileTimeErrorCode( 'RECURSIVE_CONSTRUCTOR_REDIRECT', "Constructors can't redirect to themselves either directly or indirectly.", correctionMessage: @@ -4732,7 +4710,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - RECURSIVE_FACTORY_REDIRECT = CompileTimeErrorCode( + recursiveFactoryRedirect = CompileTimeErrorCode( 'RECURSIVE_CONSTRUCTOR_REDIRECT', "Constructors can't redirect to themselves either directly or indirectly.", correctionMessage: @@ -4744,7 +4722,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the class that implements itself recursively /// String p1: a string representation of the implements loop - static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = + static const CompileTimeErrorCode recursiveInterfaceInheritance = CompileTimeErrorCode( 'RECURSIVE_INTERFACE_INHERITANCE', "'{0}' can't be a superinterface of itself: {1}.", @@ -4762,7 +4740,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the class that implements itself recursively - static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_EXTENDS = + static const CompileTimeErrorCode recursiveInterfaceInheritanceExtends = CompileTimeErrorCode( 'RECURSIVE_INTERFACE_INHERITANCE', "'{0}' can't extend itself.", @@ -4781,7 +4759,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the class that implements itself recursively - static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_IMPLEMENTS = + static const CompileTimeErrorCode recursiveInterfaceInheritanceImplements = CompileTimeErrorCode( 'RECURSIVE_INTERFACE_INHERITANCE', "'{0}' can't implement itself.", @@ -4791,7 +4769,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the mixin that constraints itself recursively - static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_ON = + static const CompileTimeErrorCode recursiveInterfaceInheritanceOn = CompileTimeErrorCode( 'RECURSIVE_INTERFACE_INHERITANCE', "'{0}' can't use itself as a superclass constraint.", @@ -4810,7 +4788,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the class that implements itself recursively - static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_WITH = + static const CompileTimeErrorCode recursiveInterfaceInheritanceWith = CompileTimeErrorCode( 'RECURSIVE_INTERFACE_INHERITANCE', "'{0}' can't use itself as a mixin.", @@ -4821,7 +4799,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the constructor /// String p1: the name of the class - static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = + static const CompileTimeErrorCode redirectGenerativeToMissingConstructor = CompileTimeErrorCode( 'REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' couldn't be found in '{1}'.", @@ -4833,7 +4811,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR = CompileTimeErrorCode( + redirectGenerativeToNonGenerativeConstructor = CompileTimeErrorCode( 'REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR', "Generative constructors can't redirect to a factory constructor.", correctionMessage: "Try redirecting to a different constructor.", @@ -4845,7 +4823,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p1: the name of the abstract class defining the constructor being /// redirected to static const CompileTimeErrorCode - REDIRECT_TO_ABSTRACT_CLASS_CONSTRUCTOR = CompileTimeErrorCode( + redirectToAbstractClassConstructor = CompileTimeErrorCode( 'REDIRECT_TO_ABSTRACT_CLASS_CONSTRUCTOR', "The redirecting constructor '{0}' can't redirect to a constructor of the " "abstract class '{1}'.", @@ -4857,7 +4835,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the name of the redirected constructor /// Type p1: the name of the redirecting constructor static const CompileTimeErrorCode - REDIRECT_TO_INVALID_FUNCTION_TYPE = CompileTimeErrorCode( + redirectToInvalidFunctionType = CompileTimeErrorCode( 'REDIRECT_TO_INVALID_FUNCTION_TYPE', "The redirected constructor '{0}' has incompatible parameters with '{1}'.", correctionMessage: "Try redirecting to a different constructor.", @@ -4868,7 +4846,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the name of the redirected constructor's return type /// Type p1: the name of the redirecting constructor's return type static const CompileTimeErrorCode - REDIRECT_TO_INVALID_RETURN_TYPE = CompileTimeErrorCode( + redirectToInvalidReturnType = CompileTimeErrorCode( 'REDIRECT_TO_INVALID_RETURN_TYPE', "The return type '{0}' of the redirected constructor isn't a subtype of " "'{1}'.", @@ -4880,7 +4858,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the constructor /// Type p1: the name of the class containing the constructor static const CompileTimeErrorCode - REDIRECT_TO_MISSING_CONSTRUCTOR = CompileTimeErrorCode( + redirectToMissingConstructor = CompileTimeErrorCode( 'REDIRECT_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' couldn't be found in '{1}'.", correctionMessage: @@ -4891,17 +4869,16 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the non-type referenced in the redirect - static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = - CompileTimeErrorCode( - 'REDIRECT_TO_NON_CLASS', - "The name '{0}' isn't a type and can't be used in a redirected " - "constructor.", - correctionMessage: "Try redirecting to a different constructor.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode redirectToNonClass = CompileTimeErrorCode( + 'REDIRECT_TO_NON_CLASS', + "The name '{0}' isn't a type and can't be used in a redirected " + "constructor.", + correctionMessage: "Try redirecting to a different constructor.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = + static const CompileTimeErrorCode redirectToNonConstConstructor = CompileTimeErrorCode( 'REDIRECT_TO_NON_CONST_CONSTRUCTOR', "A constant redirecting constructor can't redirect to a non-constant " @@ -4912,7 +4889,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - REDIRECT_TO_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER = CompileTimeErrorCode( + redirectToTypeAliasExpandsToTypeParameter = CompileTimeErrorCode( 'REDIRECT_TO_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER', "A redirecting constructor can't redirect to a type alias that expands to " "a type parameter.", @@ -4923,7 +4900,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the variable static const CompileTimeErrorCode - REFERENCED_BEFORE_DECLARATION = CompileTimeErrorCode( + referencedBeforeDeclaration = CompileTimeErrorCode( 'REFERENCED_BEFORE_DECLARATION', "Local variable '{0}' can't be referenced before it is declared.", correctionMessage: @@ -4935,7 +4912,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT = CompileTimeErrorCode( + refutablePatternInIrrefutableContext = CompileTimeErrorCode( 'REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT', "Refutable patterns can't be used in an irrefutable context.", correctionMessage: @@ -4948,28 +4925,27 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the operand type /// Type p1: the parameter type of the invoked operator /// String p2: the name of the invoked operator - static const CompileTimeErrorCode - RELATIONAL_PATTERN_OPERAND_TYPE_NOT_ASSIGNABLE = CompileTimeErrorCode( - 'RELATIONAL_PATTERN_OPERAND_TYPE_NOT_ASSIGNABLE', - "The constant expression type '{0}' is not assignable to the parameter " - "type '{1}' of the '{2}' operator.", - hasPublishedDocs: true, - ); - - /// No parameters. - static const CompileTimeErrorCode - RELATIONAL_PATTERN_OPERATOR_RETURN_TYPE_NOT_ASSIGNABLE_TO_BOOL = + static const CompileTimeErrorCode relationalPatternOperandTypeNotAssignable = CompileTimeErrorCode( - 'RELATIONAL_PATTERN_OPERATOR_RETURN_TYPE_NOT_ASSIGNABLE_TO_BOOL', - "The return type of operators used in relational patterns must be " - "assignable to 'bool'.", - correctionMessage: - "Try updating the operator declaration to return 'bool'.", + 'RELATIONAL_PATTERN_OPERAND_TYPE_NOT_ASSIGNABLE', + "The constant expression type '{0}' is not assignable to the parameter " + "type '{1}' of the '{2}' operator.", hasPublishedDocs: true, ); /// No parameters. - static const CompileTimeErrorCode REST_ELEMENT_IN_MAP_PATTERN = + static const CompileTimeErrorCode + relationalPatternOperatorReturnTypeNotAssignableToBool = CompileTimeErrorCode( + 'RELATIONAL_PATTERN_OPERATOR_RETURN_TYPE_NOT_ASSIGNABLE_TO_BOOL', + "The return type of operators used in relational patterns must be " + "assignable to 'bool'.", + correctionMessage: + "Try updating the operator declaration to return 'bool'.", + hasPublishedDocs: true, + ); + + /// No parameters. + static const CompileTimeErrorCode restElementInMapPattern = CompileTimeErrorCode( 'REST_ELEMENT_IN_MAP_PATTERN', "A map pattern can't contain a rest pattern.", @@ -4978,18 +4954,17 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = - CompileTimeErrorCode( - 'RETHROW_OUTSIDE_CATCH', - "A rethrow must be inside of a catch clause.", - correctionMessage: - "Try moving the expression into a catch clause, or using a 'throw' " - "expression.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode rethrowOutsideCatch = CompileTimeErrorCode( + 'RETHROW_OUTSIDE_CATCH', + "A rethrow must be inside of a catch clause.", + correctionMessage: + "Try moving the expression into a catch clause, or using a 'throw' " + "expression.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = + static const CompileTimeErrorCode returnInGenerativeConstructor = CompileTimeErrorCode( 'RETURN_IN_GENERATIVE_CONSTRUCTOR', "Constructors can't return values.", @@ -4999,7 +4974,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode RETURN_IN_GENERATOR = CompileTimeErrorCode( + static const CompileTimeErrorCode returnInGenerator = CompileTimeErrorCode( 'RETURN_IN_GENERATOR', "Can't return a value from a generator function that uses the 'async*' or " "'sync*' modifier.", @@ -5012,7 +4987,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the return type as declared in the return statement /// Type p1: the expected return type as defined by the method - static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_CLOSURE = + static const CompileTimeErrorCode returnOfInvalidTypeFromClosure = CompileTimeErrorCode( 'RETURN_OF_INVALID_TYPE_FROM_CLOSURE', "The returned type '{0}' isn't returnable from a '{1}' function, as " @@ -5024,7 +4999,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the return type as declared in the return statement /// Type p1: the expected return type as defined by the enclosing class /// String p2: the name of the constructor - static const CompileTimeErrorCode RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR = + static const CompileTimeErrorCode returnOfInvalidTypeFromConstructor = CompileTimeErrorCode( 'RETURN_OF_INVALID_TYPE', "A value of type '{0}' can't be returned from the constructor '{2}' " @@ -5038,7 +5013,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p1: the expected return type as defined by the method /// String p2: the name of the method static const CompileTimeErrorCode - RETURN_OF_INVALID_TYPE_FROM_FUNCTION = CompileTimeErrorCode( + returnOfInvalidTypeFromFunction = CompileTimeErrorCode( 'RETURN_OF_INVALID_TYPE', "A value of type '{0}' can't be returned from the function '{2}' because " "it has a return type of '{1}'.", @@ -5051,7 +5026,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p1: the expected return type as defined by the method /// String p2: the name of the method static const CompileTimeErrorCode - RETURN_OF_INVALID_TYPE_FROM_METHOD = CompileTimeErrorCode( + returnOfInvalidTypeFromMethod = CompileTimeErrorCode( 'RETURN_OF_INVALID_TYPE', "A value of type '{0}' can't be returned from the method '{2}' because it " "has a return type of '{1}'.", @@ -5060,7 +5035,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode RETURN_WITHOUT_VALUE = CompileTimeErrorCode( + static const CompileTimeErrorCode returnWithoutValue = CompileTimeErrorCode( 'RETURN_WITHOUT_VALUE', "The return value is missing after 'return'.", hasPublishedDocs: true, @@ -5070,7 +5045,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the sealed class being extended, implemented, or /// mixed in static const CompileTimeErrorCode - SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY = CompileTimeErrorCode( + sealedClassSubtypeOutsideOfLibrary = CompileTimeErrorCode( 'INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY', "The class '{0}' can't be extended, implemented, or mixed in outside of " "its library because it's a sealed class.", @@ -5080,7 +5055,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - SET_ELEMENT_FROM_DEFERRED_LIBRARY = CompileTimeErrorCode( + setElementFromDeferredLibrary = CompileTimeErrorCode( 'COLLECTION_ELEMENT_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be used as values in a " "'const' set literal.", @@ -5094,7 +5069,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the actual type of the set element /// Type p1: the expected type of the set element - static const CompileTimeErrorCode SET_ELEMENT_TYPE_NOT_ASSIGNABLE = + static const CompileTimeErrorCode setElementTypeNotAssignable = CompileTimeErrorCode( 'SET_ELEMENT_TYPE_NOT_ASSIGNABLE', "The element type '{0}' can't be assigned to the set type '{1}'.", @@ -5104,17 +5079,16 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the actual type of the set element /// Type p1: the expected type of the set element - static const CompileTimeErrorCode - SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY = CompileTimeErrorCode( - 'SET_ELEMENT_TYPE_NOT_ASSIGNABLE', - "The element type '{0}' can't be assigned to the set type '{1}'.", - hasPublishedDocs: true, - uniqueName: 'SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY', - ); + static const CompileTimeErrorCode setElementTypeNotAssignableNullability = + CompileTimeErrorCode( + 'SET_ELEMENT_TYPE_NOT_ASSIGNABLE', + "The element type '{0}' can't be assigned to the set type '{1}'.", + hasPublishedDocs: true, + uniqueName: 'SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY', + ); /// No parameters. - static const CompileTimeErrorCode - SHARED_DEFERRED_PREFIX = CompileTimeErrorCode( + static const CompileTimeErrorCode sharedDeferredPrefix = CompileTimeErrorCode( 'SHARED_DEFERRED_PREFIX', "The prefix of a deferred import can't be used in other import directives.", correctionMessage: "Try renaming one of the prefixes.", @@ -5122,7 +5096,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY = + static const CompileTimeErrorCode spreadExpressionFromDeferredLibrary = CompileTimeErrorCode( 'SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can't be spread into a const " @@ -5132,7 +5106,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the instance member - static const CompileTimeErrorCode STATIC_ACCESS_TO_INSTANCE_MEMBER = + static const CompileTimeErrorCode staticAccessToInstanceMember = CompileTimeErrorCode( 'STATIC_ACCESS_TO_INSTANCE_MEMBER', "Instance member '{0}' can't be accessed using static access.", @@ -5144,7 +5118,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// 'sealed' /// String p1: the name of the 'base' supertype static const CompileTimeErrorCode - SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED = CompileTimeErrorCode( + subtypeOfBaseIsNotBaseFinalOrSealed = CompileTimeErrorCode( 'SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED', "The type '{0}' must be 'base', 'final' or 'sealed' because the supertype " "'{1}' is 'base'.", @@ -5157,7 +5131,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// 'sealed' /// String p1: the name of the 'final' supertype static const CompileTimeErrorCode - SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED = CompileTimeErrorCode( + subtypeOfFinalIsNotBaseFinalOrSealed = CompileTimeErrorCode( 'SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED', "The type '{0}' must be 'base', 'final' or 'sealed' because the supertype " "'{1}' is 'final'.", @@ -5169,7 +5143,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the type of super-parameter /// Type p1: the type of associated super-constructor parameter static const CompileTimeErrorCode - SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED = CompileTimeErrorCode( + superFormalParameterTypeIsNotSubtypeOfAssociated = CompileTimeErrorCode( 'SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED', "The type '{0}' of this parameter isn't a subtype of the type '{1}' of the " "associated super constructor parameter.", @@ -5179,19 +5153,19 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED = CompileTimeErrorCode( - 'SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED', - "No associated named super constructor parameter.", - correctionMessage: - "Try changing the name to the name of an existing named super " - "constructor parameter, or creating such named parameter.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode superFormalParameterWithoutAssociatedNamed = + CompileTimeErrorCode( + 'SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED', + "No associated named super constructor parameter.", + correctionMessage: + "Try changing the name to the name of an existing named super " + "constructor parameter, or creating such named parameter.", + hasPublishedDocs: true, + ); /// No parameters. static const CompileTimeErrorCode - SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL = CompileTimeErrorCode( + superFormalParameterWithoutAssociatedPositional = CompileTimeErrorCode( 'SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL', "No associated positional super constructor parameter.", correctionMessage: @@ -5205,7 +5179,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// includes a superinitializer. /// /// No parameters. - static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = + static const CompileTimeErrorCode superInitializerInObject = CompileTimeErrorCode( 'SUPER_INITIALIZER_IN_OBJECT', "The class 'Object' can't invoke a constructor from a superclass.", @@ -5213,7 +5187,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the superinitializer - static const CompileTimeErrorCode SUPER_INVOCATION_NOT_LAST = + static const CompileTimeErrorCode superInvocationNotLast = CompileTimeErrorCode( 'SUPER_INVOCATION_NOT_LAST', "The superconstructor call must be last in an initializer list: '{0}'.", @@ -5221,7 +5195,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode SUPER_IN_ENUM_CONSTRUCTOR = + static const CompileTimeErrorCode superInEnumConstructor = CompileTimeErrorCode( 'SUPER_IN_ENUM_CONSTRUCTOR', "The enum constructor can't have a 'super' initializer.", @@ -5230,7 +5204,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode SUPER_IN_EXTENSION = CompileTimeErrorCode( + static const CompileTimeErrorCode superInExtension = CompileTimeErrorCode( 'SUPER_IN_EXTENSION', "The 'super' keyword can't be used in an extension because an extension " "doesn't have a superclass.", @@ -5238,16 +5212,15 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode SUPER_IN_EXTENSION_TYPE = - CompileTimeErrorCode( - 'SUPER_IN_EXTENSION_TYPE', - "The 'super' keyword can't be used in an extension type because an " - "extension type doesn't have a superclass.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode superInExtensionType = CompileTimeErrorCode( + 'SUPER_IN_EXTENSION_TYPE', + "The 'super' keyword can't be used in an extension type because an " + "extension type doesn't have a superclass.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = + static const CompileTimeErrorCode superInInvalidContext = CompileTimeErrorCode( 'SUPER_IN_INVALID_CONTEXT', "Invalid context for 'super' invocation.", @@ -5255,7 +5228,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = + static const CompileTimeErrorCode superInRedirectingConstructor = CompileTimeErrorCode( 'SUPER_IN_REDIRECTING_CONSTRUCTOR', "The redirecting constructor can't have a 'super' initializer.", @@ -5263,7 +5236,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode SWITCH_CASE_COMPLETES_NORMALLY = + static const CompileTimeErrorCode switchCaseCompletesNormally = CompileTimeErrorCode( 'SWITCH_CASE_COMPLETES_NORMALLY', "The 'case' shouldn't complete normally.", @@ -5273,7 +5246,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS = CompileTimeErrorCode( + tearoffOfGenerativeConstructorOfAbstractClass = CompileTimeErrorCode( 'TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS', "A generative constructor of an abstract class can't be torn off.", correctionMessage: @@ -5284,8 +5257,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the type that can't be thrown - static const CompileTimeErrorCode - THROW_OF_INVALID_TYPE = CompileTimeErrorCode( + static const CompileTimeErrorCode throwOfInvalidType = CompileTimeErrorCode( 'THROW_OF_INVALID_TYPE', "The type '{0}' of the thrown expression must be assignable to 'Object'.", hasPublishedDocs: true, @@ -5294,7 +5266,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the element whose type could not be inferred. /// String p1: The [TopLevelInferenceError]'s arguments that led to the cycle. - static const CompileTimeErrorCode TOP_LEVEL_CYCLE = CompileTimeErrorCode( + static const CompileTimeErrorCode topLevelCycle = CompileTimeErrorCode( 'TOP_LEVEL_CYCLE', "The type of '{0}' can't be inferred because it depends on itself through " "the cycle: {1}.", @@ -5306,7 +5278,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = CompileTimeErrorCode( + typeAliasCannotReferenceItself = CompileTimeErrorCode( 'TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', "Typedefs can't reference themselves directly or recursively via another " "typedef.", @@ -5316,7 +5288,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type that is deferred and being used in a type /// annotation - static const CompileTimeErrorCode TYPE_ANNOTATION_DEFERRED_CLASS = + static const CompileTimeErrorCode typeAnnotationDeferredClass = CompileTimeErrorCode( 'TYPE_ANNOTATION_DEFERRED_CLASS', "The deferred type '{0}' can't be used in a declaration, cast, or type " @@ -5332,7 +5304,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// limited by the bound as specified in the class declaration /// String p1: the name of the type parameter /// Type p2: the substituted bound of the type parameter - static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = + static const CompileTimeErrorCode typeArgumentNotMatchingBounds = CompileTimeErrorCode( 'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' doesn't conform to the bound '{2}' of the type parameter '{1}'.", @@ -5341,8 +5313,12 @@ class CompileTimeErrorCode extends DiagnosticCode { hasPublishedDocs: true, ); + @Deprecated("Please use typeArgumentNotMatchingBounds") + static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = + typeArgumentNotMatchingBounds; + /// No parameters. - static const CompileTimeErrorCode TYPE_PARAMETER_REFERENCED_BY_STATIC = + static const CompileTimeErrorCode typeParameterReferencedByStatic = CompileTimeErrorCode( 'TYPE_PARAMETER_REFERENCED_BY_STATIC', "Static members can't reference type parameters of the class.", @@ -5357,7 +5333,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type parameter /// Type p1: the name of the bounding type - static const CompileTimeErrorCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = + static const CompileTimeErrorCode typeParameterSupertypeOfItsBound = CompileTimeErrorCode( 'TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', "'{0}' can't be a supertype of its upper bound.", @@ -5368,18 +5344,17 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the type - static const CompileTimeErrorCode TYPE_TEST_WITH_NON_TYPE = - CompileTimeErrorCode( - 'TYPE_TEST_WITH_NON_TYPE', - "The name '{0}' isn't a type and can't be used in an 'is' expression.", - correctionMessage: "Try correcting the name to match an existing type.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode typeTestWithNonType = CompileTimeErrorCode( + 'TYPE_TEST_WITH_NON_TYPE', + "The name '{0}' isn't a type and can't be used in an 'is' expression.", + correctionMessage: "Try correcting the name to match an existing type.", + hasPublishedDocs: true, + ); /// Parameters: /// String p0: the name of the type static const CompileTimeErrorCode - TYPE_TEST_WITH_UNDEFINED_NAME = CompileTimeErrorCode( + typeTestWithUndefinedName = CompileTimeErrorCode( 'TYPE_TEST_WITH_UNDEFINED_NAME', "The name '{0}' isn't defined, so it can't be used in an 'is' expression.", correctionMessage: @@ -5390,7 +5365,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - UNCHECKED_INVOCATION_OF_NULLABLE_VALUE = CompileTimeErrorCode( + uncheckedInvocationOfNullableValue = CompileTimeErrorCode( 'UNCHECKED_USE_OF_NULLABLE_VALUE', "The function can't be unconditionally invoked because it can be 'null'.", correctionMessage: "Try adding a null check ('!').", @@ -5401,7 +5376,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method static const CompileTimeErrorCode - UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE = CompileTimeErrorCode( + uncheckedMethodInvocationOfNullableValue = CompileTimeErrorCode( 'UNCHECKED_USE_OF_NULLABLE_VALUE', "The method '{0}' can't be unconditionally invoked because the receiver " "can be 'null'.", @@ -5415,7 +5390,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the operator static const CompileTimeErrorCode - UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE = CompileTimeErrorCode( + uncheckedOperatorInvocationOfNullableValue = CompileTimeErrorCode( 'UNCHECKED_USE_OF_NULLABLE_VALUE', "The operator '{0}' can't be unconditionally invoked because the receiver " "can be 'null'.", @@ -5427,7 +5402,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the property static const CompileTimeErrorCode - UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE = CompileTimeErrorCode( + uncheckedPropertyAccessOfNullableValue = CompileTimeErrorCode( 'UNCHECKED_USE_OF_NULLABLE_VALUE', "The property '{0}' can't be unconditionally accessed because the receiver " "can be 'null'.", @@ -5439,32 +5414,32 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION = CompileTimeErrorCode( - 'UNCHECKED_USE_OF_NULLABLE_VALUE', - "A nullable expression can't be used as a condition.", - correctionMessage: - "Try checking that the value isn't 'null' before using it as a " - "condition.", - hasPublishedDocs: true, - uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION', - ); + static const CompileTimeErrorCode uncheckedUseOfNullableValueAsCondition = + CompileTimeErrorCode( + 'UNCHECKED_USE_OF_NULLABLE_VALUE', + "A nullable expression can't be used as a condition.", + correctionMessage: + "Try checking that the value isn't 'null' before using it as a " + "condition.", + hasPublishedDocs: true, + uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION', + ); + + /// No parameters. + static const CompileTimeErrorCode uncheckedUseOfNullableValueAsIterator = + CompileTimeErrorCode( + 'UNCHECKED_USE_OF_NULLABLE_VALUE', + "A nullable expression can't be used as an iterator in a for-in loop.", + correctionMessage: + "Try checking that the value isn't 'null' before using it as an " + "iterator.", + hasPublishedDocs: true, + uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR', + ); /// No parameters. static const CompileTimeErrorCode - UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR = CompileTimeErrorCode( - 'UNCHECKED_USE_OF_NULLABLE_VALUE', - "A nullable expression can't be used as an iterator in a for-in loop.", - correctionMessage: - "Try checking that the value isn't 'null' before using it as an " - "iterator.", - hasPublishedDocs: true, - uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR', - ); - - /// No parameters. - static const CompileTimeErrorCode - UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD = CompileTimeErrorCode( + uncheckedUseOfNullableValueInSpread = CompileTimeErrorCode( 'UNCHECKED_USE_OF_NULLABLE_VALUE', "A nullable expression can't be used in a spread.", correctionMessage: @@ -5475,20 +5450,20 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode - UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH = CompileTimeErrorCode( - 'UNCHECKED_USE_OF_NULLABLE_VALUE', - "A nullable expression can't be used in a yield-each statement.", - correctionMessage: - "Try checking that the value isn't 'null' before using it in a " - "yield-each statement.", - hasPublishedDocs: true, - uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH', - ); + static const CompileTimeErrorCode uncheckedUseOfNullableValueInYieldEach = + CompileTimeErrorCode( + 'UNCHECKED_USE_OF_NULLABLE_VALUE', + "A nullable expression can't be used in a yield-each statement.", + correctionMessage: + "Try checking that the value isn't 'null' before using it in a " + "yield-each statement.", + hasPublishedDocs: true, + uniqueName: 'UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH', + ); /// Parameters: /// String p0: the name of the annotation - static const CompileTimeErrorCode UNDEFINED_ANNOTATION = CompileTimeErrorCode( + static const CompileTimeErrorCode undefinedAnnotation = CompileTimeErrorCode( 'UNDEFINED_ANNOTATION', "Undefined name '{0}' used as an annotation.", correctionMessage: @@ -5499,7 +5474,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the undefined class - static const CompileTimeErrorCode UNDEFINED_CLASS = CompileTimeErrorCode( + static const CompileTimeErrorCode undefinedClass = CompileTimeErrorCode( 'UNDEFINED_CLASS', "Undefined class '{0}'.", correctionMessage: @@ -5509,12 +5484,15 @@ class CompileTimeErrorCode extends DiagnosticCode { isUnresolvedIdentifier: true, ); + @Deprecated("Please use undefinedClass") + static const CompileTimeErrorCode UNDEFINED_CLASS = undefinedClass; + /// Same as [CompileTimeErrorCode.UNDEFINED_CLASS], but to catch using /// "boolean" instead of "bool" in order to improve the correction message. /// /// Parameters: /// String p0: the name of the undefined class - static const CompileTimeErrorCode UNDEFINED_CLASS_BOOLEAN = + static const CompileTimeErrorCode undefinedClassBoolean = CompileTimeErrorCode( 'UNDEFINED_CLASS', "Undefined class '{0}'.", @@ -5528,7 +5506,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the name of the superclass that does not define the invoked /// constructor /// String p1: the name of the constructor being invoked - static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = + static const CompileTimeErrorCode undefinedConstructorInInitializer = CompileTimeErrorCode( 'UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', "The class '{0}' doesn't have a constructor named '{1}'.", @@ -5542,7 +5520,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p0: the name of the superclass that does not define the invoked /// constructor static const CompileTimeErrorCode - UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = CompileTimeErrorCode( + undefinedConstructorInInitializerDefault = CompileTimeErrorCode( 'UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', "The class '{0}' doesn't have an unnamed constructor.", correctionMessage: @@ -5555,7 +5533,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the enum value that is not defined /// String p1: the name of the enum used to access the constant - static const CompileTimeErrorCode UNDEFINED_ENUM_CONSTANT = + static const CompileTimeErrorCode undefinedEnumConstant = CompileTimeErrorCode( 'UNDEFINED_ENUM_CONSTANT', "There's no constant named '{0}' in '{1}'.", @@ -5568,7 +5546,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the constructor that is undefined static const CompileTimeErrorCode - UNDEFINED_ENUM_CONSTRUCTOR_NAMED = CompileTimeErrorCode( + undefinedEnumConstructorNamed = CompileTimeErrorCode( 'UNDEFINED_ENUM_CONSTRUCTOR', "The enum doesn't have a constructor named '{0}'.", correctionMessage: @@ -5579,7 +5557,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode UNDEFINED_ENUM_CONSTRUCTOR_UNNAMED = + static const CompileTimeErrorCode undefinedEnumConstructorUnnamed = CompileTimeErrorCode( 'UNDEFINED_ENUM_CONSTRUCTOR', "The enum doesn't have an unnamed constructor.", @@ -5593,7 +5571,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the getter that is undefined /// String p1: the name of the extension that was explicitly specified - static const CompileTimeErrorCode UNDEFINED_EXTENSION_GETTER = + static const CompileTimeErrorCode undefinedExtensionGetter = CompileTimeErrorCode( 'UNDEFINED_EXTENSION_GETTER', "The getter '{0}' isn't defined for the extension '{1}'.", @@ -5606,7 +5584,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method that is undefined /// String p1: the name of the extension that was explicitly specified - static const CompileTimeErrorCode UNDEFINED_EXTENSION_METHOD = + static const CompileTimeErrorCode undefinedExtensionMethod = CompileTimeErrorCode( 'UNDEFINED_EXTENSION_METHOD', "The method '{0}' isn't defined for the extension '{1}'.", @@ -5619,7 +5597,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the operator that is undefined /// String p1: the name of the extension that was explicitly specified - static const CompileTimeErrorCode UNDEFINED_EXTENSION_OPERATOR = + static const CompileTimeErrorCode undefinedExtensionOperator = CompileTimeErrorCode( 'UNDEFINED_EXTENSION_OPERATOR', "The operator '{0}' isn't defined for the extension '{1}'.", @@ -5630,7 +5608,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the setter that is undefined /// String p1: the name of the extension that was explicitly specified - static const CompileTimeErrorCode UNDEFINED_EXTENSION_SETTER = + static const CompileTimeErrorCode undefinedExtensionSetter = CompileTimeErrorCode( 'UNDEFINED_EXTENSION_SETTER', "The setter '{0}' isn't defined for the extension '{1}'.", @@ -5642,7 +5620,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method that is undefined - static const CompileTimeErrorCode UNDEFINED_FUNCTION = CompileTimeErrorCode( + static const CompileTimeErrorCode undefinedFunction = CompileTimeErrorCode( 'UNDEFINED_FUNCTION', "The function '{0}' isn't defined.", correctionMessage: @@ -5656,7 +5634,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the getter /// Object p1: the name of the enclosing type where the getter is being looked /// for - static const CompileTimeErrorCode UNDEFINED_GETTER = CompileTimeErrorCode( + static const CompileTimeErrorCode undefinedGetter = CompileTimeErrorCode( 'UNDEFINED_GETTER', "The getter '{0}' isn't defined for the type '{1}'.", correctionMessage: @@ -5669,7 +5647,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the getter /// String p1: the name of the function type alias - static const CompileTimeErrorCode UNDEFINED_GETTER_ON_FUNCTION_TYPE = + static const CompileTimeErrorCode undefinedGetterOnFunctionType = CompileTimeErrorCode( 'UNDEFINED_GETTER', "The getter '{0}' isn't defined for the '{1}' function type.", @@ -5682,7 +5660,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the identifier - static const CompileTimeErrorCode UNDEFINED_IDENTIFIER = CompileTimeErrorCode( + static const CompileTimeErrorCode undefinedIdentifier = CompileTimeErrorCode( 'UNDEFINED_IDENTIFIER', "Undefined name '{0}'.", correctionMessage: @@ -5693,7 +5671,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - UNDEFINED_IDENTIFIER_AWAIT = CompileTimeErrorCode( + undefinedIdentifierAwait = CompileTimeErrorCode( 'UNDEFINED_IDENTIFIER_AWAIT', "Undefined name 'await' in function body not marked with 'async'.", correctionMessage: @@ -5705,7 +5683,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method that is undefined /// Object p1: the resolved type name that the method lookup is happening on - static const CompileTimeErrorCode UNDEFINED_METHOD = CompileTimeErrorCode( + static const CompileTimeErrorCode undefinedMethod = CompileTimeErrorCode( 'UNDEFINED_METHOD', "The method '{0}' isn't defined for the type '{1}'.", correctionMessage: @@ -5717,7 +5695,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method /// String p1: the name of the function type alias - static const CompileTimeErrorCode UNDEFINED_METHOD_ON_FUNCTION_TYPE = + static const CompileTimeErrorCode undefinedMethodOnFunctionType = CompileTimeErrorCode( 'UNDEFINED_METHOD', "The method '{0}' isn't defined for the '{1}' function type.", @@ -5730,7 +5708,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the requested named parameter - static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = + static const CompileTimeErrorCode undefinedNamedParameter = CompileTimeErrorCode( 'UNDEFINED_NAMED_PARAMETER', "The named parameter '{0}' isn't defined.", @@ -5744,7 +5722,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the operator /// Type p1: the name of the enclosing type where the operator is being looked /// for - static const CompileTimeErrorCode UNDEFINED_OPERATOR = CompileTimeErrorCode( + static const CompileTimeErrorCode undefinedOperator = CompileTimeErrorCode( 'UNDEFINED_OPERATOR', "The operator '{0}' isn't defined for the type '{1}'.", correctionMessage: "Try defining the operator '{0}'.", @@ -5755,7 +5733,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the reference /// String p1: the name of the prefix static const CompileTimeErrorCode - UNDEFINED_PREFIXED_NAME = CompileTimeErrorCode( + undefinedPrefixedName = CompileTimeErrorCode( 'UNDEFINED_PREFIXED_NAME', "The name '{0}' is being referenced through the prefix '{1}', but it isn't " "defined in any of the libraries imported using that prefix.", @@ -5769,7 +5747,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the setter /// Type p1: the name of the enclosing type where the setter is being looked /// for - static const CompileTimeErrorCode UNDEFINED_SETTER = CompileTimeErrorCode( + static const CompileTimeErrorCode undefinedSetter = CompileTimeErrorCode( 'UNDEFINED_SETTER', "The setter '{0}' isn't defined for the type '{1}'.", correctionMessage: @@ -5782,7 +5760,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the setter /// String p1: the name of the function type alias - static const CompileTimeErrorCode UNDEFINED_SETTER_ON_FUNCTION_TYPE = + static const CompileTimeErrorCode undefinedSetterOnFunctionType = CompileTimeErrorCode( 'UNDEFINED_SETTER', "The setter '{0}' isn't defined for the '{1}' function type.", @@ -5797,36 +5775,34 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the getter /// Type p1: the name of the enclosing type where the getter is being looked /// for - static const CompileTimeErrorCode UNDEFINED_SUPER_GETTER = - CompileTimeErrorCode( - 'UNDEFINED_SUPER_MEMBER', - "The getter '{0}' isn't defined in a superclass of '{1}'.", - correctionMessage: - "Try correcting the name to the name of an existing getter, or " - "defining a getter or field named '{0}' in a superclass.", - hasPublishedDocs: true, - uniqueName: 'UNDEFINED_SUPER_GETTER', - ); + static const CompileTimeErrorCode undefinedSuperGetter = CompileTimeErrorCode( + 'UNDEFINED_SUPER_MEMBER', + "The getter '{0}' isn't defined in a superclass of '{1}'.", + correctionMessage: + "Try correcting the name to the name of an existing getter, or " + "defining a getter or field named '{0}' in a superclass.", + hasPublishedDocs: true, + uniqueName: 'UNDEFINED_SUPER_GETTER', + ); /// Parameters: /// String p0: the name of the method that is undefined /// String p1: the resolved type name that the method lookup is happening on - static const CompileTimeErrorCode UNDEFINED_SUPER_METHOD = - CompileTimeErrorCode( - 'UNDEFINED_SUPER_MEMBER', - "The method '{0}' isn't defined in a superclass of '{1}'.", - correctionMessage: - "Try correcting the name to the name of an existing method, or " - "defining a method named '{0}' in a superclass.", - hasPublishedDocs: true, - uniqueName: 'UNDEFINED_SUPER_METHOD', - ); + static const CompileTimeErrorCode undefinedSuperMethod = CompileTimeErrorCode( + 'UNDEFINED_SUPER_MEMBER', + "The method '{0}' isn't defined in a superclass of '{1}'.", + correctionMessage: + "Try correcting the name to the name of an existing method, or " + "defining a method named '{0}' in a superclass.", + hasPublishedDocs: true, + uniqueName: 'UNDEFINED_SUPER_METHOD', + ); /// Parameters: /// String p0: the name of the operator /// Type p1: the name of the enclosing type where the operator is being looked /// for - static const CompileTimeErrorCode UNDEFINED_SUPER_OPERATOR = + static const CompileTimeErrorCode undefinedSuperOperator = CompileTimeErrorCode( 'UNDEFINED_SUPER_MEMBER', "The operator '{0}' isn't defined in a superclass of '{1}'.", @@ -5839,16 +5815,15 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the setter /// Type p1: the name of the enclosing type where the setter is being looked /// for - static const CompileTimeErrorCode UNDEFINED_SUPER_SETTER = - CompileTimeErrorCode( - 'UNDEFINED_SUPER_MEMBER', - "The setter '{0}' isn't defined in a superclass of '{1}'.", - correctionMessage: - "Try correcting the name to the name of an existing setter, or " - "defining a setter or field named '{0}' in a superclass.", - hasPublishedDocs: true, - uniqueName: 'UNDEFINED_SUPER_SETTER', - ); + static const CompileTimeErrorCode undefinedSuperSetter = CompileTimeErrorCode( + 'UNDEFINED_SUPER_MEMBER', + "The setter '{0}' isn't defined in a superclass of '{1}'.", + correctionMessage: + "Try correcting the name to the name of an existing setter, or " + "defining a setter or field named '{0}' in a superclass.", + hasPublishedDocs: true, + uniqueName: 'UNDEFINED_SUPER_SETTER', + ); /// This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used /// when we are able to find the name defined in a supertype. It exists to @@ -5856,19 +5831,19 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the defining type - static const CompileTimeErrorCode - UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER = CompileTimeErrorCode( - 'UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', - "Static members from supertypes must be qualified by the name of the " - "defining type.", - correctionMessage: "Try adding '{0}.' before the name.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode unqualifiedReferenceToNonLocalStaticMember = + CompileTimeErrorCode( + 'UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', + "Static members from supertypes must be qualified by the name of the " + "defining type.", + correctionMessage: "Try adding '{0}.' before the name.", + hasPublishedDocs: true, + ); /// Parameters: /// String p0: the name of the defining type static const CompileTimeErrorCode - UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE = CompileTimeErrorCode( + unqualifiedReferenceToStaticMemberOfExtendedType = CompileTimeErrorCode( 'UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE', "Static members from the extended type or one of its superclasses must be " "qualified by the name of the defining type.", @@ -5878,7 +5853,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the URI pointing to a nonexistent file - static const CompileTimeErrorCode URI_DOES_NOT_EXIST = CompileTimeErrorCode( + static const CompileTimeErrorCode uriDoesNotExist = CompileTimeErrorCode( 'URI_DOES_NOT_EXIST', "Target of URI doesn't exist: '{0}'.", correctionMessage: @@ -5890,7 +5865,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the URI pointing to a nonexistent file static const CompileTimeErrorCode - URI_HAS_NOT_BEEN_GENERATED = CompileTimeErrorCode( + uriHasNotBeenGenerated = CompileTimeErrorCode( 'URI_HAS_NOT_BEEN_GENERATED', "Target of URI hasn't been generated: '{0}'.", correctionMessage: @@ -5900,16 +5875,14 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode URI_WITH_INTERPOLATION = - CompileTimeErrorCode( - 'URI_WITH_INTERPOLATION', - "URIs can't use string interpolation.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode uriWithInterpolation = CompileTimeErrorCode( + 'URI_WITH_INTERPOLATION', + "URIs can't use string interpolation.", + hasPublishedDocs: true, + ); /// No parameters. - static const CompileTimeErrorCode - USE_OF_NATIVE_EXTENSION = CompileTimeErrorCode( + static const CompileTimeErrorCode useOfNativeExtension = CompileTimeErrorCode( 'USE_OF_NATIVE_EXTENSION', "Dart native extensions are deprecated and aren't available in Dart 2.15.", correctionMessage: "Try using dart:ffi for C interop.", @@ -5917,7 +5890,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode USE_OF_VOID_RESULT = CompileTimeErrorCode( + static const CompileTimeErrorCode useOfVoidResult = CompileTimeErrorCode( 'USE_OF_VOID_RESULT', "This expression has a type of 'void' so its value can't be used.", correctionMessage: @@ -5928,7 +5901,7 @@ class CompileTimeErrorCode extends DiagnosticCode { ); /// No parameters. - static const CompileTimeErrorCode VALUES_DECLARATION_IN_ENUM = + static const CompileTimeErrorCode valuesDeclarationInEnum = CompileTimeErrorCode( 'VALUES_DECLARATION_IN_ENUM', "A member named 'values' can't be declared in an enum.", @@ -5939,15 +5912,13 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Object p0: the type of the object being assigned. /// Object p1: the type of the variable being assigned to - static const CompileTimeErrorCode VARIABLE_TYPE_MISMATCH = - CompileTimeErrorCode( - 'VARIABLE_TYPE_MISMATCH', - "A value of type '{0}' can't be assigned to a const variable of type " - "'{1}'.", - correctionMessage: - "Try using a subtype, or removing the 'const' keyword", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode variableTypeMismatch = CompileTimeErrorCode( + 'VARIABLE_TYPE_MISMATCH', + "A value of type '{0}' can't be assigned to a const variable of type " + "'{1}'.", + correctionMessage: "Try using a subtype, or removing the 'const' keyword", + hasPublishedDocs: true, + ); /// Let `C` be a generic class that declares a formal type parameter `X`, and /// assume that `T` is a direct superinterface of `C`. @@ -5965,7 +5936,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// superinterface {3} /// Object p3: the name of the superinterface static const CompileTimeErrorCode - WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE = CompileTimeErrorCode( + wrongExplicitTypeParameterVarianceInSuperinterface = CompileTimeErrorCode( 'WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE', "'{0}' is an '{1}' type parameter and can't be used in an '{2}' position " "in '{3}'.", @@ -5978,7 +5949,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the declared operator /// int p1: the number of parameters expected /// int p2: the number of parameters found in the operator declaration - static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = + static const CompileTimeErrorCode wrongNumberOfParametersForOperator = CompileTimeErrorCode( 'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', "Operator '{0}' should declare exactly {1} parameters, but {2} found.", @@ -5990,19 +5961,19 @@ class CompileTimeErrorCode extends DiagnosticCode { /// /// Parameters: /// int p0: the number of parameters found in the operator declaration - static const CompileTimeErrorCode - WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS = CompileTimeErrorCode( - 'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', - "Operator '-' should declare 0 or 1 parameter, but {0} found.", - hasPublishedDocs: true, - uniqueName: 'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', - ); + static const CompileTimeErrorCode wrongNumberOfParametersForOperatorMinus = + CompileTimeErrorCode( + 'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', + "Operator '-' should declare 0 or 1 parameter, but {0} found.", + hasPublishedDocs: true, + uniqueName: 'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', + ); /// Parameters: /// Object p0: the name of the type being referenced (G) /// int p1: the number of type parameters that were declared /// int p2: the number of type arguments provided - static const CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = + static const CompileTimeErrorCode wrongNumberOfTypeArguments = CompileTimeErrorCode( 'WRONG_NUMBER_OF_TYPE_ARGUMENTS', "The type '{0}' is declared with {1} type parameters, but {2} type " @@ -6017,7 +5988,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// int p0: the number of type parameters that were declared /// int p1: the number of type arguments provided static const CompileTimeErrorCode - WRONG_NUMBER_OF_TYPE_ARGUMENTS_ANONYMOUS_FUNCTION = CompileTimeErrorCode( + wrongNumberOfTypeArgumentsAnonymousFunction = CompileTimeErrorCode( 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION', "This function is declared with {0} type parameters, but {1} type " "arguments were given.", @@ -6030,7 +6001,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the class being instantiated /// String p1: the name of the constructor being invoked - static const CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR = + static const CompileTimeErrorCode wrongNumberOfTypeArgumentsConstructor = CompileTimeErrorCode( 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR', "The constructor '{0}.{1}' doesn't have type parameters.", @@ -6042,7 +6013,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the class being instantiated /// String p1: the name of the constructor being invoked static const CompileTimeErrorCode - WRONG_NUMBER_OF_TYPE_ARGUMENTS_DOT_SHORTHAND_CONSTRUCTOR = CompileTimeErrorCode( + wrongNumberOfTypeArgumentsDotShorthandConstructor = CompileTimeErrorCode( 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR', "The constructor '{0}.{1}` doesn't have type parameters.", correctionMessage: @@ -6055,7 +6026,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// int p0: the number of type parameters that were declared /// int p1: the number of type arguments provided - static const CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_ENUM = + static const CompileTimeErrorCode wrongNumberOfTypeArgumentsEnum = CompileTimeErrorCode( 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_ENUM', "The enum is declared with {0} type parameters, but {1} type arguments " @@ -6069,7 +6040,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// int p1: the number of type parameters that were declared /// int p2: the number of type arguments provided static const CompileTimeErrorCode - WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION = CompileTimeErrorCode( + wrongNumberOfTypeArgumentsExtension = CompileTimeErrorCode( 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION', "The extension '{0}' is declared with {1} type parameters, but {2} type " "arguments were given.", @@ -6081,7 +6052,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the function being referenced /// int p1: the number of type parameters that were declared /// int p2: the number of type arguments provided - static const CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION = + static const CompileTimeErrorCode wrongNumberOfTypeArgumentsFunction = CompileTimeErrorCode( 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION', "The function '{0}' is declared with {1} type parameters, but {2} type " @@ -6095,7 +6066,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the name of the method being referenced (G) /// int p1: the number of type parameters that were declared /// int p2: the number of type arguments provided - static const CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD = + static const CompileTimeErrorCode wrongNumberOfTypeArgumentsMethod = CompileTimeErrorCode( 'WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD', "The method '{0}' is declared with {1} type parameters, but {2} type " @@ -6112,7 +6083,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// String p0: the name of the type parameter /// Type p1: the name of the super interface static const CompileTimeErrorCode - WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE = CompileTimeErrorCode( + wrongTypeParameterVarianceInSuperinterface = CompileTimeErrorCode( 'WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE', "'{0}' can't be used contravariantly or invariantly in '{1}'.", correctionMessage: @@ -6138,7 +6109,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Object p1: the name of the type parameter /// Object p2: the variance position that the type parameter {1} is in static const CompileTimeErrorCode - WRONG_TYPE_PARAMETER_VARIANCE_POSITION = CompileTimeErrorCode( + wrongTypeParameterVariancePosition = CompileTimeErrorCode( 'WRONG_TYPE_PARAMETER_VARIANCE_POSITION', "The '{0}' type parameter '{1}' can't be used in an '{2}' position.", correctionMessage: @@ -6149,7 +6120,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// No parameters. static const CompileTimeErrorCode - YIELD_EACH_IN_NON_GENERATOR = CompileTimeErrorCode( + yieldEachInNonGenerator = CompileTimeErrorCode( 'YIELD_IN_NON_GENERATOR', "Yield-each statements must be in a generator function (one marked with " "either 'async*' or 'sync*').", @@ -6163,7 +6134,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Type p0: the type of the expression after `yield*` /// Type p1: the return type of the function containing the `yield*` static const CompileTimeErrorCode - YIELD_EACH_OF_INVALID_TYPE = CompileTimeErrorCode( + yieldEachOfInvalidType = CompileTimeErrorCode( 'YIELD_OF_INVALID_TYPE', "The type '{0}' implied by the 'yield*' expression must be assignable to " "'{1}'.", @@ -6175,8 +6146,7 @@ class CompileTimeErrorCode extends DiagnosticCode { /// function that is not a generator function. /// /// No parameters. - static const CompileTimeErrorCode - YIELD_IN_NON_GENERATOR = CompileTimeErrorCode( + static const CompileTimeErrorCode yieldInNonGenerator = CompileTimeErrorCode( 'YIELD_IN_NON_GENERATOR', "Yield statements must be in a generator function (one marked with either " "'async*' or 'sync*').", @@ -6188,12 +6158,11 @@ class CompileTimeErrorCode extends DiagnosticCode { /// Parameters: /// Type p0: the type of the expression after `yield` /// Type p1: the return type of the function containing the `yield` - static const CompileTimeErrorCode YIELD_OF_INVALID_TYPE = - CompileTimeErrorCode( - 'YIELD_OF_INVALID_TYPE', - "A yielded value of type '{0}' must be assignable to '{1}'.", - hasPublishedDocs: true, - ); + static const CompileTimeErrorCode yieldOfInvalidType = CompileTimeErrorCode( + 'YIELD_OF_INVALID_TYPE', + "A yielded value of type '{0}' must be assignable to '{1}'.", + hasPublishedDocs: true, + ); /// Initialize a newly created error code to have the given [name]. const CompileTimeErrorCode( @@ -6218,7 +6187,7 @@ class CompileTimeErrorCode extends DiagnosticCode { class StaticWarningCode extends DiagnosticCode { /// No parameters. - static const StaticWarningCode DEAD_NULL_AWARE_EXPRESSION = StaticWarningCode( + static const StaticWarningCode deadNullAwareExpression = StaticWarningCode( 'DEAD_NULL_AWARE_EXPRESSION', "The left operand can't be null, so the right operand is never executed.", correctionMessage: "Try removing the operator and the right operand.", @@ -6226,7 +6195,7 @@ class StaticWarningCode extends DiagnosticCode { ); /// No parameters. - static const StaticWarningCode INVALID_NULL_AWARE_ELEMENT = StaticWarningCode( + static const StaticWarningCode invalidNullAwareElement = StaticWarningCode( 'INVALID_NULL_AWARE_OPERATOR', "The element can't be null, so the null-aware operator '?' is unnecessary.", correctionMessage: "Try removing the operator '?'.", @@ -6235,7 +6204,7 @@ class StaticWarningCode extends DiagnosticCode { ); /// No parameters. - static const StaticWarningCode INVALID_NULL_AWARE_MAP_ENTRY_KEY = + static const StaticWarningCode invalidNullAwareMapEntryKey = StaticWarningCode( 'INVALID_NULL_AWARE_OPERATOR', "The map entry key can't be null, so the null-aware operator '?' is " @@ -6246,7 +6215,7 @@ class StaticWarningCode extends DiagnosticCode { ); /// No parameters. - static const StaticWarningCode INVALID_NULL_AWARE_MAP_ENTRY_VALUE = + static const StaticWarningCode invalidNullAwareMapEntryValue = StaticWarningCode( 'INVALID_NULL_AWARE_OPERATOR', "The map entry value can't be null, so the null-aware operator '?' is " @@ -6260,32 +6229,31 @@ class StaticWarningCode extends DiagnosticCode { /// String p0: the null-aware operator that is invalid /// String p1: the non-null-aware operator that can replace the invalid /// operator - static const StaticWarningCode INVALID_NULL_AWARE_OPERATOR = - StaticWarningCode( - 'INVALID_NULL_AWARE_OPERATOR', - "The receiver can't be null, so the null-aware operator '{0}' is " - "unnecessary.", - correctionMessage: "Try replacing the operator '{0}' with '{1}'.", - hasPublishedDocs: true, - ); + static const StaticWarningCode invalidNullAwareOperator = StaticWarningCode( + 'INVALID_NULL_AWARE_OPERATOR', + "The receiver can't be null, so the null-aware operator '{0}' is " + "unnecessary.", + correctionMessage: "Try replacing the operator '{0}' with '{1}'.", + hasPublishedDocs: true, + ); /// Parameters: /// Object p0: the null-aware operator that is invalid /// Object p1: the non-null-aware operator that can replace the invalid /// operator - static const StaticWarningCode - INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT = StaticWarningCode( - 'INVALID_NULL_AWARE_OPERATOR', - "The receiver can't be 'null' because of short-circuiting, so the " - "null-aware operator '{0}' can't be used.", - correctionMessage: "Try replacing the operator '{0}' with '{1}'.", - hasPublishedDocs: true, - uniqueName: 'INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT', - ); + static const StaticWarningCode invalidNullAwareOperatorAfterShortCircuit = + StaticWarningCode( + 'INVALID_NULL_AWARE_OPERATOR', + "The receiver can't be 'null' because of short-circuiting, so the " + "null-aware operator '{0}' can't be used.", + correctionMessage: "Try replacing the operator '{0}' with '{1}'.", + hasPublishedDocs: true, + uniqueName: 'INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT', + ); /// Parameters: /// String p0: the name of the constant that is missing - static const StaticWarningCode MISSING_ENUM_CONSTANT_IN_SWITCH = + static const StaticWarningCode missingEnumConstantInSwitch = StaticWarningCode( 'MISSING_ENUM_CONSTANT_IN_SWITCH', "Missing case clause for '{0}'.", @@ -6296,7 +6264,7 @@ class StaticWarningCode extends DiagnosticCode { ); /// No parameters. - static const StaticWarningCode UNNECESSARY_NON_NULL_ASSERTION = + static const StaticWarningCode unnecessaryNonNullAssertion = StaticWarningCode( 'UNNECESSARY_NON_NULL_ASSERTION', "The '!' will have no effect because the receiver can't be null.", @@ -6305,7 +6273,7 @@ class StaticWarningCode extends DiagnosticCode { ); /// No parameters. - static const StaticWarningCode UNNECESSARY_NULL_ASSERT_PATTERN = + static const StaticWarningCode unnecessaryNullAssertPattern = StaticWarningCode( 'UNNECESSARY_NULL_ASSERT_PATTERN', "The null-assert pattern will have no effect because the matched type " @@ -6317,7 +6285,7 @@ class StaticWarningCode extends DiagnosticCode { /// No parameters. static const StaticWarningCode - UNNECESSARY_NULL_CHECK_PATTERN = StaticWarningCode( + unnecessaryNullCheckPattern = StaticWarningCode( 'UNNECESSARY_NULL_CHECK_PATTERN', "The null-check pattern will have no effect because the matched type isn't " "nullable.", @@ -6351,7 +6319,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Type p0: the name of the actual argument type /// Type p1: the name of the expected function return type - static const WarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER = + static const WarningCode argumentTypeNotAssignableToErrorHandler = WarningCode( 'ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER', "The argument type '{0}' can't be assigned to the parameter type '{1} " @@ -6363,7 +6331,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the field or variable - static const WarningCode ASSIGNMENT_OF_DO_NOT_STORE = WarningCode( + static const WarningCode assignmentOfDoNotStore = WarningCode( 'ASSIGNMENT_OF_DO_NOT_STORE', "'{0}' is marked 'doNotStore' and shouldn't be assigned to a field or " "top-level variable.", @@ -6373,8 +6341,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Type p0: the return type as derived by the type of the [Future]. - static const WarningCode - BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR = WarningCode( + static const WarningCode bodyMightCompleteNormallyCatchError = WarningCode( 'BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR', "This 'onError' handler must return a value assignable to '{0}', but ends " "without returning a value.", @@ -6384,7 +6351,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Type p0: the name of the declared return type - static const WarningCode BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE = WarningCode( + static const WarningCode bodyMightCompleteNormallyNullable = WarningCode( 'BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE', "This function has a nullable return type of '{0}', but ends without " "returning a value.", @@ -6396,7 +6363,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the unassigned variable - static const WarningCode CAST_FROM_NULLABLE_ALWAYS_FAILS = WarningCode( + static const WarningCode castFromNullableAlwaysFails = WarningCode( 'CAST_FROM_NULLABLE_ALWAYS_FAILS', "This cast will always throw an exception because the nullable local " "variable '{0}' is not assigned.", @@ -6407,7 +6374,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode CAST_FROM_NULL_ALWAYS_FAILS = WarningCode( + static const WarningCode castFromNullAlwaysFails = WarningCode( 'CAST_FROM_NULL_ALWAYS_FAILS', "This cast always throws an exception because the expression always " "evaluates to 'null'.", @@ -6417,8 +6384,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Type p0: the matched value type /// Type p1: the constant value type - static const WarningCode - CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE = WarningCode( + static const WarningCode constantPatternNeverMatchesValueType = WarningCode( 'CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE', "The matched value type '{0}' can never be equal to this constant of type " "'{1}'.", @@ -6431,7 +6397,7 @@ class WarningCode extends DiagnosticCode { /// statement follows a return statement. /// /// No parameters. - static const WarningCode DEAD_CODE = WarningCode( + static const WarningCode deadCode = WarningCode( 'DEAD_CODE', "Dead code.", correctionMessage: @@ -6444,7 +6410,7 @@ class WarningCode extends DiagnosticCode { /// user has catch clauses after `catch (e)` or `on Object catch (e)`. /// /// No parameters. - static const WarningCode DEAD_CODE_CATCH_FOLLOWING_CATCH = WarningCode( + static const WarningCode deadCodeCatchFollowingCatch = WarningCode( 'DEAD_CODE_CATCH_FOLLOWING_CATCH', "Dead code: Catch clauses after a 'catch (e)' or an 'on Object catch (e)' " "are never reached.", @@ -6456,7 +6422,7 @@ class WarningCode extends DiagnosticCode { /// No parameters. static const WarningCode - DEAD_CODE_LATE_WILDCARD_VARIABLE_INITIALIZER = WarningCode( + deadCodeLateWildcardVariableInitializer = WarningCode( 'DEAD_CODE', "Dead code: The assigned-to wildcard variable is marked late and can never " "be referenced so this initializer will never be evaluated.", @@ -6474,7 +6440,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Type p0: name of the subtype /// Type p1: name of the supertype - static const WarningCode DEAD_CODE_ON_CATCH_SUBTYPE = WarningCode( + static const WarningCode deadCodeOnCatchSubtype = WarningCode( 'DEAD_CODE_ON_CATCH_SUBTYPE', "Dead code: This on-catch block won't be executed because '{0}' is a " "subtype of '{1}' and hence will have been caught already.", @@ -6486,7 +6452,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the element - static const WarningCode DEPRECATED_EXPORT_USE = WarningCode( + static const WarningCode deprecatedExportUse = WarningCode( 'DEPRECATED_EXPORT_USE', "The ability to import '{0}' indirectly is deprecated.", correctionMessage: "Try importing '{0}' directly.", @@ -6495,14 +6461,14 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the member - static const WarningCode DEPRECATED_EXTEND = WarningCode( + static const WarningCode deprecatedExtend = WarningCode( 'DEPRECATED_EXTEND', "Extending '{0}' is deprecated.", correctionMessage: "Try removing the 'extends' clause.", ); /// No parameters. - static const WarningCode DEPRECATED_EXTENDS_FUNCTION = WarningCode( + static const WarningCode deprecatedExtendsFunction = WarningCode( 'DEPRECATED_SUBTYPE_OF_FUNCTION', "Extending 'Function' is deprecated.", correctionMessage: "Try removing 'Function' from the 'extends' clause.", @@ -6512,14 +6478,14 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the member - static const WarningCode DEPRECATED_IMPLEMENT = WarningCode( + static const WarningCode deprecatedImplement = WarningCode( 'DEPRECATED_IMPLEMENT', "Implementing '{0}' is deprecated.", correctionMessage: "Try removing '{0}' from the 'implements' clause.", ); /// No parameters. - static const WarningCode DEPRECATED_IMPLEMENTS_FUNCTION = WarningCode( + static const WarningCode deprecatedImplementsFunction = WarningCode( 'DEPRECATED_SUBTYPE_OF_FUNCTION', "Implementing 'Function' has no effect.", correctionMessage: "Try removing 'Function' from the 'implements' clause.", @@ -6528,7 +6494,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode DEPRECATED_MIXIN_FUNCTION = WarningCode( + static const WarningCode deprecatedMixinFunction = WarningCode( 'DEPRECATED_SUBTYPE_OF_FUNCTION', "Mixing in 'Function' is deprecated.", correctionMessage: "Try removing 'Function' from the 'with' clause.", @@ -6537,7 +6503,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode DEPRECATED_NEW_IN_COMMENT_REFERENCE = WarningCode( + static const WarningCode deprecatedNewInCommentReference = WarningCode( 'DEPRECATED_NEW_IN_COMMENT_REFERENCE', "Using the 'new' keyword in a comment reference is deprecated.", correctionMessage: "Try referring to a constructor by its name.", @@ -6546,7 +6512,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the member - static const WarningCode DEPRECATED_SUBCLASS = WarningCode( + static const WarningCode deprecatedSubclass = WarningCode( 'DEPRECATED_SUBCLASS', "Subclassing '{0}' is deprecated.", correctionMessage: @@ -6557,7 +6523,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the doc directive argument /// String p1: the expected format - static const WarningCode DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT = WarningCode( + static const WarningCode docDirectiveArgumentWrongFormat = WarningCode( 'DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT', "The '{0}' argument must be formatted as {1}.", correctionMessage: "Try formatting '{0}' as {1}.", @@ -6567,7 +6533,7 @@ class WarningCode extends DiagnosticCode { /// String p0: the name of the doc directive /// int p1: the actual number of arguments /// int p2: the expected number of arguments - static const WarningCode DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS = WarningCode( + static const WarningCode docDirectiveHasExtraArguments = WarningCode( 'DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS', "The '{0}' directive has '{1}' arguments, but only '{2}' are expected.", correctionMessage: "Try removing the extra arguments.", @@ -6576,15 +6542,14 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the doc directive /// String p1: the name of the unexpected argument - static const WarningCode DOC_DIRECTIVE_HAS_UNEXPECTED_NAMED_ARGUMENT = - WarningCode( - 'DOC_DIRECTIVE_HAS_UNEXPECTED_NAMED_ARGUMENT', - "The '{0}' directive has an unexpected named argument, '{1}'.", - correctionMessage: "Try removing the unexpected argument.", - ); + static const WarningCode docDirectiveHasUnexpectedNamedArgument = WarningCode( + 'DOC_DIRECTIVE_HAS_UNEXPECTED_NAMED_ARGUMENT', + "The '{0}' directive has an unexpected named argument, '{1}'.", + correctionMessage: "Try removing the unexpected argument.", + ); /// No parameters. - static const WarningCode DOC_DIRECTIVE_MISSING_CLOSING_BRACE = WarningCode( + static const WarningCode docDirectiveMissingClosingBrace = WarningCode( 'DOC_DIRECTIVE_MISSING_CLOSING_BRACE', "Doc directive is missing a closing curly brace ('}').", correctionMessage: "Try closing the directive with a curly brace.", @@ -6592,7 +6557,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the corresponding doc directive tag - static const WarningCode DOC_DIRECTIVE_MISSING_CLOSING_TAG = WarningCode( + static const WarningCode docDirectiveMissingClosingTag = WarningCode( 'DOC_DIRECTIVE_MISSING_CLOSING_TAG', "Doc directive is missing a closing tag.", correctionMessage: @@ -6602,7 +6567,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the doc directive /// String p1: the name of the missing argument - static const WarningCode DOC_DIRECTIVE_MISSING_ONE_ARGUMENT = WarningCode( + static const WarningCode docDirectiveMissingOneArgument = WarningCode( 'DOC_DIRECTIVE_MISSING_ARGUMENT', "The '{0}' directive is missing a '{1}' argument.", correctionMessage: "Try adding a '{1}' argument before the closing '}'.", @@ -6611,7 +6576,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the corresponding doc directive tag - static const WarningCode DOC_DIRECTIVE_MISSING_OPENING_TAG = WarningCode( + static const WarningCode docDirectiveMissingOpeningTag = WarningCode( 'DOC_DIRECTIVE_MISSING_OPENING_TAG', "Doc directive is missing an opening tag.", correctionMessage: @@ -6623,7 +6588,7 @@ class WarningCode extends DiagnosticCode { /// String p1: the name of the first missing argument /// String p2: the name of the second missing argument /// String p3: the name of the third missing argument - static const WarningCode DOC_DIRECTIVE_MISSING_THREE_ARGUMENTS = WarningCode( + static const WarningCode docDirectiveMissingThreeArguments = WarningCode( 'DOC_DIRECTIVE_MISSING_ARGUMENT', "The '{0}' directive is missing a '{1}', a '{2}', and a '{3}' argument.", correctionMessage: @@ -6635,7 +6600,7 @@ class WarningCode extends DiagnosticCode { /// String p0: the name of the doc directive /// String p1: the name of the first missing argument /// String p2: the name of the second missing argument - static const WarningCode DOC_DIRECTIVE_MISSING_TWO_ARGUMENTS = WarningCode( + static const WarningCode docDirectiveMissingTwoArguments = WarningCode( 'DOC_DIRECTIVE_MISSING_ARGUMENT', "The '{0}' directive is missing a '{1}' and a '{2}' argument.", correctionMessage: @@ -6645,14 +6610,14 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the unknown doc directive. - static const WarningCode DOC_DIRECTIVE_UNKNOWN = WarningCode( + static const WarningCode docDirectiveUnknown = WarningCode( 'DOC_DIRECTIVE_UNKNOWN', "Doc directive '{0}' is unknown.", correctionMessage: "Try using one of the supported doc directives.", ); /// No parameters. - static const WarningCode DOC_IMPORT_CANNOT_BE_DEFERRED = WarningCode( + static const WarningCode docImportCannotBeDeferred = WarningCode( 'DOC_IMPORT_CANNOT_BE_DEFERRED', "Doc imports can't be deferred.", correctionMessage: "Try removing the 'deferred' keyword.", @@ -6660,7 +6625,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode DOC_IMPORT_CANNOT_HAVE_COMBINATORS = WarningCode( + static const WarningCode docImportCannotHaveCombinators = WarningCode( 'DOC_IMPORT_CANNOT_HAVE_COMBINATORS', "Doc imports can't have show or hide combinators.", correctionMessage: "Try removing the combinator.", @@ -6668,7 +6633,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode DOC_IMPORT_CANNOT_HAVE_CONFIGURATIONS = WarningCode( + static const WarningCode docImportCannotHaveConfigurations = WarningCode( 'DOC_IMPORT_CANNOT_HAVE_CONFIGURATIONS', "Doc imports can't have configurations.", correctionMessage: "Try removing the configurations.", @@ -6676,7 +6641,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode DOC_IMPORT_CANNOT_HAVE_PREFIX = WarningCode( + static const WarningCode docImportCannotHavePrefix = WarningCode( 'DOC_IMPORT_CANNOT_HAVE_PREFIX', "Doc imports can't have prefixes.", correctionMessage: "Try removing the prefix.", @@ -6686,7 +6651,7 @@ class WarningCode extends DiagnosticCode { /// Duplicate exports. /// /// No parameters. - static const WarningCode DUPLICATE_EXPORT = WarningCode( + static const WarningCode duplicateExport = WarningCode( 'DUPLICATE_EXPORT', "Duplicate export.", correctionMessage: "Try removing all but one export of the library.", @@ -6694,7 +6659,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode DUPLICATE_HIDDEN_NAME = WarningCode( + static const WarningCode duplicateHiddenName = WarningCode( 'DUPLICATE_HIDDEN_NAME', "Duplicate hidden name.", correctionMessage: @@ -6704,7 +6669,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the diagnostic being ignored - static const WarningCode DUPLICATE_IGNORE = WarningCode( + static const WarningCode duplicateIgnore = WarningCode( 'DUPLICATE_IGNORE', "The diagnostic '{0}' doesn't need to be ignored here because it's already " "being ignored.", @@ -6717,7 +6682,7 @@ class WarningCode extends DiagnosticCode { /// Duplicate imports. /// /// No parameters. - static const WarningCode DUPLICATE_IMPORT = WarningCode( + static const WarningCode duplicateImport = WarningCode( 'DUPLICATE_IMPORT', "Duplicate import.", correctionMessage: "Try removing all but one import of the library.", @@ -6725,7 +6690,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode DUPLICATE_SHOWN_NAME = WarningCode( + static const WarningCode duplicateShownName = WarningCode( 'DUPLICATE_SHOWN_NAME', "Duplicate shown name.", correctionMessage: @@ -6734,7 +6699,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode EQUAL_ELEMENTS_IN_SET = WarningCode( + static const WarningCode equalElementsInSet = WarningCode( 'EQUAL_ELEMENTS_IN_SET', "Two elements in a set literal shouldn't be equal.", correctionMessage: "Change or remove the duplicate element.", @@ -6742,7 +6707,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode EQUAL_KEYS_IN_MAP = WarningCode( + static const WarningCode equalKeysInMap = WarningCode( 'EQUAL_KEYS_IN_MAP', "Two keys in a map literal shouldn't be equal.", correctionMessage: "Change or remove the duplicate key.", @@ -6754,24 +6719,22 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the collection - static const WarningCode INFERENCE_FAILURE_ON_COLLECTION_LITERAL = - WarningCode( - 'INFERENCE_FAILURE_ON_COLLECTION_LITERAL', - "The type argument(s) of '{0}' can't be inferred.", - correctionMessage: "Use explicit type argument(s) for '{0}'.", - ); + static const WarningCode inferenceFailureOnCollectionLiteral = WarningCode( + 'INFERENCE_FAILURE_ON_COLLECTION_LITERAL', + "The type argument(s) of '{0}' can't be inferred.", + correctionMessage: "Use explicit type argument(s) for '{0}'.", + ); /// When "strict-inference" is enabled, types in function invocations must be /// inferred via the context type, or have type arguments. /// /// Parameters: /// String p0: the name of the function - static const WarningCode INFERENCE_FAILURE_ON_FUNCTION_INVOCATION = - WarningCode( - 'INFERENCE_FAILURE_ON_FUNCTION_INVOCATION', - "The type argument(s) of the function '{0}' can't be inferred.", - correctionMessage: "Use explicit type argument(s) for '{0}'.", - ); + static const WarningCode inferenceFailureOnFunctionInvocation = WarningCode( + 'INFERENCE_FAILURE_ON_FUNCTION_INVOCATION', + "The type argument(s) of the function '{0}' can't be inferred.", + correctionMessage: "Use explicit type argument(s) for '{0}'.", + ); /// When "strict-inference" is enabled, recursive local functions, top-level /// functions, methods, and function-typed function parameters must all @@ -6781,25 +6744,23 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the function or method - static const WarningCode INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE = - WarningCode( - 'INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE', - "The return type of '{0}' cannot be inferred.", - correctionMessage: "Declare the return type of '{0}'.", - ); + static const WarningCode inferenceFailureOnFunctionReturnType = WarningCode( + 'INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE', + "The return type of '{0}' cannot be inferred.", + correctionMessage: "Declare the return type of '{0}'.", + ); /// When "strict-inference" is enabled, types in function invocations must be /// inferred via the context type, or have type arguments. /// /// Parameters: /// String p0: the name of the type - static const WarningCode INFERENCE_FAILURE_ON_GENERIC_INVOCATION = - WarningCode( - 'INFERENCE_FAILURE_ON_GENERIC_INVOCATION', - "The type argument(s) of the generic function type '{0}' can't be " - "inferred.", - correctionMessage: "Use explicit type argument(s) for '{0}'.", - ); + static const WarningCode inferenceFailureOnGenericInvocation = WarningCode( + 'INFERENCE_FAILURE_ON_GENERIC_INVOCATION', + "The type argument(s) of the generic function type '{0}' can't be " + "inferred.", + correctionMessage: "Use explicit type argument(s) for '{0}'.", + ); /// When "strict-inference" is enabled, types in instance creation /// (constructor calls) must be inferred via the context type, or have type @@ -6807,7 +6768,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the constructor - static const WarningCode INFERENCE_FAILURE_ON_INSTANCE_CREATION = WarningCode( + static const WarningCode inferenceFailureOnInstanceCreation = WarningCode( 'INFERENCE_FAILURE_ON_INSTANCE_CREATION', "The type argument(s) of the constructor '{0}' can't be inferred.", correctionMessage: "Use explicit type argument(s) for '{0}'.", @@ -6819,7 +6780,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the variable static const WarningCode - INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE = WarningCode( + inferenceFailureOnUninitializedVariable = WarningCode( 'INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE', "The type of {0} can't be inferred without either a type or initializer.", correctionMessage: "Try specifying the type of the variable.", @@ -6830,7 +6791,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the parameter - static const WarningCode INFERENCE_FAILURE_ON_UNTYPED_PARAMETER = WarningCode( + static const WarningCode inferenceFailureOnUntypedParameter = WarningCode( 'INFERENCE_FAILURE_ON_UNTYPED_PARAMETER', "The type of {0} can't be inferred; a type must be explicitly provided.", correctionMessage: "Try specifying the type of the parameter.", @@ -6839,21 +6800,21 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the annotation /// String p1: the list of valid targets - static const WarningCode INVALID_ANNOTATION_TARGET = WarningCode( + static const WarningCode invalidAnnotationTarget = WarningCode( 'INVALID_ANNOTATION_TARGET', "The annotation '{0}' can only be used on {1}.", hasPublishedDocs: true, ); /// No parameters. - static const WarningCode INVALID_AWAIT_NOT_REQUIRED_ANNOTATION = WarningCode( + static const WarningCode invalidAwaitNotRequiredAnnotation = WarningCode( 'INVALID_AWAIT_NOT_REQUIRED_ANNOTATION', "The annotation 'awaitNotRequired' can only be applied to a " "Future-returning function, or a Future-typed field.", ); /// No parameters. - static const WarningCode INVALID_DEPRECATED_EXTEND_ANNOTATION = WarningCode( + static const WarningCode invalidDeprecatedExtendAnnotation = WarningCode( 'INVALID_DEPRECATED_EXTEND_ANNOTATION', "The annotation '@Deprecated.extend' can only be applied to extendable " "classes.", @@ -6861,17 +6822,15 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode INVALID_DEPRECATED_IMPLEMENT_ANNOTATION = - WarningCode( - 'INVALID_DEPRECATED_IMPLEMENT_ANNOTATION', - "The annotation '@Deprecated.implement' can only be applied to " - "implementable classes.", - correctionMessage: - "Try removing the '@Deprecated.implement' annotation.", - ); + static const WarningCode invalidDeprecatedImplementAnnotation = WarningCode( + 'INVALID_DEPRECATED_IMPLEMENT_ANNOTATION', + "The annotation '@Deprecated.implement' can only be applied to " + "implementable classes.", + correctionMessage: "Try removing the '@Deprecated.implement' annotation.", + ); /// No parameters. - static const WarningCode INVALID_DEPRECATED_SUBCLASS_ANNOTATION = WarningCode( + static const WarningCode invalidDeprecatedSubclassAnnotation = WarningCode( 'INVALID_DEPRECATED_SUBCLASS_ANNOTATION', "The annotation '@Deprecated.subclass' can only be applied to subclassable " "classes and mixins.", @@ -6880,7 +6839,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the element - static const WarningCode INVALID_EXPORT_OF_INTERNAL_ELEMENT = WarningCode( + static const WarningCode invalidExportOfInternalElement = WarningCode( 'INVALID_EXPORT_OF_INTERNAL_ELEMENT', "The member '{0}' can't be exported as a part of a package's public API.", correctionMessage: "Try using a hide clause to hide '{0}'.", @@ -6892,7 +6851,7 @@ class WarningCode extends DiagnosticCode { /// String p1: the name of the exported element that indirectly exposes the /// internal element static const WarningCode - INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY = WarningCode( + invalidExportOfInternalElementIndirectly = WarningCode( 'INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY', "The member '{0}' can't be exported as a part of a package's public API, " "but is indirectly exported as part of the signature of '{1}'.", @@ -6902,7 +6861,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: The name of the method - static const WarningCode INVALID_FACTORY_METHOD_DECL = WarningCode( + static const WarningCode invalidFactoryMethodDecl = WarningCode( 'INVALID_FACTORY_METHOD_DECL', "Factory method '{0}' must have a return type.", hasPublishedDocs: true, @@ -6910,14 +6869,14 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method - static const WarningCode INVALID_FACTORY_METHOD_IMPL = WarningCode( + static const WarningCode invalidFactoryMethodImpl = WarningCode( 'INVALID_FACTORY_METHOD_IMPL', "Factory method '{0}' doesn't return a newly allocated object.", hasPublishedDocs: true, ); /// No parameters. - static const WarningCode INVALID_INTERNAL_ANNOTATION = WarningCode( + static const WarningCode invalidInternalAnnotation = WarningCode( 'INVALID_INTERNAL_ANNOTATION', "Only public elements in a package's private API can be annotated as being " "internal.", @@ -6925,20 +6884,18 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN = - WarningCode( - 'INVALID_LANGUAGE_VERSION_OVERRIDE', - "The Dart language version override number must begin with '@dart'.", - correctionMessage: - "Specify a Dart language version override with a comment like '// " - "@dart = 2.0'.", - hasPublishedDocs: true, - uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN', - ); + static const WarningCode invalidLanguageVersionOverrideAtSign = WarningCode( + 'INVALID_LANGUAGE_VERSION_OVERRIDE', + "The Dart language version override number must begin with '@dart'.", + correctionMessage: + "Specify a Dart language version override with a comment like '// " + "@dart = 2.0'.", + hasPublishedDocs: true, + uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN', + ); /// No parameters. - static const WarningCode - INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS = WarningCode( + static const WarningCode invalidLanguageVersionOverrideEquals = WarningCode( 'INVALID_LANGUAGE_VERSION_OVERRIDE', "The Dart language version override comment must be specified with an '=' " "character.", @@ -6952,8 +6909,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the latest major version /// Object p1: the latest minor version - static const WarningCode - INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER = WarningCode( + static const WarningCode invalidLanguageVersionOverrideGreater = WarningCode( 'INVALID_LANGUAGE_VERSION_OVERRIDE', "The language version override can't specify a version greater than the " "latest known language version: {0}.{1}.", @@ -6963,8 +6919,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode - INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION = WarningCode( + static const WarningCode invalidLanguageVersionOverrideLocation = WarningCode( 'INVALID_LANGUAGE_VERSION_OVERRIDE', "The language version override must be specified before any declaration or " "directive.", @@ -6975,7 +6930,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE = + static const WarningCode invalidLanguageVersionOverrideLowerCase = WarningCode( 'INVALID_LANGUAGE_VERSION_OVERRIDE', "The Dart language version override comment must be specified with the " @@ -6988,47 +6943,45 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER = - WarningCode( - 'INVALID_LANGUAGE_VERSION_OVERRIDE', - "The Dart language version override comment must be specified with a " - "version number, like '2.0', after the '=' character.", - correctionMessage: - "Specify a Dart language version override with a comment like '// " - "@dart = 2.0'.", - hasPublishedDocs: true, - uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER', - ); - - /// No parameters. - static const WarningCode INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX = - WarningCode( - 'INVALID_LANGUAGE_VERSION_OVERRIDE', - "The Dart language version override number can't be prefixed with a " - "letter.", - correctionMessage: - "Specify a Dart language version override with a comment like '// " - "@dart = 2.0'.", - hasPublishedDocs: true, - uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX', - ); - - /// No parameters. - static const WarningCode - INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS = WarningCode( + static const WarningCode invalidLanguageVersionOverrideNumber = WarningCode( 'INVALID_LANGUAGE_VERSION_OVERRIDE', - "The Dart language version override comment can't be followed by any " - "non-whitespace characters.", + "The Dart language version override comment must be specified with a " + "version number, like '2.0', after the '=' character.", correctionMessage: "Specify a Dart language version override with a comment like '// " "@dart = 2.0'.", hasPublishedDocs: true, - uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS', + uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER', ); + /// No parameters. + static const WarningCode invalidLanguageVersionOverridePrefix = WarningCode( + 'INVALID_LANGUAGE_VERSION_OVERRIDE', + "The Dart language version override number can't be prefixed with a " + "letter.", + correctionMessage: + "Specify a Dart language version override with a comment like '// " + "@dart = 2.0'.", + hasPublishedDocs: true, + uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX', + ); + + /// No parameters. + static const WarningCode invalidLanguageVersionOverrideTrailingCharacters = + WarningCode( + 'INVALID_LANGUAGE_VERSION_OVERRIDE', + "The Dart language version override comment can't be followed by any " + "non-whitespace characters.", + correctionMessage: + "Specify a Dart language version override with a comment like '// " + "@dart = 2.0'.", + hasPublishedDocs: true, + uniqueName: 'INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS', + ); + /// No parameters. static const WarningCode - INVALID_LANGUAGE_VERSION_OVERRIDE_TWO_SLASHES = WarningCode( + invalidLanguageVersionOverrideTwoSlashes = WarningCode( 'INVALID_LANGUAGE_VERSION_OVERRIDE', "The Dart language version override comment must be specified with exactly " "two slashes.", @@ -7040,7 +6993,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode INVALID_LITERAL_ANNOTATION = WarningCode( + static const WarningCode invalidLiteralAnnotation = WarningCode( 'INVALID_LITERAL_ANNOTATION', "Only const constructors can have the `@literal` annotation.", hasPublishedDocs: true, @@ -7050,7 +7003,7 @@ class WarningCode extends DiagnosticCode { /// other than a non-abstract instance member in a class or mixin. /// /// No parameters. - static const WarningCode INVALID_NON_VIRTUAL_ANNOTATION = WarningCode( + static const WarningCode invalidNonVirtualAnnotation = WarningCode( 'INVALID_NON_VIRTUAL_ANNOTATION', "The annotation '@nonVirtual' can only be applied to a concrete instance " "member.", @@ -7064,7 +7017,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member /// String p1: the name of the defining class - static const WarningCode INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER = WarningCode( + static const WarningCode invalidOverrideOfNonVirtualMember = WarningCode( 'INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER', "The member '{0}' is declared non-virtual in '{1}' and can't be overridden " "in subclasses.", @@ -7075,7 +7028,7 @@ class WarningCode extends DiagnosticCode { /// did not reopen any type. /// /// No parameters. - static const WarningCode INVALID_REOPEN_ANNOTATION = WarningCode( + static const WarningCode invalidReopenAnnotation = WarningCode( 'INVALID_REOPEN_ANNOTATION', "The annotation '@reopen' can only be applied to a class that opens " "capabilities that the supertype intentionally disallows.", @@ -7088,7 +7041,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the member - static const WarningCode INVALID_REQUIRED_NAMED_PARAM = WarningCode( + static const WarningCode invalidRequiredNamedParam = WarningCode( 'INVALID_REQUIRED_NAMED_PARAM', "The type parameter '{0}' is annotated with @required but only named " "parameters without a default value can be annotated with it.", @@ -7100,8 +7053,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the member - static const WarningCode - INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM = WarningCode( + static const WarningCode invalidRequiredOptionalPositionalParam = WarningCode( 'INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM', "Incorrect use of the annotation @required on the optional positional " "parameter '{0}'. Optional positional parameters cannot be required.", @@ -7113,7 +7065,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the member - static const WarningCode INVALID_REQUIRED_POSITIONAL_PARAM = WarningCode( + static const WarningCode invalidRequiredPositionalParam = WarningCode( 'INVALID_REQUIRED_POSITIONAL_PARAM', "Redundant use of the annotation @required on the required positional " "parameter '{0}'.", @@ -7122,7 +7074,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member - static const WarningCode INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER = WarningCode( + static const WarningCode invalidUseOfDoNotSubmitMember = WarningCode( 'INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER', "Uses of '{0}' should not be submitted to source control.", correctionMessage: "Try removing the reference to '{0}'.", @@ -7131,7 +7083,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member - static const WarningCode INVALID_USE_OF_INTERNAL_MEMBER = WarningCode( + static const WarningCode invalidUseOfInternalMember = WarningCode( 'INVALID_USE_OF_INTERNAL_MEMBER', "The member '{0}' can only be used within its package.", hasPublishedDocs: true, @@ -7143,7 +7095,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member /// String p1: the name of the defining class - static const WarningCode INVALID_USE_OF_PROTECTED_MEMBER = WarningCode( + static const WarningCode invalidUseOfProtectedMember = WarningCode( 'INVALID_USE_OF_PROTECTED_MEMBER', "The member '{0}' can only be used within instance members of subclasses " "of '{1}'.", @@ -7152,12 +7104,11 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member - static const WarningCode INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER = - WarningCode( - 'INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER', - "The member '{0}' can only be used for overriding.", - hasPublishedDocs: true, - ); + static const WarningCode invalidUseOfVisibleForOverridingMember = WarningCode( + 'INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER', + "The member '{0}' can only be used for overriding.", + hasPublishedDocs: true, + ); /// This warning is generated anywhere where a member annotated with /// `@visibleForTemplate` is used outside of a "template" Dart file. @@ -7165,11 +7116,10 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member /// Uri p1: the name of the defining class - static const WarningCode INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER = - WarningCode( - 'INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER', - "The member '{0}' can only be used within '{1}' or a template library.", - ); + static const WarningCode invalidUseOfVisibleForTemplateMember = WarningCode( + 'INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER', + "The member '{0}' can only be used within '{1}' or a template library.", + ); /// This warning is generated anywhere where a member annotated with /// `@visibleForTesting` is used outside the defining library, or a test. @@ -7177,12 +7127,11 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member /// Uri p1: the name of the defining class - static const WarningCode INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER = - WarningCode( - 'INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER', - "The member '{0}' can only be used within '{1}' or a test.", - hasPublishedDocs: true, - ); + static const WarningCode invalidUseOfVisibleForTestingMember = WarningCode( + 'INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER', + "The member '{0}' can only be used within '{1}' or a test.", + hasPublishedDocs: true, + ); /// This warning is generated anywhere where a private declaration is /// annotated with `@visibleForTemplate` or `@visibleForTesting`. @@ -7190,7 +7139,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member /// String p1: the name of the annotation - static const WarningCode INVALID_VISIBILITY_ANNOTATION = WarningCode( + static const WarningCode invalidVisibilityAnnotation = WarningCode( 'INVALID_VISIBILITY_ANNOTATION', "The member '{0}' is annotated with '{1}', but this annotation is only " "meaningful on declarations of public members.", @@ -7198,17 +7147,16 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION = - WarningCode( - 'INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION', - "The annotation 'visibleForOverriding' can only be applied to a public " - "instance member that can be overridden.", - hasPublishedDocs: true, - ); + static const WarningCode invalidVisibleForOverridingAnnotation = WarningCode( + 'INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION', + "The annotation 'visibleForOverriding' can only be applied to a public " + "instance member that can be overridden.", + hasPublishedDocs: true, + ); /// No parameters. static const WarningCode - INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION = WarningCode( + invalidVisibleOutsideTemplateAnnotation = WarningCode( 'INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION', "The annotation 'visibleOutsideTemplate' can only be applied to a member " "of a class, enum, or mixin that is annotated with " @@ -7217,7 +7165,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode INVALID_WIDGET_PREVIEW_APPLICATION = WarningCode( + static const WarningCode invalidWidgetPreviewApplication = WarningCode( 'INVALID_WIDGET_PREVIEW_APPLICATION', "The '@Preview(...)' annotation can only be applied to public, statically " "accessible constructors and functions.", @@ -7227,8 +7175,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the private symbol /// String p1: the name of the proposed public symbol equivalent - static const WarningCode - INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT = WarningCode( + static const WarningCode invalidWidgetPreviewPrivateArgument = WarningCode( 'INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT', "'@Preview(...)' can only accept arguments that consist of literals and " "public symbols.", @@ -7238,20 +7185,19 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the member - static const WarningCode MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE = - WarningCode( - 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN', - "Missing concrete implementation of '{0}'.", - correctionMessage: "Try overriding the missing member.", - hasPublishedDocs: true, - uniqueName: 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE', - ); + static const WarningCode missingOverrideOfMustBeOverriddenOne = WarningCode( + 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN', + "Missing concrete implementation of '{0}'.", + correctionMessage: "Try overriding the missing member.", + hasPublishedDocs: true, + uniqueName: 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE', + ); /// Parameters: /// String p0: the name of the first member /// String p1: the name of the second member /// String p2: the number of additional missing members that aren't listed - static const WarningCode MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_THREE_PLUS = + static const WarningCode missingOverrideOfMustBeOverriddenThreePlus = WarningCode( 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN', "Missing concrete implementations of '{0}', '{1}', and {2} more.", @@ -7263,21 +7209,20 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the first member /// String p1: the name of the second member - static const WarningCode MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO = - WarningCode( - 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN', - "Missing concrete implementations of '{0}' and '{1}'.", - correctionMessage: "Try overriding the missing members.", - hasPublishedDocs: true, - uniqueName: 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO', - ); + static const WarningCode missingOverrideOfMustBeOverriddenTwo = WarningCode( + 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN', + "Missing concrete implementations of '{0}' and '{1}'.", + correctionMessage: "Try overriding the missing members.", + hasPublishedDocs: true, + uniqueName: 'MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO', + ); /// Generates a warning for a constructor, function or method invocation where /// a required parameter is missing. /// /// Parameters: /// String p0: the name of the parameter - static const WarningCode MISSING_REQUIRED_PARAM = WarningCode( + static const WarningCode missingRequiredParam = WarningCode( 'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required.", hasPublishedDocs: true, @@ -7289,7 +7234,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the parameter /// String p1: message details - static const WarningCode MISSING_REQUIRED_PARAM_WITH_DETAILS = WarningCode( + static const WarningCode missingRequiredParamWithDetails = WarningCode( 'MISSING_REQUIRED_PARAM', "The parameter '{0}' is required. {1}.", hasPublishedDocs: true, @@ -7301,7 +7246,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the sealed class - static const WarningCode MIXIN_ON_SEALED_CLASS = WarningCode( + static const WarningCode mixinOnSealedClass = WarningCode( 'MIXIN_ON_SEALED_CLASS', "The class '{0}' shouldn't be used as a mixin constraint because it is " "sealed, and any class mixing in this mixin must have '{0}' as a " @@ -7313,7 +7258,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode MULTIPLE_COMBINATORS = WarningCode( + static const WarningCode multipleCombinators = WarningCode( 'MULTIPLE_COMBINATORS', "Using multiple 'hide' or 'show' combinators is never necessary and often " "produces surprising results.", @@ -7326,7 +7271,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the class - static const WarningCode MUST_BE_IMMUTABLE = WarningCode( + static const WarningCode mustBeImmutable = WarningCode( 'MUST_BE_IMMUTABLE', "This class (or a class that this class inherits from) is marked as " "'@immutable', but one or more of its instance fields aren't final: " @@ -7336,7 +7281,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the class declaring the overridden method - static const WarningCode MUST_CALL_SUPER = WarningCode( + static const WarningCode mustCallSuper = WarningCode( 'MUST_CALL_SUPER', "This method overrides a method annotated as '@mustCallSuper' in '{0}', " "but doesn't invoke the overridden method.", @@ -7345,7 +7290,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the argument - static const WarningCode NON_CONST_ARGUMENT_FOR_CONST_PARAMETER = WarningCode( + static const WarningCode nonConstArgumentForConstParameter = WarningCode( 'NON_CONST_ARGUMENT_FOR_CONST_PARAMETER', "Argument '{0}' must be a constant.", correctionMessage: "Try replacing the argument with a constant.", @@ -7357,7 +7302,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the class defining the annotated constructor - static const WarningCode NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR = WarningCode( + static const WarningCode nonConstCallToLiteralConstructor = WarningCode( 'NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR', "This instance creation must be 'const', because the {0} constructor is " "marked as '@literal'.", @@ -7371,7 +7316,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the class defining the annotated constructor static const WarningCode - NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR_USING_NEW = WarningCode( + nonConstCallToLiteralConstructorUsingNew = WarningCode( 'NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR', "This instance creation must be 'const', because the {0} constructor is " "marked as '@literal'.", @@ -7381,7 +7326,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode NON_NULLABLE_EQUALS_PARAMETER = WarningCode( + static const WarningCode nonNullableEqualsParameter = WarningCode( 'NON_NULLABLE_EQUALS_PARAMETER', "The parameter type of '==' operators should be non-nullable.", correctionMessage: "Try using a non-nullable type.", @@ -7389,7 +7334,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode NULLABLE_TYPE_IN_CATCH_CLAUSE = WarningCode( + static const WarningCode nullableTypeInCatchClause = WarningCode( 'NULLABLE_TYPE_IN_CATCH_CLAUSE', "A potentially nullable type can't be used in an 'on' clause because it " "isn't valid to throw a nullable expression.", @@ -7400,7 +7345,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the method being invoked /// String p1: the type argument associated with the method - static const WarningCode NULL_ARGUMENT_TO_NON_NULL_TYPE = WarningCode( + static const WarningCode nullArgumentToNonNullType = WarningCode( 'NULL_ARGUMENT_TO_NON_NULL_TYPE', "'{0}' shouldn't be called with a 'null' argument for the non-nullable " "type argument '{1}'.", @@ -7409,7 +7354,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode NULL_CHECK_ALWAYS_FAILS = WarningCode( + static const WarningCode nullCheckAlwaysFails = WarningCode( 'NULL_CHECK_ALWAYS_FAILS', "This null-check will always throw an exception because the expression " "will always evaluate to 'null'.", @@ -7419,7 +7364,7 @@ class WarningCode extends DiagnosticCode { /// A field with the override annotation does not override a getter or setter. /// /// No parameters. - static const WarningCode OVERRIDE_ON_NON_OVERRIDING_FIELD = WarningCode( + static const WarningCode overrideOnNonOverridingField = WarningCode( 'OVERRIDE_ON_NON_OVERRIDING_MEMBER', "The field doesn't override an inherited getter or setter.", correctionMessage: @@ -7432,7 +7377,7 @@ class WarningCode extends DiagnosticCode { /// A getter with the override annotation does not override an existing getter. /// /// No parameters. - static const WarningCode OVERRIDE_ON_NON_OVERRIDING_GETTER = WarningCode( + static const WarningCode overrideOnNonOverridingGetter = WarningCode( 'OVERRIDE_ON_NON_OVERRIDING_MEMBER', "The getter doesn't override an inherited getter.", correctionMessage: @@ -7445,7 +7390,7 @@ class WarningCode extends DiagnosticCode { /// A method with the override annotation does not override an existing method. /// /// No parameters. - static const WarningCode OVERRIDE_ON_NON_OVERRIDING_METHOD = WarningCode( + static const WarningCode overrideOnNonOverridingMethod = WarningCode( 'OVERRIDE_ON_NON_OVERRIDING_MEMBER', "The method doesn't override an inherited method.", correctionMessage: @@ -7458,7 +7403,7 @@ class WarningCode extends DiagnosticCode { /// A setter with the override annotation does not override an existing setter. /// /// No parameters. - static const WarningCode OVERRIDE_ON_NON_OVERRIDING_SETTER = WarningCode( + static const WarningCode overrideOnNonOverridingSetter = WarningCode( 'OVERRIDE_ON_NON_OVERRIDING_MEMBER', "The setter doesn't override an inherited setter.", correctionMessage: @@ -7471,7 +7416,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Type p0: the matched value type /// Type p1: the required pattern type - static const WarningCode PATTERN_NEVER_MATCHES_VALUE_TYPE = WarningCode( + static const WarningCode patternNeverMatchesValueType = WarningCode( 'PATTERN_NEVER_MATCHES_VALUE_TYPE', "The matched value type '{0}' can never match the required type '{1}'.", correctionMessage: "Try using a different pattern.", @@ -7489,7 +7434,7 @@ class WarningCode extends DiagnosticCode { /// the call are unreachable. /// /// No parameters. - static const WarningCode RECEIVER_OF_TYPE_NEVER = WarningCode( + static const WarningCode receiverOfTypeNever = WarningCode( 'RECEIVER_OF_TYPE_NEVER', "The receiver is of type 'Never', and will never complete with a value.", correctionMessage: @@ -7500,7 +7445,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the kind of member - static const WarningCode REDECLARE_ON_NON_REDECLARING_MEMBER = WarningCode( + static const WarningCode redeclareOnNonRedeclaringMember = WarningCode( 'REDECLARE_ON_NON_REDECLARING_MEMBER', "The {0} doesn't redeclare a {0} declared in a superinterface.", correctionMessage: @@ -7514,7 +7459,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the rule name /// Object p1: the SDK version in which the lint was removed - static const WarningCode REMOVED_LINT_USE = WarningCode( + static const WarningCode removedLintUse = WarningCode( 'REMOVED_LINT_USE', "'{0}' was removed in Dart '{1}'", correctionMessage: "Remove the reference to '{0}'.", @@ -7526,7 +7471,7 @@ class WarningCode extends DiagnosticCode { /// Object p0: the rule name /// Object p1: the SDK version in which the lint was removed /// Object p2: the name of a replacing lint - static const WarningCode REPLACED_LINT_USE = WarningCode( + static const WarningCode replacedLintUse = WarningCode( 'REPLACED_LINT_USE', "'{0}' was replaced by '{2}' in Dart '{1}'.", correctionMessage: "Replace '{0}' with '{1}'.", @@ -7535,7 +7480,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the annotated function being invoked /// String p1: the name of the function containing the return - static const WarningCode RETURN_OF_DO_NOT_STORE = WarningCode( + static const WarningCode returnOfDoNotStore = WarningCode( 'RETURN_OF_DO_NOT_STORE', "'{0}' is annotated with 'doNotStore' and shouldn't be returned unless " "'{1}' is also annotated.", @@ -7546,8 +7491,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Type p0: the return type as declared in the return statement /// Type p1: the expected return type as defined by the type of the Future - static const WarningCode - RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR = WarningCode( + static const WarningCode returnOfInvalidTypeFromCatchError = WarningCode( 'INVALID_RETURN_TYPE_FOR_CATCH_ERROR', "A value of type '{0}' can't be returned by the 'onError' handler because " "it must be assignable to '{1}'.", @@ -7558,7 +7502,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Type p0: the return type of the function /// Type p1: the expected return type as defined by the type of the Future - static const WarningCode RETURN_TYPE_INVALID_FOR_CATCH_ERROR = WarningCode( + static const WarningCode returnTypeInvalidForCatchError = WarningCode( 'INVALID_RETURN_TYPE_FOR_CATCH_ERROR', "The return type '{0}' isn't assignable to '{1}', as required by " "'Future.catchError'.", @@ -7572,7 +7516,7 @@ class WarningCode extends DiagnosticCode { /// until resolution (like `List.filled;`). /// /// No parameters. - static const WarningCode SDK_VERSION_CONSTRUCTOR_TEAROFFS = WarningCode( + static const WarningCode sdkVersionConstructorTearoffs = WarningCode( 'SDK_VERSION_CONSTRUCTOR_TEAROFFS', "Tearing off a constructor requires the 'constructor-tearoffs' language " "feature.", @@ -7583,7 +7527,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode SDK_VERSION_GT_GT_GT_OPERATOR = WarningCode( + static const WarningCode sdkVersionGtGtGtOperator = WarningCode( 'SDK_VERSION_GT_GT_GT_OPERATOR', "The operator '>>>' wasn't supported until version 2.14.0, but this code " "is required to be able to run on earlier versions.", @@ -7594,7 +7538,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the version specified in the `@Since()` annotation /// String p1: the SDK version constraints - static const WarningCode SDK_VERSION_SINCE = WarningCode( + static const WarningCode sdkVersionSince = WarningCode( 'SDK_VERSION_SINCE', "This API is available since SDK {0}, but constraints '{1}' don't " "guarantee it.", @@ -7608,7 +7552,7 @@ class WarningCode extends DiagnosticCode { /// /// Parameters: /// Type p0: the name of the generic type - static const WarningCode STRICT_RAW_TYPE = WarningCode( + static const WarningCode strictRawType = WarningCode( 'STRICT_RAW_TYPE', "The generic type '{0}' should have explicit type arguments but doesn't.", correctionMessage: "Use explicit type arguments for '{0}'.", @@ -7616,7 +7560,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the sealed class - static const WarningCode SUBTYPE_OF_SEALED_CLASS = WarningCode( + static const WarningCode subtypeOfSealedClass = WarningCode( 'SUBTYPE_OF_SEALED_CLASS', "The class '{0}' shouldn't be extended, mixed in, or implemented because " "it's sealed.", @@ -7628,7 +7572,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the unicode sequence of the code point. - static const WarningCode TEXT_DIRECTION_CODE_POINT_IN_COMMENT = WarningCode( + static const WarningCode textDirectionCodePointInComment = WarningCode( 'TEXT_DIRECTION_CODE_POINT_IN_COMMENT', "The Unicode code point 'U+{0}' changes the appearance of text from how " "it's interpreted by the compiler.", @@ -7640,7 +7584,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the unicode sequence of the code point. - static const WarningCode TEXT_DIRECTION_CODE_POINT_IN_LITERAL = WarningCode( + static const WarningCode textDirectionCodePointInLiteral = WarningCode( 'TEXT_DIRECTION_CODE_POINT_IN_LITERAL', "The Unicode code point 'U+{0}' changes the appearance of text from how " "it's interpreted by the compiler.", @@ -7651,7 +7595,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode TYPE_CHECK_IS_NOT_NULL = WarningCode( + static const WarningCode typeCheckIsNotNull = WarningCode( 'TYPE_CHECK_WITH_NULL', "Tests for non-null should be done with '!= null'.", correctionMessage: "Try replacing the 'is! Null' check with '!= null'.", @@ -7660,7 +7604,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode TYPE_CHECK_IS_NULL = WarningCode( + static const WarningCode typeCheckIsNull = WarningCode( 'TYPE_CHECK_WITH_NULL', "Tests for null should be done with '== null'.", correctionMessage: "Try replacing the 'is Null' check with '== null'.", @@ -7671,7 +7615,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the library being imported /// String p1: the name in the hide clause that isn't defined in the library - static const WarningCode UNDEFINED_HIDDEN_NAME = WarningCode( + static const WarningCode undefinedHiddenName = WarningCode( 'UNDEFINED_HIDDEN_NAME', "The library '{0}' doesn't export a member with the hidden name '{1}'.", correctionMessage: "Try removing the name from the list of hidden members.", @@ -7681,7 +7625,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the undefined parameter /// String p1: the name of the targeted member - static const WarningCode UNDEFINED_REFERENCED_PARAMETER = WarningCode( + static const WarningCode undefinedReferencedParameter = WarningCode( 'UNDEFINED_REFERENCED_PARAMETER', "The parameter '{0}' isn't defined by '{1}'.", hasPublishedDocs: true, @@ -7690,7 +7634,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the library being imported /// String p1: the name in the show clause that isn't defined in the library - static const WarningCode UNDEFINED_SHOWN_NAME = WarningCode( + static const WarningCode undefinedShownName = WarningCode( 'UNDEFINED_SHOWN_NAME', "The library '{0}' doesn't export a member with the shown name '{1}'.", correctionMessage: "Try removing the name from the list of shown members.", @@ -7699,7 +7643,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the non-diagnostic being ignored - static const WarningCode UNIGNORABLE_IGNORE = WarningCode( + static const WarningCode unignorableIgnore = WarningCode( 'UNIGNORABLE_IGNORE', "The diagnostic '{0}' can't be ignored.", correctionMessage: @@ -7708,7 +7652,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_CAST = WarningCode( + static const WarningCode unnecessaryCast = WarningCode( 'UNNECESSARY_CAST', "Unnecessary cast.", correctionMessage: "Try removing the cast.", @@ -7716,14 +7660,14 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_CAST_PATTERN = WarningCode( + static const WarningCode unnecessaryCastPattern = WarningCode( 'UNNECESSARY_CAST_PATTERN', "Unnecessary cast pattern.", correctionMessage: "Try removing the cast pattern.", ); /// No parameters. - static const WarningCode UNNECESSARY_FINAL = WarningCode( + static const WarningCode unnecessaryFinal = WarningCode( 'UNNECESSARY_FINAL', "The keyword 'final' isn't necessary because the parameter is implicitly " "'final'.", @@ -7732,7 +7676,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_NAN_COMPARISON_FALSE = WarningCode( + static const WarningCode unnecessaryNanComparisonFalse = WarningCode( 'UNNECESSARY_NAN_COMPARISON', "A double can't equal 'double.nan', so the condition is always 'false'.", correctionMessage: "Try using 'double.isNan', or removing the condition.", @@ -7741,7 +7685,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_NAN_COMPARISON_TRUE = WarningCode( + static const WarningCode unnecessaryNanComparisonTrue = WarningCode( 'UNNECESSARY_NAN_COMPARISON', "A double can't equal 'double.nan', so the condition is always 'true'.", correctionMessage: "Try using 'double.isNan', or removing the condition.", @@ -7750,7 +7694,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_NO_SUCH_METHOD = WarningCode( + static const WarningCode unnecessaryNoSuchMethod = WarningCode( 'UNNECESSARY_NO_SUCH_METHOD', "Unnecessary 'noSuchMethod' declaration.", correctionMessage: "Try removing the declaration of 'noSuchMethod'.", @@ -7758,7 +7702,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE = + static const WarningCode unnecessaryNullComparisonAlwaysNullFalse = WarningCode( 'UNNECESSARY_NULL_COMPARISON', "The operand must be 'null', so the condition is always 'false'.", @@ -7768,7 +7712,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE = + static const WarningCode unnecessaryNullComparisonAlwaysNullTrue = WarningCode( 'UNNECESSARY_NULL_COMPARISON', "The operand must be 'null', so the condition is always 'true'.", @@ -7778,7 +7722,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE = + static const WarningCode unnecessaryNullComparisonNeverNullFalse = WarningCode( 'UNNECESSARY_NULL_COMPARISON', "The operand can't be 'null', so the condition is always 'false'.", @@ -7790,25 +7734,24 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE = - WarningCode( - 'UNNECESSARY_NULL_COMPARISON', - "The operand can't be 'null', so the condition is always 'true'.", - correctionMessage: "Remove the condition.", - hasPublishedDocs: true, - uniqueName: 'UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE', - ); + static const WarningCode unnecessaryNullComparisonNeverNullTrue = WarningCode( + 'UNNECESSARY_NULL_COMPARISON', + "The operand can't be 'null', so the condition is always 'true'.", + correctionMessage: "Remove the condition.", + hasPublishedDocs: true, + uniqueName: 'UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE', + ); /// Parameters: /// String p0: the name of the type - static const WarningCode UNNECESSARY_QUESTION_MARK = WarningCode( + static const WarningCode unnecessaryQuestionMark = WarningCode( 'UNNECESSARY_QUESTION_MARK', "The '?' is unnecessary because '{0}' is nullable without it.", hasPublishedDocs: true, ); /// No parameters. - static const WarningCode UNNECESSARY_SET_LITERAL = WarningCode( + static const WarningCode unnecessarySetLiteral = WarningCode( 'UNNECESSARY_SET_LITERAL', "Braces unnecessarily wrap this expression in a set literal.", correctionMessage: "Try removing the set literal around the expression.", @@ -7816,7 +7759,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_TYPE_CHECK_FALSE = WarningCode( + static const WarningCode unnecessaryTypeCheckFalse = WarningCode( 'UNNECESSARY_TYPE_CHECK', "Unnecessary type check; the result is always 'false'.", correctionMessage: @@ -7826,7 +7769,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_TYPE_CHECK_TRUE = WarningCode( + static const WarningCode unnecessaryTypeCheckTrue = WarningCode( 'UNNECESSARY_TYPE_CHECK', "Unnecessary type check; the result is always 'true'.", correctionMessage: @@ -7836,7 +7779,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNNECESSARY_WILDCARD_PATTERN = WarningCode( + static const WarningCode unnecessaryWildcardPattern = WarningCode( 'UNNECESSARY_WILDCARD_PATTERN', "Unnecessary wildcard pattern.", correctionMessage: "Try removing the wildcard pattern.", @@ -7844,7 +7787,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNREACHABLE_SWITCH_CASE = WarningCode( + static const WarningCode unreachableSwitchCase = WarningCode( 'UNREACHABLE_SWITCH_CASE', "This case is covered by the previous cases.", correctionMessage: @@ -7854,7 +7797,7 @@ class WarningCode extends DiagnosticCode { ); /// No parameters. - static const WarningCode UNREACHABLE_SWITCH_DEFAULT = WarningCode( + static const WarningCode unreachableSwitchDefault = WarningCode( 'UNREACHABLE_SWITCH_DEFAULT', "This default clause is covered by the previous cases.", correctionMessage: @@ -7865,7 +7808,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the exception variable - static const WarningCode UNUSED_CATCH_CLAUSE = WarningCode( + static const WarningCode unusedCatchClause = WarningCode( 'UNUSED_CATCH_CLAUSE', "The exception variable '{0}' isn't used, so the 'catch' clause can be " "removed.", @@ -7875,7 +7818,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the stack trace variable - static const WarningCode UNUSED_CATCH_STACK = WarningCode( + static const WarningCode unusedCatchStack = WarningCode( 'UNUSED_CATCH_STACK', "The stack trace variable '{0}' isn't used and can be removed.", correctionMessage: "Try removing the stack trace variable, or using it.", @@ -7884,16 +7827,19 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name that is declared but not referenced - static const WarningCode UNUSED_ELEMENT = WarningCode( + static const WarningCode unusedElement = WarningCode( 'UNUSED_ELEMENT', "The declaration '{0}' isn't referenced.", correctionMessage: "Try removing the declaration of '{0}'.", hasPublishedDocs: true, ); + @Deprecated("Please use unusedElement") + static const WarningCode UNUSED_ELEMENT = unusedElement; + /// Parameters: /// Object p0: the name of the parameter that is declared but not used - static const WarningCode UNUSED_ELEMENT_PARAMETER = WarningCode( + static const WarningCode unusedElementParameter = WarningCode( 'UNUSED_ELEMENT_PARAMETER', "A value for optional parameter '{0}' isn't ever given.", correctionMessage: "Try removing the unused parameter.", @@ -7902,7 +7848,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the unused field - static const WarningCode UNUSED_FIELD = WarningCode( + static const WarningCode unusedField = WarningCode( 'UNUSED_FIELD', "The value of the field '{0}' isn't used.", correctionMessage: "Try removing the field, or using it.", @@ -7911,16 +7857,19 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the content of the unused import's URI - static const WarningCode UNUSED_IMPORT = WarningCode( + static const WarningCode unusedImport = WarningCode( 'UNUSED_IMPORT', "Unused import: '{0}'.", correctionMessage: "Try removing the import directive.", hasPublishedDocs: true, ); + @Deprecated("Please use unusedImport") + static const WarningCode UNUSED_IMPORT = unusedImport; + /// Parameters: /// String p0: the label that isn't used - static const WarningCode UNUSED_LABEL = WarningCode( + static const WarningCode unusedLabel = WarningCode( 'UNUSED_LABEL', "The label '{0}' isn't used.", correctionMessage: @@ -7931,16 +7880,19 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the unused variable - static const WarningCode UNUSED_LOCAL_VARIABLE = WarningCode( + static const WarningCode unusedLocalVariable = WarningCode( 'UNUSED_LOCAL_VARIABLE', "The value of the local variable '{0}' isn't used.", correctionMessage: "Try removing the variable or using it.", hasPublishedDocs: true, ); + @Deprecated("Please use unusedLocalVariable") + static const WarningCode UNUSED_LOCAL_VARIABLE = unusedLocalVariable; + /// Parameters: /// String p0: the name of the annotated method, property or function - static const WarningCode UNUSED_RESULT = WarningCode( + static const WarningCode unusedResult = WarningCode( 'UNUSED_RESULT', "The value of '{0}' should be used.", correctionMessage: @@ -7956,7 +7908,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the annotated method, property or function /// Object p1: message details - static const WarningCode UNUSED_RESULT_WITH_MESSAGE = WarningCode( + static const WarningCode unusedResultWithMessage = WarningCode( 'UNUSED_RESULT', "'{0}' should be used. {1}.", correctionMessage: @@ -7968,7 +7920,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name that is shown but not used - static const WarningCode UNUSED_SHOWN_NAME = WarningCode( + static const WarningCode unusedShownName = WarningCode( 'UNUSED_SHOWN_NAME', "The name {0} is shown, but isn't used.", correctionMessage: "Try removing the name from the list of shown members.", @@ -7977,7 +7929,7 @@ class WarningCode extends DiagnosticCode { /// Parameters: /// String p0: the URI pointing to a nonexistent file - static const WarningCode URI_DOES_NOT_EXIST_IN_DOC_IMPORT = WarningCode( + static const WarningCode uriDoesNotExistInDocImport = WarningCode( 'URI_DOES_NOT_EXIST_IN_DOC_IMPORT', "Target of URI doesn't exist: '{0}'.", correctionMessage: diff --git a/pkg/analyzer/lib/src/error/const_argument_verifier.dart b/pkg/analyzer/lib/src/error/const_argument_verifier.dart index 78374407994..fcfb744c7f5 100644 --- a/pkg/analyzer/lib/src/error/const_argument_verifier.dart +++ b/pkg/analyzer/lib/src/error/const_argument_verifier.dart @@ -33,7 +33,7 @@ class ConstArgumentsVerifier extends SimpleAstVisitor { // depends on the value of the left hand side. _diagnosticReporter.atNode( node.rightHandSide, - WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, + WarningCode.nonConstArgumentForConstParameter, arguments: [node.rightHandSide], ); } @@ -113,7 +113,7 @@ class ConstArgumentsVerifier extends SimpleAstVisitor { if (!_isConst(resolvedArgument)) { _diagnosticReporter.atNode( argument, - WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, + WarningCode.nonConstArgumentForConstParameter, arguments: [parameterName], ); } diff --git a/pkg/analyzer/lib/src/error/constructor_fields_verifier.dart b/pkg/analyzer/lib/src/error/constructor_fields_verifier.dart index e02238bcf22..ab72ae56486 100644 --- a/pkg/analyzer/lib/src/error/constructor_fields_verifier.dart +++ b/pkg/analyzer/lib/src/error/constructor_fields_verifier.dart @@ -150,19 +150,19 @@ class _Constructor { if (names.length == 1) { diagnosticReporter.atNode( node.returnType, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, + CompileTimeErrorCode.finalNotInitializedConstructor1, arguments: names, ); } else if (names.length == 2) { diagnosticReporter.atNode( node.returnType, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2, + CompileTimeErrorCode.finalNotInitializedConstructor2, arguments: names, ); } else { diagnosticReporter.atNode( node.returnType, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS, + CompileTimeErrorCode.finalNotInitializedConstructor3Plus, arguments: [names[0], names[1], names.length - 2], ); } @@ -179,8 +179,7 @@ class _Constructor { for (var name in names) { diagnosticReporter.atNode( node.returnType, - CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + CompileTimeErrorCode.notInitializedNonNullableInstanceFieldConstructor, arguments: [name], ); } @@ -206,19 +205,18 @@ class _Constructor { diagnosticReporter.atNode( fieldName, CompileTimeErrorCode - .FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, + .fieldInitializedInInitializerAndDeclaration, ); } } else if (state == _InitState.initInFieldFormal) { diagnosticReporter.atNode( fieldName, - CompileTimeErrorCode - .FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, + CompileTimeErrorCode.fieldInitializedInParameterAndInitializer, ); } else if (state == _InitState.initInInitializer) { diagnosticReporter.atNode( fieldName, - CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, + CompileTimeErrorCode.fieldInitializedByMultipleInitializers, arguments: [fieldElement.displayName], ); } @@ -244,8 +242,7 @@ class _Constructor { if (fieldElement.isFinal || fieldElement.isConst) { diagnosticReporter.atToken( formalParameter.name, - CompileTimeErrorCode - .FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, + CompileTimeErrorCode.finalInitializedInDeclarationAndConstructor, arguments: [fieldElement.displayName], ); } diff --git a/pkg/analyzer/lib/src/error/correct_override.dart b/pkg/analyzer/lib/src/error/correct_override.dart index 63e1deed24d..cbe9c27a030 100644 --- a/pkg/analyzer/lib/src/error/correct_override.dart +++ b/pkg/analyzer/lib/src/error/correct_override.dart @@ -124,7 +124,7 @@ class CovariantParametersVerifier { // `superMember.enclosingElement3.name` are non-`null`. errorReporter.atEntity( errorEntity, - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, arguments: [ _thisMember.name!, _thisMember.enclosingElement!.name!, diff --git a/pkg/analyzer/lib/src/error/dead_code_verifier.dart b/pkg/analyzer/lib/src/error/dead_code_verifier.dart index 6ccb355fdfe..1f24aef281e 100644 --- a/pkg/analyzer/lib/src/error/dead_code_verifier.dart +++ b/pkg/analyzer/lib/src/error/dead_code_verifier.dart @@ -77,7 +77,7 @@ class DeadCodeVerifier extends RecursiveAstVisitor { if (_wildCardVariablesEnabled && element is LocalFunctionElement && element.name == '_') { - _diagnosticReporter.atNode(node, WarningCode.DEAD_CODE); + _diagnosticReporter.atNode(node, WarningCode.deadCode); } super.visitFunctionDeclaration(node); } @@ -127,7 +127,7 @@ class DeadCodeVerifier extends RecursiveAstVisitor { element.name == '_') { _diagnosticReporter.atNode( initializer, - WarningCode.DEAD_CODE_LATE_WILDCARD_VARIABLE_INITIALIZER, + WarningCode.deadCodeLateWildcardVariableInitializer, ); } } @@ -145,10 +145,10 @@ class DeadCodeVerifier extends RecursiveAstVisitor { DiagnosticCode warningCode; if (combinator is HideCombinator) { names = combinator.hiddenNames; - warningCode = WarningCode.UNDEFINED_HIDDEN_NAME; + warningCode = WarningCode.undefinedHiddenName; } else { names = (combinator as ShowCombinator).shownNames; - warningCode = WarningCode.UNDEFINED_SHOWN_NAME; + warningCode = WarningCode.undefinedShownName; } for (SimpleIdentifier name in names) { String nameStr = name.name; @@ -173,7 +173,7 @@ class DeadCodeVerifier extends RecursiveAstVisitor { for (Label label in labelTracker.unusedLabels()) { _diagnosticReporter.atNode( label, - WarningCode.UNUSED_LABEL, + WarningCode.unusedLabel, arguments: [label.label.name], ); } @@ -234,7 +234,7 @@ class NullSafetyDeadCodeVerifier { } if (node is SwitchMember && node == firstDeadNode) { - _diagnosticReporter.atToken(node.keyword, WarningCode.DEAD_CODE); + _diagnosticReporter.atToken(node.keyword, WarningCode.deadCode); _firstDeadNode = null; return; } @@ -284,7 +284,7 @@ class NullSafetyDeadCodeVerifier { _diagnosticReporter.atOffset( offset: parent.offset, length: parent.end - parent.offset, - diagnosticCode: WarningCode.DEAD_CODE, + diagnosticCode: WarningCode.deadCode, ); offset = node.end; } else if (parent is DoStatement) { @@ -297,7 +297,7 @@ class NullSafetyDeadCodeVerifier { _diagnosticReporter.atOffset( offset: whileOffset, length: whileEnd - whileOffset, - diagnosticCode: WarningCode.DEAD_CODE, + diagnosticCode: WarningCode.deadCode, ); offset = parent.semicolon.next!.offset; if (parent.hasBreakStatement) { @@ -318,7 +318,7 @@ class NullSafetyDeadCodeVerifier { _diagnosticReporter.atOffset( offset: offset, length: length, - diagnosticCode: WarningCode.DEAD_CODE, + diagnosticCode: WarningCode.deadCode, ); } } @@ -360,7 +360,7 @@ class NullSafetyDeadCodeVerifier { _diagnosticReporter.atOffset( offset: beginToken.offset, length: endToken.end - beginToken.offset, - diagnosticCode: WarningCode.DEAD_CODE, + diagnosticCode: WarningCode.deadCode, ); } } @@ -498,7 +498,7 @@ class NullSafetyDeadCodeVerifier { _diagnosticReporter.atOffset( offset: operator.offset, length: node.end - operator.offset, - diagnosticCode: WarningCode.DEAD_CODE, + diagnosticCode: WarningCode.deadCode, ); } } @@ -551,7 +551,7 @@ class _CatchClausesVerifier { _reportDiagnostic( catchClauses[index + 1], catchClauses.last, - WarningCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, + WarningCode.deadCodeCatchFollowingCatch, const [], ); _done = true; @@ -566,7 +566,7 @@ class _CatchClausesVerifier { _reportDiagnostic( catchClause, catchClauses.last, - WarningCode.DEAD_CODE_ON_CATCH_SUBTYPE, + WarningCode.deadCodeOnCatchSubtype, [currentType, type], ); _done = true; diff --git a/pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart b/pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart index f3dea80f0e4..87b484af799 100644 --- a/pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart +++ b/pkg/analyzer/lib/src/error/deprecated_functionality_verifier.dart @@ -48,13 +48,13 @@ class DeprecatedFunctionalityVerifier { if (element.hasDeprecatedWithField('_isExtend')) { _diagnosticReporter.atNode( node, - WarningCode.DEPRECATED_EXTEND, + WarningCode.deprecatedExtend, arguments: [element.name!], ); } else if (element.hasDeprecatedWithField('_isSubclass')) { _diagnosticReporter.atNode( node, - WarningCode.DEPRECATED_SUBCLASS, + WarningCode.deprecatedSubclass, arguments: [element.name!], ); } @@ -71,13 +71,13 @@ class DeprecatedFunctionalityVerifier { if (element.hasDeprecatedWithField('_isImplement')) { _diagnosticReporter.atNode( namedType, - WarningCode.DEPRECATED_IMPLEMENT, + WarningCode.deprecatedImplement, arguments: [element.name!], ); } else if (element.hasDeprecatedWithField('_isSubclass')) { _diagnosticReporter.atNode( namedType, - WarningCode.DEPRECATED_SUBCLASS, + WarningCode.deprecatedSubclass, arguments: [element.name!], ); } @@ -95,7 +95,7 @@ class DeprecatedFunctionalityVerifier { if (element.hasDeprecatedWithField('_isSubclass')) { _diagnosticReporter.atNode( namedType, - WarningCode.DEPRECATED_SUBCLASS, + WarningCode.deprecatedSubclass, arguments: [element.name!], ); } 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 9efed632078..e7b0b1760ee 100644 --- a/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart +++ b/pkg/analyzer/lib/src/error/deprecated_member_use_verifier.dart @@ -341,8 +341,8 @@ class DeprecatedMemberUseVerifier extends BaseDeprecatedMemberUseVerifier { _diagnosticReporter.atEntity( errorEntity, _isLibraryInWorkspacePackage(library) - ? HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE - : HintCode.DEPRECATED_MEMBER_USE, + ? HintCode.deprecatedMemberUseFromSamePackage + : HintCode.deprecatedMemberUse, arguments: [displayName], ); } else { @@ -354,8 +354,8 @@ class DeprecatedMemberUseVerifier extends BaseDeprecatedMemberUseVerifier { _diagnosticReporter.atEntity( errorEntity, _isLibraryInWorkspacePackage(library) - ? HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE - : HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE, + ? HintCode.deprecatedMemberUseFromSamePackageWithMessage + : HintCode.deprecatedMemberUseWithMessage, arguments: [displayName, message], ); } diff --git a/pkg/analyzer/lib/src/error/doc_comment_verifier.dart b/pkg/analyzer/lib/src/error/doc_comment_verifier.dart index 390b875b244..df4e3b3cf82 100644 --- a/pkg/analyzer/lib/src/error/doc_comment_verifier.dart +++ b/pkg/analyzer/lib/src/error/doc_comment_verifier.dart @@ -37,7 +37,7 @@ class DocCommentVerifier { if (deferredKeyword != null) { _diagnosticReporter.atToken( deferredKeyword, - WarningCode.DOC_IMPORT_CANNOT_BE_DEFERRED, + WarningCode.docImportCannotBeDeferred, ); } var configurations = docImport.import.configurations; @@ -45,7 +45,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: configurations.first.offset, length: configurations.last.end - configurations.first.offset, - diagnosticCode: WarningCode.DOC_IMPORT_CANNOT_HAVE_CONFIGURATIONS, + diagnosticCode: WarningCode.docImportCannotHaveConfigurations, ); } @@ -55,7 +55,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: combinators.first.offset, length: combinators.last.end - combinators.first.offset, - diagnosticCode: WarningCode.DOC_IMPORT_CANNOT_HAVE_COMBINATORS, + diagnosticCode: WarningCode.docImportCannotHaveCombinators, ); } @@ -67,7 +67,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: prefix.offset, length: prefix.end - prefix.offset, - diagnosticCode: WarningCode.DOC_IMPORT_CANNOT_HAVE_PREFIX, + diagnosticCode: WarningCode.docImportCannotHavePrefix, ); } } @@ -83,7 +83,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: tag.offset, length: tag.end - tag.offset, - diagnosticCode: WarningCode.DOC_DIRECTIVE_MISSING_ONE_ARGUMENT, + diagnosticCode: WarningCode.docDirectiveMissingOneArgument, arguments: [tag.type.name, required.last.name], ); } else if (gap == 2) { @@ -94,7 +94,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: tag.offset, length: tag.end - tag.offset, - diagnosticCode: WarningCode.DOC_DIRECTIVE_MISSING_TWO_ARGUMENTS, + diagnosticCode: WarningCode.docDirectiveMissingTwoArguments, arguments: [tag.type.name, ...missingArguments], ); } else if (gap == 3) { @@ -106,7 +106,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: tag.offset, length: tag.end - tag.offset, - diagnosticCode: WarningCode.DOC_DIRECTIVE_MISSING_THREE_ARGUMENTS, + diagnosticCode: WarningCode.docDirectiveMissingThreeArguments, arguments: [tag.type.name, ...missingArguments], ); } @@ -124,7 +124,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: errorOffset, length: errorLength, - diagnosticCode: WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS, + diagnosticCode: WarningCode.docDirectiveHasExtraArguments, arguments: [tag.type.name, positionalArgumentCount, requiredCount], ); } @@ -134,8 +134,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: namedArgument.offset, length: namedArgument.end - namedArgument.offset, - diagnosticCode: - WarningCode.DOC_DIRECTIVE_HAS_UNEXPECTED_NAMED_ARGUMENT, + diagnosticCode: WarningCode.docDirectiveHasUnexpectedNamedArgument, arguments: [tag.type.name, namedArgument.name], ); } @@ -156,7 +155,7 @@ class DocCommentVerifier { _diagnosticReporter.atOffset( offset: argument.offset, length: argument.end - argument.offset, - diagnosticCode: WarningCode.DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT, + diagnosticCode: WarningCode.docDirectiveArgumentWrongFormat, arguments: [parameter.name, parameter.expectedFormat.displayString], ); } diff --git a/pkg/analyzer/lib/src/error/duplicate_definition_verifier.dart b/pkg/analyzer/lib/src/error/duplicate_definition_verifier.dart index da3debd0c47..9b58ca1e26b 100644 --- a/pkg/analyzer/lib/src/error/duplicate_definition_verifier.dart +++ b/pkg/analyzer/lib/src/error/duplicate_definition_verifier.dart @@ -44,7 +44,7 @@ class DuplicateDefinitionVerifier { _diagnosticReporter.reportError( _diagnosticFactory.duplicateDefinitionForNodes( _diagnosticReporter.source, - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, stackTraceParameter, exceptionParameter, [exceptionName], @@ -202,7 +202,7 @@ class DuplicateDefinitionVerifier { if (libraryDeclarations.withName(name) case var existing?) { _diagnosticReporter.reportError( _diagnosticFactory.duplicateDefinition( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, importPrefix.firstFragment, existing as ElementImpl, [name], @@ -305,9 +305,9 @@ class DuplicateDefinitionVerifier { DiagnosticCode getDiagnostic(ElementImpl previous, FragmentImpl current) { if (previous is FieldFormalParameterElement && current is FieldFormalParameterFragment) { - return CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER; + return CompileTimeErrorCode.duplicateFieldFormalParameter; } - return CompileTimeErrorCode.DUPLICATE_DEFINITION; + return CompileTimeErrorCode.duplicateDefinition; } if (fragment is SetterFragment) { @@ -413,12 +413,12 @@ class MemberDuplicateDefinitionVerifier { if (name == 'new') { _diagnosticReporter.atConstructorDeclaration( member, - CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, + CompileTimeErrorCode.duplicateConstructorDefault, ); } else { _diagnosticReporter.atConstructorDeclaration( member, - CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, + CompileTimeErrorCode.duplicateConstructorName, arguments: [name], ); } @@ -491,7 +491,7 @@ class MemberDuplicateDefinitionVerifier { String className = firstFragment.name ?? ''; _diagnosticReporter.atToken( identifier, - CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, + CompileTimeErrorCode.conflictingStaticAndInstance, arguments: [className, name, className], ); } @@ -507,7 +507,7 @@ class MemberDuplicateDefinitionVerifier { String className = firstFragment.name ?? ''; _diagnosticReporter.atToken( identifier, - CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, + CompileTimeErrorCode.conflictingStaticAndInstance, arguments: [className, name, className], ); } @@ -540,13 +540,13 @@ class MemberDuplicateDefinitionVerifier { CompileTimeErrorCode errorCode; if (staticMember2.isSynthetic) { errorCode = - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD; + CompileTimeErrorCode.conflictingConstructorAndStaticField; } else if (staticMember2 is GetterElementImpl) { errorCode = - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_GETTER; + CompileTimeErrorCode.conflictingConstructorAndStaticGetter; } else { errorCode = - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_SETTER; + CompileTimeErrorCode.conflictingConstructorAndStaticSetter; } _diagnosticReporter.atElement2( constructor.asElement2, @@ -556,16 +556,15 @@ class MemberDuplicateDefinitionVerifier { case _ScopeEntryElement(element: MethodElementImpl()): _diagnosticReporter.atElement2( constructor.asElement2, - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD, + CompileTimeErrorCode.conflictingConstructorAndStaticMethod, arguments: [name], ); case _ScopeEntryGetterSetterPair(): _diagnosticReporter.atElement2( constructor.asElement2, state.getter.isSynthetic - ? CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD - : CompileTimeErrorCode - .CONFLICTING_CONSTRUCTOR_AND_STATIC_GETTER, + ? CompileTimeErrorCode.conflictingConstructorAndStaticField + : CompileTimeErrorCode.conflictingConstructorAndStaticGetter, arguments: [name], ); case _ScopeEntryElement(:var element): @@ -620,7 +619,7 @@ class MemberDuplicateDefinitionVerifier { if (!identical(previous, fragment.element)) { _diagnosticReporter.reportError( _diagnosticFactory.duplicateDefinition( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, originFragment ?? fragment, previous, [name], @@ -643,7 +642,7 @@ class MemberDuplicateDefinitionVerifier { if (constant.name.lexeme == declarationName) { _diagnosticReporter.atToken( constant.name, - CompileTimeErrorCode.ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING, + CompileTimeErrorCode.enumConstantSameNameAsEnclosing, ); } var constantFragment = constant.declaredFragment!; @@ -662,7 +661,7 @@ class MemberDuplicateDefinitionVerifier { if (declarationName == 'values') { _diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.ENUM_WITH_NAME_VALUES, + CompileTimeErrorCode.enumWithNameValues, ); } @@ -678,7 +677,7 @@ class MemberDuplicateDefinitionVerifier { if (inherited is InternalMethodElement) { _diagnosticReporter.atElement2( accessor.asElement2, - CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, + CompileTimeErrorCode.conflictingFieldAndMethod, arguments: [ firstFragment.displayName, baseName, @@ -700,7 +699,7 @@ class MemberDuplicateDefinitionVerifier { if (inherited is InternalPropertyAccessorElement) { _diagnosticReporter.atElement2( method.asElement2, - CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, + CompileTimeErrorCode.conflictingMethodAndField, arguments: [ firstFragment.displayName, baseName, @@ -729,7 +728,7 @@ class MemberDuplicateDefinitionVerifier { if (instance != null && baseName != 'values') { _diagnosticReporter.atElement2( accessor.asElement2, - CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, + CompileTimeErrorCode.conflictingStaticAndInstance, arguments: [declarationName, baseName, declarationName], ); } @@ -746,7 +745,7 @@ class MemberDuplicateDefinitionVerifier { if (instance != null) { _diagnosticReporter.atElement2( method.asElement2, - CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, + CompileTimeErrorCode.conflictingStaticAndInstance, arguments: [declarationName, baseName, declarationName], ); } @@ -776,7 +775,7 @@ class MemberDuplicateDefinitionVerifier { if (instanceScope.containsKey(name)) { _diagnosticReporter.atToken( identifier, - CompileTimeErrorCode.EXTENSION_CONFLICTING_STATIC_AND_INSTANCE, + CompileTimeErrorCode.extensionConflictingStaticAndInstance, arguments: [name], ); } @@ -789,7 +788,7 @@ class MemberDuplicateDefinitionVerifier { if (instanceScope.containsKey(name)) { _diagnosticReporter.atToken( identifier, - CompileTimeErrorCode.EXTENSION_CONFLICTING_STATIC_AND_INSTANCE, + CompileTimeErrorCode.extensionConflictingStaticAndInstance, arguments: [name], ); } @@ -871,7 +870,7 @@ class MemberDuplicateDefinitionVerifier { if (name.lexeme == 'values') { _diagnosticReporter.atToken( name, - CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, + CompileTimeErrorCode.valuesDeclarationInEnum, ); } } diff --git a/pkg/analyzer/lib/src/error/error_handler_verifier.dart b/pkg/analyzer/lib/src/error/error_handler_verifier.dart index 6fa3e883eb0..03ece010ea1 100644 --- a/pkg/analyzer/lib/src/error/error_handler_verifier.dart +++ b/pkg/analyzer/lib/src/error/error_handler_verifier.dart @@ -203,7 +203,7 @@ class ErrorHandlerVerifier { void report() { _diagnosticReporter.atNode( expression, - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, + WarningCode.argumentTypeNotAssignableToErrorHandler, arguments: [expressionType, expectedFunctionReturnType], ); } @@ -292,7 +292,7 @@ class ErrorHandlerVerifier { )) { _diagnosticReporter.atNode( callback, - WarningCode.RETURN_TYPE_INVALID_FOR_CATCH_ERROR, + WarningCode.returnTypeInvalidForCatchError, arguments: [functionReturnType, expectedType], ); } diff --git a/pkg/analyzer/lib/src/error/getter_setter_types_verifier.dart b/pkg/analyzer/lib/src/error/getter_setter_types_verifier.dart index aadf07d8316..20996a5678e 100644 --- a/pkg/analyzer/lib/src/error/getter_setter_types_verifier.dart +++ b/pkg/analyzer/lib/src/error/getter_setter_types_verifier.dart @@ -98,7 +98,7 @@ class GetterSetterTypesVerifier { _diagnosticReporter.atElement2( errorElement, - CompileTimeErrorCode.GETTER_NOT_SUBTYPE_SETTER_TYPES, + CompileTimeErrorCode.getterNotSubtypeSetterTypes, arguments: [getterName, getterType, setterType, setterName], ); } @@ -139,7 +139,7 @@ class GetterSetterTypesVerifier { if (!_typeSystem.isSubtypeOf(getterType, setterType)) { _diagnosticReporter.atElement2( getter, - CompileTimeErrorCode.GETTER_NOT_SUBTYPE_SETTER_TYPES, + CompileTimeErrorCode.getterNotSubtypeSetterTypes, arguments: [name, getterType, setterType, name], ); } diff --git a/pkg/analyzer/lib/src/error/ignore_validator.dart b/pkg/analyzer/lib/src/error/ignore_validator.dart index a67578a3812..14eb5f2dac5 100644 --- a/pkg/analyzer/lib/src/error/ignore_validator.dart +++ b/pkg/analyzer/lib/src/error/ignore_validator.dart @@ -172,7 +172,7 @@ class IgnoreValidator { _diagnosticReporter.atOffset( offset: ignoredElement.offset, length: name.length, - diagnosticCode: WarningCode.DUPLICATE_IGNORE, + diagnosticCode: WarningCode.duplicateIgnore, arguments: [name], ); list.remove(ignoredElement); @@ -180,7 +180,7 @@ class IgnoreValidator { _diagnosticReporter.atOffset( offset: ignoredElement.offset, length: ignoredElement.length, - diagnosticCode: WarningCode.DUPLICATE_IGNORE, + diagnosticCode: WarningCode.duplicateIgnore, arguments: [ignoredElement.type], ); list.remove(ignoredElement); @@ -213,7 +213,7 @@ class IgnoreValidator { var replacedBy = state.replacedBy; if (replacedBy != null) { _diagnosticReporter.atOffset( - diagnosticCode: WarningCode.REPLACED_LINT_USE, + diagnosticCode: WarningCode.replacedLintUse, offset: ignoredName.offset, length: name.length, arguments: [name, since, replacedBy], @@ -221,7 +221,7 @@ class IgnoreValidator { continue; } else { _diagnosticReporter.atOffset( - diagnosticCode: WarningCode.REMOVED_LINT_USE, + diagnosticCode: WarningCode.removedLintUse, offset: ignoredName.offset, length: name.length, arguments: [name, since], diff --git a/pkg/analyzer/lib/src/error/imports_verifier.dart b/pkg/analyzer/lib/src/error/imports_verifier.dart index 835c19f36eb..b7106ea55ff 100644 --- a/pkg/analyzer/lib/src/error/imports_verifier.dart +++ b/pkg/analyzer/lib/src/error/imports_verifier.dart @@ -11,11 +11,11 @@ import 'package:analyzer/src/error/codes.dart'; /// Instances of the class `ImportsVerifier` visit all of the referenced /// libraries in the source code verifying that all of the imports are used, -/// otherwise a [WarningCode.UNUSED_IMPORT] hint is generated with +/// otherwise a [WarningCode.unusedImport] hint is generated with /// [generateUnusedImportWarnings]. /// /// Additionally, [generateDuplicateImportWarnings] generates -/// [WarningCode.DUPLICATE_IMPORT] hints and [WarningCode.UNUSED_SHOWN_NAME] +/// [WarningCode.duplicateImport] hints and [WarningCode.unusedShownName] /// warnings. /// /// While this class does not yet have support for an "Organize Imports" action, @@ -98,34 +98,34 @@ class ImportsVerifier { /// Any time after the defining compilation unit has been visited by this /// visitor, this method can be called to report an - /// [WarningCode.DUPLICATE_EXPORT] hint for each of the export + /// [WarningCode.duplicateExport] hint for each of the export /// directives in the [_duplicateExports] list. void generateDuplicateExportWarnings(DiagnosticReporter diagnosticReporter) { var length = _duplicateExports.length; for (var i = 0; i < length; i++) { diagnosticReporter.atNode( _duplicateExports[i].uri, - WarningCode.DUPLICATE_EXPORT, + WarningCode.duplicateExport, ); } } /// Any time after the defining compilation unit has been visited by this /// visitor, this method can be called to report an - /// [WarningCode.DUPLICATE_IMPORT] hint for each of the import + /// [WarningCode.duplicateImport] hint for each of the import /// directives in the [_duplicateImports] list. void generateDuplicateImportWarnings(DiagnosticReporter diagnosticReporter) { var length = _duplicateImports.length; for (var i = 0; i < length; i++) { diagnosticReporter.atNode( _duplicateImports[i].uri, - WarningCode.DUPLICATE_IMPORT, + WarningCode.duplicateImport, ); } } - /// Report a [WarningCode.DUPLICATE_SHOWN_NAME] and - /// [WarningCode.DUPLICATE_HIDDEN_NAME] hints for each duplicate shown or + /// Report a [WarningCode.duplicateShownName] and + /// [WarningCode.duplicateHiddenName] hints for each duplicate shown or /// hidden name. /// /// Only call this method after all of the compilation units have been visited @@ -138,7 +138,7 @@ class ImportsVerifier { int length = identifiers.length; for (int i = 0; i < length; i++) { Identifier identifier = identifiers[i]; - reporter.atNode(identifier, WarningCode.DUPLICATE_HIDDEN_NAME); + reporter.atNode(identifier, WarningCode.duplicateHiddenName); } }); _duplicateShownNamesMap.forEach(( @@ -148,7 +148,7 @@ class ImportsVerifier { int length = identifiers.length; for (int i = 0; i < length; i++) { Identifier identifier = identifiers[i]; - reporter.atNode(identifier, WarningCode.DUPLICATE_SHOWN_NAME); + reporter.atNode(identifier, WarningCode.duplicateShownName); } }); } @@ -215,7 +215,7 @@ class ImportsVerifier { secondElementUri is DirectiveUriWithLibraryImpl) { diagnosticReporter.atNode( firstDirective.uri, - HintCode.UNNECESSARY_IMPORT, + HintCode.unnecessaryImport, arguments: [ firstElementUri.relativeUriString, secondElementUri.relativeUriString, @@ -228,7 +228,7 @@ class ImportsVerifier { } } - /// Reports [WarningCode.UNUSED_IMPORT] for each unused import. + /// Reports [WarningCode.unusedImport] for each unused import. void generateUnusedImportWarnings(DiagnosticReporter diagnosticReporter) { var importsTracking = fileAnalysis.importsTracking; for (var importDirective in fileAnalysis.unit.directives) { @@ -262,7 +262,7 @@ class ImportsVerifier { _unusedImports.add(importDirective); diagnosticReporter.atNode( importDirective.uri, - WarningCode.UNUSED_IMPORT, + WarningCode.unusedImport, arguments: [uri.relativeUriString], ); } @@ -271,7 +271,7 @@ class ImportsVerifier { } } - /// Use the error [reporter] to report an [WarningCode.UNUSED_SHOWN_NAME] + /// Use the error [reporter] to report an [WarningCode.unusedShownName] /// for each unused shown name. /// /// This method should be invoked after [generateUnusedImportWarnings]. @@ -318,7 +318,7 @@ class ImportsVerifier { if (!isUsed) { reporter.atNode( identifier, - WarningCode.UNUSED_SHOWN_NAME, + WarningCode.unusedShownName, arguments: [identifier.name], ); } diff --git a/pkg/analyzer/lib/src/error/inheritance_override.dart b/pkg/analyzer/lib/src/error/inheritance_override.dart index 88129d36c38..111c597efe3 100644 --- a/pkg/analyzer/lib/src/error/inheritance_override.dart +++ b/pkg/analyzer/lib/src/error/inheritance_override.dart @@ -201,7 +201,7 @@ class _ClassVerifier { implementsDartCoreEnum) { reporter.atToken( classNameToken, - CompileTimeErrorCode.CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE, + CompileTimeErrorCode.concreteClassHasEnumSuperinterface, ); return true; } @@ -354,8 +354,8 @@ class _ClassVerifier { errorNode: classNameToken, diagnosticCode: concreteElement is InternalSetterElement - ? CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE_SETTER - : CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, + ? CompileTimeErrorCode.invalidImplementationOverrideSetter + : CompileTimeErrorCode.invalidImplementationOverride, ); } @@ -408,8 +408,8 @@ class _ClassVerifier { errorNode: node, diagnosticCode: member is SetterElement - ? CompileTimeErrorCode.INVALID_OVERRIDE_SETTER - : CompileTimeErrorCode.INVALID_OVERRIDE, + ? CompileTimeErrorCode.invalidOverrideSetter + : CompileTimeErrorCode.invalidOverride, ); } @@ -493,7 +493,7 @@ class _ClassVerifier { hasEnum: () { reporter.atNode( namedType, - CompileTimeErrorCode.CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE, + CompileTimeErrorCode.concreteClassHasEnumSuperinterface, ); }, notSubtypable: () { @@ -511,7 +511,7 @@ class _ClassVerifier { for (var namedType in implementsClause!.interfaces) { if (_checkDirectSuperTypeNode( namedType, - CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, + CompileTimeErrorCode.implementsDisallowedClass, )) { hasError = true; } @@ -521,7 +521,7 @@ class _ClassVerifier { for (var namedType in onClause!.superclassConstraints) { if (_checkDirectSuperTypeNode( namedType, - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS, + CompileTimeErrorCode.mixinSuperClassConstraintDisallowedClass, )) { hasError = true; } @@ -530,7 +530,7 @@ class _ClassVerifier { if (superclass != null) { if (_checkDirectSuperTypeNode( superclass!, - CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, + CompileTimeErrorCode.extendsDisallowedClass, )) { hasError = true; } @@ -539,7 +539,7 @@ class _ClassVerifier { for (var namedType in withClause!.mixinTypes) { if (_checkDirectSuperTypeNode( namedType, - CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, + CompileTimeErrorCode.mixinOfDisallowedClass, )) { hasError = true; } @@ -555,11 +555,11 @@ class _ClassVerifier { /// Check that [classElement] is not a superinterface to itself. /// The [path] is a list containing the potentially cyclic implements path. /// - /// See [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE], - /// [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_EXTENDS], - /// [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_IMPLEMENTS], - /// [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_ON], - /// [CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_WITH]. + /// See [CompileTimeErrorCode.recursiveInterfaceInheritance], + /// [CompileTimeErrorCode.recursiveInterfaceInheritanceExtends], + /// [CompileTimeErrorCode.recursiveInterfaceInheritanceImplements], + /// [CompileTimeErrorCode.recursiveInterfaceInheritanceOn], + /// [CompileTimeErrorCode.recursiveInterfaceInheritanceWith]. bool _checkForRecursiveInterfaceInheritance( InterfaceElementImpl element, [ List? path, @@ -584,7 +584,7 @@ class _ClassVerifier { buffer.write(element.displayName); reporter.atElement2( classElement, - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, + CompileTimeErrorCode.recursiveInterfaceInheritance, arguments: [className, buffer.toString()], ); return true; @@ -648,7 +648,7 @@ class _ClassVerifier { if (const {'index', 'hashCode', '=='}.contains(name.lexeme)) { reporter.atToken( name, - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, + CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, arguments: [name.lexeme], ); } @@ -678,7 +678,7 @@ class _ClassVerifier { if (enclosingClass is! ClassElement || filter(enclosingClass)) { reporter.atToken( classNameToken, - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, + CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, arguments: [memberName, enclosingClass.name!], ); } @@ -694,10 +694,7 @@ class _ClassVerifier { void _checkIllegalEnumValuesDeclaration(Token name) { if (implementsDartCoreEnum && name.lexeme == 'values') { - reporter.atToken( - name, - CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, - ); + reporter.atToken(name, CompileTimeErrorCode.illegalEnumValuesDeclaration); } } @@ -715,7 +712,7 @@ class _ClassVerifier { if (inherited != null) { reporter.atToken( classNameToken, - CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, + CompileTimeErrorCode.illegalEnumValuesInheritance, arguments: [inherited.enclosingElement!.name!], ); } @@ -740,7 +737,7 @@ class _ClassVerifier { reporter.atNode( namedType, - CompileTimeErrorCode.ENUM_MIXIN_WITH_INSTANCE_VARIABLE, + CompileTimeErrorCode.enumMixinWithInstanceVariable, ); return true; } @@ -749,24 +746,24 @@ class _ClassVerifier { /// references itself directly. DiagnosticCode _getRecursiveErrorCode(InterfaceElement element) { if (element.supertype?.element == classElement) { - return CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_EXTENDS; + return CompileTimeErrorCode.recursiveInterfaceInheritanceExtends; } if (element is MixinElement) { for (var type in element.superclassConstraints) { if (type.element == classElement) { - return CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_ON; + return CompileTimeErrorCode.recursiveInterfaceInheritanceOn; } } } for (var type in element.mixins) { if (type.element == classElement) { - return CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_WITH; + return CompileTimeErrorCode.recursiveInterfaceInheritanceWith; } } - return CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_IMPLEMENTS; + return CompileTimeErrorCode.recursiveInterfaceInheritanceImplements; } /// If [name] is not implemented in the extended concrete class, the @@ -794,8 +791,8 @@ class _ClassVerifier { reporter.atNode( member, classElement is EnumElement - ? CompileTimeErrorCode.ENUM_WITH_ABSTRACT_MEMBER - : CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, + ? CompileTimeErrorCode.enumWithAbstractMember + : CompileTimeErrorCode.concreteClassWithAbstractMember, arguments: [displayName, classElement.name ?? ''], ); return true; @@ -835,7 +832,7 @@ class _ClassVerifier { // `conflict.method.enclosingElement.name` are both non-`null`. reporter.atToken( token, - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, arguments: [ name.name, conflict.getter.enclosingElement!.name!, @@ -853,7 +850,7 @@ class _ClassVerifier { reporter.atToken( token, - CompileTimeErrorCode.INCONSISTENT_INHERITANCE, + CompileTimeErrorCode.inconsistentInheritance, arguments: [name.name, candidatesStr], ); } else { @@ -890,25 +887,25 @@ class _ClassVerifier { if (descriptions.length == 1) { reporter.atToken( classNameToken, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, arguments: [descriptions[0]], ); } else if (descriptions.length == 2) { reporter.atToken( classNameToken, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberTwo, arguments: [descriptions[0], descriptions[1]], ); } else if (descriptions.length == 3) { reporter.atToken( classNameToken, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberThree, arguments: [descriptions[0], descriptions[1], descriptions[2]], ); } else if (descriptions.length == 4) { reporter.atToken( classNameToken, - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFour, arguments: [ descriptions[0], descriptions[1], @@ -919,8 +916,7 @@ class _ClassVerifier { } else { reporter.atToken( classNameToken, - CompileTimeErrorCode - .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFivePlus, arguments: [ descriptions[0], descriptions[1], @@ -940,7 +936,7 @@ class _ClassVerifier { TopLevelInferenceErrorKind.overrideNoCombinedSuperSignature) { reporter.atToken( node.name, - CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, + CompileTimeErrorCode.noCombinedSuperSignature, arguments: [classElement.name ?? '', inferenceError!.arguments[0]], ); return true; @@ -1039,19 +1035,19 @@ class _ClassVerifier { if (namesForError.length == 1) { reporter.atToken( classNameToken, - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, + WarningCode.missingOverrideOfMustBeOverriddenOne, arguments: namesForError, ); } else if (namesForError.length == 2) { reporter.atToken( classNameToken, - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO, + WarningCode.missingOverrideOfMustBeOverriddenTwo, arguments: namesForError, ); } else { reporter.atToken( classNameToken, - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_THREE_PLUS, + WarningCode.missingOverrideOfMustBeOverriddenThreePlus, arguments: [ namesForError[0], namesForError[1], 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 55cd29c2165..0cdf309a8a7 100644 --- a/pkg/analyzer/lib/src/error/language_version_override_verifier.dart +++ b/pkg/analyzer/lib/src/error/language_version_override_verifier.dart @@ -189,8 +189,7 @@ class LanguageVersionOverrideVerifier { _diagnosticReporter.atOffset( offset: offset, length: length, - diagnosticCode: - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TWO_SLASHES, + diagnosticCode: WarningCode.invalidLanguageVersionOverrideTwoSlashes, ); return false; } @@ -199,7 +198,7 @@ class LanguageVersionOverrideVerifier { _diagnosticReporter.atOffset( offset: offset, length: length, - diagnosticCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN, + diagnosticCode: WarningCode.invalidLanguageVersionOverrideAtSign, ); return false; } @@ -209,8 +208,7 @@ class LanguageVersionOverrideVerifier { _diagnosticReporter.atOffset( offset: offset, length: length, - diagnosticCode: - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE, + diagnosticCode: WarningCode.invalidLanguageVersionOverrideLowerCase, ); return false; } @@ -222,7 +220,7 @@ class LanguageVersionOverrideVerifier { _diagnosticReporter.atOffset( offset: offset, length: length, - diagnosticCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS, + diagnosticCode: WarningCode.invalidLanguageVersionOverrideEquals, ); return false; } @@ -231,7 +229,7 @@ class LanguageVersionOverrideVerifier { _diagnosticReporter.atOffset( offset: offset, length: length, - diagnosticCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX, + diagnosticCode: WarningCode.invalidLanguageVersionOverridePrefix, ); return false; } @@ -240,7 +238,7 @@ class LanguageVersionOverrideVerifier { _diagnosticReporter.atOffset( offset: offset, length: length, - diagnosticCode: WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER, + diagnosticCode: WarningCode.invalidLanguageVersionOverrideNumber, ); } @@ -277,7 +275,7 @@ class LanguageVersionOverrideVerifier { offset: offset, length: length, diagnosticCode: - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS, + WarningCode.invalidLanguageVersionOverrideTrailingCharacters, ); return false; } @@ -307,7 +305,7 @@ class LanguageVersionOverrideVerifier { offset: commentToken.offset + atDartStart, length: match.end - atDartStart, diagnosticCode: - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION, + WarningCode.invalidLanguageVersionOverrideLocation, ); } } diff --git a/pkg/analyzer/lib/src/error/literal_element_verifier.dart b/pkg/analyzer/lib/src/error/literal_element_verifier.dart index 02bb419cddd..c71061ab5c2 100644 --- a/pkg/analyzer/lib/src/error/literal_element_verifier.dart +++ b/pkg/analyzer/lib/src/error/literal_element_verifier.dart @@ -69,13 +69,13 @@ class LiteralElementVerifier { assignableWhenNullable: assignableWhenNullable, )) { (forList: false, assignableWhenNullable: false) => - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.setElementTypeNotAssignable, (forList: false, assignableWhenNullable: true) => - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.setElementTypeNotAssignableNullability, (forList: true, assignableWhenNullable: false) => - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.listElementTypeNotAssignable, (forList: true, assignableWhenNullable: true) => - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, }; _diagnosticReporter.atNode( errorNode, @@ -99,7 +99,7 @@ class LiteralElementVerifier { } else { _diagnosticReporter.atNode( element, - CompileTimeErrorCode.EXPRESSION_IN_MAP, + CompileTimeErrorCode.expressionInMap, ); } case ForElementImpl(): @@ -113,7 +113,7 @@ class LiteralElementVerifier { } else { _diagnosticReporter.atNode( element, - CompileTimeErrorCode.MAP_ENTRY_NOT_IN_MAP, + CompileTimeErrorCode.mapEntryNotInMap, ); } case SpreadElementImpl(): @@ -137,7 +137,7 @@ class LiteralElementVerifier { } else { _diagnosticReporter.atNode( element, - CompileTimeErrorCode.EXPRESSION_IN_MAP, + CompileTimeErrorCode.expressionInMap, ); } case null: @@ -179,13 +179,13 @@ class LiteralElementVerifier { )) { _diagnosticReporter.atNode( entry.key, - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.mapKeyTypeNotAssignableNullability, arguments: [keyType, mapKeyType], ); } else { _diagnosticReporter.atNode( entry.key, - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.mapKeyTypeNotAssignable, arguments: [keyType, mapKeyType], ); } @@ -210,13 +210,13 @@ class LiteralElementVerifier { )) { _diagnosticReporter.atNode( entry.value, - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.mapValueTypeNotAssignableNullability, arguments: [valueType, mapValueType], ); } else { _diagnosticReporter.atNode( entry.value, - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.mapValueTypeNotAssignable, arguments: [valueType, mapValueType], ); } @@ -231,7 +231,7 @@ class LiteralElementVerifier { if (_errorVerifier.strictCasts) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.NOT_ITERABLE_SPREAD, + CompileTimeErrorCode.notIterableSpread, ); } return; @@ -247,7 +247,7 @@ class LiteralElementVerifier { } _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, + CompileTimeErrorCode.notNullAwareNullSpread, ); return; } @@ -259,7 +259,7 @@ class LiteralElementVerifier { if (iterableType == null) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.NOT_ITERABLE_SPREAD, + CompileTimeErrorCode.notIterableSpread, ); return; } @@ -273,8 +273,8 @@ class LiteralElementVerifier { )) { var errorCode = forList - ? CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE - : CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE; + ? CompileTimeErrorCode.listElementTypeNotAssignable + : CompileTimeErrorCode.setElementTypeNotAssignable; // Also check for an "implicit tear-off conversion" which would be applied // after desugaring a spread element. var implicitCallMethod = _errorVerifier.getImplicitCallMethod( @@ -334,7 +334,7 @@ class LiteralElementVerifier { if (_errorVerifier.strictCasts) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.NOT_MAP_SPREAD, + CompileTimeErrorCode.notMapSpread, ); } return; @@ -350,7 +350,7 @@ class LiteralElementVerifier { } _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, + CompileTimeErrorCode.notNullAwareNullSpread, ); return; } @@ -358,10 +358,7 @@ class LiteralElementVerifier { var mapType = expressionType.asInstanceOf(typeProvider.mapElement); if (mapType == null) { - _diagnosticReporter.atNode( - expression, - CompileTimeErrorCode.NOT_MAP_SPREAD, - ); + _diagnosticReporter.atNode(expression, CompileTimeErrorCode.notMapSpread); return; } @@ -374,7 +371,7 @@ class LiteralElementVerifier { )) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.mapKeyTypeNotAssignable, arguments: [keyType, mapKeyType], ); } @@ -388,7 +385,7 @@ class LiteralElementVerifier { )) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.mapValueTypeNotAssignable, arguments: [valueType, mapValueType], ); } diff --git a/pkg/analyzer/lib/src/error/must_call_super_verifier.dart b/pkg/analyzer/lib/src/error/must_call_super_verifier.dart index b66fd12000d..3543b46219e 100644 --- a/pkg/analyzer/lib/src/error/must_call_super_verifier.dart +++ b/pkg/analyzer/lib/src/error/must_call_super_verifier.dart @@ -179,7 +179,7 @@ class MustCallSuperVerifier { // safe to assume [overriddenEnclosingName] is non-`null`. _diagnosticReporter.atToken( node.name, - WarningCode.MUST_CALL_SUPER, + WarningCode.mustCallSuper, arguments: [overriddenEnclosingName!], ); } diff --git a/pkg/analyzer/lib/src/error/null_safe_api_verifier.dart b/pkg/analyzer/lib/src/error/null_safe_api_verifier.dart index da365c01d11..c6aeef673fa 100644 --- a/pkg/analyzer/lib/src/error/null_safe_api_verifier.dart +++ b/pkg/analyzer/lib/src/error/null_safe_api_verifier.dart @@ -83,7 +83,7 @@ class NullSafeApiVerifier { if (argumentIsNull) { _diagnosticReporter.atNode( argument ?? node, - WarningCode.NULL_ARGUMENT_TO_NON_NULL_TYPE, + WarningCode.nullArgumentToNonNullType, arguments: [memberName, type.getDisplayString()], ); } diff --git a/pkg/analyzer/lib/src/error/nullable_dereference_verifier.dart b/pkg/analyzer/lib/src/error/nullable_dereference_verifier.dart index 71e93ab74d2..000349300c8 100644 --- a/pkg/analyzer/lib/src/error/nullable_dereference_verifier.dart +++ b/pkg/analyzer/lib/src/error/nullable_dereference_verifier.dart @@ -47,7 +47,7 @@ class NullableDereferenceVerifier { List? messages, }) { if (receiverType == _typeSystem.typeProvider.nullType) { - diagnosticCode = CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE; + diagnosticCode = CompileTimeErrorCode.invalidUseOfNullValue; arguments = []; } if (errorEntity is AstNode) { diff --git a/pkg/analyzer/lib/src/error/override_verifier.dart b/pkg/analyzer/lib/src/error/override_verifier.dart index 3e29e96d8be..c19d72b7f6d 100644 --- a/pkg/analyzer/lib/src/error/override_verifier.dart +++ b/pkg/analyzer/lib/src/error/override_verifier.dart @@ -47,7 +47,7 @@ class OverrideVerifier extends RecursiveAstVisitor { _errorReporter.atToken( field.name, - WarningCode.OVERRIDE_ON_NON_OVERRIDING_FIELD, + WarningCode.overrideOnNonOverridingField, ); } } @@ -61,17 +61,17 @@ class OverrideVerifier extends RecursiveAstVisitor { case MethodElement(): _errorReporter.atToken( node.name, - WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, + WarningCode.overrideOnNonOverridingMethod, ); case GetterElement(): _errorReporter.atToken( node.name, - WarningCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, + WarningCode.overrideOnNonOverridingGetter, ); case SetterElement(): _errorReporter.atToken( node.name, - WarningCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, + WarningCode.overrideOnNonOverridingSetter, ); } } diff --git a/pkg/analyzer/lib/src/error/redeclare_verifier.dart b/pkg/analyzer/lib/src/error/redeclare_verifier.dart index 065a300e90a..a3022fa2a5d 100644 --- a/pkg/analyzer/lib/src/error/redeclare_verifier.dart +++ b/pkg/analyzer/lib/src/error/redeclare_verifier.dart @@ -42,19 +42,19 @@ class RedeclareVerifier extends RecursiveAstVisitor { case MethodElement(): _errorReporter.atToken( node.name, - WarningCode.REDECLARE_ON_NON_REDECLARING_MEMBER, + WarningCode.redeclareOnNonRedeclaringMember, arguments: ['method'], ); case GetterElement(): _errorReporter.atToken( node.name, - WarningCode.REDECLARE_ON_NON_REDECLARING_MEMBER, + WarningCode.redeclareOnNonRedeclaringMember, arguments: ['getter'], ); case SetterElement(): _errorReporter.atToken( node.name, - WarningCode.REDECLARE_ON_NON_REDECLARING_MEMBER, + WarningCode.redeclareOnNonRedeclaringMember, arguments: ['setter'], ); } diff --git a/pkg/analyzer/lib/src/error/required_parameters_verifier.dart b/pkg/analyzer/lib/src/error/required_parameters_verifier.dart index f4980706e5e..6fe1650d9d1 100644 --- a/pkg/analyzer/lib/src/error/required_parameters_verifier.dart +++ b/pkg/analyzer/lib/src/error/required_parameters_verifier.dart @@ -157,7 +157,7 @@ class RequiredParametersVerifier extends SimpleAstVisitor { ); _errorReporter.atEntity( errorEntity, - CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, + CompileTimeErrorCode.missingRequiredArgument, arguments: [parameterName], ); } @@ -175,13 +175,13 @@ class RequiredParametersVerifier extends SimpleAstVisitor { if (reason != null) { _errorReporter.atEntity( errorEntity, - WarningCode.MISSING_REQUIRED_PARAM_WITH_DETAILS, + WarningCode.missingRequiredParamWithDetails, arguments: [parameterName, reason], ); } else { _errorReporter.atEntity( errorEntity, - WarningCode.MISSING_REQUIRED_PARAM, + WarningCode.missingRequiredParam, arguments: [parameterName], ); } diff --git a/pkg/analyzer/lib/src/error/return_type_verifier.dart b/pkg/analyzer/lib/src/error/return_type_verifier.dart index da6c69d586b..6d72301bdc1 100644 --- a/pkg/analyzer/lib/src/error/return_type_verifier.dart +++ b/pkg/analyzer/lib/src/error/return_type_verifier.dart @@ -58,7 +58,7 @@ class ReturnTypeVerifier { if (expression != null) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, + CompileTimeErrorCode.returnInGenerativeConstructor, ); } return; @@ -107,18 +107,18 @@ class ReturnTypeVerifier { if (enclosingExecutable.isGenerator) { checkElement( _typeProvider.streamElement, - CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, + CompileTimeErrorCode.illegalAsyncGeneratorReturnType, ); } else { checkElement( _typeProvider.futureElement, - CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, + CompileTimeErrorCode.illegalAsyncReturnType, ); } } else if (enclosingExecutable.isGenerator) { checkElement( _typeProvider.iterableElement, - CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, + CompileTimeErrorCode.illegalSyncGeneratorReturnType, ); } } @@ -149,13 +149,13 @@ class ReturnTypeVerifier { if (enclosingExecutable.catchErrorOnErrorReturnType != null) { _diagnosticReporter.atNode( expression, - WarningCode.RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR, + WarningCode.returnOfInvalidTypeFromCatchError, arguments: [S, T], ); } else if (enclosingExecutable.isClosure) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, + CompileTimeErrorCode.returnOfInvalidTypeFromClosure, arguments: [S, T], ); } else if (enclosingExecutable.isConstructor) { @@ -165,7 +165,7 @@ class ReturnTypeVerifier { // `enclosingExecutable.displayName` is non-`null`. _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, + CompileTimeErrorCode.returnOfInvalidTypeFromConstructor, arguments: [S, T, enclosingExecutable.displayName!], ); } else if (enclosingExecutable.isFunction) { @@ -175,7 +175,7 @@ class ReturnTypeVerifier { // `enclosingExecutable.displayName` is non-`null`. _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, + CompileTimeErrorCode.returnOfInvalidTypeFromFunction, arguments: [S, T, enclosingExecutable.displayName!], ); } else if (enclosingExecutable.isMethod) { @@ -185,7 +185,7 @@ class ReturnTypeVerifier { // `enclosingExecutable.displayName` is non-`null`. _diagnosticReporter.atNode( expression, - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, + CompileTimeErrorCode.returnOfInvalidTypeFromMethod, arguments: [S, T, enclosingExecutable.displayName!], ); } @@ -223,8 +223,7 @@ class ReturnTypeVerifier { )) { _diagnosticReporter.atNode( expression, - CompileTimeErrorCode - .RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, ); return; } @@ -287,7 +286,7 @@ class ReturnTypeVerifier { _diagnosticReporter.atToken( statement.returnKeyword, - CompileTimeErrorCode.RETURN_WITHOUT_VALUE, + CompileTimeErrorCode.returnWithoutValue, ); } diff --git a/pkg/analyzer/lib/src/error/super_formal_parameters_verifier.dart b/pkg/analyzer/lib/src/error/super_formal_parameters_verifier.dart index 03117a08776..c50b02fd12a 100644 --- a/pkg/analyzer/lib/src/error/super_formal_parameters_verifier.dart +++ b/pkg/analyzer/lib/src/error/super_formal_parameters_verifier.dart @@ -28,7 +28,7 @@ VerifySuperFormalParametersResult verifySuperFormalParameters({ diagnosticReporter?.atToken( parameter.name, CompileTimeErrorCode - .POSITIONAL_SUPER_FORMAL_PARAMETER_WITH_POSITIONAL_ARGUMENT, + .positionalSuperFormalParameterWithPositionalArgument, ); } } diff --git a/pkg/analyzer/lib/src/error/type_arguments_verifier.dart b/pkg/analyzer/lib/src/error/type_arguments_verifier.dart index c2c90778759..9528d1fc5d5 100644 --- a/pkg/analyzer/lib/src/error/type_arguments_verifier.dart +++ b/pkg/analyzer/lib/src/error/type_arguments_verifier.dart @@ -92,7 +92,7 @@ class TypeArgumentsVerifier { i < typeArgumentListLength ? typeArgumentList.arguments[i] : node; _diagnosticReporter.atNode( errorNode, - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, arguments: [typeArgument, typeParameter.name!, bound], ); } @@ -121,7 +121,7 @@ class TypeArgumentsVerifier { typeArgumentNodes.length != typeParameters.length) { _diagnosticReporter.atNode( typeArgumentList, - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_ENUM, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsEnum, arguments: [typeParameters.length, typeArgumentNodes.length], ); } @@ -148,7 +148,7 @@ class TypeArgumentsVerifier { var errorTarget = typeArgumentNodes?[i] ?? node.name; _diagnosticReporter.atEntity( errorTarget, - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, arguments: [typeArgument, typeParameter.name!, bound], ); } @@ -184,14 +184,14 @@ class TypeArgumentsVerifier { for (var argument in typeArguments.arguments) { _checkTypeArgumentConst( argument, - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST, + CompileTimeErrorCode.invalidTypeArgumentInConstList, ); } } _checkTypeArgumentCount( typeArguments, 1, - CompileTimeErrorCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, + CompileTimeErrorCode.expectedOneListTypeArguments, ); } } @@ -203,14 +203,14 @@ class TypeArgumentsVerifier { for (var argument in typeArguments.arguments) { _checkTypeArgumentConst( argument, - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP, + CompileTimeErrorCode.invalidTypeArgumentInConstMap, ); } } _checkTypeArgumentCount( typeArguments, 2, - CompileTimeErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, + CompileTimeErrorCode.expectedTwoMapTypeArguments, ); } } @@ -239,14 +239,14 @@ class TypeArgumentsVerifier { for (var argument in typeArguments.arguments) { _checkTypeArgumentConst( argument, - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_SET, + CompileTimeErrorCode.invalidTypeArgumentInConstSet, ); } } _checkTypeArgumentCount( typeArguments, 1, - CompileTimeErrorCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS, + CompileTimeErrorCode.expectedOneSetTypeArguments, ); } } @@ -256,7 +256,7 @@ class TypeArgumentsVerifier { /// /// This checks if [node] refers to a generic type and does not have explicit /// or inferred type arguments. When that happens, it reports error code - /// [WarningCode.STRICT_RAW_TYPE]. + /// [WarningCode.strictRawType]. void _checkForRawTypeName(NamedType node) { AstNode parentEscapingTypeArguments(NamedType node) { var parent = node.parent!; @@ -287,7 +287,7 @@ class TypeArgumentsVerifier { } else { _diagnosticReporter.atNode( node, - WarningCode.STRICT_RAW_TYPE, + WarningCode.strictRawType, arguments: [type], ); } @@ -343,7 +343,7 @@ class TypeArgumentsVerifier { if (!_libraryElement.featureSet.isEnabled(Feature.generic_metadata)) { _diagnosticReporter.atNode( _typeArgumentErrorNode(namedType, i), - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, ); continue; } @@ -421,7 +421,7 @@ class TypeArgumentsVerifier { for (var issue in issues) { _diagnosticReporter.atNode( _typeArgumentErrorNode(namedType, issue.index), - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, arguments: [ issue.argument, issue.parameterName, @@ -469,7 +469,7 @@ class TypeArgumentsVerifier { if (!_typeSystem.isSubtypeOf(typeArgument, bound)) { _diagnosticReporter.atNode( _typeArgumentErrorNode(namedType, i), - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, arguments: [typeArgument, typeParameterName, bound], contextMessages: buildContextMessages( invertedTypeArguments: invertedTypeArguments, @@ -519,7 +519,7 @@ class TypeArgumentsVerifier { if (!_libraryElement.featureSet.isEnabled(Feature.generic_metadata)) { _diagnosticReporter.atNode( typeArgumentList[i], - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, ); continue; } @@ -541,7 +541,7 @@ class TypeArgumentsVerifier { if (!_typeSystem.isSubtypeOf(argType, bound)) { _diagnosticReporter.atNode( typeArgumentList[i], - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, arguments: [argType, fnTypeParamName, bound], ); } @@ -551,9 +551,9 @@ class TypeArgumentsVerifier { /// Checks whether the given [typeAnnotation] contains a type parameter. /// /// The [errorCode] is either - /// [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST], - /// [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP], or - /// [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_SET]. + /// [CompileTimeErrorCode.invalidTypeArgumentInConstList], + /// [CompileTimeErrorCode.invalidTypeArgumentInConstMap], or + /// [CompileTimeErrorCode.invalidTypeArgumentInConstSet]. void _checkTypeArgumentConst( TypeAnnotation typeAnnotation, DiagnosticCode errorCode, diff --git a/pkg/analyzer/lib/src/error/unicode_text_verifier.dart b/pkg/analyzer/lib/src/error/unicode_text_verifier.dart index 4a24893846d..7601a9999b6 100644 --- a/pkg/analyzer/lib/src/error/unicode_text_verifier.dart +++ b/pkg/analyzer/lib/src/error/unicode_text_verifier.dart @@ -25,8 +25,8 @@ class UnicodeTextVerifier { // (where Unicode is outside a string or comment). var errorCode = node is SimpleStringLiteral || node is InterpolationString - ? WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL - : WarningCode.TEXT_DIRECTION_CODE_POINT_IN_COMMENT; + ? WarningCode.textDirectionCodePointInLiteral + : WarningCode.textDirectionCodePointInComment; var code = codeUnit.toRadixString(16).toUpperCase(); _diagnosticReporter.atOffset( offset: offset, diff --git a/pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart b/pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart index f2af6fab740..be879c22ade 100644 --- a/pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart +++ b/pkg/analyzer/lib/src/error/unused_local_elements_verifier.dart @@ -489,9 +489,9 @@ class GatherUsedLocalElementsVisitor extends RecursiveAstVisitor { } /// Instances of the class [UnusedLocalElementsVerifier] traverse an AST -/// looking for cases of [WarningCode.UNUSED_ELEMENT], -/// [WarningCode.UNUSED_FIELD], -/// [WarningCode.UNUSED_LOCAL_VARIABLE], etc. +/// looking for cases of [WarningCode.unusedElement], +/// [WarningCode.unusedField], +/// [WarningCode.unusedLocalVariable], etc. class UnusedLocalElementsVerifier extends RecursiveAstVisitor { /// The error listener to which errors will be reported. final DiagnosticListener _diagnosticListener; @@ -605,7 +605,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { var element = fragment!.element; if (!_isUsedElement(element)) { _reportDiagnosticForElement( - WarningCode.UNUSED_ELEMENT_PARAMETER, + WarningCode.unusedElementParameter, element, [element.displayName], ); @@ -696,11 +696,9 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { } } for (var element in elementsToReport) { - _reportDiagnosticForElement( - WarningCode.UNUSED_LOCAL_VARIABLE, - element, - [element.displayName], - ); + _reportDiagnosticForElement(WarningCode.unusedLocalVariable, element, [ + element.displayName, + ]); } } finally { _patternVariableElements = outerPatternVariableElements; @@ -1029,7 +1027,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { void _visitClassElement(InterfaceElement element) { if (!_isUsedElement(element)) { - _reportDiagnosticForElement(WarningCode.UNUSED_ELEMENT, element, [ + _reportDiagnosticForElement(WarningCode.unusedElement, element, [ element.displayName, ]); } @@ -1042,7 +1040,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { // purpose, the constructor is "used." if (element.enclosingElement.constructors.length > 1 && !_isUsedMember(element)) { - _reportDiagnosticForElement(WarningCode.UNUSED_ELEMENT, element, [ + _reportDiagnosticForElement(WarningCode.unusedElement, element, [ element.displayName, ]); } @@ -1050,7 +1048,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { void _visitFieldElement(FieldElement element) { if (!_isReadMember(element)) { - _reportDiagnosticForElement(WarningCode.UNUSED_FIELD, element, [ + _reportDiagnosticForElement(WarningCode.unusedField, element, [ element.displayName, ]); } @@ -1059,7 +1057,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { void _visitLocalFunctionElement(LocalFunctionElement element) { if (!_isUsedElement(element)) { if (_wildCardVariablesEnabled && _isNamedWildcard(element)) return; - _reportDiagnosticForElement(WarningCode.UNUSED_ELEMENT, element, [ + _reportDiagnosticForElement(WarningCode.unusedElement, element, [ element.displayName, ]); } @@ -1069,11 +1067,11 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { if (!_isUsedElement(element) && !_isNamedWildcard(element)) { DiagnosticCode code; if (_usedElements.isCatchException(element)) { - code = WarningCode.UNUSED_CATCH_CLAUSE; + code = WarningCode.unusedCatchClause; } else if (_usedElements.isCatchStackTrace(element)) { - code = WarningCode.UNUSED_CATCH_STACK; + code = WarningCode.unusedCatchStack; } else { - code = WarningCode.UNUSED_LOCAL_VARIABLE; + code = WarningCode.unusedLocalVariable; } _reportDiagnosticForElement(code, element, [element.displayName]); } @@ -1081,7 +1079,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { void _visitMethodElement(MethodElement element) { if (!_isUsedMember(element)) { - _reportDiagnosticForElement(WarningCode.UNUSED_ELEMENT, element, [ + _reportDiagnosticForElement(WarningCode.unusedElement, element, [ element.displayName, ]); } @@ -1089,7 +1087,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { void _visitPropertyAccessorElement(PropertyAccessorElement element) { if (!_isUsedMember(element)) { - _reportDiagnosticForElement(WarningCode.UNUSED_ELEMENT, element, [ + _reportDiagnosticForElement(WarningCode.unusedElement, element, [ element.displayName, ]); } @@ -1097,7 +1095,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { void _visitTopLevelFunctionElement(TopLevelFunctionElement element) { if (!_isUsedElement(element)) { - _reportDiagnosticForElement(WarningCode.UNUSED_ELEMENT, element, [ + _reportDiagnosticForElement(WarningCode.unusedElement, element, [ element.displayName, ]); } @@ -1105,7 +1103,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { void _visitTopLevelVariableElement(TopLevelVariableElement element) { if (!_isUsedElement(element)) { - _reportDiagnosticForElement(WarningCode.UNUSED_ELEMENT, element, [ + _reportDiagnosticForElement(WarningCode.unusedElement, element, [ element.displayName, ]); } @@ -1113,7 +1111,7 @@ class UnusedLocalElementsVerifier extends RecursiveAstVisitor { void _visitTypeAliasElement(TypeAliasElement element) { if (!_isUsedElement(element)) { - _reportDiagnosticForElement(WarningCode.UNUSED_ELEMENT, element, [ + _reportDiagnosticForElement(WarningCode.unusedElement, element, [ element.displayName, ]); } diff --git a/pkg/analyzer/lib/src/error/use_result_verifier.dart b/pkg/analyzer/lib/src/error/use_result_verifier.dart index ebb61bd8c5b..0af0287cb9f 100644 --- a/pkg/analyzer/lib/src/error/use_result_verifier.dart +++ b/pkg/analyzer/lib/src/error/use_result_verifier.dart @@ -110,13 +110,13 @@ class UseResultVerifier { if (message == null || message.isEmpty) { _diagnosticReporter.atNode( toAnnotate, - WarningCode.UNUSED_RESULT, + WarningCode.unusedResult, arguments: [displayName], ); } else { _diagnosticReporter.atNode( toAnnotate, - WarningCode.UNUSED_RESULT_WITH_MESSAGE, + WarningCode.unusedResultWithMessage, arguments: [displayName, message], ); } diff --git a/pkg/analyzer/lib/src/error/widget_preview_verifier.dart b/pkg/analyzer/lib/src/error/widget_preview_verifier.dart index 14380b6fe00..81653dac82e 100644 --- a/pkg/analyzer/lib/src/error/widget_preview_verifier.dart +++ b/pkg/analyzer/lib/src/error/widget_preview_verifier.dart @@ -66,7 +66,7 @@ class WidgetPreviewVerifier { if (!isValidApplication) { _diagnosticReporter.atNode( node.name, - WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, + WarningCode.invalidWidgetPreviewApplication, ); } @@ -232,7 +232,7 @@ class _InvalidWidgetPreviewArgumentDetectorVisitor extends RecursiveAstVisitor { if (Identifier.isPrivateName(node.name)) { errorReporter.atNode( rootArgument!, - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, arguments: [node.name, node.name.replaceFirst(RegExp('_*'), '')], ); } diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart index 7d1158b4a51..7eb19df245e 100644 --- a/pkg/analyzer/lib/src/fasta/ast_builder.dart +++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart @@ -1863,7 +1863,7 @@ class AstBuilder extends StackListener { if (representationName.lexeme == builder.name.lexeme) { diagnosticReporter.diagnosticReporter?.atToken( representationName, - ParserErrorCode.MEMBER_WITH_CLASS_NAME, + ParserErrorCode.memberWithClassName, ); } declarations.add( @@ -2823,7 +2823,7 @@ class AstBuilder extends StackListener { ImplementsClauseImpl? implementsClause; if (implementsKeyword != null) { var interfaces = _popNamedTypeList( - code: ParserErrorCode.EXPECTED_NAMED_TYPE_IMPLEMENTS, + code: ParserErrorCode.expectedNamedTypeImplements, ); implementsClause = ImplementsClauseImpl( implementsKeyword: implementsKeyword, @@ -2835,7 +2835,7 @@ class AstBuilder extends StackListener { if (superclass is! NamedTypeImpl) { diagnosticReporter.diagnosticReporter?.atNode( superclass, - ParserErrorCode.EXPECTED_NAMED_TYPE_EXTENDS, + ParserErrorCode.expectedNamedTypeExtends, ); var beginToken = superclass.beginToken; var endToken = superclass.endToken; @@ -2996,7 +2996,7 @@ class AstBuilder extends StackListener { if (_featureSet.isEnabled(Feature.enhanced_parts)) { diagnosticReporter.diagnosticReporter?.atNode( name, - ParserErrorCode.PART_OF_NAME, + ParserErrorCode.partOfName, ); } } @@ -3062,7 +3062,7 @@ class AstBuilder extends StackListener { case null: diagnosticReporter.diagnosticReporter?.atToken( leftParenthesis.next!, - ParserErrorCode.EXPECTED_REPRESENTATION_TYPE, + ParserErrorCode.expectedRepresentationType, ); var typeNameToken = parser.rewriter.insertSyntheticIdentifier( leftParenthesis, @@ -3078,7 +3078,7 @@ class AstBuilder extends StackListener { if (keyword.keyword != Keyword.CONST) { diagnosticReporter.diagnosticReporter?.atToken( keyword, - ParserErrorCode.REPRESENTATION_FIELD_MODIFIER, + ParserErrorCode.representationFieldModifier, ); } } @@ -3089,19 +3089,19 @@ class AstBuilder extends StackListener { if (formalParameterList.parameters.length == 1) { diagnosticReporter.diagnosticReporter?.atToken( maybeComma, - ParserErrorCode.REPRESENTATION_FIELD_TRAILING_COMMA, + ParserErrorCode.representationFieldTrailingComma, ); } else { diagnosticReporter.diagnosticReporter?.atToken( maybeComma, - ParserErrorCode.MULTIPLE_REPRESENTATION_FIELDS, + ParserErrorCode.multipleRepresentationFields, ); } } } else { diagnosticReporter.diagnosticReporter?.atToken( leftParenthesis.next!, - ParserErrorCode.EXPECTED_REPRESENTATION_FIELD, + ParserErrorCode.expectedRepresentationField, ); fieldMetadata = []; var typeNameToken = parser.rewriter.insertSyntheticIdentifier( @@ -4152,7 +4152,7 @@ class AstBuilder extends StackListener { if (supertype != null) { diagnosticReporter.diagnosticReporter?.atNode( supertype, - ParserErrorCode.EXPECTED_NAMED_TYPE_EXTENDS, + ParserErrorCode.expectedNamedTypeExtends, ); } } @@ -4223,7 +4223,7 @@ class AstBuilder extends StackListener { void handleClassWithClause(Token withKeyword) { assert(optional('with', withKeyword)); var mixinTypes = _popNamedTypeList( - code: ParserErrorCode.EXPECTED_NAMED_TYPE_WITH, + code: ParserErrorCode.expectedNamedTypeWith, ); push(WithClauseImpl(withKeyword: withKeyword, mixinTypes: mixinTypes)); } @@ -4504,7 +4504,7 @@ class AstBuilder extends StackListener { void handleEnumWithClause(Token withKeyword) { assert(optional('with', withKeyword)); var mixinTypes = _popNamedTypeList( - code: ParserErrorCode.EXPECTED_NAMED_TYPE_WITH, + code: ParserErrorCode.expectedNamedTypeWith, ); push(WithClauseImpl(withKeyword: withKeyword, mixinTypes: mixinTypes)); } @@ -4800,7 +4800,7 @@ class AstBuilder extends StackListener { if (implementsKeyword != null) { endTypeList(interfacesCount); var interfaces = _popNamedTypeList( - code: ParserErrorCode.EXPECTED_NAMED_TYPE_IMPLEMENTS, + code: ParserErrorCode.expectedNamedTypeImplements, ); push( ImplementsClauseImpl( @@ -5229,7 +5229,7 @@ class AstBuilder extends StackListener { if (onKeyword != null) { endTypeList(typeCount); var onTypes = _popNamedTypeList( - code: ParserErrorCode.EXPECTED_NAMED_TYPE_ON, + code: ParserErrorCode.expectedNamedTypeOn, ); push( MixinOnClauseImpl(onKeyword: onKeyword, superclassConstraints: onTypes), @@ -5244,7 +5244,7 @@ class AstBuilder extends StackListener { assert(optional('with', withKeyword)); // This is an error case. An error has been issued already. // Possibly the data could be used for help though. - _popNamedTypeList(code: ParserErrorCode.EXPECTED_NAMED_TYPE_WITH); + _popNamedTypeList(code: ParserErrorCode.expectedNamedTypeWith); } @override @@ -5267,7 +5267,7 @@ class AstBuilder extends StackListener { void handleNamedMixinApplicationWithClause(Token withKeyword) { assert(optionalOrNull('with', withKeyword)); var mixinTypes = _popNamedTypeList( - code: ParserErrorCode.EXPECTED_NAMED_TYPE_WITH, + code: ParserErrorCode.expectedNamedTypeWith, ); push(WithClauseImpl(withKeyword: withKeyword, mixinTypes: mixinTypes)); } @@ -6143,7 +6143,7 @@ class AstBuilder extends StackListener { if (notDefault is FieldFormalParameterImpl) { diagnosticReporter.diagnosticReporter?.atToken( notDefault.thisKeyword, - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS, + ParserErrorCode.externalConstructorWithFieldInitializers, ); } } @@ -6257,7 +6257,7 @@ class AstBuilder extends StackListener { if (!formalParameters.leftParenthesis.isSynthetic) { diagnosticReporter.diagnosticReporter?.atToken( setterName.token, - ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, + ParserErrorCode.wrongNumberOfParametersForSetter, ); } var valueNameToken = parser.rewriter.insertSyntheticIdentifier( @@ -6289,7 +6289,7 @@ class AstBuilder extends StackListener { diagnosticReporter.diagnosticReporter?.atToken( setterName.token, - ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, + ParserErrorCode.wrongNumberOfParametersForSetter, ); return FormalParameterListImpl( leftParenthesis: formalParameters.leftParenthesis, diff --git a/pkg/analyzer/lib/src/fasta/doc_comment_builder.dart b/pkg/analyzer/lib/src/fasta/doc_comment_builder.dart index 20f8f971bd3..7770c7b0870 100644 --- a/pkg/analyzer/lib/src/fasta/doc_comment_builder.dart +++ b/pkg/analyzer/lib/src/fasta/doc_comment_builder.dart @@ -205,7 +205,7 @@ final class DocCommentBuilder { _diagnosticReporter?.atOffset( offset: openingTag.offset, length: openingTag.end - openingTag.offset, - diagnosticCode: WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG, + diagnosticCode: WarningCode.docDirectiveMissingClosingTag, arguments: [openingTag.type.opposingName!], ); } @@ -222,7 +222,7 @@ final class DocCommentBuilder { _diagnosticReporter?.atOffset( offset: closingTag.offset, length: closingTag.end - closingTag.offset, - diagnosticCode: WarningCode.DOC_DIRECTIVE_MISSING_OPENING_TAG, + diagnosticCode: WarningCode.docDirectiveMissingOpeningTag, arguments: [closingTag.type.name], ); _pushDocDirective(SimpleDocDirective(closingTag)); @@ -304,7 +304,7 @@ final class DocCommentBuilder { _diagnosticReporter?.atOffset( offset: openingTag.offset, length: openingTag.end - openingTag.offset, - diagnosticCode: WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG, + diagnosticCode: WarningCode.docDirectiveMissingClosingTag, arguments: [openingTag.type.opposingName!], ); } @@ -395,7 +395,7 @@ final class DocCommentBuilder { _diagnosticReporter?.atOffset( offset: _characterSequence._offset + nameIndex, length: nameEnd - nameIndex, - diagnosticCode: WarningCode.DOC_DIRECTIVE_UNKNOWN, + diagnosticCode: WarningCode.docDirectiveUnknown, arguments: [name], ); return false; @@ -1213,7 +1213,7 @@ final class _DirectiveParser { _diagnosticReporter?.atOffset( offset: _offset + index - 1, length: 1, - diagnosticCode: WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE, + diagnosticCode: WarningCode.docDirectiveMissingClosingBrace, ); return (positionalArguments, namedArguments); } @@ -1248,7 +1248,7 @@ final class _DirectiveParser { _diagnosticReporter?.atOffset( offset: _offset + index - 1, length: 1, - diagnosticCode: WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE, + diagnosticCode: WarningCode.docDirectiveMissingClosingBrace, ); break; } @@ -1258,7 +1258,7 @@ final class _DirectiveParser { _diagnosticReporter?.atOffset( offset: extraArgumentsOffset, length: errorLength, - diagnosticCode: WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS, + diagnosticCode: WarningCode.docDirectiveHasExtraArguments, ); _end = _offset + index; } diff --git a/pkg/analyzer/lib/src/fasta/error_converter.dart b/pkg/analyzer/lib/src/fasta/error_converter.dart index d615e97b970..3a893c1352c 100644 --- a/pkg/analyzer/lib/src/fasta/error_converter.dart +++ b/pkg/analyzer/lib/src/fasta/error_converter.dart @@ -40,28 +40,28 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT, + diagnosticCode: CompileTimeErrorCode.asyncForInWrongContext, ); return; case "ASYNC_KEYWORD_USED_AS_IDENTIFIER": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, + diagnosticCode: ParserErrorCode.asyncKeywordUsedAsIdentifier, ); return; case "AWAIT_IN_WRONG_CONTEXT": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, + diagnosticCode: CompileTimeErrorCode.awaitInWrongContext, ); return; case "BUILT_IN_IDENTIFIER_AS_TYPE": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, + diagnosticCode: CompileTimeErrorCode.builtInIdentifierAsType, arguments: [lexeme()], ); return; @@ -69,15 +69,14 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: - CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, + diagnosticCode: CompileTimeErrorCode.concreteClassWithAbstractMember, ); return; case "CONST_CONSTRUCTOR_WITH_BODY": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, + diagnosticCode: ParserErrorCode.constConstructorWithBody, ); return; case "CONST_NOT_INITIALIZED": @@ -85,7 +84,7 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.CONST_NOT_INITIALIZED, + diagnosticCode: CompileTimeErrorCode.constNotInitialized, arguments: [name], ); return; @@ -93,14 +92,14 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, + diagnosticCode: ParserErrorCode.defaultValueInFunctionType, ); return; case "LABEL_UNDEFINED": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.LABEL_UNDEFINED, + diagnosticCode: CompileTimeErrorCode.labelUndefined, arguments: [arguments['name'] as Object], ); return; @@ -108,35 +107,35 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.EMPTY_ENUM_BODY, + diagnosticCode: ParserErrorCode.emptyEnumBody, ); return; case "EXPECTED_CLASS_MEMBER": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.EXPECTED_CLASS_MEMBER, + diagnosticCode: ParserErrorCode.expectedClassMember, ); return; case "EXPECTED_EXECUTABLE": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.EXPECTED_EXECUTABLE, + diagnosticCode: ParserErrorCode.expectedExecutable, ); return; case "EXPECTED_STRING_LITERAL": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.EXPECTED_STRING_LITERAL, + diagnosticCode: ParserErrorCode.expectedStringLiteral, ); return; case "EXPECTED_TOKEN": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.EXPECTED_TOKEN, + diagnosticCode: ParserErrorCode.expectedToken, arguments: [arguments['string'] as Object], ); return; @@ -144,7 +143,7 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.EXPECTED_TYPE_NAME, + diagnosticCode: ParserErrorCode.expectedTypeName, ); return; case "EXTENSION_DECLARES_INSTANCE_FIELD": @@ -156,7 +155,7 @@ class FastaErrorReporter { offset: offset, length: length, diagnosticCode: - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, ); return; case "FINAL_NOT_INITIALIZED": @@ -164,7 +163,7 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.FINAL_NOT_INITIALIZED, + diagnosticCode: CompileTimeErrorCode.finalNotInitialized, arguments: [name], ); return; @@ -173,8 +172,7 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, + diagnosticCode: CompileTimeErrorCode.finalNotInitializedConstructor1, arguments: [name], ); return; @@ -182,14 +180,14 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.GETTER_WITH_PARAMETERS, + diagnosticCode: ParserErrorCode.getterWithParameters, ); return; case "ILLEGAL_CHARACTER": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ScannerErrorCode.ILLEGAL_CHARACTER, + diagnosticCode: ScannerErrorCode.illegalCharacter, ); return; case "INVALID_ASSIGNMENT": @@ -198,7 +196,7 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_ASSIGNMENT, + diagnosticCode: CompileTimeErrorCode.invalidAssignment, arguments: [type1, type2], ); return; @@ -206,77 +204,77 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_INLINE_FUNCTION_TYPE, + diagnosticCode: CompileTimeErrorCode.invalidInlineFunctionType, ); return; case "INVALID_LITERAL_IN_CONFIGURATION": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.INVALID_LITERAL_IN_CONFIGURATION, + diagnosticCode: ParserErrorCode.invalidLiteralInConfiguration, ); return; case "IMPORT_OF_NON_LIBRARY": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, + diagnosticCode: CompileTimeErrorCode.importOfNonLibrary, ); return; case "INVALID_CAST_FUNCTION": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_CAST_FUNCTION, + diagnosticCode: CompileTimeErrorCode.invalidCastFunction, ); return; case "INVALID_CAST_FUNCTION_EXPR": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_CAST_FUNCTION_EXPR, + diagnosticCode: CompileTimeErrorCode.invalidCastFunctionExpr, ); return; case "INVALID_CAST_LITERAL_LIST": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_CAST_LITERAL_LIST, + diagnosticCode: CompileTimeErrorCode.invalidCastLiteralList, ); return; case "INVALID_CAST_LITERAL_MAP": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_CAST_LITERAL_MAP, + diagnosticCode: CompileTimeErrorCode.invalidCastLiteralMap, ); return; case "INVALID_CAST_LITERAL_SET": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_CAST_LITERAL_SET, + diagnosticCode: CompileTimeErrorCode.invalidCastLiteralSet, ); return; case "INVALID_CAST_METHOD": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_CAST_METHOD, + diagnosticCode: CompileTimeErrorCode.invalidCastMethod, ); return; case "INVALID_CAST_NEW_EXPR": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_CAST_NEW_EXPR, + diagnosticCode: CompileTimeErrorCode.invalidCastNewExpr, ); return; case "INVALID_CODE_POINT": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.INVALID_CODE_POINT, + diagnosticCode: ParserErrorCode.invalidCodePoint, arguments: ['\\u{...}'], ); return; @@ -284,21 +282,21 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.INVALID_GENERIC_FUNCTION_TYPE, + diagnosticCode: ParserErrorCode.invalidGenericFunctionType, ); return; case "INVALID_METHOD_OVERRIDE": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.INVALID_OVERRIDE, + diagnosticCode: CompileTimeErrorCode.invalidOverride, ); return; case "INVALID_MODIFIER_ON_SETTER": _reportByCode( offset: offset, length: length, - code: CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER, + code: CompileTimeErrorCode.invalidModifierOnSetter, message: message, ); return; @@ -306,13 +304,13 @@ class FastaErrorReporter { _reportByCode( offset: offset, length: length, - code: ParserErrorCode.INVALID_OPERATOR_FOR_SUPER, + code: ParserErrorCode.invalidOperatorForSuper, message: message, ); return; case "MISSING_DIGIT": diagnosticReporter?.atOffset( - diagnosticCode: ScannerErrorCode.MISSING_DIGIT, + diagnosticCode: ScannerErrorCode.missingDigit, offset: offset, length: length, ); @@ -321,168 +319,168 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.MISSING_ENUM_BODY, + diagnosticCode: ParserErrorCode.missingEnumBody, ); return; case "MISSING_FUNCTION_BODY": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.MISSING_FUNCTION_BODY, + diagnosticCode: ParserErrorCode.missingFunctionBody, ); return; case "MISSING_FUNCTION_PARAMETERS": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.MISSING_FUNCTION_PARAMETERS, + diagnosticCode: ParserErrorCode.missingFunctionParameters, ); return; case "MISSING_HEX_DIGIT": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ScannerErrorCode.MISSING_HEX_DIGIT, + diagnosticCode: ScannerErrorCode.missingHexDigit, ); return; case "MISSING_IDENTIFIER": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.MISSING_IDENTIFIER, + diagnosticCode: ParserErrorCode.missingIdentifier, ); return; case "MISSING_METHOD_PARAMETERS": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.MISSING_METHOD_PARAMETERS, + diagnosticCode: ParserErrorCode.missingMethodParameters, ); return; case "MISSING_STAR_AFTER_SYNC": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.MISSING_STAR_AFTER_SYNC, + diagnosticCode: ParserErrorCode.missingStarAfterSync, ); return; case "MISSING_TYPEDEF_PARAMETERS": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, + diagnosticCode: ParserErrorCode.missingTypedefParameters, ); return; case "MULTIPLE_IMPLEMENTS_CLAUSES": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, + diagnosticCode: ParserErrorCode.multipleImplementsClauses, ); return; case "NAMED_FUNCTION_EXPRESSION": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.NAMED_FUNCTION_EXPRESSION, + diagnosticCode: ParserErrorCode.namedFunctionExpression, ); return; case "NAMED_PARAMETER_OUTSIDE_GROUP": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, + diagnosticCode: ParserErrorCode.namedParameterOutsideGroup, ); return; case "NON_PART_OF_DIRECTIVE_IN_PART": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, + diagnosticCode: ParserErrorCode.nonPartOfDirectiveInPart, ); return; case "NON_SYNC_FACTORY": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.NON_SYNC_FACTORY, + diagnosticCode: CompileTimeErrorCode.nonSyncFactory, ); return; case "POSITIONAL_AFTER_NAMED_ARGUMENT": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT, + diagnosticCode: ParserErrorCode.positionalAfterNamedArgument, ); return; case "RECURSIVE_CONSTRUCTOR_REDIRECT": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, + diagnosticCode: CompileTimeErrorCode.recursiveConstructorRedirect, ); return; case "RETURN_IN_GENERATOR": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.RETURN_IN_GENERATOR, + diagnosticCode: CompileTimeErrorCode.returnInGenerator, ); return; case "SUPER_INVOCATION_NOT_LAST": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.SUPER_INVOCATION_NOT_LAST, + diagnosticCode: CompileTimeErrorCode.superInvocationNotLast, ); return; case "SUPER_IN_REDIRECTING_CONSTRUCTOR": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR, + diagnosticCode: CompileTimeErrorCode.superInRedirectingConstructor, ); return; case "UNDEFINED_CLASS": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.UNDEFINED_CLASS, + diagnosticCode: CompileTimeErrorCode.undefinedClass, ); return; case "UNDEFINED_GETTER": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.UNDEFINED_GETTER, + diagnosticCode: CompileTimeErrorCode.undefinedGetter, ); return; case "UNDEFINED_METHOD": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.UNDEFINED_METHOD, + diagnosticCode: CompileTimeErrorCode.undefinedMethod, ); return; case "UNDEFINED_SETTER": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: CompileTimeErrorCode.UNDEFINED_SETTER, + diagnosticCode: CompileTimeErrorCode.undefinedSetter, ); return; case "UNEXPECTED_DOLLAR_IN_STRING": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ScannerErrorCode.UNEXPECTED_DOLLAR_IN_STRING, + diagnosticCode: ScannerErrorCode.unexpectedDollarInString, ); return; case "UNEXPECTED_TOKEN": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ParserErrorCode.UNEXPECTED_TOKEN, + diagnosticCode: ParserErrorCode.unexpectedToken, arguments: [lexeme()], ); return; @@ -490,22 +488,21 @@ class FastaErrorReporter { diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, + diagnosticCode: ScannerErrorCode.unterminatedMultiLineComment, ); return; case "UNTERMINATED_STRING_LITERAL": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: ScannerErrorCode.UNTERMINATED_STRING_LITERAL, + diagnosticCode: ScannerErrorCode.unterminatedStringLiteral, ); return; case "WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER": diagnosticReporter?.atOffset( offset: offset, length: length, - diagnosticCode: - ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, + diagnosticCode: ParserErrorCode.wrongSeparatorForPositionalParameter, ); return; case "YIELD_IN_NON_GENERATOR": diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart index 8170517d2fe..56da17a9705 100644 --- a/pkg/analyzer/lib/src/generated/element_resolver.dart +++ b/pkg/analyzer/lib/src/generated/element_resolver.dart @@ -348,13 +348,13 @@ class ElementResolver { if (name != null) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, + CompileTimeErrorCode.undefinedConstructorInInitializer, arguments: [superType, name.name], ); } else { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, + CompileTimeErrorCode.undefinedConstructorInInitializerDefault, arguments: [superType], ); } @@ -367,7 +367,7 @@ class ElementResolver { )) { _diagnosticReporter.atNode( node, - CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, + CompileTimeErrorCode.nonGenerativeConstructor, arguments: [element], ); } @@ -404,17 +404,14 @@ class ElementResolver { case SuperContext.static: _diagnosticReporter.atNode( node, - CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, + CompileTimeErrorCode.superInInvalidContext, ); case SuperContext.extension: - _diagnosticReporter.atNode( - node, - CompileTimeErrorCode.SUPER_IN_EXTENSION, - ); + _diagnosticReporter.atNode(node, CompileTimeErrorCode.superInExtension); case SuperContext.extensionType: _diagnosticReporter.atNode( node, - CompileTimeErrorCode.SUPER_IN_EXTENSION_TYPE, + CompileTimeErrorCode.superInExtensionType, ); } } diff --git a/pkg/analyzer/lib/src/generated/error_detection_helpers.dart b/pkg/analyzer/lib/src/generated/error_detection_helpers.dart index 4b97e552e4c..090d64ddaaf 100644 --- a/pkg/analyzer/lib/src/generated/error_detection_helpers.dart +++ b/pkg/analyzer/lib/src/generated/error_detection_helpers.dart @@ -63,7 +63,7 @@ mixin ErrorDetectionHelpers { /// Verify that the given [argument] can be assigned to its corresponding /// parameter. /// - /// See [CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]. + /// See [CompileTimeErrorCode.argumentTypeNotAssignable]. void checkForArgumentTypeNotAssignableForArgument( ExpressionImpl argument, { bool promoteParameterToNullable = false, @@ -117,13 +117,12 @@ mixin ErrorDetectionHelpers { )) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode - .RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, ); return; } } - if (diagnosticCode == CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE) { + if (diagnosticCode == CompileTimeErrorCode.argumentTypeNotAssignable) { var additionalInfo = []; if (expectedStaticType is RecordTypeImpl && actualStaticType is RecordTypeImpl) { @@ -189,8 +188,8 @@ mixin ErrorDetectionHelpers { /// and initializer expression types. The [fieldElement] is the static element /// from the name in the [ConstructorFieldInitializer]. /// - /// See [CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE], and - /// [CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE]. + /// See [CompileTimeErrorCode.constFieldInitializerNotAssignable], and + /// [CompileTimeErrorCode.fieldInitializerNotAssignable]. void checkForFieldInitializerNotAssignable( ConstructorFieldInitializerImpl initializer, InternalFieldElement fieldElement, { @@ -223,14 +222,14 @@ mixin ErrorDetectionHelpers { // constant, not the static type. See dartbug.com/21119. diagnosticReporter.atNode( expression, - CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, + CompileTimeErrorCode.constFieldInitializerNotAssignable, arguments: [staticType, fieldType], contextMessages: messages, ); } else { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, + CompileTimeErrorCode.fieldInitializerNotAssignable, arguments: [staticType, fieldType], contextMessages: messages, ); @@ -264,7 +263,7 @@ mixin ErrorDetectionHelpers { /// when it returns 'void'. Or, in rare cases, when other types of expressions /// are void, such as identifiers. /// - /// See [CompileTimeErrorCode.USE_OF_VOID_RESULT]. + /// See [CompileTimeErrorCode.useOfVoidResult]. bool checkForUseOfVoidResult(Expression expression) { if (!identical(expression.staticType, VoidTypeImpl.instance)) { return false; @@ -274,12 +273,12 @@ mixin ErrorDetectionHelpers { SimpleIdentifier methodName = expression.methodName; diagnosticReporter.atNode( methodName, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } else { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.USE_OF_VOID_RESULT, + CompileTimeErrorCode.useOfVoidResult, ); } @@ -402,7 +401,7 @@ mixin ErrorDetectionHelpers { argument, staticParameterType, argument.typeOrThrow, - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, whyNotPromoted: whyNotPromoted, ); } diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart index e914ae150d3..a95e60d79e1 100644 --- a/pkg/analyzer/lib/src/generated/error_verifier.dart +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart @@ -58,7 +58,7 @@ import 'package:collection/collection.dart'; /// Check that none of the type [parameters] references itself in its bound. /// -/// See [CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]. +/// See [CompileTimeErrorCode.typeParameterSupertypeOfItsBound]. void checkForTypeParameterBoundRecursion( DiagnosticReporter diagnosticReporter, List parameters, @@ -89,7 +89,7 @@ void checkForTypeParameterBoundRecursion( // assume `element.bound` is non-`null`. diagnosticReporter.atToken( parameter.name, - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, + CompileTimeErrorCode.typeParameterSupertypeOfItsBound, arguments: [element.displayName, element.bound!], ); break; @@ -410,7 +410,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (!_enclosingExecutable.isAsynchronous) { diagnosticReporter.atToken( node.awaitKeyword, - CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, + CompileTimeErrorCode.awaitInWrongContext, ); } checkForUseOfVoidResult(node.expression); @@ -469,7 +469,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (labelElement is LabelElementImpl && labelElement.isOnSwitchMember) { diagnosticReporter.atNode( labelNode, - CompileTimeErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, + CompileTimeErrorCode.breakLabelOnSwitchMember, ); } } @@ -502,7 +502,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (!declarationElement.element.isDartCoreFunctionImpl) { _checkForBuiltInIdentifierAsName( node.name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, + CompileTimeErrorCode.builtInIdentifierAsTypeName, ); } _checkForConflictingClassTypeVariableErrorCodes(); @@ -565,7 +565,7 @@ class ErrorVerifier extends RecursiveAstVisitor _checkForBuiltInIdentifierAsName( node.name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, + CompileTimeErrorCode.builtInIdentifierAsTypedefName, ); try { _enclosingClass = firstFragment.asElement2; @@ -632,7 +632,7 @@ class ErrorVerifier extends RecursiveAstVisitor _checkForNonConstGenerativeEnumConstructor(node); _checkForInvalidModifierOnBody( node.body, - CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR, + CompileTimeErrorCode.invalidModifierOnConstructor, ); if (!_checkForConstConstructorWithNonConstSuper(node)) { _checkForConstConstructorWithNonFinalField(node, element); @@ -688,7 +688,7 @@ class ErrorVerifier extends RecursiveAstVisitor defaultValue, defaultValue.typeOrThrow, node.declaredFragment!.element.type, - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, ); } @@ -740,7 +740,7 @@ class ErrorVerifier extends RecursiveAstVisitor _checkForBuiltInIdentifierAsName( node.name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, + CompileTimeErrorCode.builtInIdentifierAsTypeName, ); _checkForConflictingEnumTypeVariableErrorCodes(declaredFragment); var implementsClause = node.implementsClause; @@ -760,7 +760,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (element.constants.isEmpty) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.ENUM_WITHOUT_CONSTANTS, + CompileTimeErrorCode.enumWithoutConstants, ); } } @@ -829,7 +829,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (name != null) { _checkForBuiltInIdentifierAsName( name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_NAME, + CompileTimeErrorCode.builtInIdentifierAsExtensionName, ); } super.visitExtensionDeclaration(node); @@ -849,7 +849,7 @@ class ErrorVerifier extends RecursiveAstVisitor _checkForBuiltInIdentifierAsName( node.name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_TYPE_NAME, + CompileTimeErrorCode.builtInIdentifierAsExtensionTypeName, ); _checkForConflictingExtensionTypeTypeVariableErrorCodes(declaredFragment); @@ -857,7 +857,7 @@ class ErrorVerifier extends RecursiveAstVisitor _checkForRepeatedType( libraryContext.setOfImplements(firstFragment.asElement2), node.implementsClause?.interfaces, - CompileTimeErrorCode.IMPLEMENTS_REPEATED, + CompileTimeErrorCode.implementsRepeated, ); _checkForConflictingClassMembers(declaredFragment); _checkForConflictingGenerics(node); @@ -906,7 +906,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (fields.isConst) { diagnosticReporter.atToken( fields.keyword!, - CompileTimeErrorCode.CONST_INSTANCE_FIELD, + CompileTimeErrorCode.constInstanceField, ); } } @@ -951,7 +951,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (loopVariable.isConst) { diagnosticReporter.atToken( loopVariable.keyword!, - CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE, + CompileTimeErrorCode.forInWithConstVariable, ); } } @@ -1055,7 +1055,7 @@ class ErrorVerifier extends RecursiveAstVisitor void visitFunctionTypeAlias(covariant FunctionTypeAliasImpl node) { _checkForBuiltInIdentifierAsName( node.name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, + CompileTimeErrorCode.builtInIdentifierAsTypedefName, ); _checkForMainFunction1(node.name, node.declaredFragment!); _checkForTypeAliasCannotReferenceItself( @@ -1084,7 +1084,7 @@ class ErrorVerifier extends RecursiveAstVisitor _checkForBuiltInIdentifierAsName( node.name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, + CompileTimeErrorCode.builtInIdentifierAsTypedefName, ); _checkForMainFunction1(node.name, node.declaredFragment!); _checkForTypeAliasCannotReferenceItself(node.name, fragment); @@ -1105,7 +1105,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (node.prefix != null) { _checkForBuiltInIdentifierAsName( node.prefix!.token, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_PREFIX_NAME, + CompileTimeErrorCode.builtInIdentifierAsPrefixName, ); } if (importElement != null) { @@ -1287,7 +1287,7 @@ class ErrorVerifier extends RecursiveAstVisitor List members = node.members; _checkForBuiltInIdentifierAsName( node.name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, + CompileTimeErrorCode.builtInIdentifierAsTypeName, ); _checkForConflictingClassTypeVariableErrorCodes(); @@ -1326,10 +1326,7 @@ class ErrorVerifier extends RecursiveAstVisitor // TODO(brianwilkerson): Figure out the right rule for when 'native' is // allowed. if (!_isInSystemLibrary) { - diagnosticReporter.atNode( - node, - ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE, - ); + diagnosticReporter.atNode(node, ParserErrorCode.nativeClauseInNonSdkCode); } super.visitNativeClause(node); } @@ -1518,8 +1515,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (_enclosingClass is ExtensionTypeElement) { diagnosticReporter.atToken( node.superKeyword, - CompileTimeErrorCode - .EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_FORMAL_PARAMETER, + CompileTimeErrorCode.extensionTypeConstructorWithSuperFormalParameter, ); return; } @@ -1529,7 +1525,7 @@ class ErrorVerifier extends RecursiveAstVisitor constructor.isNonRedirectingGenerative)) { diagnosticReporter.atToken( node.superKeyword, - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, + CompileTimeErrorCode.invalidSuperFormalParameterLocation, ); return; } @@ -1542,10 +1538,9 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atToken( node.name, node.isNamed - ? CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED + ? CompileTimeErrorCode.superFormalParameterWithoutAssociatedNamed : CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, + .superFormalParameterWithoutAssociatedPositional, ); return; } @@ -1556,8 +1551,7 @@ class ErrorVerifier extends RecursiveAstVisitor )) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED, + CompileTimeErrorCode.superFormalParameterTypeIsNotSubtypeOfAssociated, arguments: [element.type, superParameter.type], ); } @@ -1641,7 +1635,7 @@ class ErrorVerifier extends RecursiveAstVisitor void visitTypeParameter(TypeParameter node) { _checkForBuiltInIdentifierAsName( node.name, - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, + CompileTimeErrorCode.builtInIdentifierAsTypeParameterName, ); _checkForTypeAnnotationDeferredClass(node.bound); _checkForGenericFunctionType(node.bound); @@ -1722,7 +1716,7 @@ class ErrorVerifier extends RecursiveAstVisitor _checkForRepeatedType( libraryContext.setOfImplements(declarationElement.asElement2), implementsClause?.interfaces, - CompileTimeErrorCode.IMPLEMENTS_REPEATED, + CompileTimeErrorCode.implementsRepeated, ); _checkImplementsSuperClass(implementsClause); _checkMixinsSuperClass(withClause); @@ -1753,7 +1747,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Given a list of [directives] that have the same prefix, generate an error /// if there is more than one import and any of those imports is deferred. /// - /// See [CompileTimeErrorCode.SHARED_DEFERRED_PREFIX]. + /// See [CompileTimeErrorCode.sharedDeferredPrefix]. void _checkDeferredPrefixCollision(List directives) { int count = directives.length; if (count > 1) { @@ -1762,7 +1756,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (deferredToken != null) { diagnosticReporter.atToken( deferredToken, - CompileTimeErrorCode.SHARED_DEFERRED_PREFIX, + CompileTimeErrorCode.sharedDeferredPrefix, ); } } @@ -1776,13 +1770,13 @@ class ErrorVerifier extends RecursiveAstVisitor if (fieldElement.isAbstract) { diagnosticReporter.atToken( identifier, - CompileTimeErrorCode.ABSTRACT_FIELD_CONSTRUCTOR_INITIALIZER, + CompileTimeErrorCode.abstractFieldConstructorInitializer, ); } if (fieldElement.isExternal) { diagnosticReporter.atToken( identifier, - CompileTimeErrorCode.EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER, + CompileTimeErrorCode.externalFieldConstructorInitializer, ); } } @@ -1796,20 +1790,20 @@ class ErrorVerifier extends RecursiveAstVisitor if (declaredElement.isAbstract) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.ABSTRACT_FIELD_INITIALIZER, + CompileTimeErrorCode.abstractFieldInitializer, ); } if (declaredElement.isExternal) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.EXTERNAL_FIELD_INITIALIZER, + CompileTimeErrorCode.externalFieldInitializer, ); } } else if (declaredElement is TopLevelVariableElement) { if (declaredElement.isExternal) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.EXTERNAL_VARIABLE_INITIALIZER, + CompileTimeErrorCode.externalVariableInitializer, ); } } @@ -1818,8 +1812,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that all classes of the given [withClause] are valid. /// - /// See [CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR], - /// [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]. + /// See [CompileTimeErrorCode.mixinClassDeclaresConstructor], + /// [CompileTimeErrorCode.mixinInheritsFromNotObject]. bool _checkForAllMixinErrorCodes(WithClauseImpl? withClause) { if (withClause == null) { return false; @@ -1837,14 +1831,14 @@ class ErrorVerifier extends RecursiveAstVisitor mixinTypeIndex++; if (_checkForExtendsOrImplementsDisallowedClass( mixinName, - CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, + CompileTimeErrorCode.mixinOfDisallowedClass, )) { problemReported = true; } else { var mixinElement = mixinType.element; if (_checkForExtendsOrImplementsDeferredClass( mixinName, - CompileTimeErrorCode.MIXIN_DEFERRED_CLASS, + CompileTimeErrorCode.mixinDeferredClass, )) { problemReported = true; } @@ -1909,7 +1903,7 @@ class ErrorVerifier extends RecursiveAstVisitor } diagnosticReporter.atNode( redirectedConstructor, - CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR, + CompileTimeErrorCode.redirectToMissingConstructor, arguments: [constructorStrName, redirectedType], ); } @@ -1928,7 +1922,7 @@ class ErrorVerifier extends RecursiveAstVisitor )) { diagnosticReporter.atNode( redirectedConstructor, - CompileTimeErrorCode.REDIRECT_TO_INVALID_RETURN_TYPE, + CompileTimeErrorCode.redirectToInvalidReturnType, arguments: [redirectedReturnType, constructorReturnType], ); return; @@ -1936,7 +1930,7 @@ class ErrorVerifier extends RecursiveAstVisitor // Check parameters. diagnosticReporter.atNode( redirectedConstructor, - CompileTimeErrorCode.REDIRECT_TO_INVALID_FUNCTION_TYPE, + CompileTimeErrorCode.redirectToInvalidFunctionType, arguments: [redirectedType, constructorType], ); } @@ -1948,7 +1942,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// element in the node was `null`, then this method is not called. The /// [exportedLibrary] is the library element containing the exported element. /// - /// See [CompileTimeErrorCode.AMBIGUOUS_EXPORT]. + /// See [CompileTimeErrorCode.ambiguousExport]. void _checkForAmbiguousExport( ExportDirectiveImpl directive, LibraryExportImpl libraryExport, @@ -1968,7 +1962,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (prevElement != null && prevElement != element) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.AMBIGUOUS_EXPORT, + CompileTimeErrorCode.ambiguousExport, arguments: [name, prevElement.library!.uri, element.library!.uri], ); return; @@ -1991,7 +1985,7 @@ class ErrorVerifier extends RecursiveAstVisitor libraryNames.sort(); diagnosticReporter.atToken( name, - CompileTimeErrorCode.AMBIGUOUS_IMPORT, + CompileTimeErrorCode.ambiguousImport, arguments: [name.lexeme, libraryNames.quotedAndCommaSeparatedWithAnd], ); } @@ -1999,9 +1993,9 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the given [expression] is not final. /// - /// See [CompileTimeErrorCode.ASSIGNMENT_TO_CONST], - /// [CompileTimeErrorCode.ASSIGNMENT_TO_FINAL], and - /// [CompileTimeErrorCode.ASSIGNMENT_TO_METHOD]. + /// See [CompileTimeErrorCode.assignmentToConst], + /// [CompileTimeErrorCode.assignmentToFinal], and + /// [CompileTimeErrorCode.assignmentToMethod]. void _checkForAssignmentToFinal(Expression expression) { // TODO(scheglov): Check SimpleIdentifier(s) as all other nodes. if (expression is! SimpleIdentifier) return; @@ -2023,7 +2017,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (element.isConst) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.ASSIGNMENT_TO_CONST, + CompileTimeErrorCode.assignmentToConst, ); } } else if (element is GetterElement) { @@ -2031,18 +2025,18 @@ class ErrorVerifier extends RecursiveAstVisitor if (variable.isConst) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.ASSIGNMENT_TO_CONST, + CompileTimeErrorCode.assignmentToConst, ); } else if (variable is FieldElement && variable.isSynthetic) { diagnosticReporter.atNode( highlightedNode, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, + CompileTimeErrorCode.assignmentToFinalNoSetter, arguments: [variable.name!, variable.enclosingElement.displayName], ); } else { diagnosticReporter.atNode( highlightedNode, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, + CompileTimeErrorCode.assignmentToFinal, arguments: [variable.name!], ); } @@ -2050,19 +2044,19 @@ class ErrorVerifier extends RecursiveAstVisitor element is TopLevelFunctionElement) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.ASSIGNMENT_TO_FUNCTION, + CompileTimeErrorCode.assignmentToFunction, ); } else if (element is MethodElement) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, + CompileTimeErrorCode.assignmentToMethod, ); } else if (element is InterfaceElement || element is DynamicElementImpl || element is TypeParameterElement) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, + CompileTimeErrorCode.assignmentToType, ); } } @@ -2071,7 +2065,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (_isInLateLocalVariable.last) { diagnosticReporter.atToken( node.awaitKeyword, - CompileTimeErrorCode.AWAIT_IN_LATE_LOCAL_VARIABLE_INITIALIZER, + CompileTimeErrorCode.awaitInLateLocalVariableInitializer, ); } } @@ -2082,7 +2076,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (typeSystem.isIncompatibleWithAwait(expressionType)) { diagnosticReporter.atToken( node.awaitKeyword, - CompileTimeErrorCode.AWAIT_OF_INCOMPATIBLE_TYPE, + CompileTimeErrorCode.awaitOfIncompatibleType, ); } } @@ -2103,7 +2097,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (type != null && type.isDartCoreFunction) { diagnosticReporter.atNode( superclass, - WarningCode.DEPRECATED_EXTENDS_FUNCTION, + WarningCode.deprecatedExtendsFunction, ); } } @@ -2114,7 +2108,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (type != null && type.isDartCoreFunction) { diagnosticReporter.atNode( interface, - WarningCode.DEPRECATED_IMPLEMENTS_FUNCTION, + WarningCode.deprecatedImplementsFunction, ); break; } @@ -2125,10 +2119,7 @@ class ErrorVerifier extends RecursiveAstVisitor for (NamedType mixin in withClause.mixinTypes) { var type = mixin.type; if (type != null && type.isDartCoreFunction) { - diagnosticReporter.atNode( - mixin, - WarningCode.DEPRECATED_MIXIN_FUNCTION, - ); + diagnosticReporter.atNode(mixin, WarningCode.deprecatedMixinFunction); } } } @@ -2137,8 +2128,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that if a class is implementing a base class or mixin, it must be /// within the same library as that class or mixin. /// - /// See [CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY], - /// [CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY]. + /// See [CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary], + /// [CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary]. void _checkForBaseClassOrMixinImplementedOutsideOfLibrary( ImplementsClause? implementsClause, ) { @@ -2164,13 +2155,13 @@ class ErrorVerifier extends RecursiveAstVisitor !interfaceElement.isSealed) { diagnosticReporter.atNode( interface, - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, arguments: [interfaceElement.name!], ); } else if (interfaceElement is MixinElement) { diagnosticReporter.atNode( interface, - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, arguments: [interfaceElement.name!], ); } @@ -2184,10 +2175,10 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the given [token] is not a keyword, and generates the /// given [code] on the identifier if it is a keyword. /// - /// See [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_NAME], - /// [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME], - /// [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME], and - /// [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]. + /// See [CompileTimeErrorCode.builtInIdentifierAsExtensionName], + /// [CompileTimeErrorCode.builtInIdentifierAsTypeName], + /// [CompileTimeErrorCode.builtInIdentifierAsTypeParameterName], and + /// [CompileTimeErrorCode.builtInIdentifierAsTypedefName]. void _checkForBuiltInIdentifierAsName(Token token, DiagnosticCode code) { if (token.type.isKeyword && token.keyword?.isPseudo != true) { diagnosticReporter.atToken(token, code, arguments: [token.lexeme]); @@ -2197,7 +2188,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that if a class is being mixed in and class modifiers are enabled /// in that class' library, then it must be a mixin class. /// - /// See [CompileTimeErrorCode.CLASS_USED_AS_MIXIN]. + /// See [CompileTimeErrorCode.classUsedAsMixin]. void _checkForClassUsedAsMixin(WithClause? withClause) { if (withClause != null) { for (NamedType withMixin in withClause.mixinTypes) { @@ -2212,7 +2203,7 @@ class ErrorVerifier extends RecursiveAstVisitor !_mayIgnoreClassModifiers(withElement.library)) { diagnosticReporter.atNode( withMixin, - CompileTimeErrorCode.CLASS_USED_AS_MIXIN, + CompileTimeErrorCode.classUsedAsMixin, arguments: [withElement.name!], ); } @@ -2224,9 +2215,9 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the [_enclosingClass] does not have a method and getter pair /// with the same name, via inheritance. /// - /// See [CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE], - /// [CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD], and - /// [CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD]. + /// See [CompileTimeErrorCode.conflictingStaticAndInstance], + /// [CompileTimeErrorCode.conflictingMethodAndField], and + /// [CompileTimeErrorCode.conflictingFieldAndMethod]. void _checkForConflictingClassMembers(InterfaceFragmentImpl fragment) { var enclosingClass = _enclosingClass; if (enclosingClass == null) { @@ -2258,7 +2249,7 @@ class ErrorVerifier extends RecursiveAstVisitor void reportStaticConflict(InternalExecutableElement inherited) { diagnosticReporter.atElement2( method.asElement2, - CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, + CompileTimeErrorCode.conflictingStaticAndInstance, arguments: [ enclosingClass.displayName, name, @@ -2286,7 +2277,7 @@ class ErrorVerifier extends RecursiveAstVisitor void reportFieldConflict(InternalPropertyAccessorElement inherited) { diagnosticReporter.atElement2( method.asElement2, - CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, + CompileTimeErrorCode.conflictingMethodAndField, arguments: [ enclosingClass.displayName, name, @@ -2323,7 +2314,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (accessor.isStatic && inherited != null) { diagnosticReporter.atElement2( accessor.asElement2, - CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, + CompileTimeErrorCode.conflictingStaticAndInstance, arguments: [ enclosingClass.displayName, name, @@ -2338,7 +2329,7 @@ class ErrorVerifier extends RecursiveAstVisitor } diagnosticReporter.atElement2( accessor.asElement2, - CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, + CompileTimeErrorCode.conflictingFieldAndMethod, arguments: [ enclosingClass.displayName, name, @@ -2363,7 +2354,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (setter is InternalPropertyAccessorElement) { diagnosticReporter.atElement2( enclosingClass, - CompileTimeErrorCode.CONFLICTING_INHERITED_METHOD_AND_SETTER, + CompileTimeErrorCode.conflictingInheritedMethodAndSetter, arguments: [ enclosingClass.kind.displayName, enclosingClass.displayName, @@ -2412,8 +2403,8 @@ class ErrorVerifier extends RecursiveAstVisitor if (enclosingClass.name == name) { var code = enclosingClass is MixinElement - ? CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MIXIN - : CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS; + ? CompileTimeErrorCode.conflictingTypeVariableAndMixin + : CompileTimeErrorCode.conflictingTypeVariableAndClass; diagnosticReporter.atElement2(typeParameter, code, arguments: [name]); } // check members @@ -2423,10 +2414,8 @@ class ErrorVerifier extends RecursiveAstVisitor enclosingClass.getSetter(name) != null) { var code = enclosingClass is MixinElement - ? CompileTimeErrorCode - .CONFLICTING_TYPE_VARIABLE_AND_MEMBER_MIXIN - : CompileTimeErrorCode - .CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS; + ? CompileTimeErrorCode.conflictingTypeVariableAndMemberMixin + : CompileTimeErrorCode.conflictingTypeVariableAndMemberClass; diagnosticReporter.atElement2(typeParameter, code, arguments: [name]); } } @@ -2441,7 +2430,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (fragment.name == name) { diagnosticReporter.atElement2( typeParameter.asElement2, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_ENUM, + CompileTimeErrorCode.conflictingTypeVariableAndEnum, arguments: [name], ); } @@ -2452,7 +2441,7 @@ class ErrorVerifier extends RecursiveAstVisitor element.getSetter(name) != null) { diagnosticReporter.atElement2( typeParameter.asElement2, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_ENUM, + CompileTimeErrorCode.conflictingTypeVariableAndMemberEnum, arguments: [name], ); } @@ -2470,7 +2459,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (fragment.name == name) { diagnosticReporter.atElement2( typeParameter.asElement2, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION_TYPE, + CompileTimeErrorCode.conflictingTypeVariableAndExtensionType, arguments: [name], ); } @@ -2482,8 +2471,7 @@ class ErrorVerifier extends RecursiveAstVisitor element.getSetter(name) != null) { diagnosticReporter.atElement2( typeParameter.asElement2, - CompileTimeErrorCode - .CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION_TYPE, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtensionType, arguments: [name], ); } @@ -2492,8 +2480,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify all conflicts between type variable and enclosing extension. /// - /// See [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION], and - /// [CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION]. + /// See [CompileTimeErrorCode.conflictingTypeVariableAndExtension], and + /// [CompileTimeErrorCode.conflictingTypeVariableAndMemberExtension]. void _checkForConflictingExtensionTypeVariableErrorCodes() { for (TypeParameterElement typeParameter in _enclosingExtension!.typeParameters) { @@ -2504,7 +2492,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (_enclosingExtension!.name == name) { diagnosticReporter.atElement2( typeParameter, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION, + CompileTimeErrorCode.conflictingTypeVariableAndExtension, arguments: [name], ); } @@ -2514,7 +2502,7 @@ class ErrorVerifier extends RecursiveAstVisitor _enclosingExtension!.getSetter(name) != null) { diagnosticReporter.atElement2( typeParameter, - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtension, arguments: [name], ); } @@ -2536,7 +2524,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (error is IncompatibleInterfacesClassHierarchyError) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, + CompileTimeErrorCode.conflictingGenericInterfaces, arguments: [ _enclosingClass!.kind.displayName, _enclosingClass!.name!, @@ -2569,7 +2557,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (redirectingInitializerCount > 0) { diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, + CompileTimeErrorCode.multipleRedirectingConstructorInvocations, ); } if (declaration.factoryKeyword == null) { @@ -2583,7 +2571,7 @@ class ErrorVerifier extends RecursiveAstVisitor } diagnosticReporter.atNode( invocation, - CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, + CompileTimeErrorCode.redirectGenerativeToMissingConstructor, arguments: [constructorStrName, enclosingNamedType], ); } else { @@ -2591,7 +2579,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( initializer, CompileTimeErrorCode - .REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR, + .redirectGenerativeToNonGenerativeConstructor, ); } } @@ -2608,13 +2596,13 @@ class ErrorVerifier extends RecursiveAstVisitor if (enclosingClass is EnumElement) { diagnosticReporter.atToken( initializer.superKeyword, - CompileTimeErrorCode.SUPER_IN_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.superInEnumConstructor, ); } else if (superInitializerCount == 1) { // Only report the second (first illegal) superinitializer. diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS, + CompileTimeErrorCode.multipleSuperInitializers, ); } superInitializer = initializer; @@ -2629,20 +2617,20 @@ class ErrorVerifier extends RecursiveAstVisitor if (enclosingClass is! EnumElement) { diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.superInRedirectingConstructor, ); } } if (initializer is ConstructorFieldInitializer) { diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, ); } if (initializer is AssertInitializer) { diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.ASSERT_IN_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.assertInRedirectingConstructor, ); } } @@ -2661,7 +2649,7 @@ class ErrorVerifier extends RecursiveAstVisitor } diagnosticReporter.atToken( superInitializer.superKeyword, - CompileTimeErrorCode.SUPER_INVOCATION_NOT_LAST, + CompileTimeErrorCode.superInvocationNotLast, arguments: [constructorStrName], ); } @@ -2675,8 +2663,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Return `true` if an error is reported here, and the caller should stop /// checking the constructor for constant-related errors. /// - /// See [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER], and - /// [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD]. + /// See [CompileTimeErrorCode.constConstructorWithNonConstSuper], and + /// [CompileTimeErrorCode.constConstructorWithMixinWithField]. bool _checkForConstConstructorWithNonConstSuper( ConstructorDeclaration constructor, ) { @@ -2716,7 +2704,7 @@ class ErrorVerifier extends RecursiveAstVisitor var field = instanceFields.single; diagnosticReporter.atNode( constructor.returnType, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD, + CompileTimeErrorCode.constConstructorWithMixinWithField, arguments: ["'${field.enclosingElement.name}.${field.name}'"], ); return true; @@ -2726,7 +2714,7 @@ class ErrorVerifier extends RecursiveAstVisitor .join(', '); diagnosticReporter.atNode( constructor.returnType, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELDS, + CompileTimeErrorCode.constConstructorWithMixinWithFields, arguments: [fieldNames], ); return true; @@ -2761,7 +2749,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( errorNode, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, + CompileTimeErrorCode.constConstructorWithNonConstSuper, arguments: [element.enclosingElement.displayName], ); return true; @@ -2787,7 +2775,7 @@ class ErrorVerifier extends RecursiveAstVisitor } diagnosticReporter.atConstructorDeclaration( constructor, - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, + CompileTimeErrorCode.constConstructorWithNonFinalField, ); } @@ -2796,7 +2784,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// always non-`null`. The [namedType] is the name of the type defining the /// constructor, always non-`null`. /// - /// See [CompileTimeErrorCode.CONST_DEFERRED_CLASS]. + /// See [CompileTimeErrorCode.constDeferredClass]. void _checkForConstDeferredClass( InstanceCreationExpression expression, ConstructorName constructorName, @@ -2805,7 +2793,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (namedType.isDeferred) { diagnosticReporter.atNode( constructorName, - CompileTimeErrorCode.CONST_DEFERRED_CLASS, + CompileTimeErrorCode.constDeferredClass, ); } } @@ -2813,12 +2801,12 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the given throw [expression] is not enclosed in a 'const' /// constructor declaration. /// - /// See [CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION]. + /// See [CompileTimeErrorCode.constConstructorThrowsException]. void _checkForConstEvalThrowsException(ThrowExpression expression) { if (_enclosingExecutable.isConstConstructor) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION, + CompileTimeErrorCode.constConstructorThrowsException, ); } } @@ -2839,7 +2827,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (constructorElement != null && !constructorElement.isFactory) { diagnosticReporter.atNode( namedType, - CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, + CompileTimeErrorCode.instantiateAbstractClass, ); } } @@ -2854,7 +2842,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (type.element is MixinElement) { diagnosticReporter.atNode( namedType, - CompileTimeErrorCode.MIXIN_INSTANTIATE, + CompileTimeErrorCode.mixinInstantiate, ); } } @@ -2865,7 +2853,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// This method assumes that the instance creation or dot shorthand /// constructor invocation was tested to be 'const' before being called. /// - /// See [CompileTimeErrorCode.CONST_WITH_NON_CONST]. + /// See [CompileTimeErrorCode.constWithNonConst]. void _checkForConstWithNonConst( Expression expression, ConstructorElement? constructorElement, @@ -2875,12 +2863,12 @@ class ErrorVerifier extends RecursiveAstVisitor if (keyword != null) { diagnosticReporter.atToken( keyword, - CompileTimeErrorCode.CONST_WITH_NON_CONST, + CompileTimeErrorCode.constWithNonConst, ); } else { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.CONST_WITH_NON_CONST, + CompileTimeErrorCode.constWithNonConst, ); } } @@ -2894,8 +2882,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// This method assumes that the instance creation was tested to be 'const' /// before being called. /// - /// See [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR], and - /// [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]. + /// See [CompileTimeErrorCode.constWithUndefinedConstructor], and + /// [CompileTimeErrorCode.constWithUndefinedConstructorDefault]. void _checkForConstWithUndefinedConstructor( InstanceCreationExpression expression, ConstructorName constructorName, @@ -2910,13 +2898,13 @@ class ErrorVerifier extends RecursiveAstVisitor if (name != null) { diagnosticReporter.atNode( name, - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, + CompileTimeErrorCode.constWithUndefinedConstructor, arguments: [namedType.qualifiedName, name.name], ); } else { diagnosticReporter.atNode( constructorName, - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, + CompileTimeErrorCode.constWithUndefinedConstructorDefault, arguments: [namedType.qualifiedName], ); } @@ -2924,10 +2912,7 @@ class ErrorVerifier extends RecursiveAstVisitor void _checkForDeadNullCoalesce(TypeImpl lhsType, Expression rhs) { if (typeSystem.isStrictlyNonNullable(lhsType)) { - diagnosticReporter.atNode( - rhs, - StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, - ); + diagnosticReporter.atNode(rhs, StaticWarningCode.deadNullAwareExpression); } } @@ -2941,7 +2926,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (element is ExtensionElement) { diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.DEFERRED_IMPORT_OF_EXTENSION, + CompileTimeErrorCode.deferredImportOfExtension, ); return; } @@ -2951,7 +2936,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that any deferred imports in the given compilation [unit] have a /// unique prefix. /// - /// See [CompileTimeErrorCode.SHARED_DEFERRED_PREFIX]. + /// See [CompileTimeErrorCode.sharedDeferredPrefix]. void _checkForDeferredPrefixCollisions(CompilationUnit unit) { NodeList directives = unit.directives; int count = directives.length; @@ -3003,7 +2988,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (iterableType is DynamicType && strictCasts) { diagnosticReporter.atNode( node.iterable, - CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, + CompileTimeErrorCode.forInOfInvalidType, arguments: [iterableType, loopNamedType], ); return false; @@ -3043,7 +3028,7 @@ class ErrorVerifier extends RecursiveAstVisitor )) { diagnosticReporter.atNode( node.iterable, - CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, + CompileTimeErrorCode.forInOfInvalidType, arguments: [iterableType, loopNamedType], ); return false; @@ -3086,7 +3071,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (implicitCallMethod == null) { diagnosticReporter.atNode( node.iterable, - CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, + CompileTimeErrorCode.forInOfInvalidElementType, arguments: [iterableType, loopNamedType, variableType], ); } else { @@ -3121,7 +3106,7 @@ class ErrorVerifier extends RecursiveAstVisitor )) { diagnosticReporter.atNode( node.iterable, - CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, + CompileTimeErrorCode.forInOfInvalidElementType, arguments: [iterableType, loopNamedType, variableType], ); } @@ -3144,7 +3129,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (isWellBounded is NotWellBoundedTypeResult) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.ENUM_INSTANTIATED_TO_BOUNDS_IS_NOT_WELL_BOUNDED, + CompileTimeErrorCode.enumInstantiatedToBoundsIsNotWellBounded, ); } } @@ -3155,7 +3140,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// [LibraryExport] retrieved from the node, if the element in the node was /// `null`, then this method is not called. /// - /// See [CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY]. + /// See [CompileTimeErrorCode.exportInternalLibrary]. void _checkForExportInternalLibrary( ExportDirective directive, LibraryExport libraryExport, @@ -3187,7 +3172,7 @@ class ErrorVerifier extends RecursiveAstVisitor // first place. diagnosticReporter.atNode( directive, - CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY, + CompileTimeErrorCode.exportInternalLibrary, arguments: [directive.uri.stringValue!], ); } @@ -3195,28 +3180,28 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verifies that the given [superclass], found in an extends-clause, is not a /// deferred class. /// - /// See [CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]. + /// See [CompileTimeErrorCode.extendsDeferredClass]. void _checkForExtendsDeferredClass(NamedType? superclass) { if (superclass == null) { return; } _checkForExtendsOrImplementsDeferredClass( superclass, - CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS, + CompileTimeErrorCode.extendsDeferredClass, ); } /// Verifies that the given [superclass], found in an extends-clause, is not a /// class such as 'num' or 'String'. /// - /// See [CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]. + /// See [CompileTimeErrorCode.extendsDisallowedClass]. bool _checkForExtendsDisallowedClass(NamedType? superclass) { if (superclass == null) { return false; } return _checkForExtendsOrImplementsDisallowedClass( superclass, - CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, + CompileTimeErrorCode.extendsDisallowedClass, ); } @@ -3225,9 +3210,9 @@ class ErrorVerifier extends RecursiveAstVisitor /// /// See [_checkForExtendsDeferredClass], /// [_checkForAllMixinErrorCodes], - /// [CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS], - /// [CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS], and - /// [CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]. + /// [CompileTimeErrorCode.extendsDeferredClass], + /// [CompileTimeErrorCode.implementsDeferredClass], and + /// [CompileTimeErrorCode.mixinDeferredClass]. bool _checkForExtendsOrImplementsDeferredClass( NamedType namedType, DiagnosticCode code, @@ -3278,7 +3263,7 @@ class ErrorVerifier extends RecursiveAstVisitor for (var field in node.fields.variables) { diagnosticReporter.atToken( field.name, - CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, + CompileTimeErrorCode.extensionDeclaresInstanceField, ); } } @@ -3288,7 +3273,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (node.hasObjectMemberName) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, + CompileTimeErrorCode.extensionDeclaresMemberOfObject, ); } } @@ -3297,7 +3282,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (node.hasObjectMemberName) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, + CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, ); } } @@ -3309,7 +3294,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (_enclosingClass is ExtensionTypeElement) { diagnosticReporter.atToken( node.superKeyword, - CompileTimeErrorCode.EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION, + CompileTimeErrorCode.extensionTypeConstructorWithSuperInvocation, ); } } @@ -3326,7 +3311,7 @@ class ErrorVerifier extends RecursiveAstVisitor for (var field in node.fields.variables) { diagnosticReporter.atToken( field.name, - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, + CompileTimeErrorCode.extensionTypeDeclaresInstanceField, ); } } @@ -3342,7 +3327,7 @@ class ErrorVerifier extends RecursiveAstVisitor for (var type in clause.interfaces) { _checkForExtendsOrImplementsDeferredClass( type, - CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, + CompileTimeErrorCode.implementsDeferredClass, ); } } @@ -3354,7 +3339,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (element.hasImplementsSelfReference) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_ITSELF, + CompileTimeErrorCode.extensionTypeImplementsItself, ); } } @@ -3379,7 +3364,7 @@ class ErrorVerifier extends RecursiveAstVisitor }).toList(); diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT, + CompileTimeErrorCode.extensionTypeInheritedMemberConflict, arguments: [node.name.lexeme, memberName], contextMessages: contextMessages, ); @@ -3408,7 +3393,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (element.hasRepresentationSelfReference) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF, + CompileTimeErrorCode.extensionTypeRepresentationDependsOnItself, ); } } @@ -3422,7 +3407,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (representationType.isBottom) { diagnosticReporter.atNode( node.representation.fieldType, - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_TYPE_BOTTOM, + CompileTimeErrorCode.extensionTypeRepresentationTypeBottom, ); } } @@ -3435,7 +3420,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (member.isAbstract) { diagnosticReporter.atNode( member, - CompileTimeErrorCode.EXTENSION_TYPE_WITH_ABSTRACT_MEMBER, + CompileTimeErrorCode.extensionTypeWithAbstractMember, arguments: [member.name.lexeme, node.name.lexeme], ); } @@ -3446,7 +3431,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the given field formal [parameter] is in a constructor /// declaration. /// - /// See [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]. + /// See [CompileTimeErrorCode.fieldInitializerOutsideConstructor]. void _checkForFieldInitializingFormalRedirectingConstructor( FieldFormalParameter parameter, ) { @@ -3462,7 +3447,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (constructor.factoryKeyword != null) { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerFactoryConstructor, ); return; } @@ -3471,7 +3456,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (initializer is RedirectingConstructorInvocation) { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, ); return; } @@ -3479,7 +3464,7 @@ class ErrorVerifier extends RecursiveAstVisitor } else { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerOutsideConstructor, ); } } @@ -3487,8 +3472,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the given variable declaration [list] has only initialized /// variables if the list is final or const. /// - /// See [CompileTimeErrorCode.CONST_NOT_INITIALIZED], and - /// [CompileTimeErrorCode.FINAL_NOT_INITIALIZED]. + /// See [CompileTimeErrorCode.constNotInitialized], and + /// [CompileTimeErrorCode.finalNotInitialized]. void _checkForFinalNotInitialized(VariableDeclarationList list) { if (_isInNativeClass || list.isSynthetic) { return; @@ -3509,7 +3494,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (isConst) { diagnosticReporter.atToken( variable.name, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, arguments: [variable.name.lexeme], ); } else { @@ -3523,7 +3508,7 @@ class ErrorVerifier extends RecursiveAstVisitor } else if (!variable.isLate) { diagnosticReporter.atToken( variable.name, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED, + CompileTimeErrorCode.finalNotInitialized, arguments: [variable.name.lexeme], ); } @@ -3536,8 +3521,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// final fields are initialized. Cases in which there is at least one /// constructor are handled in [_checkForFinalNotInitialized]. /// - /// See [CompileTimeErrorCode.CONST_NOT_INITIALIZED], and - /// [CompileTimeErrorCode.FINAL_NOT_INITIALIZED]. + /// See [CompileTimeErrorCode.constNotInitialized], and + /// [CompileTimeErrorCode.finalNotInitialized]. void _checkForFinalNotInitializedInClass( InstanceFragmentImpl fragment, List members, @@ -3563,8 +3548,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Check that if a direct supertype of a node is final, then it must be in /// the same library. /// - /// See [CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY], - /// [CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY], + /// See [CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary], + /// [CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary], /// [CompileTimeErrorCode. /// FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY]. void _checkForFinalSupertypeOutsideOfLibrary( @@ -3584,7 +3569,7 @@ class ErrorVerifier extends RecursiveAstVisitor !_mayIgnoreClassModifiers(element.library)) { diagnosticReporter.atNode( superclass, - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, arguments: [element.name!], ); } @@ -3617,7 +3602,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( namedType, - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, arguments: [element.name!], ); break; @@ -3639,7 +3624,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( namedType, CompileTimeErrorCode - .FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, + .finalClassUsedAsMixinConstraintOutsideOfLibrary, arguments: [element.name!], ); } @@ -3659,7 +3644,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (type is FunctionType && type.typeParameters.isNotEmpty) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND, + CompileTimeErrorCode.genericFunctionTypeCannotBeBound, ); } } @@ -3680,7 +3665,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (languageVersionToken != null) { diagnosticReporter.atToken( languageVersionToken, - CompileTimeErrorCode.ILLEGAL_LANGUAGE_VERSION_OVERRIDE, + CompileTimeErrorCode.illegalLanguageVersionOverride, arguments: ['$sourceLanguageConstraint'], ); } @@ -3689,8 +3674,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the given implements [clause] does not implement classes such /// as 'num' or 'String'. /// - /// See [CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS], - /// [CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]. + /// See [CompileTimeErrorCode.implementsDisallowedClass], + /// [CompileTimeErrorCode.implementsDeferredClass]. bool _checkForImplementsClauseErrorCodes(ImplementsClause? clause) { if (clause == null) { return false; @@ -3699,12 +3684,12 @@ class ErrorVerifier extends RecursiveAstVisitor for (NamedType type in clause.interfaces) { if (_checkForExtendsOrImplementsDisallowedClass( type, - CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, + CompileTimeErrorCode.implementsDisallowedClass, )) { foundError = true; } else if (_checkForExtendsOrImplementsDeferredClass( type, - CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, + CompileTimeErrorCode.implementsDeferredClass, )) { foundError = true; } @@ -3742,7 +3727,7 @@ class ErrorVerifier extends RecursiveAstVisitor // `directive.uri.stringValue` is non-`null`. diagnosticReporter.atNode( directive.uri, - CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, + CompileTimeErrorCode.importInternalLibrary, arguments: [directive.uri.stringValue!], ); } @@ -3750,7 +3735,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Check that the given [typeReference] is not a type reference and that then /// the [name] is reference to an instance member. /// - /// See [CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER]. + /// See [CompileTimeErrorCode.instanceAccessToStaticMember]. void _checkForInstanceAccessToStaticMember( InterfaceElement? typeReference, Expression? target, @@ -3797,7 +3782,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// mixin. /// /// See - /// [CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY]. + /// [CompileTimeErrorCode.interfaceClassExtendedOutsideOfLibrary]. void _checkForInterfaceClassOrMixinSuperclassOutsideOfLibrary( NamedType? superclass, WithClause? withClause, @@ -3813,7 +3798,7 @@ class ErrorVerifier extends RecursiveAstVisitor !_mayIgnoreClassModifiers(superclassElement.library)) { diagnosticReporter.atNode( superclass, - CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.interfaceClassExtendedOutsideOfLibrary, arguments: [superclassElement.name!], ); } @@ -3825,7 +3810,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// given [argument]. This is used for prefix and postfix expressions where /// the argument value is implicit. /// - /// See [CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]. + /// See [CompileTimeErrorCode.argumentTypeNotAssignable]. void _checkForIntNotAssignable(ExpressionImpl argument) { var parameterElement = argument.correspondingParameter; var parameterType = parameterElement?.type; @@ -3834,20 +3819,20 @@ class ErrorVerifier extends RecursiveAstVisitor argument, parameterType, _intType, - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, ); } } /// Verify that the given [annotation] isn't defined in a deferred library. /// - /// See [CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]. + /// See [CompileTimeErrorCode.invalidAnnotationFromDeferredLibrary]. void _checkForInvalidAnnotationFromDeferredLibrary(Annotation annotation) { Identifier nameIdentifier = annotation.name; if (nameIdentifier is PrefixedIdentifier && nameIdentifier.isDeferred) { diagnosticReporter.atNode( annotation.name, - CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.invalidAnnotationFromDeferredLibrary, ); } } @@ -3865,20 +3850,20 @@ class ErrorVerifier extends RecursiveAstVisitor if (staticElement.isSynthetic) { diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializerForNonExistentField, arguments: [fieldName.name], ); } else if (staticElement.isStatic) { diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, + CompileTimeErrorCode.initializerForStaticField, arguments: [fieldName.name], ); } } else { diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializerForNonExistentField, arguments: [fieldName.name], ); return; @@ -3897,10 +3882,10 @@ class ErrorVerifier extends RecursiveAstVisitor if (_currentLibrary.featureSet.isEnabled(Feature.enhanced_enums)) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, ); } else { - diagnosticReporter.atNode(node, CompileTimeErrorCode.INSTANTIATE_ENUM); + diagnosticReporter.atNode(node, CompileTimeErrorCode.instantiateEnum); } } } @@ -3908,9 +3893,9 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that if the given [identifier] is part of a constructor /// initializer, then it does not implicitly reference 'this' expression. /// - /// See [CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER], - /// [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY], and - /// [CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC]. + /// See [CompileTimeErrorCode.implicitThisReferenceInInitializer], + /// [CompileTimeErrorCode.instanceMemberAccessFromFactory], and + /// [CompileTimeErrorCode.instanceMemberAccessFromStatic]. void _checkForInvalidInstanceMemberAccess(SimpleIdentifier identifier) { if (_isInComment) { return; @@ -3961,17 +3946,17 @@ class ErrorVerifier extends RecursiveAstVisitor if (_enclosingExecutable.inStaticMethod) { diagnosticReporter.atNode( identifier, - CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, + CompileTimeErrorCode.instanceMemberAccessFromStatic, ); } else if (_enclosingExecutable.inFactoryConstructor) { diagnosticReporter.atNode( identifier, - CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, + CompileTimeErrorCode.instanceMemberAccessFromFactory, ); } else { diagnosticReporter.atNode( identifier, - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, + CompileTimeErrorCode.implicitThisReferenceInInitializer, arguments: [identifier.name], ); } @@ -3995,12 +3980,12 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the usage of the given 'this' is valid. /// - /// See [CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS]. + /// See [CompileTimeErrorCode.invalidReferenceToThis]. void _checkForInvalidReferenceToThis(ThisExpression expression) { if (!_hasAccessToThis) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, + CompileTimeErrorCode.invalidReferenceToThis, ); } } @@ -4027,14 +4012,14 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atToken( lateKeyword, - CompileTimeErrorCode.LATE_FINAL_FIELD_WITH_CONST_CONSTRUCTOR, + CompileTimeErrorCode.lateFinalFieldWithConstConstructor, ); } /// Verify that the elements of the given list [literal] are subtypes of the /// list's static type. /// - /// See [CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE]. + /// See [CompileTimeErrorCode.listElementTypeNotAssignable]. void _checkForListElementTypeNotAssignable(ListLiteral literal) { // Determine the list's element type. We base this on the static type and // not the literal's type arguments because in strong mode, the type @@ -4075,7 +4060,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (declaredFragment is! TopLevelFunctionFragment) { diagnosticReporter.atToken( nameToken, - CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, + CompileTimeErrorCode.mainIsNotFunction, ); } } @@ -4102,14 +4087,14 @@ class ErrorVerifier extends RecursiveAstVisitor if (requiredPositional.length > 2) { diagnosticReporter.atToken( functionDeclaration.name, - CompileTimeErrorCode.MAIN_HAS_TOO_MANY_REQUIRED_POSITIONAL_PARAMETERS, + CompileTimeErrorCode.mainHasTooManyRequiredPositionalParameters, ); } if (parameters.any((e) => e.isRequiredNamed)) { diagnosticReporter.atToken( functionDeclaration.name, - CompileTimeErrorCode.MAIN_HAS_REQUIRED_NAMED_PARAMETERS, + CompileTimeErrorCode.mainHasRequiredNamedParameters, ); } @@ -4120,7 +4105,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (!typeSystem.isSubtypeOf(listOfString, type)) { diagnosticReporter.atNode( first.notDefault.typeOrSelf, - CompileTimeErrorCode.MAIN_FIRST_POSITIONAL_PARAMETER_TYPE, + CompileTimeErrorCode.mainFirstPositionalParameterType, ); } } @@ -4214,7 +4199,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atOffset( offset: offset, length: end - offset, - diagnosticCode: StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, + diagnosticCode: StaticWarningCode.missingEnumConstantInSwitch, arguments: [constantName!], ); } @@ -4225,7 +4210,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atOffset( offset: offset, length: end - offset, - diagnosticCode: StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, + diagnosticCode: StaticWarningCode.missingEnumConstantInSwitch, arguments: ['null'], ); } @@ -4237,7 +4222,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// constructor. The [mixinName] is the node to report problem on. The /// [mixinElement] is the mixing to evaluate. /// - /// See [CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR]. + /// See [CompileTimeErrorCode.mixinClassDeclaresConstructor]. bool _checkForMixinClassDeclaresConstructor( NamedType mixinName, InterfaceElement mixinElement, @@ -4246,7 +4231,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (!constructor.isSynthetic && !constructor.isFactory) { diagnosticReporter.atNode( mixinName, - CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, + CompileTimeErrorCode.mixinClassDeclaresConstructor, arguments: [mixinElement.name!], ); return true; @@ -4258,8 +4243,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that mixin classes must have 'Object' as their superclass and that /// they do not have a constructor. /// - /// See [CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR], - /// [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]. + /// See [CompileTimeErrorCode.mixinClassDeclaresConstructor], + /// [CompileTimeErrorCode.mixinInheritsFromNotObject]. void _checkForMixinClassErrorCodes( NamedCompilationUnitMember node, List members, @@ -4277,7 +4262,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (!member.isTrivial) { diagnosticReporter.atNode( member.returnType, - CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, + CompileTimeErrorCode.mixinClassDeclaresConstructor, arguments: [element.name!], ); } @@ -4288,14 +4273,14 @@ class ErrorVerifier extends RecursiveAstVisitor if (superclass != null && !superclass.typeOrThrow.isDartCoreObject) { diagnosticReporter.atNode( superclass, - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, arguments: [element.name!], ); } else if (withClause != null && !(element.isMixinApplication && withClause.mixinTypes.length < 2)) { diagnosticReporter.atNode( withClause, - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, arguments: [element.name!], ); } @@ -4307,7 +4292,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// The [mixinName] is the node to report problem on. The [mixinElement] is /// the mixing to evaluate. /// - /// See [CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT]. + /// See [CompileTimeErrorCode.mixinInheritsFromNotObject]. bool _checkForMixinInheritsNotFromObject( NamedType mixinName, InterfaceElement mixinElement, @@ -4328,7 +4313,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( mixinName, - CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, + CompileTimeErrorCode.mixinInheritsFromNotObject, arguments: [mixinElement.name!], ); return true; @@ -4360,7 +4345,7 @@ class ErrorVerifier extends RecursiveAstVisitor // so we can safely rely on `mixinName.type` being non-`null`. diagnosticReporter.atToken( mixinName.name, - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, arguments: [mixinName.type!, superType, constraint], ); return true; @@ -4401,9 +4386,9 @@ class ErrorVerifier extends RecursiveAstVisitor var errorCode = isSetter ? CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_SETTER + .mixinApplicationNoConcreteSuperInvokedSetter : CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER; + .mixinApplicationNoConcreteSuperInvokedMember; if (isSetter) { name = name.substring(0, name.length - 1); @@ -4427,8 +4412,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (!isCorrect) { diagnosticReporter.atNode( mixinName, - CompileTimeErrorCode - .MIXIN_APPLICATION_CONCRETE_SUPER_INVOKED_MEMBER_TYPE, + CompileTimeErrorCode.mixinApplicationConcreteSuperInvokedMemberType, arguments: [name, mixinMember.type, superMember.type], ); return true; @@ -4471,7 +4455,7 @@ class ErrorVerifier extends RecursiveAstVisitor } diagnosticReporter.atNode( namedType, - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, + CompileTimeErrorCode.privateCollisionInMixinApplication, arguments: [name, namedType.name.lexeme, conflictingName], ); return true; @@ -4491,7 +4475,7 @@ class ErrorVerifier extends RecursiveAstVisitor // non-`null`. diagnosticReporter.atNode( namedType, - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, + CompileTimeErrorCode.privateCollisionInMixinApplication, arguments: [ name, namedType.name.lexeme, @@ -4540,12 +4524,12 @@ class ErrorVerifier extends RecursiveAstVisitor /// Checks to ensure that the given native function [body] is in SDK code. /// - /// See [ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE]. + /// See [ParserErrorCode.nativeFunctionBodyInNonSdkCode]. void _checkForNativeFunctionBodyInNonSdkCode(NativeFunctionBody body) { if (!_isInSystemLibrary) { diagnosticReporter.atNode( body, - ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, + ParserErrorCode.nativeFunctionBodyInNonSdkCode, ); } } @@ -4557,7 +4541,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// This method assumes that the instance creation was tested to be 'new' /// before being called. /// - /// See [CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR]. + /// See [CompileTimeErrorCode.newWithUndefinedConstructor]. void _checkForNewWithUndefinedConstructor( InstanceCreationExpression expression, ConstructorName constructorName, @@ -4580,13 +4564,13 @@ class ErrorVerifier extends RecursiveAstVisitor if (name != null) { diagnosticReporter.atNode( name, - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, + CompileTimeErrorCode.newWithUndefinedConstructor, arguments: [namedType.qualifiedName, name.name], ); } else { diagnosticReporter.atNode( constructorName, - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, + CompileTimeErrorCode.newWithUndefinedConstructorDefault, arguments: [namedType.qualifiedName], ); } @@ -4596,7 +4580,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// constructor of its superclass, there should be such default constructor - /// implicit or explicit. /// - /// See [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]. + /// See [CompileTimeErrorCode.noDefaultSuperConstructorImplicit]. void _checkForNoDefaultSuperConstructorImplicit(ClassFragmentImpl fragment) { // do nothing if there is explicit constructor var constructors = fragment.element.constructors; @@ -4615,7 +4599,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (superUnnamedConstructor.isFactory) { diagnosticReporter.atElement2( fragment.asElement2, - CompileTimeErrorCode.NON_GENERATIVE_IMPLICIT_CONSTRUCTOR, + CompileTimeErrorCode.nonGenerativeImplicitConstructor, arguments: [ superElement.name ?? '', fragment.name ?? '', @@ -4634,7 +4618,7 @@ class ErrorVerifier extends RecursiveAstVisitor // real problem was already reported. diagnosticReporter.atElement2( fragment.asElement2, - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, + CompileTimeErrorCode.noDefaultSuperConstructorImplicit, arguments: [superType, fragment.displayName], ); } @@ -4664,7 +4648,7 @@ class ErrorVerifier extends RecursiveAstVisitor // no generative constructors. State this clearly to users. diagnosticReporter.atNode( superclass!, - CompileTimeErrorCode.NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS, + CompileTimeErrorCode.noGenerativeConstructorsInSuperclass, arguments: [_enclosingClass!.name!, superElement.name!], ); return true; @@ -4678,7 +4662,7 @@ class ErrorVerifier extends RecursiveAstVisitor node.factoryKeyword == null) { diagnosticReporter.atConstructorDeclaration( node, - CompileTimeErrorCode.NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.nonConstGenerativeEnumConstructor, ); } } @@ -4688,7 +4672,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// * has explicit type arguments /// * is not start of the statement /// - /// See [CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT]. + /// See [CompileTimeErrorCode.nonConstMapAsExpressionStatement]. void _checkForNonConstMapAsExpressionStatement3(SetOrMapLiteral literal) { // "const" if (literal.constKeyword != null) { @@ -4711,7 +4695,7 @@ class ErrorVerifier extends RecursiveAstVisitor // TODO(srawlins): Add any tests showing this is reported. diagnosticReporter.atNode( literal, - CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, + CompileTimeErrorCode.nonConstMapAsExpressionStatement, ); } @@ -4738,7 +4722,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( typeParameterNode, CompileTimeErrorCode - .NON_COVARIANT_TYPE_PARAMETER_POSITION_IN_REPRESENTATION_TYPE, + .nonCovariantTypeParameterPositionInRepresentationType, ); } } @@ -4757,14 +4741,14 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atToken( variableList.variables.first.name, - CompileTimeErrorCode.NON_FINAL_FIELD_IN_ENUM, + CompileTimeErrorCode.nonFinalFieldInEnum, ); } /// Verify that the given method [declaration] of operator `[]=`, has `void` /// return type. /// - /// See [CompileTimeErrorCode.NON_VOID_RETURN_FOR_OPERATOR]. + /// See [CompileTimeErrorCode.nonVoidReturnForOperator]. void _checkForNonVoidReturnTypeForOperator(MethodDeclaration declaration) { // check that []= operator if (declaration.name.lexeme != "[]=") { @@ -4777,7 +4761,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (type is! VoidType) { diagnosticReporter.atNode( annotation, - CompileTimeErrorCode.NON_VOID_RETURN_FOR_OPERATOR, + CompileTimeErrorCode.nonVoidReturnForOperator, ); } } @@ -4786,14 +4770,14 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify the [namedType], used as the return type of a setter, is valid /// (either `null` or the type 'void'). /// - /// See [CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER]. + /// See [CompileTimeErrorCode.nonVoidReturnForSetter]. void _checkForNonVoidReturnTypeForSetter(TypeAnnotation? namedType) { if (namedType != null) { DartType type = namedType.typeOrThrow; if (type is! VoidType) { diagnosticReporter.atNode( namedType, - CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, + CompileTimeErrorCode.nonVoidReturnForSetter, ); } } @@ -4821,7 +4805,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( field, - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, arguments: [field.name.lexeme], ); } @@ -4871,7 +4855,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (variable.initializer == null) { diagnosticReporter.atToken( variable.name, - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, + CompileTimeErrorCode.notInitializedNonNullableVariable, arguments: [variable.name.lexeme], ); } @@ -4880,8 +4864,8 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that all classes of the given [onClause] are valid. /// - /// See [CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS], - /// [CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DEFERRED_CLASS]. + /// See [CompileTimeErrorCode.mixinSuperClassConstraintDisallowedClass], + /// [CompileTimeErrorCode.mixinSuperClassConstraintDeferredClass]. bool _checkForOnClauseErrorCodes(MixinOnClause? onClause) { if (onClause == null) { return false; @@ -4892,13 +4876,13 @@ class ErrorVerifier extends RecursiveAstVisitor if (type is InterfaceType) { if (_checkForExtendsOrImplementsDisallowedClass( namedType, - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS, + CompileTimeErrorCode.mixinSuperClassConstraintDisallowedClass, )) { problemReported = true; } else { if (_checkForExtendsOrImplementsDeferredClass( namedType, - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DEFERRED_CLASS, + CompileTimeErrorCode.mixinSuperClassConstraintDeferredClass, )) { problemReported = true; } @@ -4914,7 +4898,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// This method assumes that the method declaration was tested to be an /// operator declaration before being called. /// - /// See [CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR]. + /// See [CompileTimeErrorCode.optionalParameterInOperator]. void _checkForOptionalParameterInOperator(MethodDeclaration declaration) { var parameterList = declaration.parameters; if (parameterList == null) { @@ -4926,7 +4910,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (formalParameter.isOptional) { diagnosticReporter.atNode( formalParameter, - CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, + CompileTimeErrorCode.optionalParameterInOperator, ); } } @@ -4980,8 +4964,8 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( node, treatedAsDouble - ? CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE - : CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE, + ? CompileTimeErrorCode.integerLiteralImpreciseAsDouble + : CompileTimeErrorCode.integerLiteralOutOfRange, arguments: messageArguments, ); } @@ -5001,7 +4985,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atToken( name, - CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, + CompileTimeErrorCode.privateOptionalParameter, ); } @@ -5009,7 +4993,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// generative constructor and references itself directly or indirectly. The /// [constructorElement] is the constructor element. /// - /// See [CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT]. + /// See [CompileTimeErrorCode.recursiveConstructorRedirect]. void _checkForRecursiveConstructorRedirect( ConstructorDeclaration declaration, ConstructorElement constructorElement, @@ -5025,7 +5009,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (_hasRedirectingFactoryConstructorCycle(constructorElement)) { diagnosticReporter.atNode( initializer, - CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, + CompileTimeErrorCode.recursiveConstructorRedirect, ); } return; @@ -5037,7 +5021,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// constructor and references itself directly or indirectly. The /// constructor [element] is the element introduced by the declaration. /// - /// See [CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT]. + /// See [CompileTimeErrorCode.recursiveFactoryRedirect]. bool _checkForRecursiveFactoryRedirect( ConstructorDeclaration declaration, ConstructorElement element, @@ -5054,7 +5038,7 @@ class ErrorVerifier extends RecursiveAstVisitor // report error diagnosticReporter.atNode( redirectedConstructorNode, - CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, + CompileTimeErrorCode.recursiveFactoryRedirect, ); return true; } @@ -5074,7 +5058,7 @@ class ErrorVerifier extends RecursiveAstVisitor parameter.defaultValue != null) { diagnosticReporter.atToken( parameter.name!, - CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR, + CompileTimeErrorCode.defaultValueInRedirectingFactoryConstructor, ); } } @@ -5096,7 +5080,7 @@ class ErrorVerifier extends RecursiveAstVisitor } diagnosticReporter.atNode( redirectedConstructor, - CompileTimeErrorCode.REDIRECT_TO_ABSTRACT_CLASS_CONSTRUCTOR, + CompileTimeErrorCode.redirectToAbstractClassConstructor, arguments: [constructorStrName, redirectedClass.name!], ); } @@ -5109,7 +5093,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Check whether the redirecting constructor, [element], is const, and /// [redirectedElement], its redirectee, is not const. /// - /// See [CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR]. + /// See [CompileTimeErrorCode.redirectToNonConstConstructor]. void _checkForRedirectToNonConstConstructor( ConstructorElement element, ConstructorElement? redirectedElement, @@ -5121,7 +5105,7 @@ class ErrorVerifier extends RecursiveAstVisitor !redirectedElement.isConst) { diagnosticReporter.atEntity( errorEntity, - CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, + CompileTimeErrorCode.redirectToNonConstConstructor, ); } } @@ -5171,12 +5155,12 @@ class ErrorVerifier extends RecursiveAstVisitor /// Check that the given rethrow [expression] is inside of a catch clause. /// - /// See [CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH]. + /// See [CompileTimeErrorCode.rethrowOutsideCatch]. void _checkForRethrowOutsideCatch(RethrowExpression expression) { if (_enclosingExecutable.catchClauseLevel == 0) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH, + CompileTimeErrorCode.rethrowOutsideCatch, ); } } @@ -5184,7 +5168,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Check that if the given constructor [declaration] is generative, then /// it does not have an expression function body. /// - /// See [CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR]. + /// See [CompileTimeErrorCode.returnInGenerativeConstructor]. void _checkForReturnInGenerativeConstructor( ConstructorDeclaration declaration, ) { @@ -5200,21 +5184,21 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atNode( body, - CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, + CompileTimeErrorCode.returnInGenerativeConstructor, ); } /// Checks that every supertype which is sealed is also declared in the /// current library. /// - /// See [CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY]. + /// See [CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary]. void _checkForSealedSupertypeOutsideOfLibrary(List supertypes) { for (NamedType namedType in supertypes) { if (namedType.type case InterfaceType(:ClassElement element)) { if (element.isSealed && element.library != _currentLibrary) { diagnosticReporter.atNode( namedType, - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, arguments: [element.name!], ); } @@ -5225,7 +5209,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the elements in the given set [literal] are subtypes of the /// set's static type. /// - /// See [CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE]. + /// See [CompileTimeErrorCode.setElementTypeNotAssignable]. void _checkForSetElementTypeNotAssignable3(SetOrMapLiteral literal) { // Determine the set's element type. We base this on the static type and // not the literal's type arguments because in strong mode, the type @@ -5260,7 +5244,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Check the given [typeReference] and that the [name] is not a reference to /// an instance member. /// - /// See [CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER]. + /// See [CompileTimeErrorCode.staticAccessToInstanceMember]. void _checkForStaticAccessToInstanceMember( InterfaceElement? typeReference, SimpleIdentifier name, @@ -5282,7 +5266,7 @@ class ErrorVerifier extends RecursiveAstVisitor } diagnosticReporter.atNode( name, - CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, + CompileTimeErrorCode.staticAccessToInstanceMember, arguments: [name.name], ); } @@ -5299,7 +5283,7 @@ class ErrorVerifier extends RecursiveAstVisitor )) { diagnosticReporter.atNode( expression, - CompileTimeErrorCode.THROW_OF_INVALID_TYPE, + CompileTimeErrorCode.throwOfInvalidType, arguments: [type], ); } @@ -5308,7 +5292,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the given [element] does not reference itself directly. /// If it does, report the error on the [nameToken]. /// - /// See [CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF]. + /// See [CompileTimeErrorCode.typeAliasCannotReferenceItself]. void _checkForTypeAliasCannotReferenceItself( Token nameToken, TypeAliasFragmentImpl element, @@ -5316,19 +5300,19 @@ class ErrorVerifier extends RecursiveAstVisitor if (element.hasSelfReference) { diagnosticReporter.atToken( nameToken, - CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, + CompileTimeErrorCode.typeAliasCannotReferenceItself, ); } } /// Verify that the [type] is not a deferred type. /// - /// See [CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS]. + /// See [CompileTimeErrorCode.typeAnnotationDeferredClass]. void _checkForTypeAnnotationDeferredClass(TypeAnnotation? type) { if (type is NamedType && type.isDeferred) { diagnosticReporter.atNode( type, - CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, + CompileTimeErrorCode.typeAnnotationDeferredClass, arguments: [type.qualifiedName], ); } @@ -5336,7 +5320,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Check that none of the type [parameters] references itself in its bound. /// - /// See [CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]. + /// See [CompileTimeErrorCode.typeParameterSupertypeOfItsBound]. void _checkForTypeParameterBoundRecursion(List parameters) { checkForTypeParameterBoundRecursion(diagnosticReporter, parameters); } @@ -5353,7 +5337,7 @@ class ErrorVerifier extends RecursiveAstVisitor // type parameters, or a local function's type parameters). diagnosticReporter.atToken( name, - CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, + CompileTimeErrorCode.typeParameterReferencedByStatic, ); } } @@ -5363,9 +5347,9 @@ class ErrorVerifier extends RecursiveAstVisitor /// super constructor invocation nor a redirecting constructor invocation, /// that the superclass has a default generative constructor. /// - /// See [CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT], - /// [CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR], and - /// [CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]. + /// See [CompileTimeErrorCode.undefinedConstructorInInitializerDefault], + /// [CompileTimeErrorCode.nonGenerativeConstructor], and + /// [CompileTimeErrorCode.noDefaultSuperConstructorExplicit]. void _checkForUndefinedConstructorInInitializerImplicit( ConstructorDeclaration constructor, ) { @@ -5413,7 +5397,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (superUnnamedConstructor == null) { diagnosticReporter.atNode( constructor.returnType, - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, + CompileTimeErrorCode.undefinedConstructorInInitializerDefault, arguments: [superElement.name!], ); return; @@ -5422,7 +5406,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (superUnnamedConstructor.isFactory) { diagnosticReporter.atNode( constructor.returnType, - CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, + CompileTimeErrorCode.nonGenerativeConstructor, arguments: [superUnnamedConstructor], ); return; @@ -5454,10 +5438,9 @@ class ErrorVerifier extends RecursiveAstVisitor if (!_currentLibrary.featureSet.isEnabled(Feature.super_parameters)) { if (requiredPositionalParameterCount != 0 || requiredNamedParameters.isNotEmpty) { - reportError( - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT, - [superType], - ); + reportError(CompileTimeErrorCode.noDefaultSuperConstructorExplicit, [ + superType, + ]); } return; } @@ -5472,7 +5455,7 @@ class ErrorVerifier extends RecursiveAstVisitor superParametersResult.positionalArgumentCount || requiredNamedParameters.isNotEmpty) { reportError( - CompileTimeErrorCode.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS, + CompileTimeErrorCode.implicitSuperInitializerMissingArguments, [superType], ); } @@ -5492,30 +5475,30 @@ class ErrorVerifier extends RecursiveAstVisitor List arguments = const []; if (operator.type == TokenType.QUESTION) { if (nullAwareElementOrMapEntryKind == null) { - code = StaticWarningCode.INVALID_NULL_AWARE_OPERATOR; + code = StaticWarningCode.invalidNullAwareOperator; endToken = operator.next!; arguments = ['?[', '[']; } else { switch (nullAwareElementOrMapEntryKind) { case _NullAwareElementOrMapEntryKind.element: - code = StaticWarningCode.INVALID_NULL_AWARE_ELEMENT; + code = StaticWarningCode.invalidNullAwareElement; case _NullAwareElementOrMapEntryKind.mapEntryKey: - code = StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_KEY; + code = StaticWarningCode.invalidNullAwareMapEntryKey; case _NullAwareElementOrMapEntryKind.mapEntryValue: - code = StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_VALUE; + code = StaticWarningCode.invalidNullAwareMapEntryValue; } } } else if (operator.type == TokenType.QUESTION_PERIOD) { - code = StaticWarningCode.INVALID_NULL_AWARE_OPERATOR; + code = StaticWarningCode.invalidNullAwareOperator; arguments = [operator.lexeme, '.']; } else if (operator.type == TokenType.QUESTION_PERIOD_PERIOD) { - code = StaticWarningCode.INVALID_NULL_AWARE_OPERATOR; + code = StaticWarningCode.invalidNullAwareOperator; arguments = [operator.lexeme, '..']; } else if (operator.type == TokenType.PERIOD_PERIOD_PERIOD_QUESTION) { - code = StaticWarningCode.INVALID_NULL_AWARE_OPERATOR; + code = StaticWarningCode.invalidNullAwareOperator; arguments = [operator.lexeme, '...']; } else if (operator.type == TokenType.BANG) { - code = StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION; + code = StaticWarningCode.unnecessaryNonNullAssertion; } else { return; } @@ -5572,7 +5555,7 @@ class ErrorVerifier extends RecursiveAstVisitor } if (typeSystem.isStrictlyNonNullable(targetType)) { - if (code == StaticWarningCode.INVALID_NULL_AWARE_OPERATOR) { + if (code == StaticWarningCode.invalidNullAwareOperator) { var previousOperator = previousShortCircuitingOperator(target); if (previousOperator != null) { diagnosticReporter.reportError( @@ -5600,7 +5583,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// defined in the enclosing class rather than in a superclass. /// /// See - /// [CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]. + /// [CompileTimeErrorCode.unqualifiedReferenceToNonLocalStaticMember]. void _checkForUnqualifiedReferenceToNonLocalStaticMember( SimpleIdentifier name, ) { @@ -5636,14 +5619,13 @@ class ErrorVerifier extends RecursiveAstVisitor if (_enclosingExtension != null) { diagnosticReporter.atNode( name, - CompileTimeErrorCode - .UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE, + CompileTimeErrorCode.unqualifiedReferenceToStaticMemberOfExtendedType, arguments: [enclosingElement.displayName], ); } else { diagnosticReporter.atNode( name, - CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, + CompileTimeErrorCode.unqualifiedReferenceToNonLocalStaticMember, arguments: [enclosingElement.displayName], ); } @@ -5661,7 +5643,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (fieldElement == null || fieldElement.isSynthetic) { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, arguments: [parameter.name.lexeme], ); } else { @@ -5672,19 +5654,19 @@ class ErrorVerifier extends RecursiveAstVisitor if (fieldElement.isSynthetic) { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, arguments: [parameter.name.lexeme], ); } else if (fieldElement.isStatic) { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, + CompileTimeErrorCode.initializerForStaticField, arguments: [parameter.name.lexeme], ); } else if (!typeSystem.isSubtypeOf(declaredType, fieldType)) { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, + CompileTimeErrorCode.fieldInitializingFormalNotAssignable, arguments: [declaredType, fieldType], ); } @@ -5692,13 +5674,13 @@ class ErrorVerifier extends RecursiveAstVisitor if (fieldElement.isSynthetic) { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, arguments: [parameter.name.lexeme], ); } else if (fieldElement.isStatic) { diagnosticReporter.atNode( parameter, - CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, + CompileTimeErrorCode.initializerForStaticField, arguments: [parameter.name.lexeme], ); } @@ -5717,7 +5699,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// This method assumes that the method declaration was tested to be an /// operator declaration before being called. /// - /// See [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]. + /// See [CompileTimeErrorCode.wrongNumberOfParametersForOperator]. bool _checkForWrongNumberOfParametersForOperator( MethodDeclaration declaration, ) { @@ -5758,14 +5740,14 @@ class ErrorVerifier extends RecursiveAstVisitor if (expected != -1 && numParameters != expected) { diagnosticReporter.atToken( nameToken, - CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, + CompileTimeErrorCode.wrongNumberOfParametersForOperator, arguments: [name, expected, numParameters], ); return true; } else if ("-" == name && numParameters > 1) { diagnosticReporter.atToken( nameToken, - CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, + CompileTimeErrorCode.wrongNumberOfParametersForOperatorMinus, arguments: [numParameters], ); return true; @@ -5889,7 +5871,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atElement2( typeParameter.asElement2, CompileTimeErrorCode - .WRONG_EXPLICIT_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + .wrongExplicitTypeParameterVarianceInSuperinterface, arguments: [ typeParameter.name ?? '', typeParameter.variance.keyword, @@ -5900,8 +5882,7 @@ class ErrorVerifier extends RecursiveAstVisitor } else { diagnosticReporter.atElement2( typeParameter.asElement2, - CompileTimeErrorCode - .WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, arguments: [typeParameter.name ?? '', superInterface], ); } @@ -5941,7 +5922,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (!variance.greaterThanOrEqual(typeParameter.variance)) { diagnosticReporter.atEntity( errorTarget, - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_POSITION, + CompileTimeErrorCode.wrongTypeParameterVariancePosition, arguments: [ typeParameter.variance.keyword, typeParameter.name ?? '', @@ -5954,7 +5935,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the current class does not have the same class in the /// 'extends' and 'implements' clauses. /// - /// See [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]. + /// See [CompileTimeErrorCode.implementsSuperClass]. void _checkImplementsSuperClass(ImplementsClause? implementsClause) { if (implementsClause == null) { return; @@ -5970,7 +5951,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (type is InterfaceType && type.element == superElement) { diagnosticReporter.atNode( interfaceNode, - CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, + CompileTimeErrorCode.implementsSuperClass, arguments: [superElement], ); } @@ -5993,12 +5974,12 @@ class ErrorVerifier extends RecursiveAstVisitor _checkForRepeatedType( libraryContext.setOfOn(declarationFragment.asElement2), onClause?.superclassConstraints, - CompileTimeErrorCode.ON_REPEATED, + CompileTimeErrorCode.onRepeated, ); _checkForRepeatedType( libraryContext.setOfImplements(declarationFragment.asElement2), implementsClause?.interfaces, - CompileTimeErrorCode.IMPLEMENTS_REPEATED, + CompileTimeErrorCode.implementsRepeated, ); _checkForConflictingGenerics(node); _checkForBaseClassOrMixinImplementedOutsideOfLibrary(implementsClause); @@ -6018,7 +5999,7 @@ class ErrorVerifier extends RecursiveAstVisitor /// Verify that the current class does not have the same class in the /// 'extends' and 'with' clauses. /// - /// See [CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS]. + /// See [CompileTimeErrorCode.implementsSuperClass]. void _checkMixinsSuperClass(WithClause? withClause) { if (withClause == null) { return; @@ -6034,7 +6015,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (type is InterfaceType && type.element == superElement) { diagnosticReporter.atNode( mixinNode, - CompileTimeErrorCode.MIXINS_SUPER_CLASS, + CompileTimeErrorCode.mixinsSuperClass, arguments: [superElement], ); } @@ -6072,7 +6053,7 @@ class ErrorVerifier extends RecursiveAstVisitor if (keyword != null) { diagnosticReporter.atToken( keyword, - CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, + CompileTimeErrorCode.invalidUseOfCovariant, ); } } @@ -6117,7 +6098,7 @@ class ErrorVerifier extends RecursiveAstVisitor var errorTarget = _parameterName(parameter) ?? parameter; diagnosticReporter.atEntity( errorTarget, - CompileTimeErrorCode.DEFAULT_VALUE_ON_REQUIRED_PARAMETER, + CompileTimeErrorCode.defaultValueOnRequiredParameter, ); } } else if (defaultValuesAreExpected) { @@ -6131,7 +6112,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atEntity( errorTarget, CompileTimeErrorCode - .MISSING_DEFAULT_VALUE_FOR_PARAMETER_WITH_ANNOTATION, + .missingDefaultValueForParameterWithAnnotation, ); } else { if (!_isWildcardSuperFormalPositionalParameter(parameter)) { @@ -6139,9 +6120,8 @@ class ErrorVerifier extends RecursiveAstVisitor errorTarget, parameterElement.isPositional ? CompileTimeErrorCode - .MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL - : CompileTimeErrorCode - .MISSING_DEFAULT_VALUE_FOR_PARAMETER, + .missingDefaultValueForParameterPositional + : CompileTimeErrorCode.missingDefaultValueForParameter, arguments: [parameterName?.lexeme ?? '?'], ); } @@ -6345,7 +6325,7 @@ class ErrorVerifier extends RecursiveAstVisitor diagnosticReporter.atOffset( offset: offset, length: length, - diagnosticCode: WarningCode.MULTIPLE_COMBINATORS, + diagnosticCode: WarningCode.multipleCombinators, ); } } @@ -6562,7 +6542,7 @@ class _UninstantiatedBoundChecker extends RecursiveAstVisitor { // has been reported. _diagnosticReporter.atNode( node, - CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, + CompileTimeErrorCode.notInstantiatedBound, ); } } diff --git a/pkg/analyzer/lib/src/generated/ffi_verifier.dart b/pkg/analyzer/lib/src/generated/ffi_verifier.dart index 4094648e866..2b781ed8681 100644 --- a/pkg/analyzer/lib/src/generated/ffi_verifier.dart +++ b/pkg/analyzer/lib/src/generated/ffi_verifier.dart @@ -133,7 +133,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (node.declaredFragment!.element.isEmptyStruct) { _diagnosticReporter.atToken( node.name, - FfiCode.EMPTY_STRUCT, + FfiCode.emptyStruct, arguments: [node.name.lexeme, className ?? ''], ); } @@ -151,7 +151,7 @@ class FfiVerifier extends RecursiveAstVisitor { superclass.isAbiSpecificIntegerSubtype) { _diagnosticReporter.atNode( superclass, - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS, + FfiCode.subtypeOfStructClassInExtends, arguments: [node.name.lexeme, superclass.name.lexeme], ); } @@ -176,13 +176,13 @@ class FfiVerifier extends RecursiveAstVisitor { var implementsClause = node.implementsClause; if (implementsClause != null) { for (NamedType type in implementsClause.interfaces) { - checkSupertype(type, FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS); + checkSupertype(type, FfiCode.subtypeOfStructClassInImplements); } } var withClause = node.withClause; if (withClause != null) { for (NamedType type in withClause.mixinTypes) { - checkSupertype(type, FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH); + checkSupertype(type, FfiCode.subtypeOfStructClassInWith); } } @@ -190,7 +190,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (node.declaredFragment!.element.typeParameters.isNotEmpty) { _diagnosticReporter.atToken( node.name, - FfiCode.GENERIC_STRUCT_SUBCLASS, + FfiCode.genericStructSubclass, arguments: [node.name.lexeme], ); } @@ -204,7 +204,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (typeSystem.isSubtypeOf(compoundType, finalizableType)) { _diagnosticReporter.atToken( node.name, - FfiCode.COMPOUND_IMPLEMENTS_FINALIZABLE, + FfiCode.compoundImplementsFinalizable, arguments: [node.name.lexeme], ); } @@ -289,7 +289,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!constructor!.isFactory) { _diagnosticReporter.atNode( node.constructorName, - FfiCode.CREATION_OF_STRUCT_OR_UNION, + FfiCode.creationOfStructOrUnion, ); } } else if (class_.isNativeCallable) { @@ -312,7 +312,7 @@ class FfiVerifier extends RecursiveAstVisitor { var name = annotation.annotationAst.name; _diagnosticReporter.atNode( name, - FfiCode.FFI_NATIVE_INVALID_DUPLICATE_DEFAULT_ASSET, + FfiCode.ffiNativeInvalidDuplicateDefaultAsset, ); } @@ -467,7 +467,7 @@ class FfiVerifier extends RecursiveAstVisitor { var name = (annotation as ElementAnnotationImpl).annotationAst.name; _diagnosticReporter.atNode( name, - FfiCode.FFI_NATIVE_INVALID_MULTIPLE_ANNOTATIONS, + FfiCode.ffiNativeInvalidMultipleAnnotations, ); break; } @@ -475,10 +475,7 @@ class FfiVerifier extends RecursiveAstVisitor { hadNativeAnnotation = true; if (!isExternal) { - _diagnosticReporter.atToken( - errorNode, - FfiCode.FFI_NATIVE_MUST_BE_EXTERNAL, - ); + _diagnosticReporter.atToken(errorNode, FfiCode.ffiNativeMustBeExternal); } var ffiSignature = annotationType.typeArguments[0]; // The T in @Native @@ -496,7 +493,7 @@ class FfiVerifier extends RecursiveAstVisitor { // Field annotated with a function type, that can't work. _diagnosticReporter.atToken( errorNode, - FfiCode.NATIVE_FIELD_INVALID_TYPE, + FfiCode.nativeFieldInvalidType, arguments: [ffiSignature], ); } @@ -536,7 +533,7 @@ class FfiVerifier extends RecursiveAstVisitor { // Function annotated with something that isn't a function type. _diagnosticReporter.atToken( errorNode, - FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, + FfiCode.mustBeANativeFunctionType, arguments: ['T', 'Native'], ); } else { @@ -565,10 +562,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (declarationElement is InternalFieldElement) { if (!declarationElement.isStatic) { - _diagnosticReporter.atToken( - errorToken, - FfiCode.NATIVE_FIELD_NOT_STATIC, - ); + _diagnosticReporter.atToken(errorToken, FfiCode.nativeFieldNotStatic); } type = declarationElement.type; } else if (declarationElement is TopLevelVariableElementImpl) { @@ -576,7 +570,7 @@ class FfiVerifier extends RecursiveAstVisitor { } else if (declarationElement is InternalPropertyAccessorElement) { type = declarationElement.variable.type; } else { - _diagnosticReporter.atToken(errorToken, FfiCode.NATIVE_FIELD_NOT_STATIC); + _diagnosticReporter.atToken(errorToken, FfiCode.nativeFieldNotStatic); return; } @@ -585,10 +579,7 @@ class FfiVerifier extends RecursiveAstVisitor { var canonical = _canonicalFfiTypeForDartType(type); if (canonical == null) { - _diagnosticReporter.atToken( - errorToken, - FfiCode.NATIVE_FIELD_MISSING_TYPE, - ); + _diagnosticReporter.atToken(errorToken, FfiCode.nativeFieldMissingType); return; } else { ffiSignature = canonical; @@ -606,7 +597,7 @@ class FfiVerifier extends RecursiveAstVisitor { )) { _diagnosticReporter.atToken( errorToken, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [type, ffiSignature, 'Native'], ); } else if (ffiSignature.isArray) { @@ -620,7 +611,7 @@ class FfiVerifier extends RecursiveAstVisitor { } else if (ffiSignature.isHandle || ffiSignature.isNativeFunction) { _diagnosticReporter.atToken( errorToken, - FfiCode.NATIVE_FIELD_INVALID_TYPE, + FfiCode.nativeFieldInvalidType, arguments: [ffiSignature], ); } @@ -651,7 +642,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (formalParameters.length + 1 != ffiParameterTypes.length) { _diagnosticReporter.atToken( errorToken, - FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER, + FfiCode.ffiNativeUnexpectedNumberOfParametersWithReceiver, arguments: [formalParameters.length + 1, ffiParameterTypes.length], ); return; @@ -665,7 +656,7 @@ class FfiVerifier extends RecursiveAstVisitor { _diagnosticReporter.atToken( errorToken, FfiCode - .FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER, + .ffiNativeOnlyClassesExtendingNativefieldwrapperclass1CanBePointer, ); } } @@ -678,7 +669,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (formalParameters.length != ffiParameterTypes.length) { _diagnosticReporter.atToken( errorToken, - FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS, + FfiCode.ffiNativeUnexpectedNumberOfParameters, arguments: [ffiParameterTypes.length, formalParameters.length], ); return; @@ -697,7 +688,7 @@ class FfiVerifier extends RecursiveAstVisitor { _diagnosticReporter.atToken( errorToken, FfiCode - .FFI_NATIVE_ONLY_CLASSES_EXTENDING_NATIVEFIELDWRAPPERCLASS1_CAN_BE_POINTER, + .ffiNativeOnlyClassesExtendingNativefieldwrapperclass1CanBePointer, ); } } @@ -717,12 +708,12 @@ class FfiVerifier extends RecursiveAstVisitor { if (nativeTypeIsOmitted) { _diagnosticReporter.atToken( errorToken, - FfiCode.NATIVE_FUNCTION_MISSING_TYPE, + FfiCode.nativeFunctionMissingType, ); } else { _diagnosticReporter.atToken( errorToken, - FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, + FfiCode.mustBeANativeFunctionType, arguments: [nativeType, 'Native'], ); } @@ -736,7 +727,7 @@ class FfiVerifier extends RecursiveAstVisitor { )) { _diagnosticReporter.atToken( errorToken, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [nativeType, dartType, 'Native'], ); return; @@ -1000,10 +991,7 @@ class FfiVerifier extends RecursiveAstVisitor { node.members.length != 1 || node.members.single is! ConstructorDeclaration || (node.members.single as ConstructorDeclaration).constKeyword == null) { - _diagnosticReporter.atToken( - node.name, - FfiCode.ABI_SPECIFIC_INTEGER_INVALID, - ); + _diagnosticReporter.atToken(node.name, FfiCode.abiSpecificIntegerInvalid); } } @@ -1020,7 +1008,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (ffiPackedAnnotations.isEmpty) { _diagnosticReporter.atToken( errorToken, - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_MISSING, + FfiCode.abiSpecificIntegerMappingMissing, ); return; } @@ -1030,7 +1018,7 @@ class FfiVerifier extends RecursiveAstVisitor { for (var annotation in extraAnnotations) { _diagnosticReporter.atNode( annotation.name, - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_EXTRA, + FfiCode.abiSpecificIntegerMappingExtra, ); } } @@ -1052,7 +1040,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!_primitiveIntegerNativeTypesFixedSize.contains(name)) { _diagnosticReporter.atNode( element.value, - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED, + FfiCode.abiSpecificIntegerMappingUnsupported, arguments: [name], ); } @@ -1075,7 +1063,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!_primitiveIntegerNativeTypesFixedSize.contains(nativeTypeName)) { _diagnosticReporter.atNode( arguments.first, - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED, + FfiCode.abiSpecificIntegerMappingUnsupported, arguments: [nativeTypeName], ); } @@ -1100,7 +1088,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (parent is! ArgumentList || grandParent is! MethodInvocation || !grandParent.isNativeLeafInvocation) { - _diagnosticReporter.atNode(errorNode, FfiCode.ADDRESS_POSITION); + _diagnosticReporter.atNode(errorNode, FfiCode.addressPosition); } } @@ -1160,7 +1148,7 @@ class FfiVerifier extends RecursiveAstVisitor { } default: } - _diagnosticReporter.atNode(errorNode, FfiCode.ADDRESS_RECEIVER); + _diagnosticReporter.atNode(errorNode, FfiCode.addressReceiver); } void _validateAllocate(FunctionExpressionInvocationImpl node) { @@ -1177,7 +1165,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = node; _diagnosticReporter.atNode( errorNode, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['$_allocatorExtensionName.$_allocateExtensionMethodName'], ); } @@ -1214,19 +1202,19 @@ class FfiVerifier extends RecursiveAstVisitor { Annotation invalidAnnotation = extraAnnotations.removeAt(0); _diagnosticReporter.atNode( invalidAnnotation, - FfiCode.MISMATCHED_ANNOTATION_ON_STRUCT_FIELD, + FfiCode.mismatchedAnnotationOnStructField, ); } for (Annotation extraAnnotation in extraAnnotations) { _diagnosticReporter.atNode( extraAnnotation, - FfiCode.EXTRA_ANNOTATION_ON_STRUCT_FIELD, + FfiCode.extraAnnotationOnStructField, ); } } else if (!requiredFound) { _diagnosticReporter.atNode( errorNode, - FfiCode.MISSING_ANNOTATION_ON_STRUCT_FIELD, + FfiCode.missingAnnotationOnStructField, arguments: [ errorNode.type!, compound!.extendsClause!.superclass.name.lexeme, @@ -1259,7 +1247,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (pointerTypeArg is TypeParameterType) { _diagnosticReporter.atNode( target, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['asFunction'], ); return; @@ -1267,7 +1255,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!_isValidFfiNativeFunctionType(pointerTypeArg)) { _diagnosticReporter.atNode( errorNode, - FfiCode.NON_NATIVE_FUNCTION_TYPE_ARGUMENT_TO_POINTER, + FfiCode.nonNativeFunctionTypeArgumentToPointer, arguments: [T], ); return; @@ -1283,7 +1271,7 @@ class FfiVerifier extends RecursiveAstVisitor { )) { _diagnosticReporter.atNode( node, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [TPrime, F, 'asFunction'], ); } @@ -1429,7 +1417,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = node; _diagnosticReporter.atNode( errorNode, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['$errorClass.create'], ); } @@ -1444,7 +1432,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = node; _diagnosticReporter.atNode( errorNode, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['elementAt'], ); } @@ -1460,14 +1448,14 @@ class FfiVerifier extends RecursiveAstVisitor { _PrimitiveDartType.handle) { _diagnosticReporter.atEntity( errorEntity, - FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, + FfiCode.leafCallMustNotReturnHandle, ); } for (var param in nativeType.normalParameterTypes) { if (_primitiveNativeType(param) == _PrimitiveDartType.handle) { _diagnosticReporter.atEntity( errorEntity, - FfiCode.LEAF_CALL_MUST_NOT_TAKE_HANDLE, + FfiCode.leafCallMustNotTakeHandle, ); } } @@ -1487,7 +1475,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (node.externalKeyword == null) { _diagnosticReporter.atToken( fields.variables[0].name, - FfiCode.FIELD_MUST_BE_EXTERNAL_IN_STRUCT, + FfiCode.fieldMustBeExternalInStruct, ); } @@ -1495,14 +1483,14 @@ class FfiVerifier extends RecursiveAstVisitor { if (fieldType == null) { _diagnosticReporter.atToken( fields.variables[0].name, - FfiCode.MISSING_FIELD_TYPE_IN_STRUCT, + FfiCode.missingFieldTypeInStruct, ); } else { DartType declaredType = fieldType.typeOrThrow; if (declaredType.nullabilitySuffix == NullabilitySuffix.question) { _diagnosticReporter.atNode( fieldType, - FfiCode.INVALID_FIELD_TYPE_IN_STRUCT, + FfiCode.invalidFieldTypeInStruct, arguments: [fieldType.toSource()], ); } else if (declaredType.isDartCoreInt) { @@ -1525,7 +1513,7 @@ class FfiVerifier extends RecursiveAstVisitor { } _diagnosticReporter.atNode( errorNode, - FfiCode.NON_SIZED_TYPE_ARGUMENT, + FfiCode.nonSizedTypeArgument, arguments: [_arrayClassName, typeArg], ); } @@ -1557,14 +1545,14 @@ class FfiVerifier extends RecursiveAstVisitor { if (clazz.isEmptyStruct) { _diagnosticReporter.atNode( node, - FfiCode.EMPTY_STRUCT, + FfiCode.emptyStruct, arguments: [clazz.name!, clazz.supertype!.getDisplayString()], ); } } else { _diagnosticReporter.atNode( fieldType, - FfiCode.INVALID_FIELD_TYPE_IN_STRUCT, + FfiCode.invalidFieldTypeInStruct, arguments: [fieldType.toSource()], ); } @@ -1590,7 +1578,7 @@ class FfiVerifier extends RecursiveAstVisitor { } _diagnosticReporter.atNode( errorNode, - FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, + FfiCode.mustBeANativeFunctionType, arguments: [T, 'fromFunction'], ); return; @@ -1605,7 +1593,7 @@ class FfiVerifier extends RecursiveAstVisitor { )) { _diagnosticReporter.atNode( f, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [FT, T, 'fromFunction'], ); return; @@ -1620,14 +1608,14 @@ class FfiVerifier extends RecursiveAstVisitor { if (argCount != 1) { _diagnosticReporter.atNode( node.argumentList.arguments[1], - FfiCode.INVALID_EXCEPTION_VALUE, + FfiCode.invalidExceptionValue, arguments: ['fromFunction'], ); } } else if (argCount != 2) { _diagnosticReporter.atNode( node.methodName, - FfiCode.MISSING_EXCEPTION_VALUE, + FfiCode.missingExceptionValue, arguments: ['fromFunction'], ); } else { @@ -1640,14 +1628,14 @@ class FfiVerifier extends RecursiveAstVisitor { )) { _diagnosticReporter.atNode( e, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [eType, R, 'fromFunction'], ); } if (!_isConst(e)) { _diagnosticReporter.atNode( e, - FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, + FfiCode.argumentMustBeAConstant, arguments: ['exceptionalReturn'], ); } @@ -1665,7 +1653,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!_isConst(arg.expression)) { _diagnosticReporter.atNode( arg.expression, - FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, + FfiCode.argumentMustBeAConstant, arguments: [_isLeafParamName], ); } @@ -1692,7 +1680,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = typeArguments[0]; _diagnosticReporter.atNode( errorNode, - FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, + FfiCode.mustBeANativeFunctionType, arguments: [S, 'lookupFunction'], ); return; @@ -1706,7 +1694,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = typeArguments[1]; _diagnosticReporter.atNode( errorNode, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [S, F, 'lookupFunction'], ); } @@ -1755,14 +1743,14 @@ class FfiVerifier extends RecursiveAstVisitor { if (!typeSystem.isEqualTo(nativeType, targetFunctionType)) { _diagnosticReporter.atNode( node, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [nativeType, targetFunctionType, _nativeAddressOf], ); } } else { _diagnosticReporter.atNode( node, - FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, + FfiCode.mustBeANativeFunctionType, arguments: [targetType, _nativeAddressOf], ); } @@ -1792,7 +1780,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!typeSystem.isEqualTo(staticType, targetFunctionType)) { _diagnosticReporter.atNode( node, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [ staticType, targetFunctionType, @@ -1803,7 +1791,7 @@ class FfiVerifier extends RecursiveAstVisitor { } else { _diagnosticReporter.atNode( node, - FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, + FfiCode.mustBeANativeFunctionType, arguments: [targetType, _nativeAddressOf], ); } @@ -1811,7 +1799,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!typeSystem.isEqualTo(staticType, targetType)) { _diagnosticReporter.atNode( node, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [staticType, targetType, _nativeAddressOf], ); } @@ -1826,7 +1814,7 @@ class FfiVerifier extends RecursiveAstVisitor { } if (!validTarget) { - _diagnosticReporter.atNode(argument, FfiCode.ARGUMENT_MUST_BE_NATIVE); + _diagnosticReporter.atNode(argument, FfiCode.argumentMustBeNative); } } @@ -1853,7 +1841,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!_isValidFfiNativeFunctionType(typeArg)) { _diagnosticReporter.atNode( node.constructorName, - FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, + FfiCode.mustBeANativeFunctionType, arguments: [typeArg, _nativeCallable], ); return; @@ -1868,7 +1856,7 @@ class FfiVerifier extends RecursiveAstVisitor { )) { _diagnosticReporter.atNode( f, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [funcType, typeArg, _nativeCallable], ); return; @@ -1883,14 +1871,14 @@ class FfiVerifier extends RecursiveAstVisitor { if (argCount != 1) { _diagnosticReporter.atNode( node.argumentList.arguments[1], - FfiCode.INVALID_EXCEPTION_VALUE, + FfiCode.invalidExceptionValue, arguments: [name], ); } } else if (argCount != 2) { _diagnosticReporter.atNode( node, - FfiCode.MISSING_EXCEPTION_VALUE, + FfiCode.missingExceptionValue, arguments: [name], ); } else { @@ -1903,14 +1891,14 @@ class FfiVerifier extends RecursiveAstVisitor { )) { _diagnosticReporter.atNode( e, - FfiCode.MUST_BE_A_SUBTYPE, + FfiCode.mustBeASubtype, arguments: [eType, natRetType, name], ); } if (!_isConst(e)) { _diagnosticReporter.atNode( e, - FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, + FfiCode.argumentMustBeAConstant, arguments: ['exceptionalReturn'], ); } @@ -1919,7 +1907,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (_primitiveNativeType(natRetType) != _PrimitiveDartType.void_) { _diagnosticReporter.atNode( f, - FfiCode.MUST_RETURN_VOID, + FfiCode.mustReturnVoid, arguments: [natRetType], ); } @@ -1932,7 +1920,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (annotation.element.ffiClass != null) { _diagnosticReporter.atNode( annotation, - FfiCode.ANNOTATION_ON_POINTER_FIELD, + FfiCode.annotationOnPointerField, ); } } @@ -1950,7 +1938,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (ffiPackedAnnotations.length > 1) { var extraAnnotations = ffiPackedAnnotations.skip(1); for (var annotation in extraAnnotations) { - _diagnosticReporter.atNode(annotation, FfiCode.PACKED_ANNOTATION); + _diagnosticReporter.atNode(annotation, FfiCode.packedAnnotation); } } @@ -1963,10 +1951,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (arguments != null && arguments.isNotEmpty) { errorNode = arguments[0]; } - _diagnosticReporter.atNode( - errorNode, - FfiCode.PACKED_ANNOTATION_ALIGNMENT, - ); + _diagnosticReporter.atNode(errorNode, FfiCode.packedAnnotationAlignment); } } @@ -1980,7 +1965,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = node; _diagnosticReporter.atNode( errorNode, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['[]'], ); } @@ -1994,7 +1979,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = node; _diagnosticReporter.atNode( errorNode, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['ref'], ); } @@ -2006,7 +1991,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = node; _diagnosticReporter.atNode( errorNode, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['ref'], ); } @@ -2020,7 +2005,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (!_isValidFfiNativeType(targetType, allowEmptyStruct: true)) { _diagnosticReporter.atNode( node, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['refWithFinalizer'], ); } @@ -2036,7 +2021,7 @@ class FfiVerifier extends RecursiveAstVisitor { AstNode errorNode = node; _diagnosticReporter.atNode( errorNode, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: ['sizeOf'], ); } @@ -2057,7 +2042,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (ffiSizeAnnotations.isEmpty) { _diagnosticReporter.atEntity( errorEntity, - FfiCode.MISSING_SIZE_ANNOTATION_CARRAY, + FfiCode.missingSizeAnnotationCarray, ); return; } @@ -2067,7 +2052,7 @@ class FfiVerifier extends RecursiveAstVisitor { for (var annotation in extraAnnotations) { _diagnosticReporter.atNode( annotation, - FfiCode.EXTRA_SIZE_ANNOTATION_CARRAY, + FfiCode.extraSizeAnnotationCarray, ); } } @@ -2078,17 +2063,14 @@ class FfiVerifier extends RecursiveAstVisitor { annotation.elementAnnotation?.arraySizeDimensions ?? ([], false); var annotationDimensions = dimensions.length; if (annotationDimensions != arrayDimensions) { - _diagnosticReporter.atNode( - annotation, - FfiCode.SIZE_ANNOTATION_DIMENSIONS, - ); + _diagnosticReporter.atNode(annotation, FfiCode.sizeAnnotationDimensions); } if (variableLength) { if (!allowVariableLength) { _diagnosticReporter.atNode( annotation, - FfiCode.VARIABLE_LENGTH_ARRAY_NOT_LAST, + FfiCode.variableLengthArrayNotLast, ); } } @@ -2137,7 +2119,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (dimensions[0] < 0) { _diagnosticReporter.atNode( errorNode, - FfiCode.NEGATIVE_VARIABLE_DIMENSION, + FfiCode.negativeVariableDimension, ); } continue; @@ -2146,7 +2128,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (dimensions[i] <= 0) { _diagnosticReporter.atNode( errorNode, - FfiCode.NON_POSITIVE_ARRAY_DIMENSION, + FfiCode.nonPositiveArrayDimension, ); } } @@ -2158,7 +2140,7 @@ class FfiVerifier extends RecursiveAstVisitor { if (typeArgument.type is TypeParameterType) { _diagnosticReporter.atNode( typeArgument, - FfiCode.NON_CONSTANT_TYPE_ARGUMENT, + FfiCode.nonConstantTypeArgument, arguments: [functionName], ); return true; diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart index 1aa906b2fac..90f0031535e 100644 --- a/pkg/analyzer/lib/src/generated/resolver.dart +++ b/pkg/analyzer/lib/src/generated/resolver.dart @@ -497,14 +497,14 @@ class ResolverVisitor extends ThrowingAstVisitor } else { diagnosticReporter.atNode( field, - CompileTimeErrorCode.MISSING_NAMED_PATTERN_FIELD_NAME, + CompileTimeErrorCode.missingNamedPatternFieldName, ); } } } else if (mustBeNamed) { diagnosticReporter.atNode( field, - CompileTimeErrorCode.POSITIONAL_FIELD_IN_OBJECT_PATTERN, + CompileTimeErrorCode.positionalFieldInObjectPattern, ); } return shared.RecordPatternField( @@ -518,7 +518,7 @@ class ResolverVisitor extends ThrowingAstVisitor /// Verify that the arguments in the given [argumentList] can be assigned to /// their corresponding parameters. /// - /// See [CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]. + /// See [CompileTimeErrorCode.argumentTypeNotAssignable]. void checkForArgumentTypesNotAssignableInList( ArgumentListImpl argumentList, List whyNotPromotedArguments, @@ -583,7 +583,7 @@ class ResolverVisitor extends ThrowingAstVisitor DiagnosticCode diagnosticCode; if (typeSystem.isPotentiallyNonNullable(returnType)) { - diagnosticCode = CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY; + diagnosticCode = CompileTimeErrorCode.bodyMightCompleteNormally; } else { var returnTypeBase = typeSystem.futureOrBase(returnType); if (returnTypeBase is DynamicType || @@ -593,7 +593,7 @@ class ResolverVisitor extends ThrowingAstVisitor returnTypeBase.isDartCoreNull) { return; } else { - diagnosticCode = WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE; + diagnosticCode = WarningCode.bodyMightCompleteNormallyNullable; } } if (errorNode is ConstructorDeclaration) { @@ -649,7 +649,7 @@ class ResolverVisitor extends ThrowingAstVisitor errorNode ??= pattern; diagnosticReporter.atNode( errorNode, - WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, + WarningCode.patternNeverMatchesValueType, arguments: [matchedValueType, requiredType], ); } @@ -676,7 +676,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (unassigned) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, arguments: [node.name], ); } @@ -687,7 +687,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (element.isFinal) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, + CompileTimeErrorCode.readPotentiallyUnassignedFinal, arguments: [node.name], ); return; @@ -696,8 +696,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (typeSystem.isPotentiallyNonNullable(element.type)) { diagnosticReporter.atNode( node, - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, arguments: [node.name], ); return; @@ -921,15 +920,14 @@ class ResolverVisitor extends ThrowingAstVisitor shared.JoinedPatternVariableInconsistency.sharedCaseAbsent) { diagnosticReporter.atNode( reference, - CompileTimeErrorCode - .PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES, + CompileTimeErrorCode.patternVariableSharedCaseScopeNotAllCases, arguments: [variable.name!], ); } else if (variable.inconsistency == shared.JoinedPatternVariableInconsistency.sharedCaseHasLabel) { diagnosticReporter.atNode( reference, - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_HAS_LABEL, + CompileTimeErrorCode.patternVariableSharedCaseScopeHasLabel, arguments: [variable.name!], ); } else if (variable.inconsistency == @@ -937,7 +935,7 @@ class ResolverVisitor extends ThrowingAstVisitor diagnosticReporter.atNode( reference, CompileTimeErrorCode - .PATTERN_VARIABLE_SHARED_CASE_SCOPE_DIFFERENT_FINALITY_OR_TYPE, + .patternVariableSharedCaseScopeDifferentFinalityOrType, arguments: [variable.name!], ); } @@ -1421,14 +1419,14 @@ class ResolverVisitor extends ThrowingAstVisitor if (flow.isAssigned(element)) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, + CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, ); } } else { if (!flow.isUnassigned(element)) { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, + CompileTimeErrorCode.assignmentToFinalLocal, arguments: [node.name.lexeme], ); } @@ -1546,7 +1544,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (hasRead && result.readElementRequested2 == null) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.UNDEFINED_IDENTIFIER, + CompileTimeErrorCode.undefinedIdentifier, arguments: [node.name], ); } @@ -1583,7 +1581,7 @@ class ResolverVisitor extends ThrowingAstVisitor } else { diagnosticReporter.atNode( typeArgumentsList, - CompileTimeErrorCode.EXPECTED_TWO_MAP_PATTERN_TYPE_ARGUMENTS, + CompileTimeErrorCode.expectedTwoMapPatternTypeArguments, arguments: [length], ); } @@ -1634,7 +1632,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (result.needsGetterError) { diagnosticReporter.atToken( nameToken, - CompileTimeErrorCode.UNDEFINED_GETTER, + CompileTimeErrorCode.undefinedGetter, arguments: [nameToken.lexeme, receiverType], ); } @@ -1690,7 +1688,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (result.needsGetterError) { diagnosticReporter.atToken( node.operator, - CompileTimeErrorCode.UNDEFINED_OPERATOR, + CompileTimeErrorCode.undefinedOperator, arguments: [methodName, matchedType], ); } @@ -1905,7 +1903,7 @@ class ResolverVisitor extends ThrowingAstVisitor flowAnalysis.isDefinitelyUnassigned(simpleIdentifier, element)) { diagnosticReporter.atNode( simpleIdentifier, - WarningCode.CAST_FROM_NULLABLE_ALWAYS_FAILS, + WarningCode.castFromNullableAlwaysFails, arguments: [simpleIdentifier.name], ); } @@ -1923,7 +1921,7 @@ class ResolverVisitor extends ThrowingAstVisitor popRewrite(); boolExpressionVerifier.checkForNonBoolExpression( node.condition, - diagnosticCode: CompileTimeErrorCode.NON_BOOL_EXPRESSION, + diagnosticCode: CompileTimeErrorCode.nonBoolExpression, whyNotPromoted: flowAnalysis.flow?.whyNotPromoted(node.condition), ); flowAnalysis.flow?.assert_afterCondition(node.condition); @@ -1946,7 +1944,7 @@ class ResolverVisitor extends ThrowingAstVisitor popRewrite(); boolExpressionVerifier.checkForNonBoolExpression( node.condition, - diagnosticCode: CompileTimeErrorCode.NON_BOOL_EXPRESSION, + diagnosticCode: CompileTimeErrorCode.nonBoolExpression, whyNotPromoted: flowAnalysis.flow?.whyNotPromoted(node.condition), ); flowAnalysis.flow?.assert_afterCondition(node.condition); @@ -2571,7 +2569,7 @@ class ResolverVisitor extends ThrowingAstVisitor var errorTarget = constructorName ?? node.name; diagnosticReporter.atEntity( errorTarget, - CompileTimeErrorCode.ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR, + CompileTimeErrorCode.enumConstantInvokesFactoryConstructor, ); } } else { @@ -2580,13 +2578,13 @@ class ResolverVisitor extends ThrowingAstVisitor if (nameNode != null) { diagnosticReporter.atNode( nameNode, - CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_NAMED, + CompileTimeErrorCode.undefinedEnumConstructorNamed, arguments: [nameNode.name], ); } else { diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_UNNAMED, + CompileTimeErrorCode.undefinedEnumConstructorUnnamed, ); } } @@ -3905,7 +3903,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (!node.isNullAware) { nullableDereferenceVerifier.expression( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD, + CompileTimeErrorCode.uncheckedUseOfNullableValueInSpread, node.expression, ); } @@ -4253,7 +4251,7 @@ class ResolverVisitor extends ThrowingAstVisitor diagnosticReporter.atToken( errorNode.block.leftBracket, - WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR, + WarningCode.bodyMightCompleteNormallyCatchError, arguments: [returnTypeBase], ); } @@ -4278,7 +4276,7 @@ class ResolverVisitor extends ThrowingAstVisitor var argumentsText = error.arguments.join(', '); diagnosticReporter.atToken( node.name, - CompileTimeErrorCode.TOP_LEVEL_CYCLE, + CompileTimeErrorCode.topLevelCycle, arguments: [node.name.lexeme, argumentsText], ); } @@ -4661,7 +4659,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (element == null) { diagnosticReporter?.atNode( nameNode, - CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, + CompileTimeErrorCode.undefinedNamedParameter, arguments: [name], ); } else { @@ -4672,7 +4670,7 @@ class ResolverVisitor extends ThrowingAstVisitor if (!usedNames.add(name)) { diagnosticReporter?.atNode( nameNode, - CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, + CompileTimeErrorCode.duplicateNamedArgument, arguments: [name], ); } @@ -4701,9 +4699,9 @@ class ResolverVisitor extends ThrowingAstVisitor int namedArgumentCount = usedNames?.length ?? 0; if (namedParameterCount > namedArgumentCount) { diagnosticCode = - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED; + CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed; } else { - diagnosticCode = CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS; + diagnosticCode = CompileTimeErrorCode.extraPositionalArguments; } if (firstUnresolvedArgument != null) { diagnosticReporter?.atNode( @@ -4730,8 +4728,8 @@ class ResolverVisitor extends ThrowingAstVisitor return true; } - /// Reports [CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_SINGULAR] or - /// [CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_PLURAL] at the + /// Reports [CompileTimeErrorCode.notEnoughPositionalArgumentsSingular] or + /// [CompileTimeErrorCode.notEnoughPositionalArgumentsPlural] at the /// specified [token], considering the name of the [nameNode]. static void _reportNotEnoughPositionalArguments({ required Token token, @@ -4802,14 +4800,13 @@ class ResolverVisitor extends ThrowingAstVisitor if (name == null) { diagnosticCode = isPlural - ? CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_PLURAL - : CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_SINGULAR; + ? CompileTimeErrorCode.notEnoughPositionalArgumentsPlural + : CompileTimeErrorCode.notEnoughPositionalArgumentsSingular; } else { diagnosticCode = isPlural - ? CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL - : CompileTimeErrorCode - .NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR; + ? CompileTimeErrorCode.notEnoughPositionalArgumentsNamePlural + : CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular; arguments.add(name); } diagnosticReporter.atToken(token, diagnosticCode, arguments: arguments); @@ -5513,7 +5510,7 @@ class ScopeResolverVisitor extends UnifyingAstVisitor { element.isVisitingWhenClause) { diagnosticReporter.atNode( node, - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, + CompileTimeErrorCode.patternVariableAssignmentInsideGuard, ); } _localVariableInfo.potentiallyMutatedInScope.add(element); @@ -5654,7 +5651,7 @@ class ScopeResolverVisitor extends UnifyingAstVisitor { // undefined. diagnosticReporter.atNode( labelNode, - CompileTimeErrorCode.LABEL_UNDEFINED, + CompileTimeErrorCode.labelUndefined, arguments: [labelNode.name], ); return null; @@ -5665,7 +5662,7 @@ class ScopeResolverVisitor extends UnifyingAstVisitor { // enclosing scope. diagnosticReporter.atNode( labelNode, - CompileTimeErrorCode.LABEL_UNDEFINED, + CompileTimeErrorCode.labelUndefined, arguments: [labelNode.name], ); return null; @@ -5678,7 +5675,7 @@ class ScopeResolverVisitor extends UnifyingAstVisitor { if (!identical(labelContainer, enclosingClosure.firstFragment)) { diagnosticReporter.atNode( labelNode, - CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE, + CompileTimeErrorCode.labelInOuterScope, arguments: [labelNode.name], ); } @@ -5691,7 +5688,7 @@ class ScopeResolverVisitor extends UnifyingAstVisitor { node is! WhileStatement) { diagnosticReporter.atNode( parentNode, - CompileTimeErrorCode.CONTINUE_LABEL_INVALID, + CompileTimeErrorCode.continueLabelInvalid, ); } return node; diff --git a/pkg/analyzer/lib/src/generated/scope_helpers.dart b/pkg/analyzer/lib/src/generated/scope_helpers.dart index 116fb0fdb0b..b48a553a6e3 100644 --- a/pkg/analyzer/lib/src/generated/scope_helpers.dart +++ b/pkg/analyzer/lib/src/generated/scope_helpers.dart @@ -58,7 +58,7 @@ mixin ScopeHelpers { void _reportDeprecatedExportUse({required Token nameToken}) { diagnosticReporter.atToken( nameToken, - WarningCode.DEPRECATED_EXPORT_USE, + WarningCode.deprecatedExportUse, arguments: [nameToken.lexeme], ); } diff --git a/pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart b/pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart index ec1fc2201bb..5d9b3fc2b0d 100644 --- a/pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart +++ b/pkg/analyzer/lib/src/hint/sdk_constraint_verifier.dart @@ -82,7 +82,7 @@ class SdkConstraintVerifier extends RecursiveAstVisitor { if (operatorType == TokenType.GT_GT_GT) { _errorReporter.atToken( node.operator, - WarningCode.SDK_VERSION_GT_GT_GT_OPERATOR, + WarningCode.sdkVersionGtGtGtOperator, ); } } @@ -115,10 +115,7 @@ class SdkConstraintVerifier extends RecursiveAstVisitor { @override void visitMethodDeclaration(MethodDeclaration node) { if (checkTripleShift && node.isOperator && node.name.lexeme == '>>>') { - _errorReporter.atToken( - node.name, - WarningCode.SDK_VERSION_GT_GT_GT_OPERATOR, - ); + _errorReporter.atToken(node.name, WarningCode.sdkVersionGtGtGtOperator); } super.visitMethodDeclaration(node); } @@ -199,7 +196,7 @@ class SdkConstraintVerifier extends RecursiveAstVisitor { } _errorReporter.atEntity( errorEntity, - WarningCode.SDK_VERSION_SINCE, + WarningCode.sdkVersionSince, arguments: [ sinceSdkVersion.toString(), _versionConstraint.toString(), diff --git a/pkg/analyzer/lib/src/lint/constants.dart b/pkg/analyzer/lib/src/lint/constants.dart index b59f9a78868..8ff1403da00 100644 --- a/pkg/analyzer/lib/src/lint/constants.dart +++ b/pkg/analyzer/lib/src/lint/constants.dart @@ -28,43 +28,41 @@ class _ConstantDiagnosticListener extends DiagnosticListener { DiagnosticCode diagnosticCode = diagnostic.diagnosticCode; if (diagnosticCode is CompileTimeErrorCode) { switch (diagnosticCode) { + case CompileTimeErrorCode.constConstructorConstantFromDeferredLibrary: case CompileTimeErrorCode - .CONST_CONSTRUCTOR_CONSTANT_FROM_DEFERRED_LIBRARY: - case CompileTimeErrorCode - .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST: - case CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD: - case CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD: - case CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION: - case CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS: - case CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL: - case CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT: - case CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING: - case CompileTimeErrorCode.CONST_EVAL_TYPE_INT: - case CompileTimeErrorCode.CONST_EVAL_TYPE_NUM: - case CompileTimeErrorCode.CONST_EVAL_TYPE_NUM_STRING: - case CompileTimeErrorCode.CONST_EVAL_TYPE_STRING: - case CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION: - case CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE: - case CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT: - case CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY: - case CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY: - case CompileTimeErrorCode.CONST_TYPE_PARAMETER: - case CompileTimeErrorCode.CONST_WITH_NON_CONST: - case CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT: - case CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS: - case CompileTimeErrorCode - .CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF: - case CompileTimeErrorCode.INVALID_CONSTANT: - case CompileTimeErrorCode.MISSING_CONST_IN_LIST_LITERAL: - case CompileTimeErrorCode.MISSING_CONST_IN_MAP_LITERAL: - case CompileTimeErrorCode.MISSING_CONST_IN_SET_LITERAL: - case CompileTimeErrorCode.NON_BOOL_CONDITION: - case CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT: - case CompileTimeErrorCode.NON_CONSTANT_MAP_ELEMENT: - case CompileTimeErrorCode.NON_CONSTANT_MAP_KEY: - case CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE: - case CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD: - case CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT: + .constConstructorWithFieldInitializedByNonConst: + case CompileTimeErrorCode.constEvalExtensionMethod: + case CompileTimeErrorCode.constEvalExtensionTypeMethod: + case CompileTimeErrorCode.constEvalMethodInvocation: + case CompileTimeErrorCode.constEvalPropertyAccess: + case CompileTimeErrorCode.constEvalTypeBool: + case CompileTimeErrorCode.constEvalTypeBoolInt: + case CompileTimeErrorCode.constEvalTypeBoolNumString: + case CompileTimeErrorCode.constEvalTypeInt: + case CompileTimeErrorCode.constEvalTypeNum: + case CompileTimeErrorCode.constEvalTypeNumString: + case CompileTimeErrorCode.constEvalTypeString: + case CompileTimeErrorCode.constEvalThrowsException: + case CompileTimeErrorCode.constEvalThrowsIdbze: + case CompileTimeErrorCode.constEvalForElement: + case CompileTimeErrorCode.constMapKeyNotPrimitiveEquality: + case CompileTimeErrorCode.constSetElementNotPrimitiveEquality: + case CompileTimeErrorCode.constTypeParameter: + case CompileTimeErrorCode.constWithNonConst: + case CompileTimeErrorCode.constWithNonConstantArgument: + case CompileTimeErrorCode.constWithTypeParameters: + case CompileTimeErrorCode.constWithTypeParametersConstructorTearoff: + case CompileTimeErrorCode.invalidConstant: + case CompileTimeErrorCode.missingConstInListLiteral: + case CompileTimeErrorCode.missingConstInMapLiteral: + case CompileTimeErrorCode.missingConstInSetLiteral: + case CompileTimeErrorCode.nonBoolCondition: + case CompileTimeErrorCode.nonConstantListElement: + case CompileTimeErrorCode.nonConstantMapElement: + case CompileTimeErrorCode.nonConstantMapKey: + case CompileTimeErrorCode.nonConstantMapValue: + case CompileTimeErrorCode.nonConstantRecordField: + case CompileTimeErrorCode.nonConstantSetElement: hasConstError = true; } } diff --git a/pkg/analyzer/lib/src/lint/options_rule_validator.dart b/pkg/analyzer/lib/src/lint/options_rule_validator.dart index 30b39843d92..8c6bebd081c 100644 --- a/pkg/analyzer/lib/src/lint/options_rule_validator.dart +++ b/pkg/analyzer/lib/src/lint/options_rule_validator.dart @@ -76,7 +76,7 @@ class LinterRuleOptionsValidator extends OptionsValidator { if (rule == null) { reporter.atSourceSpan( node.span, - AnalysisOptionsWarningCode.UNDEFINED_LINT, + AnalysisOptionsWarningCode.undefinedLint, arguments: [value], ); return; @@ -87,13 +87,13 @@ class LinterRuleOptionsValidator extends OptionsValidator { if (incompatibleRule != null) { reporter.atSourceSpan( node.span, - AnalysisOptionsWarningCode.INCOMPATIBLE_LINT, + AnalysisOptionsWarningCode.incompatibleLint, arguments: [value, incompatibleRule], ); } else if (!seenRules.add(rule.name)) { reporter.atSourceSpan( node.span, - AnalysisOptionsWarningCode.DUPLICATE_RULE, + AnalysisOptionsWarningCode.duplicateRule, arguments: [value], ); } @@ -107,13 +107,13 @@ class LinterRuleOptionsValidator extends OptionsValidator { if (replacedBy != null) { reporter.atSourceSpan( node.span, - AnalysisOptionsWarningCode.DEPRECATED_LINT_WITH_REPLACEMENT, + AnalysisOptionsWarningCode.deprecatedLintWithReplacement, arguments: [value, replacedBy], ); } else { reporter.atSourceSpan( node.span, - AnalysisOptionsWarningCode.DEPRECATED_LINT, + AnalysisOptionsWarningCode.deprecatedLint, arguments: [value], ); } @@ -123,13 +123,13 @@ class LinterRuleOptionsValidator extends OptionsValidator { if (replacedBy != null) { reporter.atSourceSpan( node.span, - AnalysisOptionsWarningCode.REPLACED_LINT, + AnalysisOptionsWarningCode.replacedLint, arguments: [value, since, replacedBy], ); } else { reporter.atSourceSpan( node.span, - AnalysisOptionsWarningCode.REMOVED_LINT, + AnalysisOptionsWarningCode.removedLint, arguments: [value, since], ); } diff --git a/pkg/analyzer/lib/src/manifest/manifest_validator.dart b/pkg/analyzer/lib/src/manifest/manifest_validator.dart index 071a65d848b..8ceb642709d 100644 --- a/pkg/analyzer/lib/src/manifest/manifest_validator.dart +++ b/pkg/analyzer/lib/src/manifest/manifest_validator.dart @@ -495,7 +495,7 @@ class ManifestValidator { reporter, activity, attributeScreenOrientation, - ManifestWarningCode.SETTING_ORIENTATION_ON_ACTIVITY, + ManifestWarningCode.settingOrientationOnActivity, ); } } @@ -505,7 +505,7 @@ class ManifestValidator { reporter, activity, attributeResizableActivity, - ManifestWarningCode.NON_RESIZABLE_ACTIVITY, + ManifestWarningCode.nonResizableActivity, ); } } @@ -532,7 +532,7 @@ class ManifestValidator { reporter, element, androidName, - ManifestWarningCode.UNSUPPORTED_CHROME_OS_HARDWARE, + ManifestWarningCode.unsupportedChromeOsHardware, [element.attributes[androidName]!.value], ); } else if (element.attributes[androidRequired]?.value == 'true') { @@ -545,7 +545,7 @@ class ManifestValidator { reporter, element, androidName, - ManifestWarningCode.UNSUPPORTED_CHROME_OS_FEATURE, + ManifestWarningCode.unsupportedChromeOsFeature, [element.attributes[androidName]!.value], ); } @@ -567,7 +567,7 @@ class ManifestValidator { reporter, permission, androidName, - ManifestWarningCode.CAMERA_PERMISSIONS_INCOMPATIBLE, + ManifestWarningCode.cameraPermissionsIncompatible, ); } } else { @@ -579,7 +579,7 @@ class ManifestValidator { reporter, permission, androidName, - ManifestWarningCode.PERMISSION_IMPLIES_UNSUPPORTED_HARDWARE, + ManifestWarningCode.permissionImpliesUnsupportedHardware, [featureName], ); } @@ -603,7 +603,7 @@ class ManifestValidator { reporter, feature, androidName, - ManifestWarningCode.UNSUPPORTED_CHROME_OS_HARDWARE, + ManifestWarningCode.unsupportedChromeOsHardware, [hardwareFeatureTouchscreen], ); } else if (feature.attributes[androidRequired]?.value == 'true') { @@ -611,7 +611,7 @@ class ManifestValidator { reporter, feature, androidName, - ManifestWarningCode.UNSUPPORTED_CHROME_OS_FEATURE, + ManifestWarningCode.unsupportedChromeOsFeature, [hardwareFeatureTouchscreen], ); } @@ -620,7 +620,7 @@ class ManifestValidator { reporter, manifest, null, - ManifestWarningCode.NO_TOUCHSCREEN_FEATURE, + ManifestWarningCode.noTouchscreenFeature, ); } } diff --git a/pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart b/pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart index e81ebd5a5b6..0db5ed98f99 100644 --- a/pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart +++ b/pkg/analyzer/lib/src/manifest/manifest_warning_code.g.dart @@ -32,7 +32,7 @@ class ManifestWarningCode extends DiagnosticCode { /// /// No parameters. static const ManifestWarningCode - CAMERA_PERMISSIONS_INCOMPATIBLE = ManifestWarningCode( + cameraPermissionsIncompatible = ManifestWarningCode( 'CAMERA_PERMISSIONS_INCOMPATIBLE', "Camera permissions make app incompatible for Chrome OS, consider adding " "optional features \"android.hardware.camera\" and " @@ -47,7 +47,7 @@ class ManifestWarningCode extends DiagnosticCode { /// A code indicating that the activity is set to be non resizable. /// /// No parameters. - static const ManifestWarningCode NON_RESIZABLE_ACTIVITY = ManifestWarningCode( + static const ManifestWarningCode nonResizableActivity = ManifestWarningCode( 'NON_RESIZABLE_ACTIVITY', "The `` element should be allowed to be resized to allow users " "to take advantage of the multi-window environment on Chrome OS", @@ -60,7 +60,7 @@ class ManifestWarningCode extends DiagnosticCode { /// manifest. /// /// No parameters. - static const ManifestWarningCode NO_TOUCHSCREEN_FEATURE = ManifestWarningCode( + static const ManifestWarningCode noTouchscreenFeature = ManifestWarningCode( 'NO_TOUCHSCREEN_FEATURE', "The default \"android.hardware.touchscreen\" needs to be optional for " "Chrome OS. ", @@ -76,7 +76,7 @@ class ManifestWarningCode extends DiagnosticCode { /// Parameters: /// Object p0: the name of the feature tag static const ManifestWarningCode - PERMISSION_IMPLIES_UNSUPPORTED_HARDWARE = ManifestWarningCode( + permissionImpliesUnsupportedHardware = ManifestWarningCode( 'PERMISSION_IMPLIES_UNSUPPORTED_HARDWARE', "Permission makes app incompatible for Chrome OS, consider adding optional " "{0} feature tag, ", @@ -89,7 +89,7 @@ class ManifestWarningCode extends DiagnosticCode { /// /// No parameters. static const ManifestWarningCode - SETTING_ORIENTATION_ON_ACTIVITY = ManifestWarningCode( + settingOrientationOnActivity = ManifestWarningCode( 'SETTING_ORIENTATION_ON_ACTIVITY', "The `` element should not be locked to any orientation so that " "users can take advantage of the multi-window environments and larger " @@ -103,7 +103,7 @@ class ManifestWarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the feature - static const ManifestWarningCode UNSUPPORTED_CHROME_OS_FEATURE = + static const ManifestWarningCode unsupportedChromeOsFeature = ManifestWarningCode( 'UNSUPPORTED_CHROME_OS_FEATURE', "The feature {0} isn't supported on Chrome OS, consider making it " @@ -117,7 +117,7 @@ class ManifestWarningCode extends DiagnosticCode { /// /// Parameters: /// String p0: the name of the feature - static const ManifestWarningCode UNSUPPORTED_CHROME_OS_HARDWARE = + static const ManifestWarningCode unsupportedChromeOsHardware = ManifestWarningCode( 'UNSUPPORTED_CHROME_OS_HARDWARE', "The feature {0} isn't supported on Chrome OS, consider making it " diff --git a/pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart b/pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart index c803fea3f46..31ab7105fa5 100644 --- a/pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart +++ b/pkg/analyzer/lib/src/pubspec/pubspec_warning_code.g.dart @@ -29,7 +29,7 @@ import "package:_fe_analyzer_shared/src/base/errors.dart"; class PubspecWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the path to the asset directory as given in the file. - static const PubspecWarningCode ASSET_DIRECTORY_DOES_NOT_EXIST = + static const PubspecWarningCode assetDirectoryDoesNotExist = PubspecWarningCode( 'ASSET_DIRECTORY_DOES_NOT_EXIST', "The asset directory '{0}' doesn't exist.", @@ -40,7 +40,7 @@ class PubspecWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the path to the asset as given in the file. - static const PubspecWarningCode ASSET_DOES_NOT_EXIST = PubspecWarningCode( + static const PubspecWarningCode assetDoesNotExist = PubspecWarningCode( 'ASSET_DOES_NOT_EXIST', "The asset file '{0}' doesn't exist.", correctionMessage: "Try creating the file or fixing the path to the file.", @@ -48,7 +48,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode ASSET_FIELD_NOT_LIST = PubspecWarningCode( + static const PubspecWarningCode assetFieldNotList = PubspecWarningCode( 'ASSET_FIELD_NOT_LIST', "The value of the 'assets' field is expected to be a list of relative file " "paths.", @@ -58,7 +58,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode ASSET_MISSING_PATH = PubspecWarningCode( + static const PubspecWarningCode assetMissingPath = PubspecWarningCode( 'ASSET_MISSING_PATH', "Asset map entry must contain a 'path' field.", correctionMessage: "Try adding a 'path' field.", @@ -69,7 +69,7 @@ class PubspecWarningCode extends DiagnosticCode { /// 'ASSET_NOT_STRING_OR_MAP' code, and will be removed. /// /// No parameters. - static const PubspecWarningCode ASSET_NOT_STRING = PubspecWarningCode( + static const PubspecWarningCode assetNotString = PubspecWarningCode( 'ASSET_NOT_STRING', "Assets are required to be file paths (strings).", correctionMessage: "Try converting the value to be a string.", @@ -77,7 +77,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode ASSET_NOT_STRING_OR_MAP = PubspecWarningCode( + static const PubspecWarningCode assetNotStringOrMap = PubspecWarningCode( 'ASSET_NOT_STRING_OR_MAP', "An asset value is required to be a file path (string) or map.", correctionMessage: "Try converting the value to be a string or map.", @@ -85,7 +85,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode ASSET_PATH_NOT_STRING = PubspecWarningCode( + static const PubspecWarningCode assetPathNotString = PubspecWarningCode( 'ASSET_PATH_NOT_STRING', "Asset paths are required to be file paths (strings).", correctionMessage: "Try converting the value to be a string.", @@ -94,17 +94,16 @@ class PubspecWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the field - static const PubspecWarningCode DEPENDENCIES_FIELD_NOT_MAP = - PubspecWarningCode( - 'DEPENDENCIES_FIELD_NOT_MAP', - "The value of the '{0}' field is expected to be a map.", - correctionMessage: "Try converting the value to be a map.", - hasPublishedDocs: true, - ); + static const PubspecWarningCode dependenciesFieldNotMap = PubspecWarningCode( + 'DEPENDENCIES_FIELD_NOT_MAP', + "The value of the '{0}' field is expected to be a map.", + correctionMessage: "Try converting the value to be a map.", + hasPublishedDocs: true, + ); /// Parameters: /// String p0: the name of the field - static const PubspecWarningCode DEPRECATED_FIELD = PubspecWarningCode( + static const PubspecWarningCode deprecatedField = PubspecWarningCode( 'DEPRECATED_FIELD', "The '{0}' field is no longer used and can be removed.", correctionMessage: "Try removing the field.", @@ -112,7 +111,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode FLUTTER_FIELD_NOT_MAP = PubspecWarningCode( + static const PubspecWarningCode flutterFieldNotMap = PubspecWarningCode( 'FLUTTER_FIELD_NOT_MAP', "The value of the 'flutter' field is expected to be a map.", correctionMessage: "Try converting the value to be a map.", @@ -121,7 +120,7 @@ class PubspecWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the kind of dependency. - static const PubspecWarningCode INVALID_DEPENDENCY = PubspecWarningCode( + static const PubspecWarningCode invalidDependency = PubspecWarningCode( 'INVALID_DEPENDENCY', "Publishable packages can't have '{0}' dependencies.", correctionMessage: @@ -131,7 +130,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode INVALID_PLATFORMS_FIELD = PubspecWarningCode( + static const PubspecWarningCode invalidPlatformsField = PubspecWarningCode( 'INVALID_PLATFORMS_FIELD', "The 'platforms' field must be a map with platforms as keys.", correctionMessage: @@ -143,7 +142,7 @@ class PubspecWarningCode extends DiagnosticCode { /// String p0: the list of packages missing from the dependencies and the list /// of packages missing from the dev_dependencies (if any) in the /// pubspec file. - static const PubspecWarningCode MISSING_DEPENDENCY = PubspecWarningCode( + static const PubspecWarningCode missingDependency = PubspecWarningCode( 'MISSING_DEPENDENCY', "Missing a dependency on imported package '{0}'.", correctionMessage: "Try adding {0}.", @@ -151,7 +150,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode MISSING_NAME = PubspecWarningCode( + static const PubspecWarningCode missingName = PubspecWarningCode( 'MISSING_NAME', "The 'name' field is required but missing.", correctionMessage: "Try adding a field named 'name'.", @@ -159,7 +158,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode NAME_NOT_STRING = PubspecWarningCode( + static const PubspecWarningCode nameNotString = PubspecWarningCode( 'NAME_NOT_STRING', "The value of the 'name' field is required to be a string.", correctionMessage: "Try converting the value to be a string.", @@ -168,7 +167,7 @@ class PubspecWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the path to the dependency as given in the file. - static const PubspecWarningCode PATH_DOES_NOT_EXIST = PubspecWarningCode( + static const PubspecWarningCode pathDoesNotExist = PubspecWarningCode( 'PATH_DOES_NOT_EXIST', "The path '{0}' doesn't exist.", correctionMessage: @@ -178,7 +177,7 @@ class PubspecWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the path as given in the file. - static const PubspecWarningCode PATH_NOT_POSIX = PubspecWarningCode( + static const PubspecWarningCode pathNotPosix = PubspecWarningCode( 'PATH_NOT_POSIX', "The path '{0}' isn't a POSIX-style path.", correctionMessage: "Try converting the value to a POSIX-style path.", @@ -187,8 +186,7 @@ class PubspecWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the path to the dependency as given in the file. - static const PubspecWarningCode - PATH_PUBSPEC_DOES_NOT_EXIST = PubspecWarningCode( + static const PubspecWarningCode pathPubspecDoesNotExist = PubspecWarningCode( 'PATH_PUBSPEC_DOES_NOT_EXIST', "The directory '{0}' doesn't contain a pubspec.", correctionMessage: @@ -198,17 +196,16 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode PLATFORM_VALUE_DISALLOWED = - PubspecWarningCode( - 'PLATFORM_VALUE_DISALLOWED', - "Keys in the `platforms` field can't have values.", - correctionMessage: "Try removing the value, while keeping the key.", - hasPublishedDocs: true, - ); + static const PubspecWarningCode platformValueDisallowed = PubspecWarningCode( + 'PLATFORM_VALUE_DISALLOWED', + "Keys in the `platforms` field can't have values.", + correctionMessage: "Try removing the value, while keeping the key.", + hasPublishedDocs: true, + ); /// Parameters: /// Object p0: the unknown platform. - static const PubspecWarningCode UNKNOWN_PLATFORM = PubspecWarningCode( + static const PubspecWarningCode unknownPlatform = PubspecWarningCode( 'UNKNOWN_PLATFORM', "The platform '{0}' is not a recognized platform.", correctionMessage: "Try correcting the platform name or removing it.", @@ -217,8 +214,7 @@ class PubspecWarningCode extends DiagnosticCode { /// Parameters: /// String p0: the name of the package in the dev_dependency list. - static const PubspecWarningCode - UNNECESSARY_DEV_DEPENDENCY = PubspecWarningCode( + static const PubspecWarningCode unnecessaryDevDependency = PubspecWarningCode( 'UNNECESSARY_DEV_DEPENDENCY', "The dev dependency on {0} is unnecessary because there is also a normal " "dependency on that package.", @@ -227,7 +223,7 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode WORKSPACE_FIELD_NOT_LIST = PubspecWarningCode( + static const PubspecWarningCode workspaceFieldNotList = PubspecWarningCode( 'WORKSPACE_FIELD_NOT_LIST', "The value of the 'workspace' field is required to be a list of relative " "file paths.", @@ -236,16 +232,15 @@ class PubspecWarningCode extends DiagnosticCode { ); /// No parameters. - static const PubspecWarningCode WORKSPACE_VALUE_NOT_STRING = - PubspecWarningCode( - 'WORKSPACE_VALUE_NOT_STRING', - "Workspace entries are required to be directory paths (strings).", - correctionMessage: "Try converting the value to be a string.", - ); + static const PubspecWarningCode workspaceValueNotString = PubspecWarningCode( + 'WORKSPACE_VALUE_NOT_STRING', + "Workspace entries are required to be directory paths (strings).", + correctionMessage: "Try converting the value to be a string.", + ); /// Parameters: /// String p0: the path of the directory that contains the pubspec.yaml file. - static const PubspecWarningCode WORKSPACE_VALUE_NOT_SUBDIRECTORY = + static const PubspecWarningCode workspaceValueNotSubdirectory = PubspecWarningCode( 'WORKSPACE_VALUE_NOT_SUBDIRECTORY', "Workspace values must be a relative path of a subdirectory of '{0}'.", diff --git a/pkg/analyzer/lib/src/pubspec/validators/dependency_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/dependency_validator.dart index 7609356222d..ab7ed4ec1ac 100644 --- a/pkg/analyzer/lib/src/pubspec/validators/dependency_validator.dart +++ b/pkg/analyzer/lib/src/pubspec/validators/dependency_validator.dart @@ -23,11 +23,9 @@ void dependencyValidator(PubspecValidationContext ctx) { } else if (field is YamlMap) { return field.nodes; } - ctx.reportErrorForNode( - field, - PubspecWarningCode.DEPENDENCIES_FIELD_NOT_MAP, - [key], - ); + ctx.reportErrorForNode(field, PubspecWarningCode.dependenciesFieldNotMap, [ + key, + ]); return {}; } @@ -50,7 +48,7 @@ void dependencyValidator(PubspecValidationContext ctx) { YamlNode pathValue() => dependency.valueAt(PubspecField.PATH_FIELD)!; if (pathEntry.contains(r'\')) { - ctx.reportErrorForNode(pathValue(), PubspecWarningCode.PATH_NOT_POSIX, [ + ctx.reportErrorForNode(pathValue(), PubspecWarningCode.pathNotPosix, [ pathEntry, ]); return; @@ -65,14 +63,14 @@ void dependencyValidator(PubspecValidationContext ctx) { if (!packageFolder.exists) { ctx.reportErrorForNode( pathValue(), - PubspecWarningCode.PATH_DOES_NOT_EXIST, + PubspecWarningCode.pathDoesNotExist, [pathEntry], ); } else { if (!packageFolder.getChild(file_paths.pubspecYaml).exists) { ctx.reportErrorForNode( pathValue(), - PubspecWarningCode.PATH_PUBSPEC_DOES_NOT_EXIST, + PubspecWarningCode.pathPubspecDoesNotExist, [pathEntry], ); } @@ -80,7 +78,7 @@ void dependencyValidator(PubspecValidationContext ctx) { if (checkForPathAndGitDeps) { ctx.reportErrorForNode( pathKey(), - PubspecWarningCode.INVALID_DEPENDENCY, + PubspecWarningCode.invalidDependency, [PubspecField.PATH_FIELD], ); } @@ -90,7 +88,7 @@ void dependencyValidator(PubspecValidationContext ctx) { if (gitEntry != null && checkForPathAndGitDeps) { ctx.reportErrorForNode( dependency.getKey(PubspecField.GIT_FIELD)!, - PubspecWarningCode.INVALID_DEPENDENCY, + PubspecWarningCode.invalidDependency, [PubspecField.GIT_FIELD], ); } @@ -123,7 +121,7 @@ void dependencyValidator(PubspecValidationContext ctx) { if (declaredDependencies.containsKey(packageName)) { ctx.reportErrorForNode( packageName, - PubspecWarningCode.UNNECESSARY_DEV_DEPENDENCY, + PubspecWarningCode.unnecessaryDevDependency, [packageName.valueOrThrow], ); } diff --git a/pkg/analyzer/lib/src/pubspec/validators/field_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/field_validator.dart index 7cd320de295..fd8627cc901 100644 --- a/pkg/analyzer/lib/src/pubspec/validators/field_validator.dart +++ b/pkg/analyzer/lib/src/pubspec/validators/field_validator.dart @@ -17,9 +17,7 @@ void fieldValidator(PubspecValidationContext ctx) { for (var field in contents.nodes.keys) { var name = ctx.asString(field); if (field is YamlNode && name != null && _deprecatedFields.contains(name)) { - ctx.reportErrorForNode(field, PubspecWarningCode.DEPRECATED_FIELD, [ - name, - ]); + ctx.reportErrorForNode(field, PubspecWarningCode.deprecatedField, [name]); } } } diff --git a/pkg/analyzer/lib/src/pubspec/validators/flutter_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/flutter_validator.dart index 6f6c9ef1da4..ca89c09ec74 100644 --- a/pkg/analyzer/lib/src/pubspec/validators/flutter_validator.dart +++ b/pkg/analyzer/lib/src/pubspec/validators/flutter_validator.dart @@ -22,7 +22,7 @@ void flutterValidator(PubspecValidationContext ctx) { } else { ctx.reportErrorForNode( flutterField, - PubspecWarningCode.FLUTTER_FIELD_NOT_MAP, + PubspecWarningCode.flutterFieldNotMap, ); } return; @@ -31,10 +31,7 @@ void flutterValidator(PubspecValidationContext ctx) { var assetsField = flutterField.nodes[PubspecField.ASSETS_FIELD]; if (assetsField == null) return; if (assetsField is! YamlList) { - ctx.reportErrorForNode( - assetsField, - PubspecWarningCode.ASSET_FIELD_NOT_LIST, - ); + ctx.reportErrorForNode(assetsField, PubspecWarningCode.assetFieldNotList); return; } @@ -44,7 +41,7 @@ void flutterValidator(PubspecValidationContext ctx) { if (entry is! String) { ctx.reportErrorForNode( assetField, - PubspecWarningCode.ASSET_NOT_STRING_OR_MAP, + PubspecWarningCode.assetNotStringOrMap, ); return; } @@ -53,22 +50,16 @@ void flutterValidator(PubspecValidationContext ctx) { } else if (assetField is YamlMap) { var pathField = assetField.nodes[PubspecField.ASSET_PATH_FIELD]; if (pathField == null) { - ctx.reportErrorForNode( - assetField, - PubspecWarningCode.ASSET_MISSING_PATH, - ); + ctx.reportErrorForNode(assetField, PubspecWarningCode.assetMissingPath); } else if (pathField is! YamlScalar) { ctx.reportErrorForNode( pathField, - PubspecWarningCode.ASSET_PATH_NOT_STRING, + PubspecWarningCode.assetPathNotString, ); } else { var entry = pathField.valueOrThrow; if (entry is! String) { - ctx.reportErrorForNode( - pathField, - PubspecWarningCode.ASSET_NOT_STRING, - ); + ctx.reportErrorForNode(pathField, PubspecWarningCode.assetNotString); return; } @@ -77,7 +68,7 @@ void flutterValidator(PubspecValidationContext ctx) { } else { ctx.reportErrorForNode( assetField, - PubspecWarningCode.ASSET_NOT_STRING_OR_MAP, + PubspecWarningCode.assetNotStringOrMap, ); } } @@ -136,8 +127,8 @@ void _validateAssetPath( if (!_assetExistsAtPath(ctx, assetPath)) { var errorCode = isDirectoryEntry - ? PubspecWarningCode.ASSET_DIRECTORY_DOES_NOT_EXIST - : PubspecWarningCode.ASSET_DOES_NOT_EXIST; + ? PubspecWarningCode.assetDirectoryDoesNotExist + : PubspecWarningCode.assetDoesNotExist; ctx.reportErrorForNode(errorField, errorCode, [pathValue]); } } diff --git a/pkg/analyzer/lib/src/pubspec/validators/missing_dependency_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/missing_dependency_validator.dart index 66a633777b4..babf0d2ff60 100644 --- a/pkg/analyzer/lib/src/pubspec/validators/missing_dependency_validator.dart +++ b/pkg/analyzer/lib/src/pubspec/validators/missing_dependency_validator.dart @@ -12,7 +12,7 @@ import 'package:analyzer/src/pubspec/pubspec_warning_code.dart'; import 'package:yaml/yaml.dart'; class MissingDependencyData { - /// Expando associating each [PubspecWarningCode.MISSING_DEPENDENCY] with + /// Expando associating each [PubspecWarningCode.missingDependency] with /// missing dependency information; this information is used by the analysis /// server to list of missing patterns; this data is used by the analysis /// server to compute fixes. @@ -76,11 +76,9 @@ class MissingDependencyValidator { } else if (field is YamlMap) { return field.nodes; } - _reportErrorForNode( - field, - PubspecWarningCode.DEPENDENCIES_FIELD_NOT_MAP, - [key], - ); + _reportErrorForNode(field, PubspecWarningCode.dependenciesFieldNotMap, [ + key, + ]); return {}; } @@ -135,7 +133,7 @@ class MissingDependencyValidator { if (addDeps.isNotEmpty || addDevDeps.isNotEmpty) { var diagnostic = _reportErrorForNode( contents.nodes.values.first, - PubspecWarningCode.MISSING_DEPENDENCY, + PubspecWarningCode.missingDependency, [message], [], ); diff --git a/pkg/analyzer/lib/src/pubspec/validators/name_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/name_validator.dart index 89a4c7310c4..ea8b4381251 100644 --- a/pkg/analyzer/lib/src/pubspec/validators/name_validator.dart +++ b/pkg/analyzer/lib/src/pubspec/validators/name_validator.dart @@ -13,7 +13,7 @@ void nameValidator(PubspecValidationContext ctx) { ctx.reporter.atOffset( offset: 0, length: 0, - diagnosticCode: PubspecWarningCode.MISSING_NAME, + diagnosticCode: PubspecWarningCode.missingName, ); return; } @@ -22,9 +22,9 @@ void nameValidator(PubspecValidationContext ctx) { ctx.reporter.atOffset( offset: 0, length: 0, - diagnosticCode: PubspecWarningCode.MISSING_NAME, + diagnosticCode: PubspecWarningCode.missingName, ); } else if (nameField is! YamlScalar || nameField.value is! String) { - ctx.reportErrorForNode(nameField, PubspecWarningCode.NAME_NOT_STRING); + ctx.reportErrorForNode(nameField, PubspecWarningCode.nameNotString); } } diff --git a/pkg/analyzer/lib/src/pubspec/validators/platforms_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/platforms_validator.dart index d26f0710e59..29a6b05b92e 100644 --- a/pkg/analyzer/lib/src/pubspec/validators/platforms_validator.dart +++ b/pkg/analyzer/lib/src/pubspec/validators/platforms_validator.dart @@ -27,16 +27,13 @@ void platformsValidator(PubspecValidationContext ctx) { } // The 'platforms' field must be a map if (platforms is! YamlMap) { - ctx.reportErrorForNode( - platforms, - PubspecWarningCode.INVALID_PLATFORMS_FIELD, - ); + ctx.reportErrorForNode(platforms, PubspecWarningCode.invalidPlatformsField); return; } // Each key under 'platforms' must be a supported platform. for (var platform in platforms.nodeMap.keys) { if (platform is! YamlScalar || !_knownPlatforms.contains(platform.value)) { - ctx.reportErrorForNode(platform, PubspecWarningCode.UNKNOWN_PLATFORM, [ + ctx.reportErrorForNode(platform, PubspecWarningCode.unknownPlatform, [ switch (platform.value) { (String s) => s, (num n) => n, @@ -48,7 +45,7 @@ void platformsValidator(PubspecValidationContext ctx) { // Values under the platforms keys are not allowed. for (var v in platforms.nodeMap.values) { if (v is! YamlScalar || v.value != null) { - ctx.reportErrorForNode(v, PubspecWarningCode.PLATFORM_VALUE_DISALLOWED); + ctx.reportErrorForNode(v, PubspecWarningCode.platformValueDisallowed); } } } diff --git a/pkg/analyzer/lib/src/pubspec/validators/screenshot_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/screenshot_validator.dart index c5b6f431014..be184616000 100644 --- a/pkg/analyzer/lib/src/pubspec/validators/screenshot_validator.dart +++ b/pkg/analyzer/lib/src/pubspec/validators/screenshot_validator.dart @@ -29,11 +29,9 @@ void screenshotsValidator(PubspecValidationContext ctx) { if (entryValue is! YamlScalar) continue; var path = entryValue.value; if (path is String && !fileExistsAtPath(path)) { - ctx.reportErrorForNode( - entryValue, - PubspecWarningCode.PATH_DOES_NOT_EXIST, - [entryValue.valueOrThrow], - ); + ctx.reportErrorForNode(entryValue, PubspecWarningCode.pathDoesNotExist, [ + entryValue.valueOrThrow, + ]); } } } diff --git a/pkg/analyzer/lib/src/pubspec/validators/workspace_validator.dart b/pkg/analyzer/lib/src/pubspec/validators/workspace_validator.dart index a28d4590e72..f3cd1de221d 100644 --- a/pkg/analyzer/lib/src/pubspec/validators/workspace_validator.dart +++ b/pkg/analyzer/lib/src/pubspec/validators/workspace_validator.dart @@ -17,7 +17,7 @@ void workspaceValidator(PubspecValidationContext ctx) { if (workspaceField is! YamlList) { ctx.reportErrorForNode( workspaceField, - PubspecWarningCode.WORKSPACE_FIELD_NOT_LIST, + PubspecWarningCode.workspaceFieldNotList, ); return; } @@ -28,7 +28,7 @@ void workspaceValidator(PubspecValidationContext ctx) { if (entry is! String) { ctx.reportErrorForNode( directoryField, - PubspecWarningCode.WORKSPACE_VALUE_NOT_STRING, + PubspecWarningCode.workspaceValueNotString, ); return; } @@ -36,7 +36,7 @@ void workspaceValidator(PubspecValidationContext ctx) { } else { ctx.reportErrorForNode( directoryField, - PubspecWarningCode.WORKSPACE_VALUE_NOT_STRING, + PubspecWarningCode.workspaceValueNotString, ); } } @@ -59,14 +59,14 @@ void _validateDirectoryPath( if (!packageRootFolder.contains(dirPath)) { ctx.reportErrorForNode( errorField, - PubspecWarningCode.WORKSPACE_VALUE_NOT_SUBDIRECTORY, + PubspecWarningCode.workspaceValueNotSubdirectory, [packageRoot], ); return; } var subDirectory = ctx.provider.getFolder(dirPath); if (!subDirectory.exists) { - ctx.reportErrorForNode(errorField, PubspecWarningCode.PATH_DOES_NOT_EXIST, [ + ctx.reportErrorForNode(errorField, PubspecWarningCode.pathDoesNotExist, [ pathValue, ]); } diff --git a/pkg/analyzer/test/dart/ast/ast_test.dart b/pkg/analyzer/test/dart/ast/ast_test.dart index 7a45450791d..0d0e6c1ad55 100644 --- a/pkg/analyzer/test/dart/ast/ast_test.dart +++ b/pkg/analyzer/test/dart/ast/ast_test.dart @@ -52,8 +52,8 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 20, 5), - error(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 26, 8), + error(ParserErrorCode.modifierOutOfOrder, 20, 5), + error(ParserErrorCode.modifierOutOfOrder, 26, 8), ]); var node = parseResult.findNode.constructor('A()'); diff --git a/pkg/analyzer/test/dart/element/fragment_offset_test.dart b/pkg/analyzer/test/dart/element/fragment_offset_test.dart index ddabe1632c3..e4fa0e20afa 100644 --- a/pkg/analyzer/test/dart/element/fragment_offset_test.dart +++ b/pkg/analyzer/test/dart/element/fragment_offset_test.dart @@ -90,7 +90,7 @@ class C = Object with M; mixin M {} class = Object with M; ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 17, 1)], + [error(ParserErrorCode.missingIdentifier, 17, 1)], ); var classTypeAlias = findNode.classTypeAlias('Object with M'); checkOffsetInRange( @@ -106,7 +106,7 @@ library; // Ensures that the class declaration isn't at offset 0 class {} ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 72, 1)], + [error(ParserErrorCode.missingIdentifier, 72, 1)], ); var classDeclaration = findNode.classDeclaration('class {}'); checkOffsetInRange( @@ -138,7 +138,7 @@ class C { C.(); } ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 14, 1)], + [error(ParserErrorCode.missingIdentifier, 14, 1)], ); var constructorDeclaration = findNode.constructor('C.()'); checkOffsetInRange( @@ -206,7 +206,7 @@ library; // Ensures that the enum declaration isn't at offset 0 enum { e1 } ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 70, 1)], + [error(ParserErrorCode.missingIdentifier, 70, 1)], ); var enumDeclaration = findNode.enumDeclaration('enum { e1 }'); checkOffsetInRange( @@ -261,7 +261,7 @@ library; // Ensures that the extension type declaration isn't at offset 0 extension type(int i) {} ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 89, 1)], + [error(ParserErrorCode.missingIdentifier, 89, 1)], ); var extensionTypeDeclaration = findNode.extensionTypeDeclaration( 'extension type(int i)', @@ -297,11 +297,11 @@ class C { ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 24, 5, ), - error(ParserErrorCode.MISSING_IDENTIFIER, 29, 1), + error(ParserErrorCode.missingIdentifier, 29, 1), ], ); var parameter = findNode.fieldFormalParameter('this.'); @@ -410,7 +410,7 @@ void f(int x) {} r''' void f((int x)) {} ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 7, 1)], + [error(ParserErrorCode.missingIdentifier, 7, 1)], ); var function = findNode.functionDeclaration('f('); var parameter = @@ -428,7 +428,7 @@ void f((int x)) {} r''' void f(void (int x)) {} ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 12, 1)], + [error(ParserErrorCode.missingIdentifier, 12, 1)], ); var function = findNode.functionDeclaration('f('); var parameter = @@ -764,7 +764,7 @@ library; // Ensures that the mixin declaration isn't at offset 0 mixin {} ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 72, 1)], + [error(ParserErrorCode.missingIdentifier, 72, 1)], ); var mixinDeclaration = findNode.mixinDeclaration('mixin {}'); checkOffsetInRange( @@ -819,7 +819,7 @@ import 'dart:math' as a; // second // ignore: unused_import import 'dart:async' as; ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 47, 1)], + [error(ParserErrorCode.missingIdentifier, 47, 1)], ); var importDirective = findNode.import('as;'); checkOffsetInRange( @@ -916,7 +916,7 @@ class C extends B { C(super.); } ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 58, 1)], + [error(ParserErrorCode.missingIdentifier, 58, 1)], ); var parameter = findNode.superFormalParameter('super.'); checkOffsetInRange( @@ -1001,8 +1001,8 @@ library; // Ensures that the function type alias declaration isn't at offset 0 typedef void(); ''', [ - error(WarningCode.UNUSED_ELEMENT, 0, 0), - error(ParserErrorCode.MISSING_IDENTIFIER, 92, 1), + error(WarningCode.unusedElement, 0, 0), + error(ParserErrorCode.missingIdentifier, 92, 1), ], ); var functionTypeAlias = findNode.functionTypeAlias('void()'); @@ -1032,8 +1032,8 @@ library; // Ensures that the generic type alias declaration isn't at offset 0 typedef = int; ''', [ - error(WarningCode.UNUSED_ELEMENT, 0, 0), - error(ParserErrorCode.MISSING_IDENTIFIER, 87, 1), + error(WarningCode.unusedElement, 0, 0), + error(ParserErrorCode.missingIdentifier, 87, 1), ], ); var genericTypeAlias = findNode.genericTypeAlias('= int'); diff --git a/pkg/analyzer/test/error/error_reporter_test.dart b/pkg/analyzer/test/error/error_reporter_test.dart index 0bb2d29d072..5ad5a424352 100644 --- a/pkg/analyzer/test/error/error_reporter_test.dart +++ b/pkg/analyzer/test/error/error_reporter_test.dart @@ -32,7 +32,7 @@ class ErrorReporterTest extends PubPackageResolutionTest { ); reporter.atElement2( element, - CompileTimeErrorCode.CAST_TO_NON_TYPE, + CompileTimeErrorCode.castToNonType, arguments: ['A'], ); @@ -53,7 +53,7 @@ extension on int {} ); reporter.atElement2( element, - CompileTimeErrorCode.CAST_TO_NON_TYPE, + CompileTimeErrorCode.castToNonType, arguments: ['A'], ); @@ -95,7 +95,7 @@ main() { reporter.atNode( findNode.simple('x'), - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, arguments: [firstType, secondType, ''], ); @@ -136,7 +136,7 @@ main() { ); reporter.atNode( findNode.simple('x'), - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, arguments: [firstType, secondType, ''], ); @@ -165,7 +165,7 @@ main() { var reporter = DiagnosticReporter(listener, source); reporter.atNode( findNode.simple('x'), - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, arguments: [fa.variables.type!.type!, fb.variables.type!.type!, ''], ); @@ -196,7 +196,7 @@ main() { var reporter = DiagnosticReporter(listener, source); reporter.atNode( findNode.simple('x'), - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, arguments: [ba.variables.type!.type!, bb.variables.type!.type!, ''], ); @@ -225,7 +225,7 @@ zap: baz reporter.atSourceSpan( span, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE, + AnalysisOptionsWarningCode.unsupportedOptionWithLegalValue, arguments: ['test', 'zip', 'zap'], ); expect(listener.diagnostics, hasLength(1)); diff --git a/pkg/analyzer/test/generated/class_member_parser_test.dart b/pkg/analyzer/test/generated/class_member_parser_test.dart index 8dbf62ae60d..09cc91955f2 100644 --- a/pkg/analyzer/test/generated/class_member_parser_test.dart +++ b/pkg/analyzer/test/generated/class_member_parser_test.dart @@ -144,8 +144,8 @@ class ClassMemberParserTest extends FastaParserTestCase var method = parser.parseClassMember('C') as MethodDeclaration; expect(method, isNotNull); listener.assertErrors([ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 13, 5), - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 23, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 13, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 23, 5), ]); FunctionBody body = method.body; expect(body, isBlockFunctionBody); @@ -162,7 +162,7 @@ class ClassMemberParserTest extends FastaParserTestCase var method = parser.parseClassMember('C') as MethodDeclaration; expect(method, isNotNull); listener.assertErrors([ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 6, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 6, 5), ]); FunctionBody body = method.body; expect(body, isBlockFunctionBody); @@ -180,8 +180,8 @@ class ClassMemberParserTest extends FastaParserTestCase var method = parser.parseClassMember('C') as MethodDeclaration; expect(method, isNotNull); listener.assertErrors([ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 16, 5), - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 58, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 16, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 58, 5), ]); FunctionBody body = method.body; expect(body, isBlockFunctionBody); @@ -204,7 +204,7 @@ class ClassMemberParserTest extends FastaParserTestCase var method = parser.parseClassMember('C') as MethodDeclaration; expect(method, isNotNull); listener.assertErrors([ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 12, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 12, 5), ]); FunctionBody body = method.body; expect(body, isBlockFunctionBody); @@ -223,9 +223,9 @@ class ClassMemberParserTest extends FastaParserTestCase var method = parser.parseClassMember('C') as MethodDeclaration; expect(method, isNotNull); listener.assertErrors([ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 16, 5), - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 39, 5), - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 62, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 16, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 39, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 62, 5), ]); FunctionBody body = method.body; expect(body, isBlockFunctionBody); @@ -246,8 +246,8 @@ class ClassMemberParserTest extends FastaParserTestCase var method = parser.parseClassMember('C') as MethodDeclaration; expect(method, isNotNull); listener.assertErrors([ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 12, 5), - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 36, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 12, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 36, 5), ]); FunctionBody body = method.body; expect(body, isBlockFunctionBody); @@ -267,8 +267,8 @@ class ClassMemberParserTest extends FastaParserTestCase var method = parser.parseClassMember('C') as MethodDeclaration; expect(method, isNotNull); listener.assertErrors([ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 18, 5), - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 42, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 18, 5), + expectedError(CompileTimeErrorCode.awaitInWrongContext, 42, 5), ]); FunctionBody body = method.body; expect(body, isBlockFunctionBody); @@ -608,7 +608,7 @@ Function(int, String) v; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 4, 3), + expectedError(ParserErrorCode.expectedIdentifierButGotKeyword, 4, 3), ]); } @@ -617,7 +617,7 @@ Function(int, String) v; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 1), + expectedError(ParserErrorCode.missingIdentifier, 4, 1), ]); } @@ -626,7 +626,7 @@ Function(int, String) v; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 2), + expectedError(ParserErrorCode.missingIdentifier, 4, 2), ]); } @@ -661,7 +661,7 @@ Function(int, String) v; assertErrors( errors: [ expectedError( - ParserErrorCode.FINAL_AND_COVARIANT_LATE_WITH_INITIALIZER, + ParserErrorCode.finalAndCovariantLateWithInitializer, 0, 9, ), @@ -927,7 +927,7 @@ Function(int, String) v; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 15, 1), + expectedError(ParserErrorCode.memberWithClassName, 15, 1), ]); expect(member, isMethodDeclaration); var method = member as MethodDeclaration; @@ -1017,7 +1017,7 @@ void Function(core.List x) m() => null; allowNativeClause = false; _parseClassMember_method_native_missing_literal(); listener.assertErrors([ - expectedError(ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, 4, 6), + expectedError(ParserErrorCode.nativeClauseShouldBeAnnotation, 4, 6), ]); } @@ -1025,7 +1025,7 @@ void Function(core.List x) m() => null; allowNativeClause = false; _parseClassMember_method_native(); listener.assertErrors([ - expectedError(ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, 4, 6), + expectedError(ParserErrorCode.nativeClauseShouldBeAnnotation, 4, 6), ]); } @@ -1033,7 +1033,7 @@ void Function(core.List x) m() => null; allowNativeClause = true; _parseClassMember_method_native_with_body(); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - assertErrorsWithCodes([ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); + assertErrorsWithCodes([ParserErrorCode.externalMethodWithBody]); // listener.assertErrors([ // expectedError(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, 17, 2), // ]); @@ -1044,8 +1044,8 @@ void Function(core.List x) m() => null; _parseClassMember_method_native_with_body(); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. assertErrorsWithCodes([ - ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, - ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, + ParserErrorCode.nativeClauseShouldBeAnnotation, + ParserErrorCode.externalMethodWithBody, ]); // listener.assertErrors([ // expectedError(ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, 4, 6), @@ -1173,7 +1173,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 16, 1), + expectedError(ParserErrorCode.memberWithClassName, 16, 1), ]); expect(member, isMethodDeclaration); var method = member as MethodDeclaration; @@ -1549,7 +1549,7 @@ void Function(core.List x) m() => null; // https://github.com/dart-lang/sdk/issues/37693 parseCompilationUnit( 'class C{ C() : super() * (); }', - errors: [expectedError(ParserErrorCode.INVALID_INITIALIZER, 15, 12)], + errors: [expectedError(ParserErrorCode.invalidInitializer, 15, 12)], ); } @@ -1577,15 +1577,15 @@ void Function(core.List x) m() => null; var unit = parseCompilationUnit( 'class{const():super.{n', errors: [ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 5, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 11, 1), - expectedError(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 11, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 20, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 20, 1), - expectedError(ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, 20, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 21, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 22, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 22, 1), + expectedError(ParserErrorCode.missingIdentifier, 5, 1), + expectedError(ParserErrorCode.missingIdentifier, 11, 1), + expectedError(ParserErrorCode.invalidConstructorName, 11, 1), + expectedError(ParserErrorCode.missingIdentifier, 20, 1), + expectedError(ParserErrorCode.expectedToken, 20, 1), + expectedError(ParserErrorCode.constConstructorWithBody, 20, 1), + expectedError(ParserErrorCode.expectedToken, 21, 1), + expectedError(ScannerErrorCode.expectedToken, 22, 1), + expectedError(ScannerErrorCode.expectedToken, 22, 1), ], ); var classDeclaration = unit.declarations[0] as ClassDeclaration; @@ -1597,7 +1597,7 @@ void Function(core.List x) m() => null; void test_parseConstructor_operator_name() { var unit = parseCompilationUnit( 'class A { operator/() : super(); }', - errors: [expectedError(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 10, 8)], + errors: [expectedError(ParserErrorCode.invalidConstructorName, 10, 8)], ); var classDeclaration = unit.declarations[0] as ClassDeclaration; var constructor = classDeclaration.members[0] as ConstructorDeclaration; @@ -1609,8 +1609,8 @@ void Function(core.List x) m() => null; createParser('C() : super()[];'); var constructor = parser.parseClassMember('C') as ConstructorDeclaration; listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 6, 5), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 14, 1), + expectedError(ParserErrorCode.invalidSuperInInitializer, 6, 5), + expectedError(ParserErrorCode.missingIdentifier, 14, 1), ]); expect(constructor, isNotNull); expect(constructor.externalKeyword, isNull); @@ -1632,8 +1632,8 @@ void Function(core.List x) m() => null; createParser('C() : this()[];'); var constructor = parser.parseClassMember('C') as ConstructorDeclaration; listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_THIS_IN_INITIALIZER, 6, 4), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 13, 1), + expectedError(ParserErrorCode.invalidThisInInitializer, 6, 4), + expectedError(ParserErrorCode.missingIdentifier, 13, 1), ]); expect(constructor, isNotNull); expect(constructor.externalKeyword, isNull); @@ -1731,7 +1731,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.ABSTRACT_EXTERNAL_FIELD, 0, 8)], + errors: [expectedError(ParserErrorCode.abstractExternalField, 0, 8)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -1744,7 +1744,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.ABSTRACT_LATE_FIELD, 0, 8)], + errors: [expectedError(ParserErrorCode.abstractLateField, 0, 8)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -1756,7 +1756,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.ABSTRACT_LATE_FIELD, 0, 8)], + errors: [expectedError(ParserErrorCode.abstractLateField, 0, 8)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -1768,7 +1768,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.ABSTRACT_STATIC_FIELD, 0, 8)], + errors: [expectedError(ParserErrorCode.abstractStaticField, 0, 8)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -1780,7 +1780,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.CONFLICTING_MODIFIERS, 6, 4)], + errors: [expectedError(ParserErrorCode.conflictingModifiers, 6, 4)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -1816,7 +1816,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.ABSTRACT_EXTERNAL_FIELD, 9, 8)], + errors: [expectedError(ParserErrorCode.abstractExternalField, 9, 8)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -1829,7 +1829,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.EXTERNAL_LATE_FIELD, 0, 8)], + errors: [expectedError(ParserErrorCode.externalLateField, 0, 8)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -1841,7 +1841,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.EXTERNAL_LATE_FIELD, 0, 8)], + errors: [expectedError(ParserErrorCode.externalLateField, 0, 8)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -1862,7 +1862,7 @@ void Function(core.List x) m() => null; createParser('final late T f;'); ClassMember member = parser.parseClassMember('C'); assertErrors( - errors: [expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 6, 4)], + errors: [expectedError(ParserErrorCode.modifierOutOfOrder, 6, 4)], ); expect(member, isNotNull); expect(member, isFieldDeclaration); @@ -1913,7 +1913,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.CONFLICTING_MODIFIERS, 5, 5)], + errors: [expectedError(ParserErrorCode.conflictingModifiers, 5, 5)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -2006,7 +2006,7 @@ void Function(core.List x) m() => null; ClassMember member = parser.parseClassMember('C'); expect(member, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 4, 4)], + errors: [expectedError(ParserErrorCode.modifierOutOfOrder, 4, 4)], ); expect(member, isFieldDeclaration); var field = member as FieldDeclaration; @@ -2032,11 +2032,11 @@ void Function(core.List x) m() => null; var constructor = parser.parseClassMember('C') as ConstructorDeclaration; expect(constructor, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.GETTER_CONSTRUCTOR, 0, 3), - expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 4, 1), - expectedError(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 4, 1), - expectedError(ParserErrorCode.MISSING_INITIALIZER, 5, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 6, 0), + expectedError(ParserErrorCode.getterConstructor, 0, 3), + expectedError(ParserErrorCode.missingMethodParameters, 4, 1), + expectedError(ParserErrorCode.invalidConstructorName, 4, 1), + expectedError(ParserErrorCode.missingInitializer, 5, 1), + expectedError(ParserErrorCode.missingFunctionBody, 6, 0), ]); expect(constructor.body, isNotNull); expect(constructor.documentationComment, isNull); diff --git a/pkg/analyzer/test/generated/complex_parser_test.dart b/pkg/analyzer/test/generated/complex_parser_test.dart index 2dddf0ef071..8e48502ff9d 100644 --- a/pkg/analyzer/test/generated/complex_parser_test.dart +++ b/pkg/analyzer/test/generated/complex_parser_test.dart @@ -125,11 +125,7 @@ class ComplexParserTest extends FastaParserTestCase { parseExpression( 'x xor y', errors: [ - expectedError( - ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, - 2, - 3, - ), + expectedError(ParserErrorCode.binaryOperatorWrittenOut, 2, 3), ], ) as BinaryExpression; @@ -145,11 +141,7 @@ class ComplexParserTest extends FastaParserTestCase { parseExpression( 'x > 0 and y > 1', errors: [ - expectedError( - ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, - 6, - 3, - ), + expectedError(ParserErrorCode.binaryOperatorWrittenOut, 6, 3), ], ) as BinaryExpression; @@ -428,7 +420,7 @@ class C { var expression = parseExpression( "x == y != z", - codes: [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND], + codes: [ParserErrorCode.equalityCannotBeEqualityOperand], ) as BinaryExpression; expect(expression.leftOperand, isBinaryExpression); @@ -448,7 +440,7 @@ class C { var expression = parseExpression( "super == y != z", - codes: [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND], + codes: [ParserErrorCode.equalityCannotBeEqualityOperand], ) as BinaryExpression; expect(expression.leftOperand, isBinaryExpression); diff --git a/pkg/analyzer/test/generated/error_parser_test.dart b/pkg/analyzer/test/generated/error_parser_test.dart index 02f3421a099..24acd650569 100644 --- a/pkg/analyzer/test/generated/error_parser_test.dart +++ b/pkg/analyzer/test/generated/error_parser_test.dart @@ -29,7 +29,7 @@ class ErrorParserTest extends FastaParserTestCase { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.ABSTRACT_CLASS_MEMBER, 0, 8), + expectedError(ParserErrorCode.abstractClassMember, 0, 8), ]); } @@ -45,7 +45,7 @@ class ErrorParserTest extends FastaParserTestCase { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.ABSTRACT_CLASS_MEMBER, 0, 8), + expectedError(ParserErrorCode.abstractClassMember, 0, 8), ]); } @@ -54,7 +54,7 @@ class ErrorParserTest extends FastaParserTestCase { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.ABSTRACT_CLASS_MEMBER, 0, 8), + expectedError(ParserErrorCode.abstractClassMember, 0, 8), ]); } @@ -63,49 +63,49 @@ class ErrorParserTest extends FastaParserTestCase { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.ABSTRACT_CLASS_MEMBER, 0, 8), + expectedError(ParserErrorCode.abstractClassMember, 0, 8), ]); } void test_abstractEnum() { parseCompilationUnit( "abstract enum E {ONE}", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 8)], ); } void test_abstractTopLevelFunction_function() { parseCompilationUnit( "abstract f(v) {}", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 8)], ); } void test_abstractTopLevelFunction_getter() { parseCompilationUnit( "abstract get m {}", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 8)], ); } void test_abstractTopLevelFunction_setter() { parseCompilationUnit( "abstract set m(v) {}", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 8)], ); } void test_abstractTopLevelVariable() { parseCompilationUnit( "abstract C f;", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 8)], ); } void test_abstractTypeDef() { parseCompilationUnit( "abstract typedef F();", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 8)], ); } @@ -116,9 +116,7 @@ main() { // missing async await foo.bar(); } ''', - errors: [ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 28, 5), - ], + errors: [expectedError(CompileTimeErrorCode.awaitInWrongContext, 28, 5)], ); } @@ -129,9 +127,7 @@ main() { // missing async (await foo); } ''', - errors: [ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 29, 5), - ], + errors: [expectedError(CompileTimeErrorCode.awaitInWrongContext, 29, 5)], ); } @@ -142,9 +138,7 @@ main() { // missing async [await foo]; } ''', - errors: [ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 29, 5), - ], + errors: [expectedError(CompileTimeErrorCode.awaitInWrongContext, 29, 5)], ); } @@ -155,9 +149,7 @@ main() { // missing async await foo(); } ''', - errors: [ - expectedError(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 28, 5), - ], + errors: [expectedError(CompileTimeErrorCode.awaitInWrongContext, 28, 5)], ); } @@ -177,7 +169,7 @@ main() { // missing async var statement = parseStatement('if (x) {break;}') as IfStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, 8, 5), + expectedError(ParserErrorCode.breakOutsideOfLoop, 8, 5), ]); } @@ -197,7 +189,7 @@ main() { // missing async void test_breakOutsideOfLoop_functionExpression_inALoop() { parseStatement("for(; x;) {() {break;};}"); listener.assertErrors([ - expectedError(ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, 15, 5), + expectedError(ParserErrorCode.breakOutsideOfLoop, 15, 5), ]); } @@ -209,8 +201,8 @@ main() { // missing async parseCompilationUnit( "class C { abstract class B {} }", errors: [ - expectedError(ParserErrorCode.ABSTRACT_CLASS_MEMBER, 10, 8), - expectedError(ParserErrorCode.CLASS_IN_CLASS, 19, 5), + expectedError(ParserErrorCode.abstractClassMember, 10, 8), + expectedError(ParserErrorCode.classInClass, 19, 5), ], ); } @@ -218,7 +210,7 @@ main() { // missing async void test_classInClass_nonAbstract() { parseCompilationUnit( "class C { class B {} }", - errors: [expectedError(ParserErrorCode.CLASS_IN_CLASS, 10, 5)], + errors: [expectedError(ParserErrorCode.classInClass, 10, 5)], ); } @@ -229,16 +221,16 @@ main() { // missing async CompilationUnitMember member = parseFullCompilationUnitMember(); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, 10, 8), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 19, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 19, 1), + expectedError(CompileTimeErrorCode.builtInIdentifierAsType, 10, 8), + expectedError(ParserErrorCode.expectedToken, 19, 1), + expectedError(ParserErrorCode.expectedToken, 19, 1), ]); } void test_colonInPlaceOfIn() { parseStatement("for (var x : list) {}"); listener.assertErrors([ - expectedError(ParserErrorCode.COLON_IN_PLACE_OF_IN, 11, 1), + expectedError(ParserErrorCode.colonInPlaceOfIn, 11, 1), ]); } @@ -247,7 +239,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.CONFLICTING_MODIFIERS, 10, 5), + expectedError(ParserErrorCode.conflictingModifiers, 10, 5), ]); } @@ -255,9 +247,7 @@ main() { // missing async createParser('const final int x = null;'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([ - expectedError(ParserErrorCode.CONST_AND_FINAL, 6, 5), - ]); + listener.assertErrors([expectedError(ParserErrorCode.constAndFinal, 6, 5)]); } void test_constAndVar() { @@ -265,14 +255,14 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.CONFLICTING_MODIFIERS, 6, 3), + expectedError(ParserErrorCode.conflictingModifiers, 6, 3), ]); } void test_constClass() { parseCompilationUnit( "const class C {}", - errors: [expectedError(ParserErrorCode.CONST_CLASS, 0, 5)], + errors: [expectedError(ParserErrorCode.constClass, 0, 5)], ); } @@ -281,7 +271,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, 10, 1), + expectedError(ParserErrorCode.constConstructorWithBody, 10, 1), ]); } @@ -291,8 +281,8 @@ main() { // missing async errors: [ // Fasta interprets the `const` as a malformed top level const // and `enum` as the start of an enum declaration. - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 5), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 4), + expectedError(ParserErrorCode.expectedToken, 0, 5), + expectedError(ParserErrorCode.missingIdentifier, 6, 4), ], ); } @@ -301,28 +291,28 @@ main() { // missing async createParser('const factory C() {}'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([expectedError(ParserErrorCode.CONST_FACTORY, 0, 5)]); + listener.assertErrors([expectedError(ParserErrorCode.constFactory, 0, 5)]); } void test_constMethod() { createParser('const int m() {}'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([expectedError(ParserErrorCode.CONST_METHOD, 0, 5)]); + listener.assertErrors([expectedError(ParserErrorCode.constMethod, 0, 5)]); } void test_constMethod_noReturnType() { createParser('const m() {}'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([expectedError(ParserErrorCode.CONST_METHOD, 0, 5)]); + listener.assertErrors([expectedError(ParserErrorCode.constMethod, 0, 5)]); } void test_constMethod_noReturnType2() { createParser('const m();'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([expectedError(ParserErrorCode.CONST_METHOD, 0, 5)]); + listener.assertErrors([expectedError(ParserErrorCode.constMethod, 0, 5)]); } void test_constructor_super_cascade_synthetic() { @@ -330,9 +320,9 @@ main() { // missing async parseCompilationUnit( 'class B extends A { B(): super.. {} }', errors: [ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 25, 5), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 30, 2), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 33, 1), + expectedError(ParserErrorCode.invalidSuperInInitializer, 25, 5), + expectedError(ParserErrorCode.expectedToken, 30, 2), + expectedError(ParserErrorCode.missingIdentifier, 33, 1), ], ); } @@ -342,9 +332,7 @@ main() { // missing async // https://github.com/dart-lang/sdk/issues/31198 parseCompilationUnit( 'class B extends A { B(): super().foo {} }', - errors: [ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 25, 5), - ], + errors: [expectedError(ParserErrorCode.invalidSuperInInitializer, 25, 5)], ); } @@ -353,9 +341,7 @@ main() { // missing async // https://github.com/dart-lang/sdk/issues/31198 parseCompilationUnit( 'class B extends A { B(): super().foo() {} }', - errors: [ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 25, 5), - ], + errors: [expectedError(ParserErrorCode.invalidSuperInInitializer, 25, 5)], ); } @@ -363,9 +349,7 @@ main() { // missing async // https://github.com/dart-lang/sdk/issues/37600 parseCompilationUnit( 'class B extends A { B(): super.c().create() {} }', - errors: [ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 25, 5), - ], + errors: [expectedError(ParserErrorCode.invalidSuperInInitializer, 25, 5)], ); } @@ -373,9 +357,7 @@ main() { // missing async // https://github.com/dart-lang/sdk/issues/37600 parseCompilationUnit( 'class B extends A { B(): super.c().create().x() {} }', - errors: [ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 25, 5), - ], + errors: [expectedError(ParserErrorCode.invalidSuperInInitializer, 25, 5)], ); } @@ -384,9 +366,9 @@ main() { // missing async parseCompilationUnit( 'class B extends A { B(): this.. {} }', errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 25, 4), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 29, 2), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 32, 1), + expectedError(ParserErrorCode.missingAssignmentInInitializer, 25, 4), + expectedError(ParserErrorCode.expectedToken, 29, 2), + expectedError(ParserErrorCode.missingIdentifier, 32, 1), ], ); } @@ -396,9 +378,7 @@ main() { // missing async // https://github.com/dart-lang/sdk/issues/31198 parseCompilationUnit( 'class B extends A { B(): this().foo; }', - errors: [ - expectedError(ParserErrorCode.INVALID_THIS_IN_INITIALIZER, 25, 4), - ], + errors: [expectedError(ParserErrorCode.invalidThisInInitializer, 25, 4)], ); } @@ -407,9 +387,7 @@ main() { // missing async // https://github.com/dart-lang/sdk/issues/31198 parseCompilationUnit( 'class B extends A { B(): this().foo(); }', - errors: [ - expectedError(ParserErrorCode.INVALID_THIS_IN_INITIALIZER, 25, 4), - ], + errors: [expectedError(ParserErrorCode.invalidThisInInitializer, 25, 4)], ); } @@ -417,9 +395,7 @@ main() { // missing async // https://github.com/dart-lang/sdk/issues/37600 parseCompilationUnit( 'class B extends A { B(): super.c().create() {} }', - errors: [ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 25, 5), - ], + errors: [expectedError(ParserErrorCode.invalidSuperInInitializer, 25, 5)], ); } @@ -427,9 +403,7 @@ main() { // missing async // https://github.com/dart-lang/sdk/issues/37600 parseCompilationUnit( 'class B extends A { B(): super.c().create().x {} }', - errors: [ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 25, 5), - ], + errors: [expectedError(ParserErrorCode.invalidSuperInInitializer, 25, 5)], ); } @@ -437,9 +411,9 @@ main() { // missing async createParser('class C { C< }'); parser.parseCompilationUnit2(); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 11, 1), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 13, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 13, 1), + expectedError(ParserErrorCode.expectedToken, 11, 1), + expectedError(ParserErrorCode.expectedTypeName, 13, 1), + expectedError(ParserErrorCode.missingIdentifier, 13, 1), ]); } @@ -447,10 +421,10 @@ main() { // missing async createParser('class C { C<@Foo }'); parser.parseCompilationUnit2(); listener.assertErrors([ - expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 12, 4), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 13, 3), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 17, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 17, 1), + expectedError(ParserErrorCode.annotationOnTypeArgument, 12, 4), + expectedError(ParserErrorCode.expectedToken, 13, 3), + expectedError(ParserErrorCode.expectedTypeName, 17, 1), + expectedError(ParserErrorCode.missingIdentifier, 17, 1), ]); } @@ -458,11 +432,11 @@ main() { // missing async createParser('class C { C<@Foo @Bar() }'); parser.parseCompilationUnit2(); listener.assertErrors([ - expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 12, 4), - expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 17, 6), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 22, 1), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 24, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 24, 1), + expectedError(ParserErrorCode.annotationOnTypeArgument, 12, 4), + expectedError(ParserErrorCode.annotationOnTypeArgument, 17, 6), + expectedError(ParserErrorCode.expectedToken, 22, 1), + expectedError(ParserErrorCode.expectedTypeName, 24, 1), + expectedError(ParserErrorCode.missingIdentifier, 24, 1), ]); } @@ -471,7 +445,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, 0, 1), + expectedError(ParserErrorCode.constructorWithReturnType, 0, 1), ]); } @@ -479,9 +453,7 @@ main() { // missing async createParser('var C() {}'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([ - expectedError(ParserErrorCode.VAR_RETURN_TYPE, 0, 3), - ]); + listener.assertErrors([expectedError(ParserErrorCode.varReturnType, 0, 3)]); } void test_constTypedef() { @@ -490,8 +462,8 @@ main() { // missing async errors: [ // Fasta interprets the `const` as a malformed top level const // and `typedef` as the start of an typedef declaration. - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 5), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 7), + expectedError(ParserErrorCode.expectedToken, 0, 5), + expectedError(ParserErrorCode.missingIdentifier, 6, 7), ], ); } @@ -512,7 +484,7 @@ main() { // missing async var statement = parseStatement('if (x) {continue;}') as IfStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, 8, 8), + expectedError(ParserErrorCode.continueOutsideOfLoop, 8, 8), ]); } @@ -532,7 +504,7 @@ main() { // missing async void test_continueOutsideOfLoop_functionExpression_inALoop() { parseStatement("for(; x;) {() {continue;};}"); listener.assertErrors([ - expectedError(ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, 15, 8), + expectedError(ParserErrorCode.continueOutsideOfLoop, 15, 8), ]); } @@ -545,7 +517,7 @@ main() { // missing async parseStatement('switch (x) {case 1: continue;}') as SwitchStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, 20, 8), + expectedError(ParserErrorCode.continueWithoutLabelInCase, 20, 8), ]); } @@ -569,7 +541,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 4, 9), + expectedError(ParserErrorCode.modifierOutOfOrder, 4, 9), ]); } @@ -577,7 +549,7 @@ main() { // missing async createParser('covariant final f = null;'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrorsWithCodes([ParserErrorCode.FINAL_AND_COVARIANT]); + listener.assertErrorsWithCodes([ParserErrorCode.finalAndCovariant]); } void test_covariantAndStatic() { @@ -585,7 +557,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.COVARIANT_AND_STATIC, 10, 6), + expectedError(ParserErrorCode.covariantAndStatic, 10, 6), ]); } @@ -594,7 +566,7 @@ main() { // missing async // this would be a better error message. parseStatement("covariant int x;"); listener.assertErrors([ - expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 9), + expectedError(ParserErrorCode.extraneousModifier, 0, 9), ]); } @@ -603,7 +575,7 @@ main() { // missing async var member = parseFullCompilationUnitMember() as ClassDeclaration; expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.COVARIANT_MEMBER, 10, 9), + expectedError(ParserErrorCode.covariantMember, 10, 9), ]); } @@ -612,7 +584,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.COVARIANT_AND_STATIC, 7, 9), + expectedError(ParserErrorCode.covariantAndStatic, 7, 9), ]); } @@ -621,7 +593,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.COVARIANT_AND_STATIC, 7, 9), + expectedError(ParserErrorCode.covariantAndStatic, 7, 9), ]); } @@ -630,7 +602,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.COVARIANT_MEMBER, 0, 9), + expectedError(ParserErrorCode.covariantMember, 0, 9), ]); } @@ -639,7 +611,7 @@ main() { // missing async var member = parseFullCompilationUnitMember() as ClassDeclaration; expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 9), + expectedError(ParserErrorCode.extraneousModifier, 0, 9), ]); } @@ -648,14 +620,14 @@ main() { // missing async var member = parseFullCompilationUnitMember() as EnumDeclaration; expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 9), + expectedError(ParserErrorCode.extraneousModifier, 0, 9), ]); } void test_covariantTopLevelDeclaration_typedef() { parseCompilationUnit( "covariant typedef F();", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 9)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 9)], ); } @@ -665,7 +637,7 @@ main() { // missing async parser.parseFormalParameterList(inFunctionType: true).parameters[0]; expectNotNullIfNoErrors(parameter); listener.assertErrors([ - expectedError(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 8, 1), + expectedError(ParserErrorCode.defaultValueInFunctionType, 8, 1), ]); } @@ -675,7 +647,7 @@ main() { // missing async parser.parseFormalParameterList(inFunctionType: true).parameters[0]; expectNotNullIfNoErrors(parameter); listener.assertErrors([ - expectedError(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 8, 1), + expectedError(ParserErrorCode.defaultValueInFunctionType, 8, 1), ]); } @@ -685,7 +657,7 @@ main() { // missing async parser.parseFormalParameterList(inFunctionType: true).parameters[0]; expectNotNullIfNoErrors(parameter); listener.assertErrors([ - expectedError(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 8, 1), + expectedError(ParserErrorCode.defaultValueInFunctionType, 8, 1), ]); } @@ -693,10 +665,8 @@ main() { // missing async // TODO(brianwilkerson): Remove codes when highlighting is fixed. CompilationUnit unit = parseCompilationUnit( "class Foo{} library l;", - codes: [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST], - errors: [ - expectedError(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, 12, 10), - ], + codes: [ParserErrorCode.libraryDirectiveNotFirst], + errors: [expectedError(ParserErrorCode.libraryDirectiveNotFirst, 12, 10)], ); expect(unit, isNotNull); } @@ -705,9 +675,9 @@ main() { // missing async // TODO(brianwilkerson): Remove codes when highlighting is fixed. CompilationUnit unit = parseCompilationUnit( "library l;\nclass Foo{}\npart 'a.dart';", - codes: [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], + codes: [ParserErrorCode.directiveAfterDeclaration], errors: [ - expectedError(ParserErrorCode.DIRECTIVE_AFTER_DECLARATION, 23, 14), + expectedError(ParserErrorCode.directiveAfterDeclaration, 23, 14), ], ); expect(unit, isNotNull); @@ -718,7 +688,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.DUPLICATED_MODIFIER, 6, 5), + expectedError(ParserErrorCode.duplicatedModifier, 6, 5), ]); } @@ -727,7 +697,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.DUPLICATED_MODIFIER, 9, 8), + expectedError(ParserErrorCode.duplicatedModifier, 9, 8), ]); } @@ -736,7 +706,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.DUPLICATED_MODIFIER, 8, 7), + expectedError(ParserErrorCode.duplicatedModifier, 8, 7), ]); } @@ -745,7 +715,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.DUPLICATED_MODIFIER, 6, 5), + expectedError(ParserErrorCode.duplicatedModifier, 6, 5), ]); } @@ -754,7 +724,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.DUPLICATED_MODIFIER, 7, 6), + expectedError(ParserErrorCode.duplicatedModifier, 7, 6), ]); } @@ -763,7 +733,7 @@ main() { // missing async ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.DUPLICATED_MODIFIER, 4, 3), + expectedError(ParserErrorCode.duplicatedModifier, 4, 3), ]); } @@ -773,7 +743,7 @@ main() { // missing async as SwitchStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT, 31, 2), + expectedError(ParserErrorCode.duplicateLabelInSwitchStatement, 31, 2), ]); } @@ -796,7 +766,7 @@ class Foo { } } ''', - errors: [expectedError(ParserErrorCode.ENUM_IN_CLASS, 14, 4)], + errors: [expectedError(ParserErrorCode.enumInClass, 14, 4)], ); } @@ -804,11 +774,7 @@ class Foo { parseExpression( "1 == 2 == 3", errors: [ - expectedError( - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, - 7, - 2, - ), + expectedError(ParserErrorCode.equalityCannotBeEqualityOperand, 7, 2), ], ); } @@ -817,11 +783,7 @@ class Foo { parseExpression( "1 == 2 != 3", errors: [ - expectedError( - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, - 7, - 2, - ), + expectedError(ParserErrorCode.equalityCannotBeEqualityOperand, 7, 2), ], ); } @@ -830,11 +792,7 @@ class Foo { parseExpression( "1 != 2 == 3", errors: [ - expectedError( - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, - 7, - 2, - ), + expectedError(ParserErrorCode.equalityCannotBeEqualityOperand, 7, 2), ], ); } @@ -842,7 +800,7 @@ class Foo { void test_expectedBody_class() { parseCompilationUnit( "class A class B {}", - errors: [expectedError(ParserErrorCode.EXPECTED_CLASS_BODY, 6, 1)], + errors: [expectedError(ParserErrorCode.expectedClassBody, 6, 1)], ); } @@ -850,7 +808,7 @@ class Foo { var statement = parseStatement('switch (e) {break;}') as SwitchStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 5), + expectedError(ParserErrorCode.expectedToken, 12, 5), ]); } @@ -858,11 +816,11 @@ class Foo { parseCompilationUnit( 'class C{ heart 2 heart }', errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 9, 5), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 5), - expectedError(ParserErrorCode.EXPECTED_CLASS_MEMBER, 15, 1), - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 17, 5), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 17, 5), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 9, 5), + expectedError(ParserErrorCode.expectedToken, 9, 5), + expectedError(ParserErrorCode.expectedClassMember, 15, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 17, 5), + expectedError(ParserErrorCode.expectedToken, 17, 5), ], ); } @@ -871,9 +829,9 @@ class Foo { parseCompilationUnit( 'class C { 4 score }', errors: [ - expectedError(ParserErrorCode.EXPECTED_CLASS_MEMBER, 10, 1), - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 12, 5), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 5), + expectedError(ParserErrorCode.expectedClassMember, 10, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 12, 5), + expectedError(ParserErrorCode.expectedToken, 12, 5), ], ); } @@ -882,8 +840,8 @@ class Foo { // TODO(brianwilkerson): Remove codes when highlighting is fixed. parseCompilationUnit( '@A', - codes: [ParserErrorCode.EXPECTED_EXECUTABLE], - errors: [expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 1, 1)], + codes: [ParserErrorCode.expectedExecutable], + errors: [expectedError(ParserErrorCode.expectedExecutable, 1, 1)], ); } @@ -891,10 +849,10 @@ class Foo { parseCompilationUnit( 'class C { void 2 void }', errors: [ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 15, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 15, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 17, 4), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 22, 1), + expectedError(ParserErrorCode.missingIdentifier, 15, 1), + expectedError(ParserErrorCode.expectedToken, 15, 1), + expectedError(ParserErrorCode.expectedToken, 17, 4), + expectedError(ParserErrorCode.missingIdentifier, 22, 1), ], ); } @@ -903,11 +861,11 @@ class Foo { CompilationUnit unit = parseCompilationUnit( 'heart 2 heart', errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 0, 5), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 5), - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 6, 1), - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 8, 5), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 8, 5), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 0, 5), + expectedError(ParserErrorCode.expectedToken, 0, 5), + expectedError(ParserErrorCode.expectedExecutable, 6, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 8, 5), + expectedError(ParserErrorCode.expectedToken, 8, 5), ], ); expect(unit, isNotNull); @@ -917,11 +875,11 @@ class Foo { CompilationUnit unit = parseCompilationUnit( 'void 2 void', errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 4), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 5, 1), - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 5, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 4), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 11, 0), + expectedError(ParserErrorCode.expectedToken, 0, 4), + expectedError(ParserErrorCode.missingIdentifier, 5, 1), + expectedError(ParserErrorCode.expectedExecutable, 5, 1), + expectedError(ParserErrorCode.expectedToken, 7, 4), + expectedError(ParserErrorCode.missingIdentifier, 11, 0), ], ); expect(unit, isNotNull); @@ -931,9 +889,9 @@ class Foo { parseCompilationUnit( '4 score', errors: [ - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 0, 1), - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 2, 5), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 2, 5), + expectedError(ParserErrorCode.expectedExecutable, 0, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 2, 5), + expectedError(ParserErrorCode.expectedToken, 2, 5), ], ); } @@ -942,8 +900,8 @@ class Foo { parseCompilationUnit( 'x', errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 0, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 0, 1), + expectedError(ParserErrorCode.expectedToken, 0, 1), ], ); } @@ -952,9 +910,7 @@ class Foo { var literal = parseExpression( "'\$x\$'", - errors: [ - expectedError(ScannerErrorCode.MISSING_IDENTIFIER, 4, 1), - ], + errors: [expectedError(ScannerErrorCode.missingIdentifier, 4, 1)], ) as StringLiteral; expectNotNullIfNoErrors(literal); @@ -967,9 +923,7 @@ class Foo { var literal = parseExpression( "'\$\$foo'", - errors: [ - expectedError(ScannerErrorCode.MISSING_IDENTIFIER, 2, 1), - ], + errors: [expectedError(ScannerErrorCode.missingIdentifier, 2, 1)], ) as StringLiteral; expectNotNullIfNoErrors(literal); @@ -979,16 +933,14 @@ class Foo { createParser('(x, y z)'); ArgumentList list = parser.parseArgumentList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 6, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 6, 1)]); } void test_expectedToken_parseStatement_afterVoid() { parseStatement("void}", expectedEndOffset: 4); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 4), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 1), + expectedError(ParserErrorCode.expectedToken, 0, 4), + expectedError(ParserErrorCode.missingIdentifier, 4, 1), ]); } @@ -996,8 +948,8 @@ class Foo { // TODO(brianwilkerson): Remove codes when highlighting is fixed. CompilationUnit unit = parseCompilationUnit( "export '' class A {}", - codes: [ParserErrorCode.EXPECTED_TOKEN], - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 2)], + codes: [ParserErrorCode.expectedToken], + errors: [expectedError(ParserErrorCode.expectedToken, 7, 2)], ); ExportDirective directive = unit.directives[0] as ExportDirective; expect(directive.uri, isNotNull); @@ -1014,7 +966,7 @@ class Foo { void test_expectedToken_semicolonMissingAfterExpression() { parseStatement("x"); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.EXPECTED_TOKEN]); + listener.assertErrorsWithCodes([ParserErrorCode.expectedToken]); // listener // .assertErrors([expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 1)]); } @@ -1023,8 +975,8 @@ class Foo { // TODO(brianwilkerson): Remove codes when highlighting is fixed. CompilationUnit unit = parseCompilationUnit( "import '' class A {}", - codes: [ParserErrorCode.EXPECTED_TOKEN], - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 2)], + codes: [ParserErrorCode.expectedToken], + errors: [expectedError(ParserErrorCode.expectedToken, 7, 2)], ); ImportDirective directive = unit.directives[0] as ImportDirective; Token semicolon = directive.semicolon; @@ -1036,8 +988,8 @@ class Foo { CompilationUnit unit = parseCompilationUnit( "export class A {}", errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 6), - expectedError(ParserErrorCode.EXPECTED_STRING_LITERAL, 7, 5), + expectedError(ParserErrorCode.expectedToken, 0, 6), + expectedError(ParserErrorCode.expectedStringLiteral, 7, 5), ], ); ExportDirective directive = unit.directives[0] as ExportDirective; @@ -1054,15 +1006,13 @@ class Foo { void test_expectedToken_whileMissingInDoStatement() { parseStatement("do {} (x);"); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 6, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 6, 1)]); } void test_expectedTypeName_as() { parseExpression( "x as", - errors: [expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 4, 0)], + errors: [expectedError(ParserErrorCode.expectedTypeName, 4, 0)], ); } @@ -1070,14 +1020,14 @@ class Foo { parseExpression( "x as void)", expectedEndOffset: 9, - errors: [expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 5, 4)], + errors: [expectedError(ParserErrorCode.expectedTypeName, 5, 4)], ); } void test_expectedTypeName_is() { parseExpression( "x is", - errors: [expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 4, 0)], + errors: [expectedError(ParserErrorCode.expectedTypeName, 4, 0)], ); } @@ -1085,7 +1035,7 @@ class Foo { parseExpression( "x is void)", expectedEndOffset: 9, - errors: [expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 5, 4)], + errors: [expectedError(ParserErrorCode.expectedTypeName, 5, 4)], ); } @@ -1093,7 +1043,7 @@ class Foo { parseCompilationUnit( 'export foo;', errors: [ - expectedError(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, 0, 6), + expectedError(CompileTimeErrorCode.builtInIdentifierAsType, 0, 6), ], ); } @@ -1102,7 +1052,7 @@ class Foo { parseCompilationUnit( 'class C { export foo; }', errors: [ - expectedError(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, 10, 6), + expectedError(CompileTimeErrorCode.builtInIdentifierAsType, 10, 6), ], ); } @@ -1112,7 +1062,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 6, 8), + expectedError(ParserErrorCode.modifierOutOfOrder, 6, 8), ]); } @@ -1121,7 +1071,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 8, 8), + expectedError(ParserErrorCode.modifierOutOfOrder, 8, 8), ]); } @@ -1130,14 +1080,14 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 7, 8), + expectedError(ParserErrorCode.modifierOutOfOrder, 7, 8), ]); } void test_externalClass() { parseCompilationUnit( "external class C {}", - errors: [expectedError(ParserErrorCode.EXTERNAL_CLASS, 0, 8)], + errors: [expectedError(ParserErrorCode.externalClass, 0, 8)], ); } @@ -1146,7 +1096,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXTERNAL_FACTORY_WITH_BODY, 21, 1), + expectedError(ParserErrorCode.externalFactoryWithBody, 21, 1), ]); } @@ -1155,7 +1105,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); + listener.assertErrorsWithCodes([ParserErrorCode.externalMethodWithBody]); // listener.assertErrors( // [expectedError(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, 15, 2)]); } @@ -1163,7 +1113,7 @@ class Foo { void test_externalEnum() { parseCompilationUnit( "external enum E {ONE}", - errors: [expectedError(ParserErrorCode.EXTERNAL_ENUM, 0, 8)], + errors: [expectedError(ParserErrorCode.externalEnum, 0, 8)], ); } @@ -1172,7 +1122,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(CompileTimeErrorCode.CONST_NOT_INITIALIZED, 17, 1), + expectedError(CompileTimeErrorCode.constNotInitialized, 17, 1), ]); } @@ -1209,7 +1159,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); + listener.assertErrorsWithCodes([ParserErrorCode.externalMethodWithBody]); // listener.assertErrors( // [expectedError(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, 19, 2)]); } @@ -1219,7 +1169,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); + listener.assertErrorsWithCodes([ParserErrorCode.externalMethodWithBody]); // listener.assertErrors( // [expectedError(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, 13, 2)]); } @@ -1229,7 +1179,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); + listener.assertErrorsWithCodes([ParserErrorCode.externalMethodWithBody]); // listener.assertErrors( // [expectedError(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, 31, 2)]); } @@ -1239,7 +1189,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); + listener.assertErrorsWithCodes([ParserErrorCode.externalMethodWithBody]); // listener.assertErrors( // [expectedError(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, 26, 2)]); } @@ -1247,7 +1197,7 @@ class Foo { void test_externalTypedef() { parseCompilationUnit( "external typedef F();", - errors: [expectedError(ParserErrorCode.EXTERNAL_TYPEDEF, 0, 8)], + errors: [expectedError(ParserErrorCode.externalTypedef, 0, 8)], ); } @@ -1256,7 +1206,7 @@ class Foo { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1), + expectedError(ParserErrorCode.missingIdentifier, 8, 1), ]); } @@ -1264,18 +1214,14 @@ class Foo { createParser('({int b},)'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 8, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 8, 1)]); } void test_extraCommaTrailingPositionalParameterGroup() { createParser('([int b],)'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 8, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 8, 1)]); } void test_extraTrailingCommaInParameterList() { @@ -1283,41 +1229,35 @@ class Foo { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 3, 1), + expectedError(ParserErrorCode.missingIdentifier, 3, 1), ]); } void test_factory_issue_36400() { parseCompilationUnit( 'class T { T factory T() { return null; } }', - errors: [expectedError(ParserErrorCode.TYPE_BEFORE_FACTORY, 10, 1)], + errors: [expectedError(ParserErrorCode.typeBeforeFactory, 10, 1)], ); } void test_factoryTopLevelDeclaration_class() { parseCompilationUnit( "factory class C {}", - errors: [ - expectedError(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, 0, 7), - ], + errors: [expectedError(ParserErrorCode.factoryTopLevelDeclaration, 0, 7)], ); } void test_factoryTopLevelDeclaration_enum() { parseCompilationUnit( "factory enum E { v }", - errors: [ - expectedError(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, 0, 7), - ], + errors: [expectedError(ParserErrorCode.factoryTopLevelDeclaration, 0, 7)], ); } void test_factoryTopLevelDeclaration_typedef() { parseCompilationUnit( "factory typedef F();", - errors: [ - expectedError(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, 0, 7), - ], + errors: [expectedError(ParserErrorCode.factoryTopLevelDeclaration, 0, 7)], ); } @@ -1326,7 +1266,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 12, 1), + expectedError(ParserErrorCode.missingFunctionBody, 12, 1), ]); } @@ -1335,7 +1275,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 11, 1), + expectedError(ParserErrorCode.missingFunctionBody, 11, 1), ]); } @@ -1344,11 +1284,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError( - ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - 7, - 4, - ), + expectedError(ParserErrorCode.fieldInitializerOutsideConstructor, 7, 4), ]); } @@ -1357,8 +1293,8 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 6, 9), - expectedError(ParserErrorCode.FINAL_AND_COVARIANT, 6, 9), + expectedError(ParserErrorCode.modifierOutOfOrder, 6, 9), + expectedError(ParserErrorCode.finalAndCovariant, 6, 9), ]); } @@ -1366,7 +1302,7 @@ class Foo { createParser('final var x = null;'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([expectedError(ParserErrorCode.FINAL_AND_VAR, 6, 3)]); + listener.assertErrors([expectedError(ParserErrorCode.finalAndVar, 6, 3)]); } void test_finalClassMember_modifierOnly() { @@ -1374,8 +1310,8 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 5), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 5, 0), + expectedError(ParserErrorCode.expectedToken, 0, 5), + expectedError(ParserErrorCode.missingIdentifier, 5, 0), ]); } @@ -1384,14 +1320,14 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 5), + expectedError(ParserErrorCode.extraneousModifier, 0, 5), ]); } void test_finalEnum() { parseCompilationUnit( "final enum E {ONE}", - errors: [error(ParserErrorCode.FINAL_ENUM, 0, 5)], + errors: [error(ParserErrorCode.finalEnum, 0, 5)], ); } @@ -1400,7 +1336,7 @@ class Foo { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 5), + expectedError(ParserErrorCode.extraneousModifier, 0, 5), ]); } @@ -1410,8 +1346,8 @@ class Foo { errors: [ // Fasta interprets the `final` as a malformed top level final // and `typedef` as the start of an typedef declaration. - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 5), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 7), + expectedError(ParserErrorCode.expectedToken, 0, 5), + expectedError(ParserErrorCode.missingIdentifier, 6, 7), ], ); } @@ -1420,7 +1356,7 @@ class Foo { parseCompilationUnit( "Function(abstract) x = null;", errors: [ - expectedError(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, 9, 8), + expectedError(CompileTimeErrorCode.builtInIdentifierAsType, 9, 8), ], ); } @@ -1429,12 +1365,8 @@ class Foo { parseCompilationUnit( "Function(class) x = null;", errors: [ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 9, 5), - expectedError( - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, - 9, - 5, - ), + expectedError(ParserErrorCode.expectedTypeName, 9, 5), + expectedError(ParserErrorCode.expectedIdentifierButGotKeyword, 9, 5), ], ); } @@ -1443,8 +1375,8 @@ class Foo { parseCompilationUnit( "void f(const x()) {}", errors: [ - expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 7, 5), - expectedError(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, 7, 5), + expectedError(ParserErrorCode.extraneousModifier, 7, 5), + expectedError(ParserErrorCode.functionTypedParameterVar, 7, 5), ], ); } @@ -1452,9 +1384,7 @@ class Foo { void test_functionTypedParameter_final() { parseCompilationUnit( "void f(final x()) {}", - errors: [ - expectedError(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, 7, 5), - ], + errors: [expectedError(ParserErrorCode.functionTypedParameterVar, 7, 5)], ); } @@ -1462,9 +1392,9 @@ class Foo { parseCompilationUnit( "void f(int Function(", errors: [ - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 20, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 20, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 20, 0), + expectedError(ScannerErrorCode.expectedToken, 20, 1), + expectedError(ScannerErrorCode.expectedToken, 20, 1), + expectedError(ParserErrorCode.missingFunctionBody, 20, 0), ], ); } @@ -1472,9 +1402,7 @@ class Foo { void test_functionTypedParameter_var() { parseCompilationUnit( "void f(var x()) {}", - errors: [ - expectedError(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, 7, 3), - ], + errors: [expectedError(ParserErrorCode.functionTypedParameterVar, 7, 3)], ); } @@ -1507,8 +1435,8 @@ class Wrong { CompilationUnit unit = parser.parseCompilationUnit2(); expectNotNullIfNoErrors(unit); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 30, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 30, 1), + expectedError(ParserErrorCode.expectedTypeName, 30, 1), + expectedError(ParserErrorCode.expectedToken, 30, 1), ]); } @@ -1520,34 +1448,26 @@ class Wrong { // Fasta considers `get` to be an identifier in this situation. // TODO(danrubel): Investigate better recovery. var statement = result as ExpressionStatement; - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 3), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 0, 3)]); expect(statement.expression.toSource(), 'get'); } void test_getterInFunction_block_returnType() { // Fasta considers `get` to be an identifier in this situation. parseStatement("int get x { return _x; }", expectedEndOffset: 8); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 4, 3), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 4, 3)]); } void test_getterInFunction_expression_noReturnType() { // Fasta considers `get` to be an identifier in this situation. parseStatement("get x => _x;", expectedEndOffset: 4); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 3), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 0, 3)]); } void test_getterInFunction_expression_returnType() { // Fasta considers `get` to be an identifier in this situation. parseStatement("int get x => _x;", expectedEndOffset: 8); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 4, 3), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 4, 3)]); } void test_getterNativeWithBody() { @@ -1555,11 +1475,11 @@ class Wrong { parser.parseClassMember('C') as MethodDeclaration; if (!allowNativeClause) { assertErrorsWithCodes([ - ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, - ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, + ParserErrorCode.nativeClauseShouldBeAnnotation, + ParserErrorCode.externalMethodWithBody, ]); } else { - assertErrorsWithCodes([ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); + assertErrorsWithCodes([ParserErrorCode.externalMethodWithBody]); } } @@ -1568,7 +1488,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.GETTER_WITH_PARAMETERS]); + listener.assertErrorsWithCodes([ParserErrorCode.getterWithParameters]); // listener.assertErrors( // [expectedError(ParserErrorCode.GETTER_WITH_PARAMETERS, 9, 2)]); } @@ -1576,16 +1496,16 @@ class Wrong { void test_illegalAssignmentToNonAssignable_assign_int() { parseStatement("0 = 1;"); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 0, 1), - expectedError(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 0, 1), + expectedError(ParserErrorCode.missingAssignableSelector, 0, 1), + expectedError(ParserErrorCode.illegalAssignmentToNonAssignable, 0, 1), ]); } void test_illegalAssignmentToNonAssignable_assign_this() { parseStatement("this = 1;"); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 0, 4), - expectedError(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 0, 4), + expectedError(ParserErrorCode.missingAssignableSelector, 0, 4), + expectedError(ParserErrorCode.illegalAssignmentToNonAssignable, 0, 4), ]); } @@ -1593,11 +1513,7 @@ class Wrong { parseExpression( "0--", errors: [ - expectedError( - ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, - 1, - 2, - ), + expectedError(ParserErrorCode.illegalAssignmentToNonAssignable, 1, 2), ], ); } @@ -1606,11 +1522,7 @@ class Wrong { parseExpression( "0++", errors: [ - expectedError( - ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, - 1, - 2, - ), + expectedError(ParserErrorCode.illegalAssignmentToNonAssignable, 1, 2), ], ); } @@ -1619,11 +1531,7 @@ class Wrong { parseExpression( "(x)++", errors: [ - expectedError( - ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, - 3, - 2, - ), + expectedError(ParserErrorCode.illegalAssignmentToNonAssignable, 3, 2), ], ); } @@ -1632,11 +1540,7 @@ class Wrong { parseExpression( "x(y)(z)++", errors: [ - expectedError( - ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, - 7, - 2, - ), + expectedError(ParserErrorCode.illegalAssignmentToNonAssignable, 7, 2), ], ); } @@ -1644,22 +1548,22 @@ class Wrong { void test_illegalAssignmentToNonAssignable_superAssigned() { parseStatement("super = x;"); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 0, 5), - expectedError(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 0, 5), + expectedError(ParserErrorCode.missingAssignableSelector, 0, 5), + expectedError(ParserErrorCode.illegalAssignmentToNonAssignable, 0, 5), ]); } void test_implementsBeforeExtends() { parseCompilationUnit( "class A implements B extends C {}", - errors: [expectedError(ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, 21, 7)], + errors: [expectedError(ParserErrorCode.implementsBeforeExtends, 21, 7)], ); } void test_implementsBeforeWith() { parseCompilationUnit( "class A extends B implements C with D {}", - errors: [expectedError(ParserErrorCode.IMPLEMENTS_BEFORE_WITH, 31, 4)], + errors: [expectedError(ParserErrorCode.implementsBeforeWith, 31, 4)], ); } @@ -1667,7 +1571,7 @@ class Wrong { var statement = parseStatement('for (int a = 0 in foo) {}'); expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, 11, 1), + expectedError(ParserErrorCode.initializedVariableInForEach, 11, 1), ]); } @@ -1675,7 +1579,7 @@ class Wrong { var statement = parseStatement('for (@Foo var a = 0 in foo) {}'); expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, 16, 1), + expectedError(ParserErrorCode.initializedVariableInForEach, 16, 1), ]); } @@ -1683,9 +1587,9 @@ class Wrong { var statement = parseStatement('for (f()) {}'); expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1), + expectedError(ParserErrorCode.expectedToken, 7, 1), + expectedError(ParserErrorCode.expectedToken, 7, 1), + expectedError(ParserErrorCode.missingIdentifier, 8, 1), ]); } @@ -1693,8 +1597,8 @@ class Wrong { var statement = parseStatement('for (T f()) {}'); expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 1), + expectedError(ParserErrorCode.expectedToken, 7, 1), + expectedError(ParserErrorCode.expectedToken, 9, 1), ]); } @@ -1702,7 +1606,7 @@ class Wrong { var statement = parseStatement('for (var a = 0 in foo) {}'); expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH, 11, 1), + expectedError(ParserErrorCode.initializedVariableInForEach, 11, 1), ]); } @@ -1710,7 +1614,7 @@ class Wrong { var statement = parseStatement('await for (; ;) {}'); expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_AWAIT_IN_FOR, 0, 5), + expectedError(ParserErrorCode.invalidAwaitInFor, 0, 5), ]); } @@ -1718,7 +1622,7 @@ class Wrong { var literal = parseExpression( "'begin \\u{110000}'", - errors: [expectedError(ParserErrorCode.INVALID_CODE_POINT, 7, 9)], + errors: [expectedError(ParserErrorCode.invalidCodePoint, 7, 9)], ) as StringLiteral; expectNotNullIfNoErrors(literal); @@ -1731,7 +1635,7 @@ class Wrong { var reference = parseCommentReference('new 42', 0) as CommentReference; expectNotNullIfNoErrors(reference); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_COMMENT_REFERENCE, 0, 6), + expectedError(ParserErrorCode.invalidCommentReference, 0, 6), ]); } @@ -1741,7 +1645,7 @@ class Wrong { var reference = parseCommentReference('new a.b.c.d', 0) as CommentReference; expectNotNullIfNoErrors(reference); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_COMMENT_REFERENCE, 0, 11), + expectedError(ParserErrorCode.invalidCommentReference, 0, 11), ]); } @@ -1752,7 +1656,7 @@ class Wrong { var reference = parseCommentReference('42', 0) as CommentReference; expectNotNullIfNoErrors(reference); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_COMMENT_REFERENCE, 0, 2), + expectedError(ParserErrorCode.invalidCommentReference, 0, 2), ]); } @@ -1762,7 +1666,7 @@ class Wrong { var reference = parseCommentReference('a.b.c.d', 0) as CommentReference; expectNotNullIfNoErrors(reference); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_COMMENT_REFERENCE, 0, 7), + expectedError(ParserErrorCode.invalidCommentReference, 0, 7), ]); } @@ -1771,7 +1675,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 2, 1), + expectedError(ParserErrorCode.missingIdentifier, 2, 1), ]); } @@ -1780,7 +1684,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 2, 4), + expectedError(ParserErrorCode.expectedIdentifierButGotKeyword, 2, 4), ]); } @@ -1789,8 +1693,8 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 6, 5), - error(ParserErrorCode.INVALID_INITIALIZER, 6, 10), + error(ParserErrorCode.missingAssignableSelector, 6, 5), + error(ParserErrorCode.invalidInitializer, 6, 10), ]); } @@ -1800,7 +1704,7 @@ class Wrong { expectNotNullIfNoErrors(member); listener.assertErrors([ expectedError( - ParserErrorCode.FIELD_INITIALIZED_OUTSIDE_DECLARING_CLASS, + ParserErrorCode.fieldInitializedOutsideDeclaringClass, 12, 1, ), @@ -1811,7 +1715,7 @@ class Wrong { var literal = parseExpression( "'not \\x0 a'", - errors: [expectedError(ParserErrorCode.INVALID_HEX_ESCAPE, 5, 3)], + errors: [expectedError(ParserErrorCode.invalidHexEscape, 5, 3)], ) as StringLiteral; expectNotNullIfNoErrors(literal); @@ -1821,7 +1725,7 @@ class Wrong { var literal = parseExpression( "'\\x0'", - errors: [expectedError(ParserErrorCode.INVALID_HEX_ESCAPE, 1, 3)], + errors: [expectedError(ParserErrorCode.invalidHexEscape, 1, 3)], ) as StringLiteral; expectNotNullIfNoErrors(literal); @@ -1831,7 +1735,7 @@ class Wrong { parseCompilationUnit( 'typedef F = int Function(int a());', errors: [ - expectedError(CompileTimeErrorCode.INVALID_INLINE_FUNCTION_TYPE, 30, 1), + expectedError(CompileTimeErrorCode.invalidInlineFunctionType, 30, 1), ], ); } @@ -1840,11 +1744,11 @@ class Wrong { parseCompilationUnit( r"main () { print('${x' '); }", errors: [ - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 23, 1), - expectedError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 26, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 20, 3), - expectedError(ParserErrorCode.EXPECTED_STRING_LITERAL, 23, 1), - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 27, 0), + expectedError(ScannerErrorCode.expectedToken, 23, 1), + expectedError(ScannerErrorCode.unterminatedStringLiteral, 26, 1), + expectedError(ParserErrorCode.expectedToken, 20, 3), + expectedError(ParserErrorCode.expectedStringLiteral, 23, 1), + expectedError(ParserErrorCode.expectedExecutable, 27, 0), ], ); } @@ -1853,9 +1757,7 @@ class Wrong { var literal = parseExpression( "'\$1'", - errors: [ - expectedError(ScannerErrorCode.MISSING_IDENTIFIER, 2, 1), - ], + errors: [expectedError(ScannerErrorCode.missingIdentifier, 2, 1)], ) as StringLiteral; expectNotNullIfNoErrors(literal); @@ -1866,14 +1768,14 @@ class Wrong { Configuration configuration = parser.parseConfiguration(); expectNotNullIfNoErrors(configuration); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_LITERAL_IN_CONFIGURATION, 12, 2), + expectedError(ParserErrorCode.invalidLiteralInConfiguration, 12, 2), ]); } void test_invalidOperator() { CompilationUnit unit = parseCompilationUnit( 'class C { void operator ===(x) { } }', - errors: [expectedError(ScannerErrorCode.UNSUPPORTED_OPERATOR, 24, 1)], + errors: [expectedError(ScannerErrorCode.unsupportedOperator, 24, 1)], ); expect(unit, isNotNull); } @@ -1883,8 +1785,8 @@ class Wrong { CompilationUnit unit = parser.parseCompilationUnit2(); expectNotNullIfNoErrors(unit); listener.assertErrors([ - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 23, 5), - expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 28, 1), + expectedError(ParserErrorCode.unexpectedToken, 23, 5), + expectedError(ParserErrorCode.missingMethodParameters, 28, 1), ]); } @@ -1893,7 +1795,7 @@ class Wrong { expectNotNullIfNoErrors(expression); listener.assertErrors([ expectedError( - ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER, + ParserErrorCode.invalidOperatorQuestionmarkPeriodForSuper, 5, 2, ), @@ -1905,7 +1807,7 @@ class Wrong { 'class C { C() : super?.namedConstructor(); }', errors: [ expectedError( - ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER, + ParserErrorCode.invalidOperatorQuestionmarkPeriodForSuper, 21, 2, ), @@ -1918,7 +1820,7 @@ class Wrong { 'super?.v', errors: [ expectedError( - ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER, + ParserErrorCode.invalidOperatorQuestionmarkPeriodForSuper, 5, 2, ), @@ -1932,14 +1834,14 @@ class Wrong { Expression expression = parser.parseUnaryExpression(); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 2, 5), + expectedError(ParserErrorCode.missingAssignableSelector, 2, 5), ]); } void test_invalidPropertyAccess_this() { parseExpression( 'x.this', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 2, 4)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 2, 4)], ); } @@ -1948,7 +1850,7 @@ class Wrong { CompilationUnit unit = parser.parseCompilationUnit2(); expectNotNullIfNoErrors(unit); listener.assertErrors([ - expectedError(CompileTimeErrorCode.RETURN_IN_GENERATOR, 13, 2), + expectedError(CompileTimeErrorCode.returnInGenerator, 13, 2), ]); } @@ -1957,7 +1859,7 @@ class Wrong { CompilationUnit unit = parser.parseCompilationUnit2(); expectNotNullIfNoErrors(unit); listener.assertErrors([ - expectedError(CompileTimeErrorCode.RETURN_IN_GENERATOR, 12, 2), + expectedError(CompileTimeErrorCode.returnInGenerator, 12, 2), ]); } @@ -1965,9 +1867,9 @@ class Wrong { parseCompilationUnit( "var set foo; main(){}", errors: [ - expectedError(ParserErrorCode.VAR_RETURN_TYPE, 0, 3), - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 8, 3), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 11, 1), + expectedError(ParserErrorCode.varReturnType, 0, 3), + expectedError(ParserErrorCode.missingFunctionParameters, 8, 3), + expectedError(ParserErrorCode.missingFunctionBody, 11, 1), ], ); } @@ -1976,8 +1878,8 @@ class Wrong { parseCompilationUnit( "var Function(var arg);", errors: [ - expectedError(ParserErrorCode.VAR_RETURN_TYPE, 0, 3), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 21, 1), + expectedError(ParserErrorCode.varReturnType, 0, 3), + expectedError(ParserErrorCode.missingFunctionBody, 21, 1), ], ); } @@ -1986,11 +1888,11 @@ class Wrong { parseCompilationUnit( "typedef var Function(var arg);", errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 7), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 3), - expectedError(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, 8, 3), - expectedError(ParserErrorCode.VAR_RETURN_TYPE, 8, 3), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 29, 1), + expectedError(ParserErrorCode.expectedToken, 0, 7), + expectedError(ParserErrorCode.missingIdentifier, 8, 3), + expectedError(ParserErrorCode.missingTypedefParameters, 8, 3), + expectedError(ParserErrorCode.varReturnType, 8, 3), + expectedError(ParserErrorCode.missingFunctionBody, 29, 1), ], ); } @@ -2000,8 +1902,8 @@ class Wrong { parseCompilationUnit( "typedef T = typedef F = Map Function();", errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 1), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 12, 7), + expectedError(ParserErrorCode.expectedToken, 10, 1), + expectedError(ParserErrorCode.expectedTypeName, 12, 7), ], ); } @@ -2010,7 +1912,7 @@ class Wrong { Expression expression = parseStringLiteral("'\\u{'"); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_UNICODE_ESCAPE_U_BRACKET, 1, 3), + expectedError(ParserErrorCode.invalidUnicodeEscapeUBracket, 1, 3), ]); } @@ -2018,7 +1920,7 @@ class Wrong { Expression expression = parseStringLiteral("'\\u'"); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_UNICODE_ESCAPE_U_STARTED, 1, 2), + expectedError(ParserErrorCode.invalidUnicodeEscapeUStarted, 1, 2), ]); } @@ -2026,7 +1928,7 @@ class Wrong { Expression expression = parseStringLiteral("'\\u{0A'"); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_UNICODE_ESCAPE_U_BRACKET, 1, 5), + expectedError(ParserErrorCode.invalidUnicodeEscapeUBracket, 1, 5), ]); } @@ -2034,7 +1936,7 @@ class Wrong { Expression expression = parseStringLiteral("'\\u0 and some more'"); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_UNICODE_ESCAPE_U_NO_BRACKET, 1, 3), + expectedError(ParserErrorCode.invalidUnicodeEscapeUNoBracket, 1, 3), ]); } @@ -2042,7 +1944,7 @@ class Wrong { Expression expression = parseStringLiteral("'\\u{110000}'"); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_CODE_POINT, 1, 9), + expectedError(ParserErrorCode.invalidCodePoint, 1, 9), ]); } @@ -2050,7 +1952,7 @@ class Wrong { Expression expression = parseStringLiteral("'\\u04'"); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_UNICODE_ESCAPE_U_NO_BRACKET, 1, 4), + expectedError(ParserErrorCode.invalidUnicodeEscapeUNoBracket, 1, 4), ]); } @@ -2058,7 +1960,7 @@ class Wrong { Expression expression = parseStringLiteral("'\\u{}'"); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_UNICODE_ESCAPE_U_BRACKET, 1, 4), + expectedError(ParserErrorCode.invalidUnicodeEscapeUBracket, 1, 4), ]); } @@ -2066,25 +1968,21 @@ class Wrong { Expression expression = parseStringLiteral("'\\u{0000000001}'"); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_UNICODE_ESCAPE_U_BRACKET, 1, 9), + expectedError(ParserErrorCode.invalidUnicodeEscapeUBracket, 1, 9), ]); } void test_libraryDirectiveNotFirst() { parseCompilationUnit( "import 'x.dart'; library l;", - errors: [ - expectedError(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, 17, 7), - ], + errors: [expectedError(ParserErrorCode.libraryDirectiveNotFirst, 17, 7)], ); } void test_libraryDirectiveNotFirst_afterPart() { CompilationUnit unit = parseCompilationUnit( "part 'a.dart';\nlibrary l;", - errors: [ - expectedError(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, 15, 7), - ], + errors: [expectedError(ParserErrorCode.libraryDirectiveNotFirst, 15, 7)], ); expect(unit, isNotNull); } @@ -2108,28 +2006,28 @@ class Wrong { void test_localFunctionDeclarationModifier_abstract() { parseCompilationUnit( "class C { m() { abstract f() {} } }", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 16, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 16, 8)], ); } void test_localFunctionDeclarationModifier_external() { parseCompilationUnit( "class C { m() { external f() {} } }", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 16, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 16, 8)], ); } void test_localFunctionDeclarationModifier_factory() { parseCompilationUnit( "class C { m() { factory f() {} } }", - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 16, 7)], + errors: [expectedError(ParserErrorCode.expectedToken, 16, 7)], ); } void test_localFunctionDeclarationModifier_static() { parseCompilationUnit( "class C { m() { static f() {} } }", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 16, 6)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 16, 6)], ); } @@ -2140,9 +2038,7 @@ class Wrong { createParser('f(E extends num p);'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 7), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 7)]); expect(member, isMethodDeclaration); var method = member as MethodDeclaration; expect( @@ -2157,7 +2053,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 5), + expectedError(ParserErrorCode.expectedToken, 10, 5), ]); expect(member, isMethodDeclaration); var method = member as MethodDeclaration; @@ -2191,18 +2087,14 @@ class Wrong { void test_missingAssignableSelector_prefix_minusMinus_literal() { parseExpression( "--0", - errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 2, 1), - ], + errors: [expectedError(ParserErrorCode.missingAssignableSelector, 2, 1)], ); } void test_missingAssignableSelector_prefix_plusPlus_literal() { parseExpression( "++0", - errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 2, 1), - ], + errors: [expectedError(ParserErrorCode.missingAssignableSelector, 2, 1)], ); } @@ -2213,7 +2105,7 @@ class Wrong { void test_missingAssignableSelector_superAsExpressionFunctionBody() { CompilationUnit unit = parseCompilationUnit( 'main() => super;', - errors: [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 10, 5)], + errors: [error(ParserErrorCode.missingAssignableSelector, 10, 5)], ); var declaration = unit.declarations.first as FunctionDeclaration; var body = declaration.functionExpression.body as ExpressionFunctionBody; @@ -2226,9 +2118,7 @@ class Wrong { void test_missingAssignableSelector_superPrimaryExpression() { CompilationUnit unit = parseCompilationUnit( 'main() {super;}', - errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 8, 5), - ], + errors: [expectedError(ParserErrorCode.missingAssignableSelector, 8, 5)], ); var declaration = unit.declarations.first as FunctionDeclaration; var blockBody = declaration.functionExpression.body as BlockFunctionBody; @@ -2247,7 +2137,7 @@ class Wrong { var statement = parseStatement('try {}') as TryStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_CATCH_OR_FINALLY, 0, 3), + expectedError(ParserErrorCode.missingCatchOrFinally, 0, 3), ]); expect(statement, isNotNull); } @@ -2260,7 +2150,7 @@ class Wrong { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 14, 1), + expectedError(ScannerErrorCode.expectedToken, 14, 1), ]); } @@ -2268,7 +2158,7 @@ class Wrong { parseCompilationUnit( "class A { static f; }", errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 17, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 17, 1), ], ); } @@ -2276,9 +2166,7 @@ class Wrong { void test_missingConstFinalVarOrType_topLevel() { parseCompilationUnit( 'a;', - errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 0, 1), - ], + errors: [expectedError(ParserErrorCode.missingConstFinalVarOrType, 0, 1)], ); } @@ -2287,7 +2175,7 @@ class Wrong { var declaration = parseFullCompilationUnitMember() as EnumDeclaration; expectNotNullIfNoErrors(declaration); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_ENUM_BODY, 6, 1), + expectedError(ParserErrorCode.missingEnumBody, 6, 1), ]); } @@ -2296,7 +2184,7 @@ class Wrong { var declaration = parseFullCompilationUnitMember() as EnumDeclaration; expectNotNullIfNoErrors(declaration); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 3), + expectedError(ParserErrorCode.expectedToken, 12, 3), ]); } @@ -2306,7 +2194,7 @@ class Wrong { as ThrowExpression; expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, 5, 1), + expectedError(ParserErrorCode.missingExpressionInThrow, 5, 1), ]); } @@ -2314,12 +2202,12 @@ class Wrong { createParser(';'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 0, 1), + expectedError(ParserErrorCode.missingFunctionBody, 0, 1), ]); } @@ -2327,12 +2215,12 @@ class Wrong { createParser('return 0;'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 0, 6), + expectedError(ParserErrorCode.missingFunctionBody, 0, 6), ]); } @@ -2341,9 +2229,7 @@ class Wrong { // to parse it as an expression statement. It isn't clear what the best // error message is in this case. parseStatement("int f { return x;}", expectedEndOffset: 6); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 4, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 4, 1)]); } void test_missingFunctionParameters_local_nonVoid_expression() { @@ -2352,48 +2238,40 @@ class Wrong { // error message is in this case. parseStatement("int f => x;"); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 6, 2), + expectedError(ParserErrorCode.missingFunctionParameters, 6, 2), ]); } void test_missingFunctionParameters_local_void_block() { parseStatement("void f { return x;}", expectedEndOffset: 7); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 5, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 5, 1)]); } void test_missingFunctionParameters_local_void_expression() { parseStatement("void f => x;"); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 7, 2), + expectedError(ParserErrorCode.missingFunctionParameters, 7, 2), ]); } void test_missingFunctionParameters_topLevel_nonVoid_block() { parseCompilationUnit( "int f { return x;}", - errors: [ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 4, 1), - ], + errors: [expectedError(ParserErrorCode.missingFunctionParameters, 4, 1)], ); } void test_missingFunctionParameters_topLevel_nonVoid_expression() { parseCompilationUnit( "int f => x;", - errors: [ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 4, 1), - ], + errors: [expectedError(ParserErrorCode.missingFunctionParameters, 4, 1)], ); } void test_missingFunctionParameters_topLevel_void_block() { CompilationUnit unit = parseCompilationUnit( "void f { return x;}", - errors: [ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 5, 1), - ], + errors: [expectedError(ParserErrorCode.missingFunctionParameters, 5, 1)], ); var funct = unit.declarations[0] as FunctionDeclaration; expect(funct.functionExpression.parameters, hasLength(0)); @@ -2402,9 +2280,7 @@ class Wrong { void test_missingFunctionParameters_topLevel_void_expression() { CompilationUnit unit = parseCompilationUnit( "void f => x;", - errors: [ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 5, 1), - ], + errors: [expectedError(ParserErrorCode.missingFunctionParameters, 5, 1)], ); var funct = unit.declarations[0] as FunctionDeclaration; expect(funct.functionExpression.parameters, hasLength(0)); @@ -2415,7 +2291,7 @@ class Wrong { var expression = parser.parseMultiplicativeExpression() as BinaryExpression; expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 3, 0), + expectedError(ParserErrorCode.missingIdentifier, 3, 0), ]); } @@ -2424,8 +2300,8 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 0, 3), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 3), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 0, 3), + expectedError(ParserErrorCode.expectedToken, 0, 3), ]); } @@ -2434,7 +2310,7 @@ class Wrong { var declaration = parseFullCompilationUnitMember() as EnumDeclaration; expectNotNullIfNoErrors(declaration); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1), + expectedError(ParserErrorCode.missingIdentifier, 8, 1), ]); } @@ -2443,7 +2319,7 @@ class Wrong { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 5, 1), + expectedError(ParserErrorCode.missingIdentifier, 5, 1), ]); } @@ -2452,7 +2328,7 @@ class Wrong { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 5, 1), + expectedError(ParserErrorCode.missingIdentifier, 5, 1), ]); } @@ -2460,7 +2336,7 @@ class Wrong { SymbolLiteral literal = parseSymbolLiteral('#a.'); expectNotNullIfNoErrors(literal); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 3, 1), + expectedError(ParserErrorCode.missingIdentifier, 3, 1), ]); } @@ -2468,7 +2344,7 @@ class Wrong { SymbolLiteral literal = parseSymbolLiteral('#'); expectNotNullIfNoErrors(literal); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 1, 1), + expectedError(ParserErrorCode.missingIdentifier, 1, 1), ]); } @@ -2477,7 +2353,7 @@ class Wrong { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 1, 1), + expectedError(ParserErrorCode.missingIdentifier, 1, 1), ]); } @@ -2486,7 +2362,7 @@ class Wrong { var method = parser.parseClassMember('C') as MethodDeclaration; expectNotNullIfNoErrors(method); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_KEYWORD_OPERATOR, 0, 1), + expectedError(ParserErrorCode.missingKeywordOperator, 0, 1), ]); } @@ -2495,7 +2371,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_KEYWORD_OPERATOR, 0, 1), + expectedError(ParserErrorCode.missingKeywordOperator, 0, 1), ]); } @@ -2504,7 +2380,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_KEYWORD_OPERATOR, 4, 1), + expectedError(ParserErrorCode.missingKeywordOperator, 4, 1), ]); } @@ -2513,7 +2389,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_KEYWORD_OPERATOR, 5, 1), + expectedError(ParserErrorCode.missingKeywordOperator, 5, 1), ]); } @@ -2522,7 +2398,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 5, 1), + expectedError(ParserErrorCode.missingMethodParameters, 5, 1), ]); expect(member, isMethodDeclaration); var method = member as MethodDeclaration; @@ -2534,7 +2410,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 5, 1), + expectedError(ParserErrorCode.missingMethodParameters, 5, 1), ]); } @@ -2544,8 +2420,8 @@ class Wrong { parser.parseFormalParameterList(inFunctionType: true).parameters[0]; expectNotNullIfNoErrors(parameter); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 1), - expectedError(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 6, 1), + expectedError(ParserErrorCode.missingIdentifier, 6, 1), + expectedError(ParserErrorCode.defaultValueInFunctionType, 6, 1), ]); expect(parameter.name, isNotNull); } @@ -2556,8 +2432,8 @@ class Wrong { parser.parseFormalParameterList(inFunctionType: true).parameters[0]; expectNotNullIfNoErrors(parameter); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 1), - expectedError(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 6, 1), + expectedError(ParserErrorCode.missingIdentifier, 6, 1), + expectedError(ParserErrorCode.defaultValueInFunctionType, 6, 1), ]); expect(parameter.name, isNotNull); } @@ -2568,7 +2444,7 @@ class Wrong { parser.parseFormalParameterList(inFunctionType: true).parameters[0]; expectNotNullIfNoErrors(parameter); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 5, 1), + expectedError(ParserErrorCode.missingIdentifier, 5, 1), ]); expect(parameter.name, isNotNull); } @@ -2576,7 +2452,7 @@ class Wrong { void test_missingNameInPartOfDirective() { CompilationUnit unit = parseCompilationUnit( "part of;", - errors: [expectedError(ParserErrorCode.EXPECTED_STRING_LITERAL, 7, 1)], + errors: [expectedError(ParserErrorCode.expectedStringLiteral, 7, 1)], ); expect(unit, isNotNull); } @@ -2585,7 +2461,7 @@ class Wrong { parseCompilationUnit( "import 'foo.dart' deferred;", errors: [ - expectedError(ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT, 18, 8), + expectedError(ParserErrorCode.missingPrefixInDeferredImport, 18, 8), ], ); } @@ -2594,28 +2470,28 @@ class Wrong { createParser('sync {}'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_STAR_AFTER_SYNC, 0, 4), + expectedError(ParserErrorCode.missingStarAfterSync, 0, 4), ]); } void test_missingStatement() { parseStatement("is"); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 2), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 0, 2), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 2, 0), + expectedError(ParserErrorCode.expectedToken, 0, 2), + expectedError(ParserErrorCode.missingIdentifier, 0, 2), + expectedError(ParserErrorCode.expectedTypeName, 2, 0), ]); } void test_missingStatement_afterVoid() { parseStatement("void;"); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 1), + expectedError(ParserErrorCode.missingIdentifier, 4, 1), ]); } @@ -2624,7 +2500,7 @@ class Wrong { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 9, 1), + expectedError(ScannerErrorCode.expectedToken, 9, 1), ]); } @@ -2633,34 +2509,28 @@ class Wrong { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 10, 1), + expectedError(ScannerErrorCode.expectedToken, 10, 1), ]); } void test_missingTypedefParameters_nonVoid() { parseCompilationUnit( "typedef int F;", - errors: [ - expectedError(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, 13, 1), - ], + errors: [expectedError(ParserErrorCode.missingTypedefParameters, 13, 1)], ); } void test_missingTypedefParameters_typeParameters() { parseCompilationUnit( "typedef F;", - errors: [ - expectedError(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, 12, 1), - ], + errors: [expectedError(ParserErrorCode.missingTypedefParameters, 12, 1)], ); } void test_missingTypedefParameters_void() { parseCompilationUnit( "typedef void F;", - errors: [ - expectedError(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, 14, 1), - ], + errors: [expectedError(ParserErrorCode.missingTypedefParameters, 14, 1)], ); } @@ -2668,7 +2538,7 @@ class Wrong { var statement = parseStatement('for (a < b in foo) {}'); expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 1), + expectedError(ParserErrorCode.unexpectedToken, 7, 1), ]); } @@ -2676,31 +2546,27 @@ class Wrong { createParser('(a, {b}, [c])'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 1)]); } void test_mixedParameterGroups_positionalNamed() { createParser('(a, [b], {c})'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 1)]); } void test_mixin_application_lacks_with_clause() { parseCompilationUnit( "class Foo = Bar;", - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 15, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 15, 1)], ); } void test_multipleExtendsClauses() { parseCompilationUnit( "class A extends B extends C {}", - errors: [expectedError(ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, 18, 7)], + errors: [expectedError(ParserErrorCode.multipleExtendsClauses, 18, 7)], ); } @@ -2708,7 +2574,7 @@ class Wrong { parseCompilationUnit( "class A implements B implements C {}", errors: [ - expectedError(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, 21, 10), + expectedError(ParserErrorCode.multipleImplementsClauses, 21, 10), ], ); } @@ -2716,9 +2582,7 @@ class Wrong { void test_multipleLibraryDirectives() { parseCompilationUnit( "library l; library m;", - errors: [ - expectedError(ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES, 11, 7), - ], + errors: [expectedError(ParserErrorCode.multipleLibraryDirectives, 11, 7)], ); } @@ -2726,17 +2590,13 @@ class Wrong { createParser('(a, {b}, {c})'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 1)]); } void test_multiplePartOfDirectives() { parseCompilationUnit( "part of l; part of m;", - errors: [ - expectedError(ParserErrorCode.MULTIPLE_PART_OF_DIRECTIVES, 11, 4), - ], + errors: [expectedError(ParserErrorCode.multiplePartOfDirectives, 11, 4)], ); } @@ -2744,23 +2604,21 @@ class Wrong { createParser('(a, [b], [c])'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 1)]); } void test_multipleVariablesInForEach() { var statement = parseStatement('for (int a, b in foo) {}'); expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 10, 1), + expectedError(ParserErrorCode.unexpectedToken, 10, 1), ]); } void test_multipleWithClauses() { parseCompilationUnit( "class A extends B with C with D {}", - errors: [expectedError(ParserErrorCode.MULTIPLE_WITH_CLAUSES, 25, 4)], + errors: [expectedError(ParserErrorCode.multipleWithClauses, 25, 4)], ); } @@ -2769,7 +2627,7 @@ class Wrong { createParser('f() {}'); expression = parser.parsePrimaryExpression(); listener.assertErrors([ - expectedError(ParserErrorCode.NAMED_FUNCTION_EXPRESSION, 0, 1), + expectedError(ParserErrorCode.namedFunctionExpression, 0, 1), ]); expect(expression, isFunctionExpression); } @@ -2779,7 +2637,7 @@ class Wrong { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, 6, 1), + expectedError(ParserErrorCode.namedParameterOutsideGroup, 6, 1), ]); expect(list.parameters[0].isRequired, isTrue); expect(list.parameters[1].isNamed, isTrue); @@ -2790,8 +2648,8 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 12, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 12, 1), + expectedError(ParserErrorCode.missingFunctionParameters, 12, 1), + expectedError(ParserErrorCode.missingFunctionBody, 12, 1), ]); } @@ -2800,15 +2658,15 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 12, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 12, 1), + expectedError(ParserErrorCode.missingFunctionParameters, 12, 1), + expectedError(ParserErrorCode.missingFunctionBody, 12, 1), ]); } void test_nonIdentifierLibraryName_library() { CompilationUnit unit = parseCompilationUnit( "library 'lib';", - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 5)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 5)], ); expect(unit, isNotNull); } @@ -2817,10 +2675,10 @@ class Wrong { CompilationUnit unit = parseCompilationUnit( "part of 3;", errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 5, 2), - expectedError(ParserErrorCode.EXPECTED_STRING_LITERAL, 8, 1), - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 8, 1), - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 9, 1), + expectedError(ParserErrorCode.expectedToken, 5, 2), + expectedError(ParserErrorCode.expectedStringLiteral, 8, 1), + expectedError(ParserErrorCode.expectedExecutable, 8, 1), + expectedError(ParserErrorCode.unexpectedToken, 9, 1), ], ); expect(unit, isNotNull); @@ -2831,21 +2689,21 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.INVALID_OPERATOR, 9, 2), + expectedError(ParserErrorCode.invalidOperator, 9, 2), ]); } void test_optionalAfterNormalParameters_named() { parseCompilationUnit( "f({a}, b) {}", - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 5, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 5, 1)], ); } void test_optionalAfterNormalParameters_positional() { parseCompilationUnit( "f([a], b) {}", - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 5, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 5, 1)], ); } @@ -2855,7 +2713,7 @@ class Wrong { listener.assertErrors([ // Cascade section is preceded by `null` in this test // and error is reported on '('. - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 1), + expectedError(ParserErrorCode.missingIdentifier, 6, 1), ]); expect(methodInvocation.target, isNull); expect(methodInvocation.methodName.name, ""); @@ -2869,7 +2727,7 @@ class Wrong { listener.assertErrors([ // Cascade section is preceded by `null` in this test // and error is reported on '<'. - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 1), + expectedError(ParserErrorCode.missingIdentifier, 6, 1), ]); expect(methodInvocation.target, isNull); expect(methodInvocation.methodName.name, ""); @@ -2881,9 +2739,9 @@ class Wrong { parseCompilationUnit( 'class C { C. }', errors: [ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 13, 1), - expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 10, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 13, 1), + expectedError(ParserErrorCode.missingIdentifier, 13, 1), + expectedError(ParserErrorCode.missingMethodParameters, 10, 1), + expectedError(ParserErrorCode.missingFunctionBody, 13, 1), ], ); } @@ -2893,7 +2751,7 @@ class Wrong { ArgumentList list = parser.parseArgumentList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ParserErrorCode.POSITIONAL_AFTER_NAMED_ARGUMENT, 7, 1), + expectedError(ParserErrorCode.positionalAfterNamedArgument, 7, 1), ]); } @@ -2902,7 +2760,7 @@ class Wrong { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, 6, 1), + expectedError(ParserErrorCode.namedParameterOutsideGroup, 6, 1), ]); expect(list.parameters[0].isRequired, isTrue); expect(list.parameters[1].isNamed, isTrue); @@ -2913,7 +2771,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY, 15, 1), + expectedError(ParserErrorCode.redirectingConstructorWithBody, 15, 1), ]); } @@ -2922,7 +2780,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY, 15, 1), + expectedError(ParserErrorCode.redirectingConstructorWithBody, 15, 1), ]); } @@ -2931,25 +2789,21 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError( - ParserErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR, - 4, - 1, - ), + expectedError(ParserErrorCode.redirectionInNonFactoryConstructor, 4, 1), ]); } void test_setterInFunction_block() { parseStatement("set x(v) {_x = v;}"); listener.assertErrors([ - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 0, 3), + expectedError(ParserErrorCode.unexpectedToken, 0, 3), ]); } void test_setterInFunction_expression() { parseStatement("set x(v) => _x = v;"); listener.assertErrors([ - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 0, 3), + expectedError(ParserErrorCode.unexpectedToken, 0, 3), ]); } @@ -2958,7 +2812,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 6, 6), + expectedError(ParserErrorCode.modifierOutOfOrder, 6, 6), ]); } @@ -2967,8 +2821,8 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 6, 6), - expectedError(CompileTimeErrorCode.CONST_NOT_INITIALIZED, 17, 1), + expectedError(ParserErrorCode.modifierOutOfOrder, 6, 6), + expectedError(CompileTimeErrorCode.constNotInitialized, 17, 1), ]); } @@ -2977,7 +2831,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 4, 6), + expectedError(ParserErrorCode.modifierOutOfOrder, 4, 6), ]); } @@ -2986,7 +2840,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.STATIC_CONSTRUCTOR, 0, 6), + expectedError(ParserErrorCode.staticConstructor, 0, 6), ]); } @@ -2995,7 +2849,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 12, 1), + expectedError(ParserErrorCode.missingFunctionBody, 12, 1), ]); } @@ -3004,7 +2858,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.STATIC_OPERATOR, 0, 6), + expectedError(ParserErrorCode.staticOperator, 0, 6), ]); } @@ -3013,7 +2867,7 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.STATIC_OPERATOR, 0, 6), + expectedError(ParserErrorCode.staticOperator, 0, 6), ]); } @@ -3027,42 +2881,42 @@ class Wrong { ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 15, 1), + expectedError(ParserErrorCode.missingFunctionBody, 15, 1), ]); } void test_staticTopLevelDeclaration_class() { parseCompilationUnit( "static class C {}", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 6)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 6)], ); } void test_staticTopLevelDeclaration_enum() { parseCompilationUnit( "static enum E { v }", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 6)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 6)], ); } void test_staticTopLevelDeclaration_function() { parseCompilationUnit( "static f() {}", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 6)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 6)], ); } void test_staticTopLevelDeclaration_typedef() { parseCompilationUnit( "static typedef F();", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 6)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 6)], ); } void test_staticTopLevelDeclaration_variable() { parseCompilationUnit( "static var x;", - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 6)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 6)], ); } @@ -3074,13 +2928,13 @@ m() { '${${ ''', codes: [ - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, - ScannerErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.unterminatedStringLiteral, + ScannerErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], ); } @@ -3090,7 +2944,7 @@ m() { parseStatement('switch (a) {case 1 return 0;}') as SwitchStatement; expect(statement, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 19, 6), + expectedError(ParserErrorCode.expectedToken, 19, 6), ]); } @@ -3099,7 +2953,7 @@ m() { parseStatement('switch (a) {default return 0;}') as SwitchStatement; expect(statement, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 20, 6), + expectedError(ParserErrorCode.expectedToken, 20, 6), ]); } @@ -3109,7 +2963,7 @@ m() { as SwitchStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, 31, 4), + expectedError(ParserErrorCode.switchHasCaseAfterDefaultCase, 31, 4), ]); } @@ -3121,8 +2975,8 @@ m() { as SwitchStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, 31, 4), - expectedError(ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, 49, 4), + expectedError(ParserErrorCode.switchHasCaseAfterDefaultCase, 31, 4), + expectedError(ParserErrorCode.switchHasCaseAfterDefaultCase, 49, 4), ]); } @@ -3132,7 +2986,7 @@ m() { as SwitchStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, 31, 7), + expectedError(ParserErrorCode.switchHasMultipleDefaultCases, 31, 7), ]); } @@ -3144,8 +2998,8 @@ m() { as SwitchStatement; expectNotNullIfNoErrors(statement); listener.assertErrors([ - expectedError(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, 31, 7), - expectedError(ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, 50, 7), + expectedError(ParserErrorCode.switchHasMultipleDefaultCases, 31, 7), + expectedError(ParserErrorCode.switchHasMultipleDefaultCases, 50, 7), ]); } @@ -3155,7 +3009,7 @@ m() { as SwitchStatement; expect(statement, isNotNull); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY, 9, 1), + expectedError(ParserErrorCode.expectedSwitchStatementBody, 9, 1), ]); } @@ -3172,16 +3026,14 @@ m() { void test_topLevelFactory_withFunction() { parseCompilationUnit( 'factory Function() x = null;', - errors: [ - expectedError(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, 0, 7), - ], + errors: [expectedError(ParserErrorCode.factoryTopLevelDeclaration, 0, 7)], ); } void test_topLevelOperator_withFunction() { parseCompilationUnit( 'operator Function() x = null;', - errors: [expectedError(ParserErrorCode.TOP_LEVEL_OPERATOR, 0, 8)], + errors: [expectedError(ParserErrorCode.topLevelOperator, 0, 8)], ); } @@ -3190,28 +3042,28 @@ m() { CompilationUnitMember member = parseFullCompilationUnitMember(); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.TOP_LEVEL_OPERATOR, 0, 1), + expectedError(ParserErrorCode.topLevelOperator, 0, 1), ]); } void test_topLevelOperator_withoutType() { parseCompilationUnit( 'operator +(bool x, bool y) => x | y;', - errors: [expectedError(ParserErrorCode.TOP_LEVEL_OPERATOR, 0, 8)], + errors: [expectedError(ParserErrorCode.topLevelOperator, 0, 8)], ); } void test_topLevelOperator_withType() { parseCompilationUnit( 'bool operator +(bool x, bool y) => x | y;', - errors: [expectedError(ParserErrorCode.TOP_LEVEL_OPERATOR, 5, 8)], + errors: [expectedError(ParserErrorCode.topLevelOperator, 5, 8)], ); } void test_topLevelOperator_withVoid() { parseCompilationUnit( 'void operator +(bool x, bool y) => x | y;', - errors: [expectedError(ParserErrorCode.TOP_LEVEL_OPERATOR, 5, 8)], + errors: [expectedError(ParserErrorCode.topLevelOperator, 5, 8)], ); } @@ -3219,9 +3071,9 @@ m() { parseCompilationUnit( "String @A string;", codes: [ - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, + ParserErrorCode.missingConstFinalVarOrType, + ParserErrorCode.expectedToken, + ParserErrorCode.missingConstFinalVarOrType, ], ); } @@ -3240,8 +3092,8 @@ main() { } ''', errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 49, 1), - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 51, 1), + expectedError(ParserErrorCode.expectedToken, 49, 1), + expectedError(ParserErrorCode.expectedExecutable, 51, 1), ], ); } @@ -3249,21 +3101,21 @@ main() { void test_typedef_namedFunction() { parseCompilationUnit( 'typedef void Function();', - codes: [ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD], + codes: [ParserErrorCode.expectedIdentifierButGotKeyword], ); } void test_typedefInClass_withoutReturnType() { parseCompilationUnit( "class C { typedef F(x); }", - errors: [expectedError(ParserErrorCode.TYPEDEF_IN_CLASS, 10, 7)], + errors: [expectedError(ParserErrorCode.typedefInClass, 10, 7)], ); } void test_typedefInClass_withReturnType() { parseCompilationUnit( "class C { typedef int F(int x); }", - errors: [expectedError(ParserErrorCode.TYPEDEF_IN_CLASS, 10, 7)], + errors: [expectedError(ParserErrorCode.typedefInClass, 10, 7)], ); } @@ -3272,8 +3124,8 @@ main() { parseCompilationUnit( r"main() { String s = 'a' 'b', 'c$foo'; return s; }", errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 27, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 29, 2), + expectedError(ParserErrorCode.expectedToken, 27, 1), + expectedError(ParserErrorCode.missingIdentifier, 29, 2), ], ); } @@ -3282,24 +3134,20 @@ main() { createParser('(a, b})'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 5, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 5, 1)]); } void test_unexpectedTerminatorForParameterGroup_optional() { createParser('(a, b])'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 5, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 5, 1)]); } void test_unexpectedToken_endOfFieldDeclarationStatement() { parseStatement("String s = (null));", expectedEndOffset: 17); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 16, 1), + expectedError(ParserErrorCode.expectedToken, 16, 1), ]); } @@ -3307,11 +3155,7 @@ main() { parseExpression( "f()++", errors: [ - expectedError( - ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, - 3, - 2, - ), + expectedError(ParserErrorCode.illegalAssignmentToNonAssignable, 3, 2), ], ); } @@ -3319,16 +3163,14 @@ main() { void test_unexpectedToken_invalidPrefixExpression() { parseExpression( "++f()", - errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 4, 1), - ], + errors: [expectedError(ParserErrorCode.missingAssignableSelector, 4, 1)], ); } void test_unexpectedToken_returnInExpressionFunctionBody() { parseCompilationUnit( "f() => return null;", - errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 6)], + errors: [expectedError(ParserErrorCode.unexpectedToken, 7, 6)], ); } @@ -3337,14 +3179,14 @@ main() { var declaration = parseFullCompilationUnitMember() as ClassDeclaration; expectNotNullIfNoErrors(declaration); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_CLASS_MEMBER, 17, 1), + expectedError(ParserErrorCode.expectedClassMember, 17, 1), ]); } void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { parseCompilationUnit( "int x; ; int y;", - errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 1)], + errors: [expectedError(ParserErrorCode.unexpectedToken, 7, 1)], ); } @@ -3352,7 +3194,7 @@ main() { CompilationUnit unit = parseCompilationUnit( "library;", featureSet: FeatureSets.language_2_18, - errors: [expectedError(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 0, 7)], + errors: [expectedError(ParserErrorCode.experimentNotEnabled, 0, 7)], ); expect(unit, isNotNull); } @@ -3371,9 +3213,9 @@ main() { void main() { var x = "''', errors: [ - expectedError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 24, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 25, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 24, 1), + expectedError(ScannerErrorCode.unterminatedStringLiteral, 24, 1), + expectedError(ScannerErrorCode.expectedToken, 25, 1), + expectedError(ParserErrorCode.expectedToken, 24, 1), ], ); } @@ -3390,7 +3232,7 @@ void main() { } ''', errors: [ - expectedError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 24, 1), + expectedError(ScannerErrorCode.unterminatedStringLiteral, 24, 1), ], ); } @@ -3405,14 +3247,14 @@ void main() { void main() { var x = """''', codes: [ - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.unterminatedStringLiteral, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], errors: [ - expectedError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 24, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 30, 0), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 30, 0), + expectedError(ScannerErrorCode.unterminatedStringLiteral, 24, 1), + expectedError(ScannerErrorCode.expectedToken, 30, 0), + expectedError(ParserErrorCode.expectedToken, 30, 0), ], ); } @@ -3427,14 +3269,14 @@ void main() { void main() { var x = """"''', codes: [ - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.unterminatedStringLiteral, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], errors: [ - expectedError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 24, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 31, 0), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 31, 0), + expectedError(ScannerErrorCode.unterminatedStringLiteral, 24, 1), + expectedError(ScannerErrorCode.expectedToken, 31, 0), + expectedError(ParserErrorCode.expectedToken, 31, 0), ], ); } @@ -3449,14 +3291,14 @@ void main() { void main() { var x = """""''', codes: [ - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.unterminatedStringLiteral, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], errors: [ - expectedError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 28, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 32, 0), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 32, 0), + expectedError(ScannerErrorCode.unterminatedStringLiteral, 28, 1), + expectedError(ScannerErrorCode.expectedToken, 32, 0), + expectedError(ParserErrorCode.expectedToken, 32, 0), ], ); } @@ -3466,7 +3308,7 @@ void main() { Expression expression = parser.parseUnaryExpression(); expectNotNullIfNoErrors(expression); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 0, 1), + expectedError(ParserErrorCode.missingIdentifier, 0, 1), ]); var binaryExpression = expression as BinaryExpression; expect(binaryExpression.leftOperand.isSynthetic, isTrue); @@ -3478,7 +3320,7 @@ void main() { void test_varAndType_field() { parseCompilationUnit( "class C { var int x; }", - errors: [expectedError(ParserErrorCode.VAR_AND_TYPE, 10, 3)], + errors: [expectedError(ParserErrorCode.varAndType, 10, 3)], ); } @@ -3486,7 +3328,7 @@ void main() { // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but // this would be a better error message. parseStatement("var int x;"); - listener.assertErrors([expectedError(ParserErrorCode.VAR_AND_TYPE, 0, 3)]); + listener.assertErrors([expectedError(ParserErrorCode.varAndType, 0, 3)]); } void test_varAndType_parameter() { @@ -3495,13 +3337,13 @@ void main() { createParser('(var int x)'); FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); - listener.assertErrors([expectedError(ParserErrorCode.VAR_AND_TYPE, 1, 3)]); + listener.assertErrors([expectedError(ParserErrorCode.varAndType, 1, 3)]); } void test_varAndType_topLevelVariable() { parseCompilationUnit( "var int x;", - errors: [expectedError(ParserErrorCode.VAR_AND_TYPE, 0, 3)], + errors: [expectedError(ParserErrorCode.varAndType, 0, 3)], ); } @@ -3509,7 +3351,7 @@ void main() { parseExpression( "x as var", expectedEndOffset: 5, - errors: [expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 5, 3)], + errors: [expectedError(ParserErrorCode.expectedTypeName, 5, 3)], ); } @@ -3519,8 +3361,8 @@ void main() { errors: [ // Fasta interprets the `var` as a malformed top level var // and `class` as the start of a class declaration. - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 3), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 5), + expectedError(ParserErrorCode.expectedToken, 0, 3), + expectedError(ParserErrorCode.missingIdentifier, 4, 5), ], ); } @@ -3531,8 +3373,8 @@ void main() { errors: [ // Fasta interprets the `var` as a malformed top level var // and `enum` as the start of an enum declaration. - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 3), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 4), + expectedError(ParserErrorCode.expectedToken, 0, 3), + expectedError(ParserErrorCode.missingIdentifier, 4, 4), ], ); } @@ -3541,9 +3383,7 @@ void main() { createParser('var m() {}'); ClassMember member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); - listener.assertErrors([ - expectedError(ParserErrorCode.VAR_RETURN_TYPE, 0, 3), - ]); + listener.assertErrors([expectedError(ParserErrorCode.varReturnType, 0, 3)]); } void test_varTypedef() { @@ -3552,8 +3392,8 @@ void main() { errors: [ // Fasta interprets the `var` as a malformed top level var // and `typedef` as the start of an typedef declaration. - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 3), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 7), + expectedError(ParserErrorCode.expectedToken, 0, 3), + expectedError(ParserErrorCode.missingIdentifier, 4, 7), ], ); } @@ -3615,7 +3455,7 @@ void main() { void test_withBeforeExtends() { parseCompilationUnit( "class A with B extends C {}", - errors: [expectedError(ParserErrorCode.WITH_BEFORE_EXTENDS, 15, 7)], + errors: [expectedError(ParserErrorCode.withBeforeExtends, 15, 7)], ); } @@ -3631,11 +3471,7 @@ void main() { FormalParameterList list = parser.parseFormalParameterList(); expectNotNullIfNoErrors(list); listener.assertErrors([ - expectedError( - ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER, - 7, - 1, - ), + expectedError(ParserErrorCode.wrongSeparatorForPositionalParameter, 7, 1), ]); } @@ -3645,8 +3481,8 @@ void main() { expectNotNullIfNoErrors(list); // fasta scanner generates '(a, {b, c]})' where '}' is synthetic listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 10, 1), + expectedError(ParserErrorCode.expectedToken, 9, 1), + expectedError(ScannerErrorCode.expectedToken, 10, 1), ]); } @@ -3656,8 +3492,8 @@ void main() { expectNotNullIfNoErrors(list); // fasta scanner generates '(a, [b, c}])' where ']' is synthetic listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 10, 1), + expectedError(ParserErrorCode.expectedToken, 9, 1), + expectedError(ScannerErrorCode.expectedToken, 10, 1), ]); } diff --git a/pkg/analyzer/test/generated/expression_parser_test.dart b/pkg/analyzer/test/generated/expression_parser_test.dart index 49f97314a2e..2aa72322394 100644 --- a/pkg/analyzer/test/generated/expression_parser_test.dart +++ b/pkg/analyzer/test/generated/expression_parser_test.dart @@ -45,9 +45,9 @@ class ExpressionParserTest extends FastaParserTestCase { parseExpression( '()', errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 1, 1), - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 0), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 7, 0), + expectedError(ParserErrorCode.expectedToken, 1, 1), + expectedError(ParserErrorCode.unexpectedToken, 7, 0), + expectedError(ParserErrorCode.missingFunctionBody, 7, 0), ], ); } @@ -57,15 +57,11 @@ class ExpressionParserTest extends FastaParserTestCase { parseExpression( 'n=<.["\$assert', errors: [ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 3, 1), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 4, 1), - expectedError( - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, - 7, - 6, - ), - expectedError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 12, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 13, 1), + expectedError(ParserErrorCode.expectedTypeName, 3, 1), + expectedError(ParserErrorCode.expectedTypeName, 4, 1), + expectedError(ParserErrorCode.expectedIdentifierButGotKeyword, 7, 6), + expectedError(ScannerErrorCode.unterminatedStringLiteral, 12, 1), + expectedError(ScannerErrorCode.expectedToken, 13, 1), ], ); } @@ -75,8 +71,8 @@ class ExpressionParserTest extends FastaParserTestCase { parseExpression( '[(){}]', errors: [ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 4, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 6, 1), + expectedError(ParserErrorCode.expectedTypeName, 4, 1), + expectedError(ParserErrorCode.expectedToken, 6, 1), ], ); } @@ -87,14 +83,10 @@ class ExpressionParserTest extends FastaParserTestCase { parseExpression( '<.["', errors: [ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 1, 1), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 2, 1), - expectedError( - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, - 3, - 1, - ), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 4, 1), + expectedError(ParserErrorCode.expectedTypeName, 1, 1), + expectedError(ParserErrorCode.expectedTypeName, 2, 1), + expectedError(ScannerErrorCode.unterminatedStringLiteral, 3, 1), + expectedError(ScannerErrorCode.expectedToken, 4, 1), ], ) as ListLiteral; @@ -109,8 +101,8 @@ class ExpressionParserTest extends FastaParserTestCase { parseExpression( '<.[]', errors: [ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 1, 1), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 2, 2), + expectedError(ParserErrorCode.expectedTypeName, 1, 1), + expectedError(ParserErrorCode.expectedTypeName, 2, 2), ], ) as ListLiteral; @@ -151,7 +143,7 @@ class ExpressionParserTest extends FastaParserTestCase { // type arguments, but the parser could report this. expectedError( /* ParserErrorCode.EXPECTED_ONE_OR_TWO_TYPE_VARIABLES */ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, 11, 3, ), @@ -172,7 +164,7 @@ class ExpressionParserTest extends FastaParserTestCase { // type arguments, but the parser could report this. expectedError( /* ParserErrorCode.EXPECTED_ONE_OR_TWO_TYPE_VARIABLES */ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, 11, 3, ), @@ -804,7 +796,7 @@ class ExpressionParserTest extends FastaParserTestCase { void test_parseConstExpression_mapLiteral_typed_missingGt() { Expression expression = parseExpression( 'const ', codes: [ // TODO(danrubel): Improve this error message. - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], ); expect(expression, isNotNull); @@ -1106,7 +1098,7 @@ class ExpressionParserTest extends FastaParserTestCase { 'const (E i) => i++', ); expect(expression, isNotNull); - assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]); + assertErrorsWithCodes([ParserErrorCode.unexpectedToken]); expect(expression.body, isNotNull); expect(expression.typeParameters, isNotNull); expect(expression.parameters, isNotNull); @@ -1117,7 +1109,7 @@ class ExpressionParserTest extends FastaParserTestCase { Expression expression = parseExpression( '[0, 1, 2]', - codes: [ParserErrorCode.EXPECTED_TOKEN], + codes: [ParserErrorCode.expectedToken], ); expect(expression, isNotNull); var literal = expression as ListLiteral; @@ -1275,7 +1267,7 @@ class ExpressionParserTest extends FastaParserTestCase { 'new a.b.c()', errors: [ expectedError( - ParserErrorCode.CONSTRUCTOR_WITH_TYPE_ARGUMENTS, + ParserErrorCode.constructorWithTypeArguments, 8, 1, ), @@ -1904,7 +1896,7 @@ class ExpressionParserTest extends FastaParserTestCase { var asExpression = parseExpression( 'x as Y as Z', - errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 2)], + errors: [expectedError(ParserErrorCode.unexpectedToken, 7, 2)], ) as AsExpression; expect(asExpression, isNotNull); @@ -1982,7 +1974,7 @@ class ExpressionParserTest extends FastaParserTestCase { var isExpression = parseExpression( 'x is Y is! Z', - errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 2)], + errors: [expectedError(ParserErrorCode.unexpectedToken, 7, 2)], ) as IsExpression; expect(isExpression, isNotNull); @@ -2131,11 +2123,7 @@ class ExpressionParserTest extends FastaParserTestCase { expect(expression, isNotNull); assertErrors( errors: [ - expectedError( - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, - 8, - 4, - ), + expectedError(ParserErrorCode.expectedIdentifierButGotKeyword, 8, 4), ], ); expect(expression, isStringInterpolation); @@ -2605,7 +2593,7 @@ class ExpressionParserTest extends FastaParserTestCase { PrefixExpression expression = parseUnaryExpression('!super'); expect(expression, isNotNull); assertErrors( - errors: [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 1, 5)], + errors: [error(ParserErrorCode.missingAssignableSelector, 1, 5)], ); expect(expression.operator, isNotNull); expect(expression.operator.type, TokenType.BANG); diff --git a/pkg/analyzer/test/generated/extension_methods_parser_test.dart b/pkg/analyzer/test/generated/extension_methods_parser_test.dart index 93c05ba0a69..7aee6fc5dcc 100644 --- a/pkg/analyzer/test/generated/extension_methods_parser_test.dart +++ b/pkg/analyzer/test/generated/extension_methods_parser_test.dart @@ -21,10 +21,10 @@ class ExtensionMethodsParserTest extends FastaParserTestCase { var unit = parseCompilationUnit( 'extension E extends A with B, C implements D { }', errors: [ - expectedError(ParserErrorCode.EXPECTED_INSTEAD, 12, 7), - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 22, 4), - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 28, 1), - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 32, 10), + expectedError(ParserErrorCode.expectedInstead, 12, 7), + expectedError(ParserErrorCode.unexpectedToken, 22, 4), + expectedError(ParserErrorCode.unexpectedToken, 28, 1), + expectedError(ParserErrorCode.unexpectedToken, 32, 10), ], ); expect(unit.declarations, hasLength(1)); @@ -39,8 +39,8 @@ class ExtensionMethodsParserTest extends FastaParserTestCase { var unit = parseCompilationUnit( 'extension E implements C, D { }', errors: [ - expectedError(ParserErrorCode.EXPECTED_INSTEAD, 12, 10), - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 24, 1), + expectedError(ParserErrorCode.expectedInstead, 12, 10), + expectedError(ParserErrorCode.unexpectedToken, 24, 1), ], ); expect(unit.declarations, hasLength(1)); @@ -96,7 +96,7 @@ extension E on C { class C {} ''', errors: [ - expectedError(ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR, 21, 1), + expectedError(ParserErrorCode.extensionDeclaresConstructor, 21, 1), ], ); expect(unit.declarations, hasLength(2)); @@ -113,7 +113,7 @@ extension E on C { class C {} ''', errors: [ - expectedError(ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR, 21, 1), + expectedError(ParserErrorCode.extensionDeclaresConstructor, 21, 1), ], ); expect(unit.declarations, hasLength(2)); @@ -125,9 +125,9 @@ class C {} var unit = parseCompilationUnit( 'extension E', errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 1), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 11, 0), - expectedError(ParserErrorCode.EXPECTED_EXTENSION_BODY, 11, 0), + expectedError(ParserErrorCode.expectedToken, 10, 1), + expectedError(ParserErrorCode.expectedTypeName, 11, 0), + expectedError(ParserErrorCode.expectedExtensionBody, 11, 0), ], ); expect(unit.declarations, hasLength(1)); @@ -142,8 +142,8 @@ class C {} var unit = parseCompilationUnit( 'extension E {}', errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 1), - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 12, 1), + expectedError(ParserErrorCode.expectedToken, 10, 1), + expectedError(ParserErrorCode.expectedTypeName, 12, 1), ], ); expect(unit.declarations, hasLength(1)); @@ -157,7 +157,7 @@ class C {} void test_missing_on_withClassAndBlock() { var unit = parseCompilationUnit( 'extension E C {}', - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 10, 1)], ); expect(unit.declarations, hasLength(1)); var extension = unit.declarations[0] as ExtensionDeclaration; @@ -201,7 +201,7 @@ class C {} void test_simple_extends() { var unit = parseCompilationUnit( 'extension E extends C { }', - errors: [expectedError(ParserErrorCode.EXPECTED_INSTEAD, 12, 7)], + errors: [expectedError(ParserErrorCode.expectedInstead, 12, 7)], ); expect(unit.declarations, hasLength(1)); var extension = unit.declarations[0] as ExtensionDeclaration; @@ -214,7 +214,7 @@ class C {} void test_simple_implements() { var unit = parseCompilationUnit( 'extension E implements C { }', - errors: [expectedError(ParserErrorCode.EXPECTED_INSTEAD, 12, 10)], + errors: [expectedError(ParserErrorCode.expectedInstead, 12, 10)], ); expect(unit.declarations, hasLength(1)); var extension = unit.declarations[0] as ExtensionDeclaration; @@ -240,7 +240,7 @@ class C {} void test_simple_with() { var unit = parseCompilationUnit( 'extension E with C { }', - errors: [expectedError(ParserErrorCode.EXPECTED_INSTEAD, 12, 4)], + errors: [expectedError(ParserErrorCode.expectedInstead, 12, 4)], ); expect(unit.declarations, hasLength(1)); var extension = unit.declarations[0] as ExtensionDeclaration; diff --git a/pkg/analyzer/test/generated/formal_parameter_parser_test.dart b/pkg/analyzer/test/generated/formal_parameter_parser_test.dart index 7514f6910cc..f612749977a 100644 --- a/pkg/analyzer/test/generated/formal_parameter_parser_test.dart +++ b/pkg/analyzer/test/generated/formal_parameter_parser_test.dart @@ -232,7 +232,7 @@ class C { FormalParameter parameter = parseNNBDFormalParameter( 'covariant required A a : null', kind, - errors: [expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 12, 8)], + errors: [expectedError(ParserErrorCode.modifierOutOfOrder, 12, 8)], ); expect(parameter, isNotNull); expect(parameter, isDefaultFormalParameter); @@ -397,7 +397,7 @@ class C { parseNNBDFormalParameter( 'external int i', ParameterKind.REQUIRED, - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 1, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 1, 8)], ); } @@ -461,7 +461,7 @@ class C { FormalParameter parameter = parseNNBDFormalParameter( 'final required a : null', kind, - errors: [expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 8, 8)], + errors: [expectedError(ParserErrorCode.modifierOutOfOrder, 8, 8)], ); expect(parameter, isNotNull); expect(parameter, isDefaultFormalParameter); @@ -795,7 +795,7 @@ class C { FormalParameter parameter = parseNNBDFormalParameter( 'var required a : null', kind, - errors: [expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 6, 8)], + errors: [expectedError(ParserErrorCode.modifierOutOfOrder, 6, 8)], ); expect(parameter, isNotNull); expect(parameter, isDefaultFormalParameter); @@ -1004,7 +1004,7 @@ class C { void test_parseFormalParameterList_prefixedType_missingName() { FormalParameterList list = parseFormalParameterList( '(io.File)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 1)], ); expect(list, isNotNull); expect(list.leftParenthesis, isNotNull); @@ -1025,8 +1025,8 @@ class C { FormalParameterList list = parseFormalParameterList( '(io.)', errors: [ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 4, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 1), + expectedError(ParserErrorCode.expectedTypeName, 4, 1), + expectedError(ParserErrorCode.missingIdentifier, 4, 1), ], ); expect(list, isNotNull); @@ -1048,8 +1048,8 @@ class C { FormalParameterList list = parseFormalParameterList( '(io.,a)', errors: [ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 4, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 1), + expectedError(ParserErrorCode.expectedTypeName, 4, 1), + expectedError(ParserErrorCode.missingIdentifier, 4, 1), ], ); expect(list, isNotNull); @@ -1065,7 +1065,7 @@ class C { void test_parseNormalFormalParameter_field_const_noType() { NormalFormalParameter parameter = parseNormalFormalParameter( 'const this.a', - diagnosticCodes: [ParserErrorCode.EXTRANEOUS_MODIFIER], + diagnosticCodes: [ParserErrorCode.extraneousModifier], ); expect(parameter, isNotNull); expect(parameter, isFieldFormalParameter); @@ -1079,7 +1079,7 @@ class C { void test_parseNormalFormalParameter_field_const_type() { NormalFormalParameter parameter = parseNormalFormalParameter( 'const A this.a', - diagnosticCodes: [ParserErrorCode.EXTRANEOUS_MODIFIER], + diagnosticCodes: [ParserErrorCode.extraneousModifier], ); expect(parameter, isNotNull); expect(parameter, isFieldFormalParameter); @@ -1347,7 +1347,7 @@ class C { void test_parseNormalFormalParameter_simple_const_noType() { NormalFormalParameter parameter = parseNormalFormalParameter( 'const a', - diagnosticCodes: [ParserErrorCode.EXTRANEOUS_MODIFIER], + diagnosticCodes: [ParserErrorCode.extraneousModifier], ); expect(parameter, isNotNull); expect(parameter, isSimpleFormalParameter); @@ -1360,7 +1360,7 @@ class C { void test_parseNormalFormalParameter_simple_const_type() { NormalFormalParameter parameter = parseNormalFormalParameter( 'const A a', - diagnosticCodes: [ParserErrorCode.EXTRANEOUS_MODIFIER], + diagnosticCodes: [ParserErrorCode.extraneousModifier], ); expect(parameter, isNotNull); expect(parameter, isSimpleFormalParameter); diff --git a/pkg/analyzer/test/generated/function_reference_parser_test.dart b/pkg/analyzer/test/generated/function_reference_parser_test.dart index d519733e511..85143ad77b2 100644 --- a/pkg/analyzer/test/generated/function_reference_parser_test.dart +++ b/pkg/analyzer/test/generated/function_reference_parser_test.dart @@ -43,7 +43,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { .expression, ); listener.assertErrors([ - expectedError(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 1, 6), + expectedError(ParserErrorCode.experimentNotEnabled, 1, 6), ]); } @@ -140,7 +140,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a&d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 1)], ) as MethodInvocation, ); @@ -154,7 +154,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a*d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 1)], ) as MethodInvocation, ); @@ -172,7 +172,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a|d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 1)], ) as MethodInvocation, ); @@ -182,7 +182,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a^d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 1)], ) as MethodInvocation, ); @@ -192,7 +192,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { var methodInvocation = parseExpression( 'f(a is int)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 9, 2)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 9, 2)], ) as MethodInvocation; var arguments = methodInvocation.argumentList.arguments; @@ -208,12 +208,8 @@ class FunctionReferenceParserTest extends FastaParserTestCase { parseExpression( 'f', errors: [ - expectedError( - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, - 3, - 1, - ), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 0), + expectedError(ParserErrorCode.equalityCannotBeEqualityOperand, 3, 1), + expectedError(ParserErrorCode.expectedToken, 7, 0), ], ); } @@ -236,7 +232,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { 'f(a[d]>e)', errors: [ expectedError( - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, + ParserErrorCode.equalityCannotBeEqualityOperand, 11, 1, ), @@ -254,7 +250,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a%d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 1)], ) as MethodInvocation, ); @@ -264,7 +260,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { var methodInvocation = parseExpression( 'f(a..toString())', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 2)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 2)], ) as MethodInvocation; var arguments = methodInvocation.argumentList.arguments; @@ -277,7 +273,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a+d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 1)], ) as MethodInvocation, ); @@ -287,7 +283,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { var methodInvocation = parseExpression( 'f(a ? null : null)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 9, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 9, 1)], ) as MethodInvocation; var arguments = methodInvocation.argumentList.arguments; @@ -300,7 +296,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a?.toString())', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 2)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 2)], ) as MethodInvocation, ); @@ -310,7 +306,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a?.foo())', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 2)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 2)], ) as MethodInvocation, ); @@ -321,8 +317,8 @@ class FunctionReferenceParserTest extends FastaParserTestCase { parseExpression( 'f(a?..toString())', errors: [ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 3), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 11, 8), + expectedError(ParserErrorCode.missingIdentifier, 8, 3), + expectedError(ParserErrorCode.expectedToken, 11, 8), ], ) as MethodInvocation; @@ -337,7 +333,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a?.hashCode)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 2)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 2)], ) as MethodInvocation, ); @@ -347,7 +343,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a ?? d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 9, 2)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 9, 2)], ) as MethodInvocation, ); @@ -357,7 +353,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a/d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 1)], ) as MethodInvocation, ); @@ -367,7 +363,7 @@ class FunctionReferenceParserTest extends FastaParserTestCase { expect_two_args( parseExpression( 'f(a~/d)', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 2)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 8, 2)], ) as MethodInvocation, ); diff --git a/pkg/analyzer/test/generated/generic_metadata_parser_test.dart b/pkg/analyzer/test/generated/generic_metadata_parser_test.dart index 803587b9f6f..af7d012c7a0 100644 --- a/pkg/analyzer/test/generated/generic_metadata_parser_test.dart +++ b/pkg/analyzer/test/generated/generic_metadata_parser_test.dart @@ -52,11 +52,7 @@ mixin GenericMetadataParserTest on FastaParserTestCase { void test_className_prefixed_constructorName_absent() { var compilationUnit = _parseCompilationUnit( '@p.A() class C {}', - disabledError: expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - 4, - 1, - ), + disabledError: expectedError(ParserErrorCode.experimentNotEnabled, 4, 1), ); var classDeclaration = compilationUnit.declarations.single as ClassDeclaration; @@ -72,11 +68,7 @@ mixin GenericMetadataParserTest on FastaParserTestCase { void test_className_prefixed_constructorName_present() { var compilationUnit = _parseCompilationUnit( '@p.A.ctor() class C {}', - disabledError: expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - 4, - 1, - ), + disabledError: expectedError(ParserErrorCode.experimentNotEnabled, 4, 1), ); var classDeclaration = compilationUnit.declarations.single as ClassDeclaration; @@ -92,11 +84,7 @@ mixin GenericMetadataParserTest on FastaParserTestCase { void test_className_unprefixed_constructorName_absent() { var compilationUnit = _parseCompilationUnit( '@A() class C {}', - disabledError: expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - 2, - 1, - ), + disabledError: expectedError(ParserErrorCode.experimentNotEnabled, 2, 1), ); var classDeclaration = compilationUnit.declarations.single as ClassDeclaration; @@ -111,11 +99,7 @@ mixin GenericMetadataParserTest on FastaParserTestCase { void test_className_unprefixed_constructorName_present() { var compilationUnit = _parseCompilationUnit( '@A.ctor() class C {}', - disabledError: expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - 2, - 1, - ), + disabledError: expectedError(ParserErrorCode.experimentNotEnabled, 2, 1), ); var classDeclaration = compilationUnit.declarations.single as ClassDeclaration; @@ -132,16 +116,12 @@ mixin GenericMetadataParserTest on FastaParserTestCase { '@p.x class C {}', errors: [ expectedError( - ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED, + ParserErrorCode.annotationWithTypeArgumentsUninstantiated, 6, 1, ), ], - disabledError: expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - 4, - 1, - ), + disabledError: expectedError(ParserErrorCode.experimentNotEnabled, 4, 1), ); var classDeclaration = compilationUnit.declarations.single as ClassDeclaration; @@ -159,16 +139,12 @@ mixin GenericMetadataParserTest on FastaParserTestCase { '@x class C {}', errors: [ expectedError( - ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED, + ParserErrorCode.annotationWithTypeArgumentsUninstantiated, 4, 1, ), ], - disabledError: expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - 2, - 1, - ), + disabledError: expectedError(ParserErrorCode.experimentNotEnabled, 2, 1), ); var classDeclaration = compilationUnit.declarations.single as ClassDeclaration; @@ -184,11 +160,11 @@ mixin GenericMetadataParserTest on FastaParserTestCase { _parseCompilationUnit( '@p.A.ctor() class C {}', errors: [ - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 9, 1), - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 10, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 1), - expectedError(ParserErrorCode.TOP_LEVEL_OPERATOR, 11, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 15, 5), + expectedError(ParserErrorCode.expectedExecutable, 9, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 10, 1), + expectedError(ParserErrorCode.expectedToken, 10, 1), + expectedError(ParserErrorCode.topLevelOperator, 11, 1), + expectedError(ParserErrorCode.missingFunctionBody, 15, 5), ], disabledError: null, ); @@ -199,18 +175,14 @@ mixin GenericMetadataParserTest on FastaParserTestCase { '@p.B.ctor() class C {}', errors: [ expectedError( - ParserErrorCode.ANNOTATION_WITH_TYPE_ARGUMENTS_UNINSTANTIATED, + ParserErrorCode.annotationWithTypeArgumentsUninstantiated, 6, 1, ), - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 7, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 15, 5), + expectedError(ParserErrorCode.expectedExecutable, 7, 1), + expectedError(ParserErrorCode.missingFunctionBody, 15, 5), ], - disabledError: expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - 2, - 1, - ), + disabledError: expectedError(ParserErrorCode.experimentNotEnabled, 2, 1), ); } diff --git a/pkg/analyzer/test/generated/new_as_identifier_parser_test.dart b/pkg/analyzer/test/generated/new_as_identifier_parser_test.dart index 578345611be..b34773fd4ba 100644 --- a/pkg/analyzer/test/generated/new_as_identifier_parser_test.dart +++ b/pkg/analyzer/test/generated/new_as_identifier_parser_test.dart @@ -29,16 +29,16 @@ class C { } ''', errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 18, 4), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 23, 3), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 23, 3), - expectedError(ParserErrorCode.EXPECTED_CLASS_MEMBER, 23, 3), - expectedError(ParserErrorCode.MISSING_KEYWORD_OPERATOR, 27, 1), - expectedError(ParserErrorCode.INVALID_OPERATOR, 27, 1), - expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 27, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 29, 4), - expectedError(ParserErrorCode.EXPECTED_CLASS_MEMBER, 29, 4), - expectedError(ParserErrorCode.EXPECTED_CLASS_MEMBER, 33, 1), + expectedError(ParserErrorCode.missingAssignmentInInitializer, 18, 4), + expectedError(ParserErrorCode.missingIdentifier, 23, 3), + expectedError(ParserErrorCode.missingFunctionBody, 23, 3), + expectedError(ParserErrorCode.expectedClassMember, 23, 3), + expectedError(ParserErrorCode.missingKeywordOperator, 27, 1), + expectedError(ParserErrorCode.invalidOperator, 27, 1), + expectedError(ParserErrorCode.missingMethodParameters, 27, 1), + expectedError(ParserErrorCode.missingFunctionBody, 29, 4), + expectedError(ParserErrorCode.expectedClassMember, 29, 4), + expectedError(ParserErrorCode.expectedClassMember, 33, 1), ], ); } @@ -315,7 +315,7 @@ class C { } ''', featureSet: FeatureSets.language_2_13, - errors: [expectedError(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 14, 3)], + errors: [expectedError(ParserErrorCode.experimentNotEnabled, 14, 3)], ); var classDeclaration = unit.declarations.single as ClassDeclaration; var constructorDeclaration = diff --git a/pkg/analyzer/test/generated/nnbd_parser_test.dart b/pkg/analyzer/test/generated/nnbd_parser_test.dart index 73167906922..413ee8d2bce 100644 --- a/pkg/analyzer/test/generated/nnbd_parser_test.dart +++ b/pkg/analyzer/test/generated/nnbd_parser_test.dart @@ -156,7 +156,7 @@ main() { parseCompilationUnit( 'main() { a..[27]?..x; }', errors: [ - expectedError(ParserErrorCode.NULL_AWARE_CASCADE_OUT_OF_ORDER, 16, 3), + expectedError(ParserErrorCode.nullAwareCascadeOutOfOrder, 16, 3), ], ); } @@ -195,9 +195,9 @@ main() { parseCompilationUnit( 'D? foo(X? x) { X ? ? x2 = x + bar(7) : y; }', errors: [ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 19, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 40, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 40, 1), + expectedError(ParserErrorCode.missingIdentifier, 19, 1), + expectedError(ParserErrorCode.expectedToken, 40, 1), + expectedError(ParserErrorCode.missingIdentifier, 40, 1), ], ); } @@ -231,11 +231,11 @@ main() { parseCompilationUnit( r'+t{{r?this}}', errors: [ - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 0, 1), - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 1, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 6, 4), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 10, 1), + expectedError(ParserErrorCode.expectedExecutable, 0, 1), + expectedError(ParserErrorCode.missingFunctionParameters, 1, 1), + expectedError(ParserErrorCode.expectedToken, 6, 4), + expectedError(ParserErrorCode.expectedToken, 10, 1), + expectedError(ParserErrorCode.missingIdentifier, 10, 1), ], ); } diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart index aeb9d40cfe8..099c98465d0 100644 --- a/pkg/analyzer/test/generated/non_error_resolver_test.dart +++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart @@ -83,7 +83,7 @@ library L; export 'lib.dart'; export 'lib.dart'; ''', - [error(WarningCode.DUPLICATE_EXPORT, 37, 10)], + [error(WarningCode.duplicateExport, 37, 10)], ); } @@ -149,7 +149,7 @@ main() { new N2(); } ''', - [error(WarningCode.UNUSED_SHOWN_NAME, 44, 1)], + [error(WarningCode.unusedShownName, 44, 1)], ); } @@ -350,7 +350,7 @@ f() { -x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1)], + [error(WarningCode.unusedLocalVariable, 14, 1)], ); } @@ -436,7 +436,7 @@ main() { F f = (int i) async => i; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 43, 1)], + [error(WarningCode.unusedLocalVariable, 43, 1)], ); } @@ -564,7 +564,7 @@ f(list) async { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1)], + [error(WarningCode.unusedLocalVariable, 33, 1)], ); } @@ -576,7 +576,7 @@ f(list) async* { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1)], + [error(WarningCode.unusedLocalVariable, 34, 1)], ); } @@ -670,7 +670,7 @@ f() { dynamic x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 16, 1)], + [error(WarningCode.unusedLocalVariable, 16, 1)], ); } @@ -689,7 +689,7 @@ void testNewSet(Set setEls) { newSet: () => customNewSet = new Set()); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 51, 12)], + [error(WarningCode.unusedLocalVariable, 51, 12)], ); } @@ -814,7 +814,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, + CompileTimeErrorCode.undefinedConstructorInInitializerDefault, 54, 7, ), @@ -995,7 +995,7 @@ main() { const int x = 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 21, 1)], + [error(WarningCode.unusedLocalVariable, 21, 1)], ); } @@ -1113,7 +1113,7 @@ main() { var v = dynamic; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); } @@ -1301,7 +1301,7 @@ class A native 'something' { A() {} } ''', - [error(ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE, 8, 18)], + [error(ParserErrorCode.nativeClauseInNonSdkCode, 8, 18)], ); } @@ -1312,7 +1312,7 @@ class A native 'something' { final int x; } ''', - [error(ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE, 8, 18)], + [error(ParserErrorCode.nativeClauseInNonSdkCode, 8, 18)], ); } @@ -1663,9 +1663,9 @@ import 'lib.dart'; import 'lib.dart'; ''', [ - error(WarningCode.UNUSED_IMPORT, 21, 10), - error(WarningCode.UNUSED_IMPORT, 40, 10), - error(WarningCode.DUPLICATE_IMPORT, 40, 10), + error(WarningCode.unusedImport, 21, 10), + error(WarningCode.unusedImport, 40, 10), + error(WarningCode.duplicateImport, 40, 10), ], ); } @@ -1681,8 +1681,8 @@ import 'lib1.dart'; import 'lib2.dart'; ''', [ - error(WarningCode.UNUSED_IMPORT, 21, 11), - error(WarningCode.UNUSED_IMPORT, 41, 11), + error(WarningCode.unusedImport, 21, 11), + error(WarningCode.unusedImport, 41, 11), ], ); } @@ -1883,7 +1883,7 @@ class B extends A { _m() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 41, 2)], + [error(WarningCode.unusedElement, 41, 2)], ); } @@ -1901,7 +1901,7 @@ class B extends A { _m() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 41, 2)], + [error(WarningCode.unusedElement, 41, 2)], ); } @@ -2055,9 +2055,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 26, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 5), + error(WarningCode.unusedLocalVariable, 26, 5), + error(WarningCode.unusedLocalVariable, 41, 5), + error(WarningCode.unusedLocalVariable, 56, 5), ], ); } @@ -2254,8 +2254,8 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 93, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 97, 1), + error(WarningCode.unusedLocalVariable, 93, 1), + error(CompileTimeErrorCode.invalidAssignment, 97, 1), ], ); var z = @@ -2314,7 +2314,7 @@ h(bool b) { Map m = (b ? f : g)('x'); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 104, 1)], + [error(WarningCode.unusedLocalVariable, 104, 1)], ); var parameter = findNode.stringLiteral("'x'").correspondingParameter; expect(parameter!.library, isNull); @@ -2571,7 +2571,7 @@ f2() { !dynamic; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 7)], + [error(WarningCode.unusedLocalVariable, 47, 7)], ); } @@ -2704,7 +2704,7 @@ f() { var m = {'a' : 0, 'b' : 1}; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -2735,7 +2735,7 @@ class A { const A.b2(bool p) : v = true || p; } ''', - [error(WarningCode.DEAD_CODE, 167, 4)], + [error(WarningCode.deadCode, 167, 4)], ); } @@ -2864,8 +2864,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_METHOD, 0, 0), - error(CompileTimeErrorCode.UNDEFINED_METHOD, 0, 0), + error(CompileTimeErrorCode.undefinedMethod, 0, 0), + error(CompileTimeErrorCode.undefinedMethod, 0, 0), ], ); } @@ -2988,7 +2988,7 @@ f() { } h(x) {} ''', - [error(WarningCode.UNUSED_ELEMENT, 8, 1)], + [error(WarningCode.unusedElement, 8, 1)], ); } @@ -3061,7 +3061,7 @@ f() { var x = new A.x(); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 1)], + [error(WarningCode.unusedLocalVariable, 35, 1)], ); } @@ -3075,7 +3075,7 @@ f(A a) { var x = a.x(); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1)], + [error(WarningCode.unusedLocalVariable, 36, 1)], ); } @@ -3089,7 +3089,7 @@ f(A a) { var x = a.x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1)], + [error(WarningCode.unusedLocalVariable, 36, 1)], ); } @@ -3308,7 +3308,7 @@ main() { }; } ''', - [error(WarningCode.UNUSED_ELEMENT, 11, 1)], + [error(WarningCode.unusedElement, 11, 1)], ); } diff --git a/pkg/analyzer/test/generated/non_hint_code_test.dart b/pkg/analyzer/test/generated/non_hint_code_test.dart index 48fd1a10440..a32c9cde39a 100644 --- a/pkg/analyzer/test/generated/non_hint_code_test.dart +++ b/pkg/analyzer/test/generated/non_hint_code_test.dart @@ -27,7 +27,7 @@ f(var message, var dynamic_) { int s = message; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 94, 1)], + [error(WarningCode.unusedLocalVariable, 94, 1)], ); } @@ -45,7 +45,7 @@ f(var message) { int s = message; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 119, 1)], + [error(WarningCode.unusedLocalVariable, 119, 1)], ); } @@ -62,7 +62,7 @@ f(var message) { String s = message; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 100, 1)], + [error(WarningCode.unusedLocalVariable, 100, 1)], ); } @@ -152,7 +152,7 @@ class PubSuggestionCodeTest extends PubPackageResolutionTest { ''' import 'package:somepackage/other.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 0, 0)], + [error(CompileTimeErrorCode.uriDoesNotExist, 0, 0)], ); } diff --git a/pkg/analyzer/test/generated/patterns_parser_test.dart b/pkg/analyzer/test/generated/patterns_parser_test.dart index c47ff45e1bd..f57b3bddad9 100644 --- a/pkg/analyzer/test/generated/patterns_parser_test.dart +++ b/pkg/analyzer/test/generated/patterns_parser_test.dart @@ -30,7 +30,7 @@ void f(x) { } ''', errors: [ - error(ParserErrorCode.ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME, 29, 2), + error(ParserErrorCode.illegalPatternAssignmentVariableName, 29, 2), ], ); var node = findNode.singlePatternAssignment.pattern; @@ -52,7 +52,7 @@ void f(x) { } ''', errors: [ - error(ParserErrorCode.ILLEGAL_PATTERN_ASSIGNMENT_VARIABLE_NAME, 31, 4), + error(ParserErrorCode.illegalPatternAssignmentVariableName, 31, 4), ], ); var node = findNode.singlePatternAssignment.pattern; @@ -77,8 +77,8 @@ void f(x) { } ''', errors: [ - error(ParserErrorCode.MISSING_IDENTIFIER, 41, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 41, 1), + error(ParserErrorCode.missingIdentifier, 41, 1), + error(ParserErrorCode.expectedToken, 41, 1), ], ); var node = findNode.switchPatternCase('case'); @@ -644,7 +644,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 8)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 8)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -901,7 +901,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 8)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 8)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -928,7 +928,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 9)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 9)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -1325,7 +1325,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.ILLEGAL_PATTERN_IDENTIFIER_NAME, 36, 2)], + errors: [error(ParserErrorCode.illegalPatternIdentifierName, 36, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -1344,7 +1344,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.ILLEGAL_PATTERN_IDENTIFIER_NAME, 36, 4)], + errors: [error(ParserErrorCode.illegalPatternIdentifierName, 36, 4)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -3061,9 +3061,7 @@ void f() { [a, final d] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 23, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 23, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -3090,9 +3088,7 @@ void f() { [a, final int d] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 27, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 27, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -3121,9 +3117,7 @@ void f() { [a, int d] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 21, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 21, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -3151,9 +3145,7 @@ void f() { [a, var d] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 21, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 21, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -3180,9 +3172,7 @@ void f() { [a, var int d] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 25, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 25, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -3217,7 +3207,7 @@ f() { } catch (e) {} } ''', - errors: [error(ParserErrorCode.MISSING_IDENTIFIER, 26, 1)], + errors: [error(ParserErrorCode.missingIdentifier, 26, 1)], ); } @@ -4226,7 +4216,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 43, 1)], + errors: [error(ParserErrorCode.expectedToken, 43, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -4255,7 +4245,7 @@ void f(x) { } } ''', - errors: [error(ScannerErrorCode.EXPECTED_TOKEN, 59, 1)], + errors: [error(ScannerErrorCode.expectedToken, 59, 1)], ); var node = findNode.switchStatement('switch').members.single; assertParsedNodeText(node, r''' @@ -4291,7 +4281,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 43, 3)], + errors: [error(ParserErrorCode.expectedToken, 43, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -5345,7 +5335,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 50, 1)], + errors: [error(ParserErrorCode.expectedToken, 50, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -5378,8 +5368,8 @@ void f(Object o) { } ''', errors: [ - error(ParserErrorCode.EXPECTED_TOKEN, 59, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 59, 1), + error(ParserErrorCode.expectedToken, 59, 1), + error(ParserErrorCode.missingIdentifier, 59, 1), ], ); var node = findNode.switchPatternCase('case'); @@ -5419,7 +5409,7 @@ void f(x) { } } ''', - errors: [error(ScannerErrorCode.EXPECTED_TOKEN, 50, 1)], + errors: [error(ScannerErrorCode.expectedToken, 50, 1)], ); var node = findNode.switchStatement('switch').members.single; assertParsedNodeText(node, r''' @@ -5462,7 +5452,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 50, 5)], + errors: [error(ParserErrorCode.expectedToken, 50, 5)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -5522,7 +5512,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 2)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -5714,7 +5704,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 2)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -5739,7 +5729,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 2)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -5958,7 +5948,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 2)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -6150,7 +6140,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 2)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -6175,7 +6165,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 51, 2)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 51, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -6805,7 +6795,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 55, 1)], + errors: [error(ParserErrorCode.expectedToken, 55, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -6840,7 +6830,7 @@ void f(x) { } } ''', - errors: [error(ScannerErrorCode.EXPECTED_TOKEN, 71, 1)], + errors: [error(ScannerErrorCode.expectedToken, 71, 1)], ); var node = findNode.switchStatement('switch').members.single; assertParsedNodeText(node, r''' @@ -6882,7 +6872,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 55, 3)], + errors: [error(ParserErrorCode.expectedToken, 55, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -7585,9 +7575,9 @@ void main() { } ''', errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 33, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 42, 1), - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 42, 1), + error(ParserErrorCode.patternAssignmentDeclaresVariable, 33, 1), + error(ParserErrorCode.missingIdentifier, 42, 1), + error(ParserErrorCode.patternAssignmentDeclaresVariable, 42, 1), ], ); // No assertion on the parsed node text; all we are concerned with is that @@ -7606,8 +7596,7 @@ class C { ''', errors: [ error( - ParserErrorCode - .PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD, + ParserErrorCode.patternVariableDeclarationOutsideFunctionOrMethod, 16, 6, ), @@ -7650,8 +7639,7 @@ var (a, b) = (0, 1); ''', errors: [ error( - ParserErrorCode - .PATTERN_VARIABLE_DECLARATION_OUTSIDE_FUNCTION_OR_METHOD, + ParserErrorCode.patternVariableDeclarationOutsideFunctionOrMethod, 4, 6, ), @@ -7689,13 +7677,9 @@ f(x) { } ''', errors: [ - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 9, 9), - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 9, 9), - error( - ParserErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, - 17, - 1, - ), + error(ParserErrorCode.missingAssignableSelector, 9, 9), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 9, 9), + error(ParserErrorCode.recordLiteralOnePositionalNoTrailingComma, 17, 1), ], ); } @@ -7707,7 +7691,7 @@ f(x) { late var (_) = x; } ''', - errors: [error(ParserErrorCode.LATE_PATTERN_VARIABLE_DECLARATION, 9, 4)], + errors: [error(ParserErrorCode.latePatternVariableDeclaration, 9, 4)], ); var node = findNode.patternVariableDeclarationStatement('= x'); assertParsedNodeText(node, r''' @@ -8658,7 +8642,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 36, 5)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 36, 5)], ); var node = findNode.singleGuardedPattern; assertParsedNodeText(node, r''' @@ -10065,11 +10049,11 @@ void f(x) { } ''', errors: [ - error(ParserErrorCode.EXPECTED_TOKEN, 41, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 41, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 43, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 44, 1), - error(ParserErrorCode.UNEXPECTED_TOKEN, 44, 1), + error(ParserErrorCode.expectedToken, 41, 1), + error(ParserErrorCode.missingIdentifier, 41, 1), + error(ParserErrorCode.expectedToken, 43, 1), + error(ParserErrorCode.missingIdentifier, 44, 1), + error(ParserErrorCode.unexpectedToken, 44, 1), ], ); // We don't care what the parsed AST is, just that there are errors. @@ -10089,11 +10073,11 @@ void f(x) { } ''', errors: [ - error(ParserErrorCode.EXPECTED_TOKEN, 40, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 40, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 42, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 43, 1), - error(ParserErrorCode.UNEXPECTED_TOKEN, 43, 1), + error(ParserErrorCode.expectedToken, 40, 1), + error(ParserErrorCode.missingIdentifier, 40, 1), + error(ParserErrorCode.expectedToken, 42, 1), + error(ParserErrorCode.missingIdentifier, 43, 1), + error(ParserErrorCode.unexpectedToken, 43, 1), ], ); // We don't care what the parsed AST is, just that there are errors. @@ -10399,7 +10383,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 36, 4)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 36, 4)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -10422,7 +10406,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.INVALID_INSIDE_UNARY_PATTERN, 36, 3)], + errors: [error(ParserErrorCode.invalidInsideUnaryPattern, 36, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -10687,9 +10671,9 @@ main() { int var = 0; ''', errors: [ - error(ParserErrorCode.EXPECTED_TOKEN, 11, 3), - error(ParserErrorCode.MISSING_IDENTIFIER, 19, 1), - error(ScannerErrorCode.EXPECTED_TOKEN, 24, 1), + error(ParserErrorCode.expectedToken, 11, 3), + error(ParserErrorCode.missingIdentifier, 19, 1), + error(ScannerErrorCode.expectedToken, 24, 1), ], ); } @@ -10809,7 +10793,7 @@ f(x) => switch(x) { int() => 0 : 1 }; ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 33, 1)], + errors: [error(ParserErrorCode.expectedToken, 33, 1)], ); var node = findNode.switchExpression('switch'); assertParsedNodeText(node, r''' @@ -10845,7 +10829,7 @@ f(x) => [switch(x) { int() => 0 : 1 }, 0]; ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 34, 1)], + errors: [error(ParserErrorCode.expectedToken, 34, 1)], ); var node = findNode.listLiteral('['); assertParsedNodeText(node, r''' @@ -10887,7 +10871,7 @@ f(x) => switch(x) { int() => 0 : (1, 2) }; ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 33, 1)], + errors: [error(ParserErrorCode.expectedToken, 33, 1)], ); var node = findNode.switchExpression('switch'); assertParsedNodeText(node, r''' @@ -10922,8 +10906,8 @@ f(x) => switch (x) { }; ''', errors: [ - error(ParserErrorCode.UNEXPECTED_TOKEN, 23, 4), - error(ParserErrorCode.UNEXPECTED_TOKEN, 42, 4), + error(ParserErrorCode.unexpectedToken, 23, 4), + error(ParserErrorCode.unexpectedToken, 42, 4), ], ); var node = findNode.switchExpression('switch'); @@ -10965,8 +10949,8 @@ f(x) => switch (x) { }; ''', errors: [ - error(ParserErrorCode.EXPECTED_TOKEN, 24, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 36, 1), + error(ParserErrorCode.expectedToken, 24, 1), + error(ParserErrorCode.expectedToken, 36, 1), ], ); var node = findNode.switchExpression('switch'); @@ -11007,7 +10991,7 @@ f(x) => switch (x) { default => 'other' }; ''', - errors: [error(ParserErrorCode.DEFAULT_IN_SWITCH_EXPRESSION, 37, 7)], + errors: [error(ParserErrorCode.defaultInSwitchExpression, 37, 7)], ); var node = findNode.switchExpression('switch'); assertParsedNodeText(node, r''' @@ -11048,7 +11032,7 @@ f(x) => switch (x) { _ => 2 }; ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 41, 2)], + errors: [error(ParserErrorCode.expectedToken, 41, 2)], ); var node = findNode.switchExpression('switch'); assertParsedNodeText(node, r''' @@ -11095,7 +11079,7 @@ f(x) => switch (x) { _ => 2 }; ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 41, 2)], + errors: [error(ParserErrorCode.expectedToken, 41, 2)], ); var node = findNode.switchExpression('switch'); assertParsedNodeText(node, r''' @@ -11140,7 +11124,7 @@ f(x) => switch(x) { double() => 1 }; ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 35, 6)], + errors: [error(ParserErrorCode.expectedToken, 35, 6)], ); var node = findNode.switchExpression('switch'); assertParsedNodeText(node, r''' @@ -11184,7 +11168,7 @@ f(x) => switch (x) { 2 => 'two' }; ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 33, 1)], + errors: [error(ParserErrorCode.expectedToken, 33, 1)], ); var node = findNode.switchExpression('switch'); assertParsedNodeText(node, r''' @@ -11226,7 +11210,7 @@ f(x) => switch (x) { < 1 => 0 }; ''', - errors: [error(ParserErrorCode.EXPECTED_TOKEN, 40, 2)], + errors: [error(ParserErrorCode.expectedToken, 40, 2)], ); // No assertion on the parsed node text; all we are concerned with is that // the parser doesn't crash. @@ -11278,7 +11262,7 @@ void f(Object? x) { }; } ''', - errors: [error(ParserErrorCode.MISSING_IDENTIFIER, 45, 2)], + errors: [error(ParserErrorCode.missingIdentifier, 45, 2)], ); var node = findNode.switchPatternCase('case'); assertParsedNodeText(node, r''' @@ -11306,9 +11290,9 @@ void f(Object? x) { } ''', errors: [ - error(ParserErrorCode.MISSING_IDENTIFIER, 48, 2), - error(ParserErrorCode.EXPECTED_TOKEN, 48, 2), - error(ParserErrorCode.EXPECTED_TOKEN, 48, 2), + error(ParserErrorCode.missingIdentifier, 48, 2), + error(ParserErrorCode.expectedToken, 48, 2), + error(ParserErrorCode.expectedToken, 48, 2), ], ); var node = findNode.switchPatternCase('case'); @@ -11348,8 +11332,8 @@ void f(Object? x) { } ''', errors: [ - error(ParserErrorCode.MISSING_IDENTIFIER, 45, 2), - error(ParserErrorCode.EXPECTED_TOKEN, 45, 2), + error(ParserErrorCode.missingIdentifier, 45, 2), + error(ParserErrorCode.expectedToken, 45, 2), ], ); var node = findNode.switchPatternCase('case'); @@ -11377,8 +11361,8 @@ void f(Object? x) { } ''', errors: [ - error(ParserErrorCode.MISSING_IDENTIFIER, 48, 2), - error(ParserErrorCode.EXPECTED_TOKEN, 48, 2), + error(ParserErrorCode.missingIdentifier, 48, 2), + error(ParserErrorCode.expectedToken, 48, 2), ], ); var node = findNode.switchPatternCase('case'); @@ -11407,9 +11391,9 @@ SwitchPatternCase void f(Object? x) => switch (x) {if}; ''', errors: [ - error(ParserErrorCode.MISSING_IDENTIFIER, 33, 2), - error(ParserErrorCode.EXPECTED_TOKEN, 33, 2), - error(ParserErrorCode.EXPECTED_TOKEN, 33, 2), + error(ParserErrorCode.missingIdentifier, 33, 2), + error(ParserErrorCode.expectedToken, 33, 2), + error(ParserErrorCode.expectedToken, 33, 2), ], ); var node = findNode.switchExpression('if'); @@ -11528,7 +11512,7 @@ void f(x) { ''', errors: [ error( - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT, + ParserErrorCode.variablePatternKeywordInDeclarationContext, 19, 5, ), @@ -11609,7 +11593,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.ILLEGAL_PATTERN_VARIABLE_NAME, 40, 2)], + errors: [error(ParserErrorCode.illegalPatternVariableName, 40, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -11628,7 +11612,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.ILLEGAL_PATTERN_VARIABLE_NAME, 40, 4)], + errors: [error(ParserErrorCode.illegalPatternVariableName, 40, 4)], ); var node = findNode.singleGuardedPattern.pattern; assertParsedNodeText(node, r''' @@ -11854,7 +11838,7 @@ void f(x) { ''', errors: [ error( - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT, + ParserErrorCode.variablePatternKeywordInDeclarationContext, 19, 3, ), @@ -11973,7 +11957,7 @@ void f(int x) { ''', errors: [ error( - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT, + ParserErrorCode.variablePatternKeywordInDeclarationContext, 23, 3, ), @@ -12001,7 +11985,7 @@ void f(x) { ''', errors: [ error( - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT, + ParserErrorCode.variablePatternKeywordInDeclarationContext, 19, 3, ), @@ -12030,7 +12014,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.VAR_AND_TYPE, 36, 3)], + errors: [error(ParserErrorCode.varAndType, 36, 3)], ); var node = findNode.singleGuardedPattern; assertParsedNodeText(node, r''' @@ -12053,7 +12037,7 @@ void f(x) { } } ''', - errors: [error(ParserErrorCode.VAR_AND_TYPE, 36, 3)], + errors: [error(ParserErrorCode.varAndType, 36, 3)], ); var node = findNode.singleGuardedPattern; assertParsedNodeText(node, r''' @@ -12401,9 +12385,7 @@ void f() { [a, final _] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 23, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 23, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -12430,9 +12412,7 @@ void f() { [a, final int _] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 27, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 27, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -12461,9 +12441,7 @@ void f() { [a, int _] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 21, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 21, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -12491,9 +12469,7 @@ void f() { [a, var _] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 21, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 21, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' @@ -12520,9 +12496,7 @@ void f() { [a, var int _] = y; } ''', - errors: [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 25, 1), - ], + errors: [error(ParserErrorCode.patternAssignmentDeclaresVariable, 25, 1)], ); var node = findNode.patternAssignment('='); assertParsedNodeText(node, r''' diff --git a/pkg/analyzer/test/generated/recovery_parser_test.dart b/pkg/analyzer/test/generated/recovery_parser_test.dart index 083ae282b8a..e31089e54e8 100644 --- a/pkg/analyzer/test/generated/recovery_parser_test.dart +++ b/pkg/analyzer/test/generated/recovery_parser_test.dart @@ -24,7 +24,7 @@ main() { class RecoveryParserTest extends FastaParserTestCase { void test_additiveExpression_missing_LHS() { var expression = - parseExpression("+ y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("+ y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -35,8 +35,8 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "+", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -48,7 +48,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_additiveExpression_missing_RHS() { var expression = - parseExpression("x +", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x +", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -56,7 +56,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_additiveExpression_missing_RHS_super() { var expression = - parseExpression("super +", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("super +", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -67,9 +67,9 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "* +", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -81,9 +81,9 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "+ *", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -95,8 +95,8 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "super + +", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -105,7 +105,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_assignableSelector() { var expression = - parseExpression("a.b[]", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("a.b[]", codes: [ParserErrorCode.missingIdentifier]) as IndexExpression; var index = expression.index; expect(index, isSimpleIdentifier); @@ -114,7 +114,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_assignmentExpression_missing_compound1() { var expression = - parseExpression("= y = 0", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("= y = 0", codes: [ParserErrorCode.missingIdentifier]) as AssignmentExpression; Expression syntheticExpression = expression.leftHandSide; expect(syntheticExpression, isSimpleIdentifier); @@ -123,7 +123,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_assignmentExpression_missing_compound2() { var expression = - parseExpression("x = = 0", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x = = 0", codes: [ParserErrorCode.missingIdentifier]) as AssignmentExpression; Expression syntheticExpression = (expression.rightHandSide as AssignmentExpression).leftHandSide; @@ -133,7 +133,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_assignmentExpression_missing_compound3() { var expression = - parseExpression("x = y =", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x = y =", codes: [ParserErrorCode.missingIdentifier]) as AssignmentExpression; Expression syntheticExpression = (expression.rightHandSide as AssignmentExpression).rightHandSide; @@ -143,7 +143,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_assignmentExpression_missing_LHS() { var expression = - parseExpression("= 0", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("= 0", codes: [ParserErrorCode.missingIdentifier]) as AssignmentExpression; expect(expression.leftHandSide, isSimpleIdentifier); expect(expression.leftHandSide.isSynthetic, isTrue); @@ -151,7 +151,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_assignmentExpression_missing_RHS() { var expression = - parseExpression("x =", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x =", codes: [ParserErrorCode.missingIdentifier]) as AssignmentExpression; expect(expression.leftHandSide, isSimpleIdentifier); expect(expression.rightHandSide.isSynthetic, isTrue); @@ -159,7 +159,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseAndExpression_missing_LHS() { var expression = - parseExpression("& y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("& y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -170,8 +170,8 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "&", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -183,7 +183,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseAndExpression_missing_RHS() { var expression = - parseExpression("x &", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x &", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -191,7 +191,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseAndExpression_missing_RHS_super() { var expression = - parseExpression("super &", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("super &", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -202,9 +202,9 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "== &&", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -216,9 +216,9 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "&& ==", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -230,8 +230,8 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "super & &", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -240,7 +240,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseOrExpression_missing_LHS() { var expression = - parseExpression("| y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("| y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -251,8 +251,8 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "|", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -264,7 +264,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseOrExpression_missing_RHS() { var expression = - parseExpression("x |", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x |", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -272,7 +272,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseOrExpression_missing_RHS_super() { var expression = - parseExpression("super |", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("super |", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -283,9 +283,9 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "^ |", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -297,9 +297,9 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "| ^", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -311,8 +311,8 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "super | |", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -321,7 +321,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseXorExpression_missing_LHS() { var expression = - parseExpression("^ y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("^ y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -332,8 +332,8 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "^", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -345,7 +345,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseXorExpression_missing_RHS() { var expression = - parseExpression("x ^", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x ^", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -353,7 +353,7 @@ class RecoveryParserTest extends FastaParserTestCase { void test_bitwiseXorExpression_missing_RHS_super() { var expression = - parseExpression("super ^", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("super ^", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -364,9 +364,9 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "& ^", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -378,9 +378,9 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "^ &", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -392,8 +392,8 @@ class RecoveryParserTest extends FastaParserTestCase { parseExpression( "super ^ ^", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -407,7 +407,7 @@ class A {} class B = Object with A {}''', codes: // TODO(danrubel): Consolidate and improve error message. - [ParserErrorCode.EXPECTED_EXECUTABLE, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedExecutable, ParserErrorCode.expectedToken], ); } @@ -415,10 +415,10 @@ class B = Object with A {}''', createParser('import "/testB.dart" show @'); parser.parseCompilationUnit2(); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 26, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 26, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 26, 1), - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 27, 0), + expectedError(ParserErrorCode.missingIdentifier, 26, 1), + expectedError(ParserErrorCode.expectedToken, 26, 1), + expectedError(ParserErrorCode.expectedToken, 26, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 27, 0), ]); } @@ -426,14 +426,14 @@ class B = Object with A {}''', createParser('import "/testB.dart" show ;'); parser.parseCompilationUnit2(); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 26, 1), + expectedError(ParserErrorCode.missingIdentifier, 26, 1), ]); } void test_conditionalExpression_missingElse() { Expression expression = parseExpression( 'x ? y :', - codes: [ParserErrorCode.MISSING_IDENTIFIER], + codes: [ParserErrorCode.missingIdentifier], ); expectNotNullIfNoErrors(expression); expect(expression, isConditionalExpression); @@ -445,7 +445,7 @@ class B = Object with A {}''', void test_conditionalExpression_missingThen() { Expression expression = parseExpression( 'x ? : z', - codes: [ParserErrorCode.MISSING_IDENTIFIER], + codes: [ParserErrorCode.missingIdentifier], ); expectNotNullIfNoErrors(expression); expect(expression, isConditionalExpression); @@ -457,25 +457,21 @@ class B = Object with A {}''', void test_conditionalExpression_super() { parseExpression( 'x ? super : z', - errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 4, 5), - ], + errors: [expectedError(ParserErrorCode.missingAssignableSelector, 4, 5)], ); } void test_conditionalExpression_super2() { parseExpression( 'x ? z : super', - errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 8, 5), - ], + errors: [expectedError(ParserErrorCode.missingAssignableSelector, 8, 5)], ); } void test_declarationBeforeDirective() { CompilationUnit unit = parseCompilationUnit( "class foo { } import 'bar.dart';", - codes: [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], + codes: [ParserErrorCode.directiveAfterDeclaration], ); expect(unit.directives, hasLength(1)); expect(unit.declarations, hasLength(1)); @@ -488,9 +484,9 @@ class B = Object with A {}''', var result = parseExpression( ".", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPERIMENT_NOT_ENABLED, - ParserErrorCode.EXPERIMENT_NOT_ENABLED, + ParserErrorCode.missingIdentifier, + ParserErrorCode.experimentNotEnabled, + ParserErrorCode.experimentNotEnabled, ], ); var expression = result as DotShorthandPropertyAccess; @@ -500,7 +496,7 @@ class B = Object with A {}''', void test_equalityExpression_missing_LHS() { var expression = - parseExpression("== y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("== y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -511,8 +507,8 @@ class B = Object with A {}''', parseExpression( "==", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -524,7 +520,7 @@ class B = Object with A {}''', void test_equalityExpression_missing_RHS() { var expression = - parseExpression("x ==", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x ==", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -532,7 +528,7 @@ class B = Object with A {}''', void test_equalityExpression_missing_RHS_super() { var expression = - parseExpression("super ==", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("super ==", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -542,9 +538,9 @@ class B = Object with A {}''', parseExpression( "== is", codes: [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.expectedTypeName, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ); } @@ -554,9 +550,9 @@ class B = Object with A {}''', parseExpression( "super == ==", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.equalityCannotBeEqualityOperand, ], ) as BinaryExpression; @@ -566,9 +562,7 @@ class B = Object with A {}''', void test_equalityExpression_superRHS() { parseExpression( "1 == super", - errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 5, 5), - ], + errors: [expectedError(ParserErrorCode.missingAssignableSelector, 5, 5)], ); } @@ -576,7 +570,7 @@ class B = Object with A {}''', List result = parseExpressionList(', 2, 3, 4'); expectNotNullIfNoErrors(result); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.MISSING_IDENTIFIER]); + listener.assertErrorsWithCodes([ParserErrorCode.missingIdentifier]); // listener.assertErrors( // [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 0, 1)]); expect(result, hasLength(4)); @@ -589,7 +583,7 @@ class B = Object with A {}''', List result = parseExpressionList('1, 2, , 4'); expectNotNullIfNoErrors(result); // TODO(brianwilkerson): Convert codes to errors when highlighting is fixed. - listener.assertErrorsWithCodes([ParserErrorCode.MISSING_IDENTIFIER]); + listener.assertErrorsWithCodes([ParserErrorCode.missingIdentifier]); // listener.assertErrors( // [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 1)]); expect(result, hasLength(4)); @@ -611,7 +605,7 @@ class B = Object with A {}''', void test_functionExpression_in_ConstructorFieldInitializer() { CompilationUnit unit = parseCompilationUnit( "class A { A() : a = (){}; var v; }", - codes: [ParserErrorCode.EXPECTED_CLASS_MEMBER], + codes: [ParserErrorCode.expectedClassMember], ); // Make sure we recovered and parsed "var v" correctly ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration; @@ -628,21 +622,19 @@ class B = Object with A {}''', parseExpression( "m(f() => 0);", expectedEndOffset: 11, - codes: [ParserErrorCode.NAMED_FUNCTION_EXPRESSION], + codes: [ParserErrorCode.namedFunctionExpression], ); } void test_ifStatement_noElse_statement() { parseStatement('if (x v) f(x);'); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 6, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 6, 1)]); } void test_importDirectivePartial_as() { CompilationUnit unit = parseCompilationUnit( "import 'b.dart' d as b;", - codes: [ParserErrorCode.UNEXPECTED_TOKEN], + codes: [ParserErrorCode.unexpectedToken], ); var importDirective = unit.childEntities.first as ImportDirective; expect(importDirective.asKeyword, isNotNull); @@ -653,7 +645,7 @@ class B = Object with A {}''', void test_importDirectivePartial_hide() { CompilationUnit unit = parseCompilationUnit( "import 'b.dart' d hide foo;", - codes: [ParserErrorCode.UNEXPECTED_TOKEN], + codes: [ParserErrorCode.unexpectedToken], ); var importDirective = unit.childEntities.first as ImportDirective; expect(importDirective.combinators, hasLength(1)); @@ -664,7 +656,7 @@ class B = Object with A {}''', void test_importDirectivePartial_show() { CompilationUnit unit = parseCompilationUnit( "import 'b.dart' d show foo;", - codes: [ParserErrorCode.UNEXPECTED_TOKEN], + codes: [ParserErrorCode.unexpectedToken], ); var importDirective = unit.childEntities.first as ImportDirective; expect(importDirective.combinators, hasLength(1)); @@ -675,10 +667,7 @@ class B = Object with A {}''', void test_incomplete_conditionalExpression() { parseExpression( "x ? 0", - codes: [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ], + codes: [ParserErrorCode.expectedToken, ParserErrorCode.missingIdentifier], ); } @@ -687,7 +676,7 @@ class B = Object with A {}''', var member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_INITIALIZER, 4, 1), + expectedError(ParserErrorCode.missingInitializer, 4, 1), ]); } @@ -696,7 +685,7 @@ class B = Object with A {}''', var member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 6, 1), + expectedError(ParserErrorCode.missingAssignmentInInitializer, 6, 1), ]); expect(member, isConstructorDeclaration); NodeList initializers = @@ -715,8 +704,8 @@ class B = Object with A {}''', var member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 11, 1), - expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 6, 4), + expectedError(ParserErrorCode.expectedToken, 11, 1), + expectedError(ParserErrorCode.missingAssignmentInInitializer, 6, 4), ]); } @@ -725,7 +714,7 @@ class B = Object with A {}''', var member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 6, 4), + expectedError(ParserErrorCode.missingAssignmentInInitializer, 6, 4), ]); } @@ -734,8 +723,8 @@ class B = Object with A {}''', var member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 12, 1), - expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 6, 4), + expectedError(ParserErrorCode.missingIdentifier, 12, 1), + expectedError(ParserErrorCode.missingAssignmentInInitializer, 6, 4), ]); } @@ -744,14 +733,14 @@ class B = Object with A {}''', var member = parser.parseClassMember('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 6, 1), + expectedError(ParserErrorCode.missingAssignmentInInitializer, 6, 1), ]); } void test_incomplete_functionExpression() { var expression = parseExpression( "() a => null", - errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 3, 1)], + errors: [expectedError(ParserErrorCode.unexpectedToken, 3, 1)], ); var functionExpression = expression as FunctionExpression; expect(functionExpression.parameters!.parameters, hasLength(0)); @@ -760,7 +749,7 @@ class B = Object with A {}''', void test_incomplete_functionExpression2() { var expression = parseExpression( "() a {}", - errors: [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 3, 1)], + errors: [expectedError(ParserErrorCode.unexpectedToken, 3, 1)], ); var functionExpression = expression as FunctionExpression; expect(functionExpression.parameters!.parameters, hasLength(0)); @@ -778,8 +767,8 @@ Map map) { return result; }''', errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 24), - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 0, 3), + expectedError(ParserErrorCode.expectedToken, 12, 24), + expectedError(ParserErrorCode.missingFunctionParameters, 0, 3), ], ); } @@ -787,7 +776,7 @@ Map map) { void test_incomplete_topLevelFunction() { parseCompilationUnit( "foo();", - codes: [ParserErrorCode.MISSING_FUNCTION_BODY], + codes: [ParserErrorCode.missingFunctionBody], ); } @@ -795,8 +784,8 @@ Map map) { CompilationUnit unit = parseCompilationUnit( "String", errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 0, 6), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 6), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 0, 6), + expectedError(ParserErrorCode.expectedToken, 0, 6), ], ); NodeList declarations = unit.declarations; @@ -813,10 +802,7 @@ Map map) { void test_incomplete_topLevelVariable_const() { CompilationUnit unit = parseCompilationUnit( "const ", - codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ], + codes: [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ); NodeList declarations = unit.declarations; expect(declarations, hasLength(1)); @@ -832,10 +818,7 @@ Map map) { void test_incomplete_topLevelVariable_final() { CompilationUnit unit = parseCompilationUnit( "final ", - codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ], + codes: [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ); NodeList declarations = unit.declarations; expect(declarations, hasLength(1)); @@ -851,10 +834,7 @@ Map map) { void test_incomplete_topLevelVariable_var() { CompilationUnit unit = parseCompilationUnit( "var ", - codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ], + codes: [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ); NodeList declarations = unit.declarations; expect(declarations, hasLength(1)); @@ -873,10 +853,7 @@ Map map) { class C { const }''', - codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ], + codes: [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ); NodeList declarations = unit.declarations; expect(declarations, hasLength(1)); @@ -901,10 +878,7 @@ class C { class C { final }''', - codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ], + codes: [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ); NodeList declarations = unit.declarations; expect(declarations, hasLength(1)); @@ -930,8 +904,8 @@ class C { static c }''', codes: [ - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingConstFinalVarOrType, + ParserErrorCode.expectedToken, ], ); NodeList declarations = unit.declarations; @@ -958,7 +932,7 @@ class C { class C { static c x }''', - codes: [ParserErrorCode.EXPECTED_TOKEN], + codes: [ParserErrorCode.expectedToken], ); NodeList declarations = unit.declarations; expect(declarations, hasLength(1)); @@ -985,8 +959,8 @@ class C { A }''', codes: [ - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingConstFinalVarOrType, + ParserErrorCode.expectedToken, ], ); NodeList declarations = unit.declarations; @@ -1013,10 +987,7 @@ class C { class C { var }''', - codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ], + codes: [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ); NodeList declarations = unit.declarations; expect(declarations, hasLength(1)); @@ -1040,8 +1011,8 @@ class C { // entry parsing is enabled by default var statement = parseStatement('for (String item i) {}') as ForStatement; listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 4), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 17, 1), + expectedError(ParserErrorCode.expectedToken, 12, 4), + expectedError(ParserErrorCode.expectedToken, 17, 1), ]); expect(statement, isForStatement); expect(statement.toSource(), 'for (String item; i;) {}'); @@ -1055,8 +1026,8 @@ class C { void test_incompleteForEach2() { var statement = parseStatement('for (String item i) {}') as ForStatement; listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 12, 4), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 17, 1), + expectedError(ParserErrorCode.expectedToken, 12, 4), + expectedError(ParserErrorCode.expectedToken, 17, 1), ]); expect(statement.toSource(), 'for (String item; i;) {}'); var forLoopParts = statement.forLoopParts as ForPartsWithDeclarations; @@ -1068,9 +1039,7 @@ class C { void test_incompleteLocalVariable_atTheEndOfBlock() { Statement statement = parseStatement('String v }', expectedEndOffset: 9); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 1)]); expect(statement, isVariableDeclarationStatement); expect(statement.toSource(), 'String v;'); } @@ -1078,8 +1047,8 @@ class C { void test_incompleteLocalVariable_atTheEndOfBlock_modifierOnly() { Statement statement = parseStatement('final }', expectedEndOffset: 6); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 5), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 1), + expectedError(ParserErrorCode.expectedToken, 0, 5), + expectedError(ParserErrorCode.missingIdentifier, 6, 1), ]); expect(statement, isVariableDeclarationStatement); expect(statement.toSource(), 'final ;'); @@ -1090,9 +1059,7 @@ class C { 'String v String v2;', expectedEndOffset: 9, ); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 1)]); expect(statement, isVariableDeclarationStatement); expect(statement.toSource(), 'String v;'); } @@ -1102,18 +1069,14 @@ class C { 'String v if (true) {}', expectedEndOffset: 9, ); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 1)]); expect(statement, isVariableDeclarationStatement); expect(statement.toSource(), 'String v;'); } void test_incompleteLocalVariable_beforeNextBlock() { Statement statement = parseStatement('String v {}', expectedEndOffset: 9); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 7, 1)]); expect(statement, isVariableDeclarationStatement); expect(statement.toSource(), 'String v;'); } @@ -1124,7 +1087,7 @@ class C { expectedEndOffset: 15, ); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 13, 1), + expectedError(ParserErrorCode.expectedToken, 13, 1), ]); expect(statement, isVariableDeclarationStatement); expect(statement.toSource(), 'List v;'); @@ -1136,7 +1099,7 @@ class C { class C { final List declarations = unit.declarations; @@ -1166,7 +1129,7 @@ class C { r''' class C declarations = unit.declarations; @@ -1186,7 +1149,7 @@ class C { }''', - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 21, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 21, 1)], ); // one class List declarations = unit.declarations; @@ -1206,7 +1169,7 @@ class C { r''' class C declarations = unit.declarations; @@ -1224,22 +1187,22 @@ class C {}; }", - codes: [ParserErrorCode.LITERAL_WITH_CLASS], + codes: [ParserErrorCode.literalWithClass], ); parseCompilationUnit( "class C { var f = new Map {}; }", - codes: [ParserErrorCode.LITERAL_WITH_CLASS_AND_NEW], + codes: [ParserErrorCode.literalWithClassAndNew], ); parseCompilationUnit( "class C { var f = new {}; }", - codes: [ParserErrorCode.LITERAL_WITH_NEW], + codes: [ParserErrorCode.literalWithNew], ); } @@ -1249,7 +1212,7 @@ class C g; }''', - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 18, 6)], + errors: [expectedError(ParserErrorCode.expectedToken, 18, 6)], ); // one class List declarations = unit.declarations; @@ -1266,7 +1229,7 @@ class C { void test_invalidTypeParameters_super() { parseCompilationUnit( 'class C {}', - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 8, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 8, 1)], ); } @@ -1274,10 +1237,10 @@ class C { CompilationUnit unit = parseCompilationUnit( "class Bar {m(x){if (x is ) return;if (x is !)}}", codes: [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedTypeName, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], ); ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration; @@ -1301,8 +1264,8 @@ class C { var unit = parseCompilationUnit( 'class C { get C.named => null; }', errors: [ - expectedError(ParserErrorCode.GETTER_CONSTRUCTOR, 10, 3), - expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 14, 1), + expectedError(ParserErrorCode.getterConstructor, 10, 3), + expectedError(ParserErrorCode.missingMethodParameters, 14, 1), ], ); var declaration = unit.declarations[0] as ClassDeclaration; @@ -1314,7 +1277,7 @@ class C { void test_issue_34610_initializers() { var unit = parseCompilationUnit( 'class C { C.named : super(); }', - errors: [expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 10, 1)], + errors: [expectedError(ParserErrorCode.missingMethodParameters, 10, 1)], ); var declaration = unit.declarations[0] as ClassDeclaration; var constructor = declaration.members[0] as ConstructorDeclaration; @@ -1326,7 +1289,7 @@ class C { void test_issue_34610_missing_param() { var unit = parseCompilationUnit( 'class C { C => null; }', - errors: [expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 10, 1)], + errors: [expectedError(ParserErrorCode.missingMethodParameters, 10, 1)], ); var declaration = unit.declarations[0] as ClassDeclaration; var constructor = declaration.members[0] as ConstructorDeclaration; @@ -1338,7 +1301,7 @@ class C { void test_issue_34610_named_missing_param() { var unit = parseCompilationUnit( 'class C { C.named => null; }', - errors: [expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 10, 1)], + errors: [expectedError(ParserErrorCode.missingMethodParameters, 10, 1)], ); var declaration = unit.declarations[0] as ClassDeclaration; var constructor = declaration.members[0] as ConstructorDeclaration; @@ -1351,8 +1314,8 @@ class C { var unit = parseCompilationUnit( 'class C { set C.named => null; }', errors: [ - expectedError(ParserErrorCode.SETTER_CONSTRUCTOR, 10, 3), - expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 14, 1), + expectedError(ParserErrorCode.setterConstructor, 10, 3), + expectedError(ParserErrorCode.missingMethodParameters, 14, 1), ], ); var declaration = unit.declarations[0] as ClassDeclaration; @@ -1366,13 +1329,13 @@ class C { // TODO(brianwilkerson): We could do better with this. parseCompilationUnit( "do() {}", - codes: [ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD], + codes: [ParserErrorCode.expectedIdentifierButGotKeyword], ); } void test_logicalAndExpression_missing_LHS() { var expression = - parseExpression("&& y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("&& y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -1383,8 +1346,8 @@ class C { parseExpression( "&&", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1396,7 +1359,7 @@ class C { void test_logicalAndExpression_missing_RHS() { var expression = - parseExpression("x &&", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x &&", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -1407,9 +1370,9 @@ class C { parseExpression( "| &&", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1421,9 +1384,9 @@ class C { parseExpression( "&& |", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1432,7 +1395,7 @@ class C { void test_logicalOrExpression_missing_LHS() { var expression = - parseExpression("|| y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("|| y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -1443,8 +1406,8 @@ class C { parseExpression( "||", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1456,7 +1419,7 @@ class C { void test_logicalOrExpression_missing_RHS() { var expression = - parseExpression("x ||", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x ||", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -1467,9 +1430,9 @@ class C { parseExpression( "&& ||", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1481,9 +1444,9 @@ class C { parseExpression( "|| &&", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1493,7 +1456,7 @@ class C { void test_method_missingBody() { parseCompilationUnit( "class C { b() }", - errors: [expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 14, 1)], + errors: [expectedError(ParserErrorCode.missingFunctionBody, 14, 1)], ); } @@ -1501,7 +1464,7 @@ class C { var expression = parseExpression( "f(x: 1 y: 2)", - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 7, 1)], ) as MethodInvocation; NodeList arguments = expression.argumentList.arguments; @@ -1512,9 +1475,7 @@ class C { createParser('(a b: c)'); ArgumentList argumentList = parser.parseArgumentList(); expectNotNullIfNoErrors(argumentList); - listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 3, 1), - ]); + listener.assertErrors([expectedError(ParserErrorCode.expectedToken, 3, 1)]); expect(argumentList.arguments, hasLength(2)); } @@ -1525,7 +1486,7 @@ class C { int length {} void foo() {} }''', - errors: [expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 16, 6)], + errors: [expectedError(ParserErrorCode.missingMethodParameters, 16, 6)], ); expect(unit, isNotNull); ClassDeclaration classDeclaration = @@ -1543,7 +1504,7 @@ class C { var member = parser.parseClassMemberOrNull('C'); expectNotNullIfNoErrors(member); listener.assertErrors([ - expectedError(ParserErrorCode.EXPECTED_CLASS_MEMBER, 10, 1), + expectedError(ParserErrorCode.expectedClassMember, 10, 1), ]); // TODO(danrubel): Consider generating a sub method so that the // existing annotation can be associated with a class member. @@ -1580,8 +1541,8 @@ class C { CompilationUnit unit = parseCompilationUnit( 'String n x = "";', codes: [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, + ParserErrorCode.expectedToken, + ParserErrorCode.missingConstFinalVarOrType, ], ); expect(unit, isNotNull); @@ -1593,7 +1554,7 @@ class C { void test_multiplicativeExpression_missing_LHS() { var expression = - parseExpression("* y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("* y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -1604,8 +1565,8 @@ class C { parseExpression( "*", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1617,7 +1578,7 @@ class C { void test_multiplicativeExpression_missing_RHS() { var expression = - parseExpression("x *", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x *", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -1625,7 +1586,7 @@ class C { void test_multiplicativeExpression_missing_RHS_super() { var expression = - parseExpression("super *", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("super *", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -1633,14 +1594,14 @@ class C { void test_multiplicativeExpression_precedence_unary_left() { var expression = - parseExpression("-x *", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("-x *", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isPrefixExpression); } void test_multiplicativeExpression_precedence_unary_right() { var expression = - parseExpression("* -y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("* -y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isPrefixExpression); } @@ -1650,9 +1611,9 @@ class C { parseExpression( "super == ==", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.equalityCannotBeEqualityOperand, ], ) as BinaryExpression; @@ -1663,8 +1624,8 @@ class C { CompilationUnit unit = parseCompilationUnit( 'class A { b(c: 0, Foo d: 0, e){} }', errors: [ - expectedError(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, 13, 1), - expectedError(ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, 23, 1), + expectedError(ParserErrorCode.namedParameterOutsideGroup, 13, 1), + expectedError(ParserErrorCode.namedParameterOutsideGroup, 23, 1), ], ); expect(unit.declarations, hasLength(1)); @@ -1682,19 +1643,19 @@ class C { parseCompilationUnit( "import dart:io; class C {}", errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 6), - expectedError(ParserErrorCode.EXPECTED_STRING_LITERAL, 7, 4), - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 7, 4), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 4), - expectedError(ParserErrorCode.EXPECTED_EXECUTABLE, 11, 1), - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 12, 2), + expectedError(ParserErrorCode.expectedToken, 0, 6), + expectedError(ParserErrorCode.expectedStringLiteral, 7, 4), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 7, 4), + expectedError(ParserErrorCode.expectedToken, 7, 4), + expectedError(ParserErrorCode.expectedExecutable, 11, 1), + expectedError(ParserErrorCode.missingConstFinalVarOrType, 12, 2), ], ); } void test_prefixExpression_missing_operand_minus() { var expression = - parseExpression("-", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("-", codes: [ParserErrorCode.missingIdentifier]) as PrefixExpression; expect(expression.operand, isSimpleIdentifier); expect(expression.operand.isSynthetic, isTrue); @@ -1706,7 +1667,7 @@ class C { parsePrimaryExpression( '?a', expectedEndOffset: 0, - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 0, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 0, 1)], ) as SimpleIdentifier; expectNotNullIfNoErrors(expression); @@ -1715,7 +1676,7 @@ class C { void test_relationalExpression_missing_LHS() { var expression = - parseExpression("is y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("is y", codes: [ParserErrorCode.missingIdentifier]) as IsExpression; expect(expression.expression, isSimpleIdentifier); expect(expression.expression.isSynthetic, isTrue); @@ -1725,15 +1686,15 @@ class C { parseExpression( "is", codes: [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.expectedTypeName, + ParserErrorCode.missingIdentifier, ], ); } void test_relationalExpression_missing_RHS() { var expression = - parseExpression("x is", codes: [ParserErrorCode.EXPECTED_TYPE_NAME]) + parseExpression("x is", codes: [ParserErrorCode.expectedTypeName]) as IsExpression; expect(expression.type, isNamedType); expect(expression.type.isSynthetic, isTrue); @@ -1743,16 +1704,16 @@ class C { parseExpression( "<< is", codes: [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.expectedTypeName, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ); } void test_shiftExpression_missing_LHS() { var expression = - parseExpression("<< y", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("<< y", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.leftOperand, isSimpleIdentifier); expect(expression.leftOperand.isSynthetic, isTrue); @@ -1763,8 +1724,8 @@ class C { parseExpression( "<<", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1776,7 +1737,7 @@ class C { void test_shiftExpression_missing_RHS() { var expression = - parseExpression("x <<", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("x <<", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -1784,7 +1745,7 @@ class C { void test_shiftExpression_missing_RHS_super() { var expression = - parseExpression("super <<", codes: [ParserErrorCode.MISSING_IDENTIFIER]) + parseExpression("super <<", codes: [ParserErrorCode.missingIdentifier]) as BinaryExpression; expect(expression.rightOperand, isSimpleIdentifier); expect(expression.rightOperand.isSynthetic, isTrue); @@ -1795,9 +1756,9 @@ class C { parseExpression( "+ <<", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1809,9 +1770,9 @@ class C { parseExpression( "<< +", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1823,8 +1784,8 @@ class C { parseExpression( "super << <<", codes: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, ], ) as BinaryExpression; @@ -1835,8 +1796,8 @@ class C { CompilationUnit unit = parseCompilationUnit( "typedef n", codes: [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, + ParserErrorCode.expectedToken, + ParserErrorCode.missingTypedefParameters, ], ); NodeList declarations = unit.declarations; @@ -1846,6 +1807,6 @@ class C { } void test_unaryPlus() { - parseExpression("+2", codes: [ParserErrorCode.MISSING_IDENTIFIER]); + parseExpression("+2", codes: [ParserErrorCode.missingIdentifier]); } } diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart index 273c1f7c611..51f99124bd3 100644 --- a/pkg/analyzer/test/generated/resolver_test.dart +++ b/pkg/analyzer/test/generated/resolver_test.dart @@ -25,7 +25,7 @@ int f(num n) { assert (n is int); return n & 0x0F; }''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 47, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 47, 1)], ); } @@ -80,7 +80,7 @@ void f(List list) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 110, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 110, 1)], ); } @@ -146,7 +146,7 @@ int f() { num n = 1234; return n & 0x0F; }''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 37, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 37, 1)], ); } } diff --git a/pkg/analyzer/test/generated/simple_parser_test.dart b/pkg/analyzer/test/generated/simple_parser_test.dart index 0e43c9039dd..4fe3dea1ee8 100644 --- a/pkg/analyzer/test/generated/simple_parser_test.dart +++ b/pkg/analyzer/test/generated/simple_parser_test.dart @@ -128,13 +128,9 @@ class C { } ''', errors: [ - expectedError(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 18, 5), - expectedError( - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, - 24, - 5, - ), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 24, 5), + expectedError(ParserErrorCode.invalidSuperInInitializer, 18, 5), + expectedError(ParserErrorCode.expectedIdentifierButGotKeyword, 24, 5), + expectedError(ParserErrorCode.missingIdentifier, 24, 5), ], ); } @@ -147,11 +143,11 @@ class C { } ''', errors: [ - expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 18, 4), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 23, 5), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 23, 5), - expectedError(ParserErrorCode.CONST_METHOD, 23, 5), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 28, 1), + expectedError(ParserErrorCode.missingAssignmentInInitializer, 18, 4), + expectedError(ParserErrorCode.missingIdentifier, 23, 5), + expectedError(ParserErrorCode.missingFunctionBody, 23, 5), + expectedError(ParserErrorCode.constMethod, 23, 5), + expectedError(ParserErrorCode.missingIdentifier, 28, 1), ], ); } @@ -160,7 +156,7 @@ class C { // https://github.com/dart-lang/sdk/issues/37733 var unit = parseCompilationUnit( r'class C { f(()); }', - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 12, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 12, 1)], ); var classDeclaration = unit.declarations[0] as ClassDeclaration; var method = classDeclaration.members[0] as MethodDeclaration; @@ -740,7 +736,7 @@ class C {} createParser('{}'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); @@ -759,7 +755,7 @@ class C {} createParser('async {}'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); @@ -779,7 +775,7 @@ class C {} createParser('async* {}'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); @@ -799,7 +795,7 @@ class C {} createParser('sync* {}'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); @@ -819,7 +815,7 @@ class C {} createParser(';'); FunctionBody functionBody = parser.parseFunctionBody( true, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); @@ -833,7 +829,7 @@ class C {} createParser('=> y;'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); @@ -853,7 +849,7 @@ class C {} createParser('async => y;'); FunctionBody functionBody = parser.parseFunctionBody( false, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, false, ); expectNotNullIfNoErrors(functionBody); @@ -1004,8 +1000,8 @@ void main() {final c = C();} parseCompilationUnit( 'library ;', errors: [ - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 0, 7), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 17, 1), + expectedError(ParserErrorCode.missingFunctionParameters, 0, 7), + expectedError(ParserErrorCode.missingFunctionBody, 17, 1), ], ); } @@ -1264,7 +1260,7 @@ Function(core.List x) m() => null; createParser('<>'); TypeArgumentList argumentList = parser.parseTypeArgumentList(); expectNotNullIfNoErrors(argumentList); - listener.assertErrorsWithCodes([ParserErrorCode.EXPECTED_TYPE_NAME]); + listener.assertErrorsWithCodes([ParserErrorCode.expectedTypeName]); expect(argumentList.leftBracket, isNotNull); expect(argumentList.arguments, hasLength(1)); expect(argumentList.rightBracket, isNotNull); @@ -1495,7 +1491,7 @@ Function(core.List x) m() => null; parseStatement('final late a;') as VariableDeclarationStatement; var declarationList = statement.variables; assertErrors( - errors: [expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 6, 4)], + errors: [expectedError(ParserErrorCode.modifierOutOfOrder, 6, 4)], ); expect(declarationList.keyword!.lexeme, 'final'); expect(declarationList.type, isNull); @@ -1506,9 +1502,7 @@ Function(core.List x) m() => null; var statement = parseStatement('late a;') as VariableDeclarationStatement; var declarationList = statement.variables; assertErrors( - errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 5, 1), - ], + errors: [expectedError(ParserErrorCode.missingConstFinalVarOrType, 5, 1)], ); expect(declarationList.keyword, isNull); expect(declarationList.type, isNull); @@ -1530,9 +1524,7 @@ Function(core.List x) m() => null; parseStatement('late a = 0;') as VariableDeclarationStatement; var declarationList = statement.variables; assertErrors( - errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 5, 1), - ], + errors: [expectedError(ParserErrorCode.missingConstFinalVarOrType, 5, 1)], ); expect(declarationList.keyword, isNull); expect(declarationList.type, isNull); @@ -1601,12 +1593,12 @@ Function(core.List x) m() => null; var unit = parseCompilationUnit( r'typedef K=Function(<>($', errors: [ - expectedError(CompileTimeErrorCode.INVALID_INLINE_FUNCTION_TYPE, 19, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 19, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 20, 1), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 22, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 23, 1), - expectedError(ScannerErrorCode.EXPECTED_TOKEN, 23, 1), + expectedError(CompileTimeErrorCode.invalidInlineFunctionType, 19, 1), + expectedError(ParserErrorCode.missingIdentifier, 19, 1), + expectedError(ParserErrorCode.missingIdentifier, 20, 1), + expectedError(ParserErrorCode.expectedToken, 22, 1), + expectedError(ScannerErrorCode.expectedToken, 23, 1), + expectedError(ScannerErrorCode.expectedToken, 23, 1), ], ); var typeAlias = unit.declarations[0] as GenericTypeAlias; @@ -1622,8 +1614,8 @@ Function(core.List x) m() => null; var unit = parseCompilationUnit( r'typedef T=Function(());', errors: [ - expectedError(CompileTimeErrorCode.INVALID_INLINE_FUNCTION_TYPE, 19, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 19, 1), + expectedError(CompileTimeErrorCode.invalidInlineFunctionType, 19, 1), + expectedError(ParserErrorCode.missingIdentifier, 19, 1), ], ); var typeAlias = unit.declarations[0] as GenericTypeAlias; diff --git a/pkg/analyzer/test/generated/simple_resolver_test.dart b/pkg/analyzer/test/generated/simple_resolver_test.dart index f548ac983d2..0b5aae1dd44 100644 --- a/pkg/analyzer/test/generated/simple_resolver_test.dart +++ b/pkg/analyzer/test/generated/simple_resolver_test.dart @@ -529,8 +529,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 65, 1), + error(WarningCode.unusedLocalVariable, 40, 1), + error(WarningCode.unusedLocalVariable, 65, 1), ], ); } @@ -597,7 +597,7 @@ void main() { var y = new C().x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 124, 1)], + [error(WarningCode.unusedLocalVariable, 124, 1)], ); // Verify that the getter for "x" in "new C().x" refers to the getter @@ -665,7 +665,7 @@ class H extends D { H(int i) : super(i); } ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 14)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 14)], ); } @@ -693,7 +693,7 @@ class H extends D { H(int i) : super(i); } ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 14)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 14)], ); } @@ -728,7 +728,7 @@ f() { List> b = []; b[0][0] = 'hi'; }''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 44, 4)], + [error(CompileTimeErrorCode.invalidAssignment, 44, 4)], ); } @@ -767,7 +767,7 @@ class A { class A extends B {} class B {} class C = Object with A;''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 54, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 54, 1)], ); var a = findElement2.class_('A'); @@ -781,7 +781,7 @@ class A { A() {} } class C = Object with A;''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 43, 1)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 43, 1)], ); var a = findElement2.class_('A'); diff --git a/pkg/analyzer/test/generated/statement_parser_test.dart b/pkg/analyzer/test/generated/statement_parser_test.dart index c8b910629ad..055327595fc 100644 --- a/pkg/analyzer/test/generated/statement_parser_test.dart +++ b/pkg/analyzer/test/generated/statement_parser_test.dart @@ -44,9 +44,9 @@ class StatementParserTest extends FastaParserTestCase { var unit = parseCompilationUnit( 'foo Future> bar() {}', errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 11, 4), - expectedError(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 4, 6), - expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 22, 3), + expectedError(ParserErrorCode.expectedToken, 11, 4), + expectedError(ParserErrorCode.missingFunctionParameters, 4, 6), + expectedError(ParserErrorCode.missingFunctionBody, 22, 3), ], ); // Validate that recovery has properly updated the token stream. @@ -62,18 +62,14 @@ class StatementParserTest extends FastaParserTestCase { void test_invalid_typeParamAnnotation() { parseCompilationUnit( 'main() { C<@Foo T> v; }', - errors: [ - expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 11, 4), - ], + errors: [expectedError(ParserErrorCode.annotationOnTypeArgument, 11, 4)], ); } void test_invalid_typeParamAnnotation2() { parseCompilationUnit( 'main() { C<@Foo.bar(1) T> v; }', - errors: [ - expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 11, 11), - ], + errors: [expectedError(ParserErrorCode.annotationOnTypeArgument, 11, 11)], ); } @@ -88,9 +84,7 @@ main() { W>> > v; }''', - errors: [ - expectedError(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 13, 63), - ], + errors: [expectedError(ParserErrorCode.annotationOnTypeArgument, 13, 63)], ); } @@ -238,9 +232,9 @@ main() { parseCompilationUnit( 'main() { else return 0; } ', errors: [ - expectedError(ParserErrorCode.EXPECTED_TOKEN, 7, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 9, 4), - expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 9, 4), + expectedError(ParserErrorCode.expectedToken, 7, 1), + expectedError(ParserErrorCode.missingIdentifier, 9, 4), + expectedError(ParserErrorCode.unexpectedToken, 9, 4), ], ); } @@ -935,7 +929,7 @@ main() { void test_parseLocalVariable_external() { parseStatement('external int i;'); assertErrors( - errors: [expectedError(ParserErrorCode.EXTRANEOUS_MODIFIER, 0, 8)], + errors: [expectedError(ParserErrorCode.extraneousModifier, 0, 8)], ); } @@ -978,7 +972,7 @@ main() { void test_parseNonLabeledStatement_const_object_named_typeParameters_34403() { var statement = parseStatement('const A.c();') as ExpressionStatement; - assertErrorsWithCodes([ParserErrorCode.CONSTRUCTOR_WITH_TYPE_ARGUMENTS]); + assertErrorsWithCodes([ParserErrorCode.constructorWithTypeArguments]); expect(statement.expression, isNotNull); } @@ -1213,7 +1207,7 @@ main() { void test_parseStatement_emptyTypeArgumentList() { var declaration = parseStatement('C<> c;') as VariableDeclarationStatement; - assertErrorsWithCodes([ParserErrorCode.EXPECTED_TYPE_NAME]); + assertErrorsWithCodes([ParserErrorCode.expectedTypeName]); VariableDeclarationList variables = declaration.variables; var type = variables.type as NamedType; var argumentList = type.typeArguments!; @@ -1431,7 +1425,7 @@ main() { void test_parseTryStatement_catch_error_invalidCatchParam() { CompilationUnit unit = parseCompilationUnit( 'main() { try {} catch (int e) { } }', - errors: [expectedError(ParserErrorCode.CATCH_SYNTAX, 27, 1)], + errors: [expectedError(ParserErrorCode.catchSyntax, 27, 1)], ); var method = unit.declarations[0] as FunctionDeclaration; var body = method.functionExpression.body as BlockFunctionBody; @@ -1454,7 +1448,7 @@ main() { void test_parseTryStatement_catch_error_missingCatchParam() { var statement = parseStatement('try {} catch () {}') as TryStatement; - listener.assertErrors([expectedError(ParserErrorCode.CATCH_SYNTAX, 14, 1)]); + listener.assertErrors([expectedError(ParserErrorCode.catchSyntax, 14, 1)]); expect(statement.tryKeyword, isNotNull); expect(statement.body, isNotNull); NodeList catchClauses = statement.catchClauses; @@ -1473,7 +1467,7 @@ main() { void test_parseTryStatement_catch_error_missingCatchParen() { var statement = parseStatement('try {} catch {}') as TryStatement; - listener.assertErrors([expectedError(ParserErrorCode.CATCH_SYNTAX, 13, 1)]); + listener.assertErrors([expectedError(ParserErrorCode.catchSyntax, 13, 1)]); expect(statement.tryKeyword, isNotNull); expect(statement.body, isNotNull); NodeList catchClauses = statement.catchClauses; @@ -1492,7 +1486,7 @@ main() { void test_parseTryStatement_catch_error_missingCatchTrace() { var statement = parseStatement('try {} catch (e,) {}') as TryStatement; - listener.assertErrors([expectedError(ParserErrorCode.CATCH_SYNTAX, 16, 1)]); + listener.assertErrors([expectedError(ParserErrorCode.catchSyntax, 16, 1)]); expect(statement.tryKeyword, isNotNull); expect(statement.body, isNotNull); NodeList catchClauses = statement.catchClauses; @@ -1738,11 +1732,11 @@ main() { var unit = parseCompilationUnit( ' b = await ffi(); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1)], + [error(WarningCode.unusedLocalVariable, 62, 1)], ); } @@ -40,8 +40,8 @@ f() async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 58, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 62, 10), + error(WarningCode.unusedLocalVariable, 58, 1), + error(CompileTimeErrorCode.invalidAssignment, 62, 10), ], ); } @@ -53,7 +53,7 @@ f(Stream stream) async { await for (int i in stream) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1)], + [error(WarningCode.unusedLocalVariable, 47, 1)], ); } @@ -65,8 +65,8 @@ f(Stream stream) async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 50, 1), - error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 55, 6), + error(WarningCode.unusedLocalVariable, 50, 1), + error(CompileTimeErrorCode.forInOfInvalidElementType, 55, 6), ], ); } @@ -79,8 +79,8 @@ f(Stream stream) async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1), - error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 52, 6), + error(WarningCode.unusedLocalVariable, 47, 1), + error(CompileTimeErrorCode.forInOfInvalidElementType, 52, 6), ], ); } @@ -92,7 +92,7 @@ f(Stream stream) async { await for (var i in stream) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1)], + [error(WarningCode.unusedLocalVariable, 47, 1)], ); } @@ -104,7 +104,7 @@ f(Stream stream) async { await for (i in stream) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 1)], + [error(WarningCode.unusedLocalVariable, 41, 1)], ); } @@ -117,8 +117,8 @@ f(Stream stream) async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 44, 1), - error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 65, 6), + error(WarningCode.unusedLocalVariable, 44, 1), + error(CompileTimeErrorCode.forInOfInvalidElementType, 65, 6), ], ); } @@ -130,7 +130,7 @@ f(Stream stream) async { await for (int i in stream) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 42, 1)], + [error(WarningCode.unusedLocalVariable, 42, 1)], ); } @@ -141,7 +141,7 @@ f(Stream stream) async { await for (num i in stream) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1)], + [error(WarningCode.unusedLocalVariable, 47, 1)], ); } @@ -168,9 +168,9 @@ void f( } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 263, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 281, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 296, 2), + error(WarningCode.unusedLocalVariable, 263, 4), + error(CompileTimeErrorCode.invalidAssignment, 281, 2), + error(CompileTimeErrorCode.invalidAssignment, 296, 2), ], ); } @@ -182,7 +182,7 @@ f() { for (int i in []) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); } @@ -194,8 +194,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 22, 10), + error(WarningCode.unusedLocalVariable, 17, 1), + error(CompileTimeErrorCode.forInOfInvalidElementType, 22, 10), ], ); } @@ -208,7 +208,7 @@ f() { for (var i in d) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1)], + [error(WarningCode.unusedLocalVariable, 46, 1)], ); } @@ -220,7 +220,7 @@ f() { for (int i in iterable) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 37, 1)], + [error(WarningCode.unusedLocalVariable, 37, 1)], ); } @@ -231,7 +231,7 @@ f() { for (var i in []) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); } @@ -243,7 +243,7 @@ f() { for (i in []) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -256,8 +256,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1), - error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 27, 10), + error(WarningCode.unusedLocalVariable, 12, 1), + error(CompileTimeErrorCode.forInOfInvalidElementType, 27, 10), ], ); } @@ -269,7 +269,7 @@ f() { for (int i in []) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); } @@ -280,7 +280,7 @@ f(List o) { // Could be []. for (var i in o) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 1)], + [error(WarningCode.unusedLocalVariable, 39, 1)], ); } @@ -294,8 +294,8 @@ class Foo> { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 81, 1), - error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 86, 8), + error(WarningCode.unusedLocalVariable, 81, 1), + error(CompileTimeErrorCode.forInOfInvalidElementType, 86, 8), ], ); } @@ -309,7 +309,7 @@ class Foo> { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 78, 1)], + [error(WarningCode.unusedLocalVariable, 78, 1)], ); } @@ -320,7 +320,7 @@ f() { for (num i in []) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); } @@ -333,7 +333,7 @@ f(Object p) { p = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 68, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 68, 6)], ); } @@ -344,7 +344,7 @@ f(Object p) { ((p is String) && ((p = 42) == 42)) && p.length != 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 57, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 57, 6)], ); } @@ -355,7 +355,7 @@ f(Object p) { (p is String) && (((p = 42) == 42) && p.length != 0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 56, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 56, 6)], ); } @@ -368,7 +368,7 @@ g(Object p) { p = 42; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 65, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 65, 6)], ); } @@ -381,7 +381,7 @@ g(Object p) { p is String ? callMe(() { p.length; }) : 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 75, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 75, 6)], ); } @@ -398,7 +398,7 @@ f(Object p) { p = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 80, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 80, 6)], ); } @@ -417,7 +417,7 @@ f(A p) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 97, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 97, 1)], ); } @@ -436,7 +436,7 @@ f(A p) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 102, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 102, 1)], ); } @@ -450,7 +450,7 @@ f(Object p) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 52, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 52, 6)], ); } @@ -464,7 +464,7 @@ f(Object p) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 56, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 56, 6)], ); } @@ -479,8 +479,8 @@ g(Object p) { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 16, 1), - error(CompileTimeErrorCode.UNDEFINED_GETTER, 57, 6), + error(WarningCode.unusedElement, 16, 1), + error(CompileTimeErrorCode.undefinedGetter, 57, 6), ], ); } @@ -500,7 +500,7 @@ f(A p) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 100, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 100, 1)], ); } @@ -519,7 +519,7 @@ f(A p) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 109, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 109, 1)], ); } @@ -533,7 +533,7 @@ g(A a) { a.element.anyGetterExistsInDynamic; } ''', - [error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 37, 10)], + [error(CompileTimeErrorCode.nonTypeAsTypeArgument, 37, 10)], ); } } diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart index 9c41fb0e2f4..09f0391a17e 100644 --- a/pkg/analyzer/test/generated/static_warning_code_test.dart +++ b/pkg/analyzer/test/generated/static_warning_code_test.dart @@ -29,7 +29,7 @@ abstract class D { foo(x, [y]); } class E extends C implements D {}''', - [error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 73, 1)], + [error(CompileTimeErrorCode.invalidImplementationOverride, 73, 1)], ); } diff --git a/pkg/analyzer/test/generated/strong_mode_test.dart b/pkg/analyzer/test/generated/strong_mode_test.dart index a0d18d7da1a..fff06f1eeb9 100644 --- a/pkg/analyzer/test/generated/strong_mode_test.dart +++ b/pkg/analyzer/test/generated/strong_mode_test.dart @@ -256,8 +256,8 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { void test() { var x = f(3); } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 32, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 60, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 32, 4), + error(WarningCode.unusedLocalVariable, 60, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -279,8 +279,8 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { void test() { var x = f(3); } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 32, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 60, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 32, 4), + error(WarningCode.unusedLocalVariable, 60, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -299,8 +299,8 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { void test() { var x = f(3); } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 46, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 76, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 46, 4), + error(WarningCode.unusedLocalVariable, 76, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -324,8 +324,8 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { void test() { var x = f(3)(4); } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 82, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 110, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 82, 4), + error(WarningCode.unusedLocalVariable, 110, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -350,10 +350,10 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { void test() { var x = f(3)(null); } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 82, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 110, 1), - error(CompileTimeErrorCode.COULD_NOT_INFER, 114, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 119, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 82, 4), + error(WarningCode.unusedLocalVariable, 110, 1), + error(CompileTimeErrorCode.couldNotInfer, 114, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 119, 4), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -392,11 +392,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { class B extends A {} '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS, - 92, - 4, - ), + error(CompileTimeErrorCode.noGenerativeConstructorsInSuperclass, 92, 4), ]); ConstructorDeclaration constructor = AstFinder.getConstructorInClass( @@ -448,7 +444,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { return (x) => x; } '''; - await assertErrorsInCode(code, [error(WarningCode.UNUSED_ELEMENT, 144, 5)]); + await assertErrorsInCode(code, [error(WarningCode.unusedElement, 144, 5)]); Asserter assertListOfInt = _isListOf(_isInt); @@ -490,15 +486,15 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 91, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 107, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 144, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 200, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 205, 21), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 259, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 275, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 309, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 330, 1), + error(WarningCode.unusedLocalVariable, 91, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 107, 4), + error(WarningCode.unusedLocalVariable, 144, 2), + error(WarningCode.unusedLocalVariable, 200, 2), + error(CompileTimeErrorCode.invalidAssignment, 205, 21), + error(WarningCode.unusedLocalVariable, 259, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 275, 1), + error(WarningCode.unusedLocalVariable, 309, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 330, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -532,14 +528,14 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 91, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 103, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 140, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 192, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 244, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 256, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 290, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 307, 1), + error(WarningCode.unusedLocalVariable, 91, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 103, 4), + error(WarningCode.unusedLocalVariable, 140, 2), + error(WarningCode.unusedLocalVariable, 192, 2), + error(WarningCode.unusedLocalVariable, 244, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 256, 1), + error(WarningCode.unusedLocalVariable, 290, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 307, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -572,13 +568,13 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 97, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 161, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 166, 23), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 228, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 245, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 286, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 308, 1), + error(WarningCode.unusedLocalVariable, 97, 2), + error(WarningCode.unusedLocalVariable, 161, 2), + error(CompileTimeErrorCode.invalidAssignment, 166, 23), + error(WarningCode.unusedLocalVariable, 228, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 245, 1), + error(WarningCode.unusedLocalVariable, 286, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 308, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -620,11 +616,11 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 66, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 154, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 262, 21), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 337, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 397, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 66, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 154, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 262, 21), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 337, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 397, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -660,10 +656,10 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 66, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 150, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 318, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 374, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 66, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 150, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 318, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 374, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -697,11 +693,11 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 49, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 101, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 153, 21), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 200, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 232, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 49, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 101, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 153, 21), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 200, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 232, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -735,10 +731,10 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 49, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 97, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 181, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 209, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 49, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 97, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 181, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 209, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -774,11 +770,11 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 66, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 152, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 256, 21), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 329, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 387, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 66, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 152, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 256, 21), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 329, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 387, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -814,10 +810,10 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 66, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 148, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 310, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 364, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 66, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 148, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 310, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 364, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -851,13 +847,13 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 88, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 131, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 179, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 191, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 225, 2), - error(CompileTimeErrorCode.UNDEFINED_METHOD, 239, 11), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 288, 2), + error(WarningCode.unusedLocalVariable, 88, 2), + error(WarningCode.unusedLocalVariable, 131, 2), + error(WarningCode.unusedLocalVariable, 179, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 191, 1), + error(WarningCode.unusedLocalVariable, 225, 2), + error(CompileTimeErrorCode.undefinedMethod, 239, 11), + error(WarningCode.unusedLocalVariable, 288, 2), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -938,7 +934,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { Future test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 60, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 60, 4), ], ); _isFutureOfInt(invoke.staticType as InterfaceType); @@ -953,7 +949,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { FutureOr test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 60, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 60, 4), ], ); _isFutureOfInt(invoke.staticType as InterfaceType); @@ -968,7 +964,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { Future test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 60, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 60, 4), ], ); _isFutureOfInt(invoke.staticType as InterfaceType); @@ -986,7 +982,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { FutureOr test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 60, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 60, 4), ], ); _isFutureOfInt(invoke.staticType as InterfaceType); @@ -1004,7 +1000,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { FutureOr test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 60, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 60, 4), ], ); _isFutureOf([_isNum])(invoke.staticType as InterfaceType); @@ -1022,7 +1018,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { FutureOr test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 42, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 42, 4), ], ); _isFutureOrOfInt(invoke.staticType as InterfaceType); @@ -1040,7 +1036,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { FutureOr test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 64, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 64, 4), ], ); _isFutureOfInt(invoke.staticType as InterfaceType); @@ -1060,7 +1056,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { FutureOr test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 65, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 65, 4), ], ); _isFutureOfInt(invoke.staticType as InterfaceType); @@ -1078,7 +1074,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { FutureOr> test() => mk(3); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 48, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 48, 4), ], ); _isListOf(_isInt)(invoke.staticType as InterfaceType); @@ -1099,7 +1095,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { r''' dynamic test(FutureOr x) => x.abs(); ''', - expectedErrors: [error(CompileTimeErrorCode.UNDEFINED_METHOD, 61, 3)], + expectedErrors: [error(CompileTimeErrorCode.undefinedMethod, 61, 3)], ); _isInvalidType(invoke.typeOrThrow); } @@ -1110,7 +1106,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { r''' dynamic test(FutureOr x) => x.then((x) => x); ''', - expectedErrors: [error(CompileTimeErrorCode.UNDEFINED_METHOD, 61, 4)], + expectedErrors: [error(CompileTimeErrorCode.undefinedMethod, 61, 4)], ); _isInvalidType(invoke.typeOrThrow); } @@ -1123,7 +1119,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { ''', expectedErrors: [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 65, 3, ), @@ -1140,11 +1136,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { test() => f.then((int x) {}); ''', expectedErrors: [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 79, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 79, 1), ], ); _isFunction2Of(_isInt, _isNull)( @@ -1161,11 +1153,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { test() => f.then((int x) {return;}); ''', expectedErrors: [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 79, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 79, 1), ], ); _isFunction2Of(_isInt, _isNull)( @@ -1182,11 +1170,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { test() => f.then((int x) {return null;}); ''', expectedErrors: [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 79, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 79, 1), ], ); _isFunction2Of(_isInt, _isNull)( @@ -1204,7 +1188,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { dynamic test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 60, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 60, 4), ], ); _isFutureOfInt(invoke.staticType as InterfaceType); @@ -1219,7 +1203,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { dynamic test() => mk(new Future.value(42)); ''', expectedErrors: [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 75, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 75, 4), ], ); _isFutureOfInt(invoke.staticType as InterfaceType); @@ -1233,11 +1217,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { test() => f.then((int x) {}); ''', expectedErrors: [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 79, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 79, 1), ], ); _isFunction2Of(_isInt, _isNull)( @@ -1254,11 +1234,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { test() => f.then((int x) {return;}); ''', expectedErrors: [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 79, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 79, 1), ], ); _isFunction2Of(_isInt, _isNull)( @@ -1275,11 +1251,7 @@ class StrongModeLocalInferenceTest extends PubPackageResolutionTest { test() => f.then((int x) { return null;}); ''', expectedErrors: [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 79, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 79, 1), ], ); _isFunction2Of(_isInt, _isNull)( @@ -1316,11 +1288,11 @@ void test() { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 205, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 241, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 284, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 318, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 347, 2), + error(WarningCode.unusedLocalVariable, 205, 2), + error(WarningCode.unusedLocalVariable, 241, 2), + error(WarningCode.unusedLocalVariable, 284, 2), + error(WarningCode.unusedLocalVariable, 318, 2), + error(WarningCode.unusedLocalVariable, 347, 2), ]); Element elementA = AstFinder.getClass(unit, "A").declaredFragment!.element; @@ -1352,7 +1324,7 @@ void test() { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 225, 1), + error(WarningCode.unusedLocalVariable, 225, 1), ]); DartType cType = findElement2.localVar('c').type; @@ -1372,9 +1344,9 @@ test() { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 84, 1), - error(CompileTimeErrorCode.COULD_NOT_INFER, 88, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 90, 15), + error(WarningCode.unusedLocalVariable, 84, 1), + error(CompileTimeErrorCode.couldNotInfer, 88, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 90, 15), ]); _expectInferenceError(r''' Couldn't infer type parameter 'T'. @@ -1399,10 +1371,10 @@ test() { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 95, 1), - error(CompileTimeErrorCode.COULD_NOT_INFER, 99, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 101, 15), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 118, 16), + error(WarningCode.unusedLocalVariable, 95, 1), + error(CompileTimeErrorCode.couldNotInfer, 99, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 101, 15), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 118, 16), ]); _expectInferenceError(r''' Couldn't infer type parameter 'T'. @@ -1428,9 +1400,9 @@ test() { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 5), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 68, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 71, 1), + error(WarningCode.unusedLocalVariable, 56, 5), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 68, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 71, 1), ]); var node = findNode.singleMethodInvocation; @@ -1473,8 +1445,8 @@ test() { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 94, 5), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 102, 3), + error(WarningCode.unusedLocalVariable, 94, 5), + error(CompileTimeErrorCode.invalidAssignment, 102, 3), ]); } @@ -1490,8 +1462,8 @@ test(Iterable values) { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 158, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 195, 3), + error(WarningCode.unusedLocalVariable, 158, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 195, 3), ]); } @@ -1506,9 +1478,9 @@ test() { } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 80, 1), - error(CompileTimeErrorCode.COULD_NOT_INFER, 84, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 84, 5), + error(WarningCode.unusedLocalVariable, 80, 1), + error(CompileTimeErrorCode.couldNotInfer, 84, 1), + error(CompileTimeErrorCode.invalidAssignment, 84, 5), ]); _expectInferenceError(r''' Couldn't infer type parameter 'T'. @@ -1530,8 +1502,8 @@ Consider passing explicit type argument(s) to the generic. } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 58, 2), + error(WarningCode.unusedLocalVariable, 33, 1), + error(WarningCode.unusedLocalVariable, 58, 2), ]); } @@ -1547,7 +1519,7 @@ void _mergeSort(T Function(T) list, int compare(T a, T b), T Function(T) targ _mergeSort(target, compare, list); } '''; - await assertErrorsInCode(code, [error(WarningCode.UNUSED_ELEMENT, 5, 10)]); + await assertErrorsInCode(code, [error(WarningCode.unusedElement, 5, 10)]); var node = findNode.singleBlock; assertResolvedNodeText(node, r''' @@ -1714,7 +1686,7 @@ void _mergeSort(List list, int compare(T a, T b), List target) { _mergeSort(target, compare, list); } '''; - await assertErrorsInCode(code, [error(WarningCode.UNUSED_ELEMENT, 5, 10)]); + await assertErrorsInCode(code, [error(WarningCode.unusedElement, 5, 10)]); var node = findNode.singleBlock; assertResolvedNodeText(node, r''' @@ -1881,7 +1853,7 @@ void _mergeSort(T list, int compare(T a, T b), T target) { _mergeSort(target, compare, list); } '''; - await assertErrorsInCode(code, [error(WarningCode.UNUSED_ELEMENT, 5, 10)]); + await assertErrorsInCode(code, [error(WarningCode.unusedElement, 5, 10)]); var node = findNode.singleBlock; assertResolvedNodeText(node, r''' @@ -2046,8 +2018,8 @@ test() { } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 22, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 61, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 22, 4), + error(WarningCode.unusedLocalVariable, 61, 1), ]); var node = findNode.methodInvocation('f(g)'); @@ -2091,7 +2063,7 @@ abstract class Iterable { num test(Iterable values) => values.fold(values.first as num, max); '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 190, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 190, 3), ]); var node = findNode.methodInvocation('values.fold'); @@ -2293,83 +2265,83 @@ MethodInvocation A a5 = new F.named(3, "hello", "hello"); }'''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 547, 4), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 633, 1), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 644, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 547, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 633, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 644, 1), error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 692, 1, ), error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 697, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 769, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 816, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 869, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 929, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 995, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1000, 31), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1056, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1061, 41), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1157, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1168, 7), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1177, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1204, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1221, 7), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1230, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1286, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1333, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1386, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1446, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1512, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1517, 34), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1576, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1581, 41), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1676, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1687, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1690, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1723, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1740, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1743, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1802, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1837, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1878, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1918, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1964, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1969, 17), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2008, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 2013, 23), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2087, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2098, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2128, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2145, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2208, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2252, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2302, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2359, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2425, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 2430, 28), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2483, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 2488, 38), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2580, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2591, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2618, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2635, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2694, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2805, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2874, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 2901, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 2914, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2942, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 3007, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 3060, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 3089, 7), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 3098, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 3125, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 3154, 7), + error(WarningCode.unusedLocalVariable, 769, 2), + error(WarningCode.unusedLocalVariable, 816, 2), + error(WarningCode.unusedLocalVariable, 869, 2), + error(WarningCode.unusedLocalVariable, 929, 2), + error(WarningCode.unusedLocalVariable, 995, 2), + error(CompileTimeErrorCode.invalidAssignment, 1000, 31), + error(WarningCode.unusedLocalVariable, 1056, 2), + error(CompileTimeErrorCode.invalidAssignment, 1061, 41), + error(WarningCode.unusedLocalVariable, 1157, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1168, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1177, 1), + error(WarningCode.unusedLocalVariable, 1204, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1221, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1230, 1), + error(WarningCode.unusedLocalVariable, 1286, 2), + error(WarningCode.unusedLocalVariable, 1333, 2), + error(WarningCode.unusedLocalVariable, 1386, 2), + error(WarningCode.unusedLocalVariable, 1446, 2), + error(WarningCode.unusedLocalVariable, 1512, 2), + error(CompileTimeErrorCode.invalidAssignment, 1517, 34), + error(WarningCode.unusedLocalVariable, 1576, 2), + error(CompileTimeErrorCode.invalidAssignment, 1581, 41), + error(WarningCode.unusedLocalVariable, 1676, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1687, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1690, 7), + error(WarningCode.unusedLocalVariable, 1723, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1740, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1743, 7), + error(WarningCode.unusedLocalVariable, 1802, 2), + error(WarningCode.unusedLocalVariable, 1837, 2), + error(WarningCode.unusedLocalVariable, 1878, 2), + error(WarningCode.unusedLocalVariable, 1918, 2), + error(WarningCode.unusedLocalVariable, 1964, 2), + error(CompileTimeErrorCode.invalidAssignment, 1969, 17), + error(WarningCode.unusedLocalVariable, 2008, 2), + error(CompileTimeErrorCode.invalidAssignment, 2013, 23), + error(WarningCode.unusedLocalVariable, 2087, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2098, 7), + error(WarningCode.unusedLocalVariable, 2128, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2145, 7), + error(WarningCode.unusedLocalVariable, 2208, 2), + error(WarningCode.unusedLocalVariable, 2252, 2), + error(WarningCode.unusedLocalVariable, 2302, 2), + error(WarningCode.unusedLocalVariable, 2359, 2), + error(WarningCode.unusedLocalVariable, 2425, 2), + error(CompileTimeErrorCode.invalidAssignment, 2430, 28), + error(WarningCode.unusedLocalVariable, 2483, 2), + error(CompileTimeErrorCode.invalidAssignment, 2488, 38), + error(WarningCode.unusedLocalVariable, 2580, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2591, 1), + error(WarningCode.unusedLocalVariable, 2618, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2635, 1), + error(WarningCode.unusedLocalVariable, 2694, 2), + error(WarningCode.unusedLocalVariable, 2805, 2), + error(WarningCode.unusedLocalVariable, 2874, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 2901, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 2914, 1), + error(WarningCode.unusedLocalVariable, 2942, 2), + error(WarningCode.unusedLocalVariable, 3007, 2), + error(WarningCode.unusedLocalVariable, 3060, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 3089, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 3098, 1), + error(WarningCode.unusedLocalVariable, 3125, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 3154, 7), ]); Expression rhs(AstNode stmt) { @@ -2537,11 +2509,11 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 84, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 124, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 165, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 172, 7), + error(WarningCode.unusedLocalVariable, 45, 2), + error(WarningCode.unusedLocalVariable, 84, 2), + error(WarningCode.unusedLocalVariable, 124, 2), + error(WarningCode.unusedLocalVariable, 165, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 172, 7), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -2586,12 +2558,12 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 66, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 94, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 100, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 128, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 134, 7), + error(WarningCode.unusedLocalVariable, 39, 2), + error(WarningCode.unusedLocalVariable, 66, 2), + error(WarningCode.unusedLocalVariable, 94, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 100, 7), + error(WarningCode.unusedLocalVariable, 128, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 134, 7), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -2623,12 +2595,12 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 84, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 124, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 136, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 170, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 182, 7), + error(WarningCode.unusedLocalVariable, 45, 2), + error(WarningCode.unusedLocalVariable, 84, 2), + error(WarningCode.unusedLocalVariable, 124, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 136, 7), + error(WarningCode.unusedLocalVariable, 170, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 182, 7), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -2660,14 +2632,14 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 44, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 71, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 76, 8), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 104, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 109, 17), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 146, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 151, 21), + error(WarningCode.unusedLocalVariable, 39, 2), + error(CompileTimeErrorCode.invalidAssignment, 44, 7), + error(WarningCode.unusedLocalVariable, 71, 2), + error(CompileTimeErrorCode.invalidAssignment, 76, 8), + error(WarningCode.unusedLocalVariable, 104, 2), + error(CompileTimeErrorCode.invalidAssignment, 109, 17), + error(WarningCode.unusedLocalVariable, 146, 2), + error(CompileTimeErrorCode.invalidAssignment, 151, 21), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -2697,12 +2669,12 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 43, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 74, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 106, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 112, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 144, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 150, 7), + error(WarningCode.unusedLocalVariable, 43, 2), + error(WarningCode.unusedLocalVariable, 74, 2), + error(WarningCode.unusedLocalVariable, 106, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 112, 7), + error(WarningCode.unusedLocalVariable, 144, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 150, 7), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -2735,15 +2707,15 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 52, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 92, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 144, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 150, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 202, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 212, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 248, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 267, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 277, 1), + error(WarningCode.unusedLocalVariable, 52, 2), + error(WarningCode.unusedLocalVariable, 92, 2), + error(WarningCode.unusedLocalVariable, 144, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 150, 7), + error(WarningCode.unusedLocalVariable, 202, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 212, 1), + error(WarningCode.unusedLocalVariable, 248, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 267, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 277, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -2798,15 +2770,15 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 80, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 124, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 130, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 174, 2), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 183, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 212, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 229, 7), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 238, 1), + error(WarningCode.unusedLocalVariable, 46, 2), + error(WarningCode.unusedLocalVariable, 80, 2), + error(WarningCode.unusedLocalVariable, 124, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 130, 7), + error(WarningCode.unusedLocalVariable, 174, 2), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 183, 1), + error(WarningCode.unusedLocalVariable, 212, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 229, 7), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 238, 1), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -2841,15 +2813,15 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 51, 16), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 94, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 99, 26), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 152, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 157, 32), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 172, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 216, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 221, 20), + error(WarningCode.unusedLocalVariable, 46, 2), + error(CompileTimeErrorCode.invalidAssignment, 51, 16), + error(WarningCode.unusedLocalVariable, 94, 2), + error(CompileTimeErrorCode.invalidAssignment, 99, 26), + error(WarningCode.unusedLocalVariable, 152, 2), + error(CompileTimeErrorCode.invalidAssignment, 157, 32), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 172, 7), + error(WarningCode.unusedLocalVariable, 216, 2), + error(CompileTimeErrorCode.invalidAssignment, 221, 20), ]); List statements = AstFinder.getStatementsInTopLevelFunction( @@ -2882,7 +2854,7 @@ MethodInvocation } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 101, 1), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 101, 1), ]); Expression methodReturnValue(String methodName) { @@ -2915,7 +2887,7 @@ MethodInvocation String test() => f((l) => l.length); '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 72, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 72, 4), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -2941,17 +2913,9 @@ MethodInvocation A test() => new B(3); '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 28, - 1, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 39, - 1, - ), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 126, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 28, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 126, 1), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -2975,16 +2939,8 @@ MethodInvocation A test() => new B(3); '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 28, - 1, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 39, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 28, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3009,17 +2965,9 @@ MethodInvocation A test() => new B(3); '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 28, - 1, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 39, - 1, - ), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 126, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 28, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 126, 1), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3044,16 +2992,8 @@ MethodInvocation A test() => new B(); '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 28, - 1, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 39, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 28, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3080,16 +3020,8 @@ MethodInvocation Contra1> test() => mkA(); '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 28, - 1, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 39, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 28, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3116,16 +3048,8 @@ MethodInvocation Contra1> test() => mkA(); '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 28, - 1, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 39, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 28, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3153,16 +3077,8 @@ MethodInvocation Contra1> test() => mkA(); '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 28, - 1, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 39, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 28, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3190,16 +3106,8 @@ MethodInvocation Contra1> test() => mkA(); '''; await assertErrorsInCode(code, [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 28, - 1, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 39, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 28, 1), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3298,7 +3206,7 @@ class B { Func1 test() => f(42); '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 74, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 74, 4), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3318,7 +3226,7 @@ class B { Func1 test() => f(42); '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 74, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 74, 4), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3339,7 +3247,7 @@ class B { dynamic test() => f(42, (num x) => x); '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 82, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 82, 4), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3359,7 +3267,7 @@ class B { dynamic test() => f(42, (num x) => x); '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 82, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 82, 4), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3379,8 +3287,8 @@ class B { num test() => g(f(3)); '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 74, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 112, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 74, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 112, 4), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3402,8 +3310,8 @@ class B { num test() => g(f(3)); '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 74, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 112, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 74, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 112, 4), ]); FunctionDeclaration test = AstFinder.getTopLevelFunction(unit, "test"); @@ -3436,13 +3344,13 @@ class B { _isListOf(_isString)(exp.staticType as InterfaceType); } - /// Verifies the result has [CompileTimeErrorCode.COULD_NOT_INFER] with + /// Verifies the result has [CompileTimeErrorCode.couldNotInfer] with /// the expected [errorMessage]. void _expectInferenceError(String errorMessage) { var errors = result.diagnostics .where( - (e) => e.diagnosticCode == CompileTimeErrorCode.COULD_NOT_INFER, + (e) => e.diagnosticCode == CompileTimeErrorCode.couldNotInfer, ) .map((e) => e.message) .toList(); @@ -3487,7 +3395,7 @@ main() { var foo = a.hashCode; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 3)], + [error(WarningCode.unusedLocalVariable, 35, 3)], ); expectInitializerType('foo', 'int'); } @@ -3510,7 +3418,7 @@ main() { (x.then((x) => x) == null); '''; await assertErrorsInCode(code, [ - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE, 139, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullFalse, 139, 7), ]); } @@ -3534,7 +3442,7 @@ main() { (x.then((x) => x) == null); '''; await assertErrorsInCode(code, [ - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE, 163, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullFalse, 163, 7), ]); } @@ -3546,13 +3454,13 @@ void main() { x = 42; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 21, 1)], + [error(WarningCode.unusedLocalVariable, 21, 1)], ); } test_genericFunction() async { await assertErrorsInCode(r'T f(T x) => null;', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 15, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 15, 4), ]); var node = findNode.functionDeclaration('f'); @@ -3602,7 +3510,7 @@ FunctionDeclaration test_genericFunction_bounds() async { await assertErrorsInCode(r'T f(T x) => null;', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 27, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 27, 4), ]); var node = findNode.functionDeclaration('f { static T f(T x) => null; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 37, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 37, 4)], ); var node = findNode.methodDeclaration('f'); @@ -3748,28 +3656,22 @@ class D { } '''; await assertErrorsInCode(code, [ - error(CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, 23, 2), - error(CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, 49, 2), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 23, 2), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 49, 2), + error(CompileTimeErrorCode.notInitializedNonNullableInstanceField, 57, 2), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, - 57, - 2, - ), - error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 141, 2, ), - error(CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, 179, 2), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 179, 2), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 187, 2, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 271, 2, ), @@ -3806,7 +3708,7 @@ List eee = [new Object()]; ''', [ error( - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, 73, 4, ), @@ -3830,8 +3732,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 36, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 65, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 36, 4), + error(WarningCode.unusedLocalVariable, 65, 9), ], ); assertType(findElement2.method('f').type, 'List Function(E)'); @@ -3860,11 +3762,10 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 36, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 82, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 36, 4), + error(WarningCode.unusedLocalVariable, 82, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 86, 9, ), @@ -3904,27 +3805,19 @@ void test(T Function(T) pf) { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 30, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 60, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 96, 4), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 123, - 4, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 224, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 237, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 281, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 315, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 349, 15), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 388, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 423, 12), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 460, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 492, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 30, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 60, 4), + error(CompileTimeErrorCode.invalidAssignment, 96, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 123, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 224, 4), + error(WarningCode.unusedLocalVariable, 237, 10), + error(WarningCode.unusedLocalVariable, 281, 10), + error(WarningCode.unusedLocalVariable, 315, 10), + error(WarningCode.unusedLocalVariable, 349, 15), + error(WarningCode.unusedLocalVariable, 388, 10), + error(WarningCode.unusedLocalVariable, 423, 12), + error(WarningCode.unusedLocalVariable, 460, 9), + error(WarningCode.unusedLocalVariable, 492, 9), ], ); _assertLocalVarType('lambdaCall', "int"); @@ -3944,7 +3837,7 @@ void test(T pf(T e)) { var paramCall = (pf)(3); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 9)], + [error(WarningCode.unusedLocalVariable, 35, 9)], ); _assertLocalVarType('paramCall', "int"); } @@ -3956,7 +3849,7 @@ void test(T pf(T e)) { var paramCall = (pf)(3); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 9)], + [error(WarningCode.unusedLocalVariable, 35, 9)], ); _assertLocalVarType('paramCall', "int"); } @@ -3987,27 +3880,19 @@ void test(T Function(T) pf) { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 30, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 60, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 96, 4), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 123, - 4, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 224, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 237, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 276, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 305, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 334, 15), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 368, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 398, 12), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 430, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 457, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 30, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 60, 4), + error(CompileTimeErrorCode.invalidAssignment, 96, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 123, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 224, 4), + error(WarningCode.unusedLocalVariable, 237, 10), + error(WarningCode.unusedLocalVariable, 276, 10), + error(WarningCode.unusedLocalVariable, 305, 10), + error(WarningCode.unusedLocalVariable, 334, 15), + error(WarningCode.unusedLocalVariable, 368, 10), + error(WarningCode.unusedLocalVariable, 398, 12), + error(WarningCode.unusedLocalVariable, 430, 9), + error(WarningCode.unusedLocalVariable, 457, 9), ], ); _assertLocalVarType('lambdaCall', "int"); @@ -4044,26 +3929,18 @@ void test(T Function(T) pf) { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 30, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 60, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 96, 4), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 123, - 4, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 224, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 236, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 268, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 300, 15), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 337, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 370, 12), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 405, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 435, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 30, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 60, 4), + error(CompileTimeErrorCode.invalidAssignment, 96, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 123, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 224, 4), + error(WarningCode.unusedLocalVariable, 236, 10), + error(WarningCode.unusedLocalVariable, 268, 10), + error(WarningCode.unusedLocalVariable, 300, 15), + error(WarningCode.unusedLocalVariable, 337, 10), + error(WarningCode.unusedLocalVariable, 370, 12), + error(WarningCode.unusedLocalVariable, 405, 9), + error(WarningCode.unusedLocalVariable, 435, 9), ], ); _assertLocalVarType('methodCall', "int"); @@ -4082,7 +3959,7 @@ void test(T pf(T e)) { var paramCall = pf(3); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 9)], + [error(WarningCode.unusedLocalVariable, 35, 9)], ); _assertLocalVarType('paramCall', "int"); } @@ -4094,7 +3971,7 @@ void test(T pf(T e)) { var paramCall = pf(3); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 9)], + [error(WarningCode.unusedLocalVariable, 35, 9)], ); _assertLocalVarType('paramCall', "int"); } @@ -4123,26 +4000,18 @@ void test(T Function(T) pf) { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 30, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 60, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 96, 4), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 123, - 4, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 224, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 236, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 263, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 290, 15), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 322, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 350, 12), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 380, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 405, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 30, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 60, 4), + error(CompileTimeErrorCode.invalidAssignment, 96, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 123, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 224, 4), + error(WarningCode.unusedLocalVariable, 236, 10), + error(WarningCode.unusedLocalVariable, 263, 10), + error(WarningCode.unusedLocalVariable, 290, 15), + error(WarningCode.unusedLocalVariable, 322, 10), + error(WarningCode.unusedLocalVariable, 350, 12), + error(WarningCode.unusedLocalVariable, 380, 9), + error(WarningCode.unusedLocalVariable, 405, 9), ], ); _assertLocalVarType('methodCall', "int"); @@ -4165,8 +4034,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 41, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 70, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 41, 4), + error(WarningCode.unusedLocalVariable, 70, 9), ], ); assertType( @@ -4193,7 +4062,7 @@ void test(T pf(T e)) { var paramTearOff = pf; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 12)], + [error(WarningCode.unusedLocalVariable, 35, 12)], ); _assertLocalVarType('paramTearOff', "T Function(T)"); } @@ -4213,8 +4082,8 @@ void foo() { list.map((e) => 3); }''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 40, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 75, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 40, 4), + error(CompileTimeErrorCode.invalidAssignment, 75, 4), ], ); @@ -4318,7 +4187,7 @@ main() { var foo = max(1.0, 2.0); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 3)], + [error(WarningCode.unusedLocalVariable, 35, 3)], ); expectInitializerType('foo', 'double'); } @@ -4331,7 +4200,7 @@ main() { var foo = math.max(1.0, 2.0); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 43, 3)], + [error(WarningCode.unusedLocalVariable, 43, 3)], ); expectInitializerType('foo', 'double'); } @@ -4344,7 +4213,7 @@ main() { var foo = max(1.0, 2); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 3)], + [error(WarningCode.unusedLocalVariable, 35, 3)], ); expectInitializerType('foo', 'num'); } @@ -4357,7 +4226,7 @@ main() { var foo = max(1, 2.0); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 3)], + [error(WarningCode.unusedLocalVariable, 35, 3)], ); expectInitializerType('foo', 'num'); } @@ -4370,7 +4239,7 @@ main() { var foo = max(1, 2); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 3)], + [error(WarningCode.unusedLocalVariable, 35, 3)], ); expectInitializerType('foo', 'int'); } @@ -4397,7 +4266,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 96, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 96, 4)], ); var node1 = findNode.methodInvocation('f(3);'); @@ -4469,8 +4338,8 @@ class C { } ''', [ - error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 56, 3), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 106, 4), + error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 56, 3), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 106, 4), ], ); @@ -4550,8 +4419,8 @@ S f(S x) { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 16, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 41, 4), + error(WarningCode.unusedElement, 16, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 41, 4), ], ); assertType(findElement2.topFunction('f').type, 'S Function(S)'); @@ -4572,8 +4441,8 @@ class D extends C { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 27, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 72, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 27, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 72, 4), ], ); @@ -4634,9 +4503,9 @@ class D extends B { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 48, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 141, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 247, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 48, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 141, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 247, 4), ], ); } @@ -4655,7 +4524,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 87, 1, ), @@ -4692,14 +4561,14 @@ class D extends C { T f(T x) => null; }''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 69, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 69, 4), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 101, 1, contextMessages: [message(testFile, 46, 1)], ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 124, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 124, 4), ], ); } @@ -4716,14 +4585,14 @@ class D extends C { T f(T x) => null; }''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 69, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 69, 4), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 101, 1, contextMessages: [message(testFile, 46, 1)], ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 124, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 124, 4), ], ); } @@ -4738,14 +4607,14 @@ class D extends C { String f(S x) => null; }''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 37, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 37, 4), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 74, 1, contextMessages: [message(testFile, 24, 1)], ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 87, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 87, 4), ], ); } @@ -4760,14 +4629,14 @@ class D extends C { S f(T x) => null; }''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 27, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 27, 4), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 59, 1, contextMessages: [message(testFile, 14, 1)], ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 75, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 75, 4), ], ); } @@ -4794,12 +4663,8 @@ C toSpan(dynamic element) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 122, 1), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 160, - 4, - ), + error(WarningCode.unusedLocalVariable, 122, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 160, 4), ], ); _assertLocalVarType('y', 'List'); @@ -4829,26 +4694,18 @@ void test(T Function(T) pf) { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 30, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 60, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 96, 4), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 123, - 4, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 224, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 236, 13), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 263, 13), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 290, 18), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 322, 13), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 350, 15), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 380, 12), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 405, 12), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 30, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 60, 4), + error(CompileTimeErrorCode.invalidAssignment, 96, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 123, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 224, 4), + error(WarningCode.unusedLocalVariable, 236, 13), + error(WarningCode.unusedLocalVariable, 263, 13), + error(WarningCode.unusedLocalVariable, 290, 18), + error(WarningCode.unusedLocalVariable, 322, 13), + error(WarningCode.unusedLocalVariable, 350, 15), + error(WarningCode.unusedLocalVariable, 380, 12), + error(WarningCode.unusedLocalVariable, 405, 12), ], ); _assertLocalVarType('methodTearOff', "T Function(int)"); @@ -4902,8 +4759,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 69, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 81, 3), + error(CompileTimeErrorCode.invalidAssignment, 69, 4), + error(WarningCode.unusedLocalVariable, 81, 3), ], ); @@ -4921,8 +4778,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 105, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 117, 3), + error(CompileTimeErrorCode.invalidAssignment, 105, 4), + error(WarningCode.unusedLocalVariable, 117, 3), ], ); expectInitializerType('foo', 'Future'); @@ -4938,14 +4795,13 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 3), + error(WarningCode.unusedLocalVariable, 40, 3), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 46, 1, ), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 85, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 85, 1), ], ); // Note: this correctly reports the error @@ -4968,9 +4824,9 @@ void test() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 37, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 73, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 102, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 37, 4), + error(CompileTimeErrorCode.invalidAssignment, 73, 4), + error(WarningCode.unusedLocalVariable, 102, 9), ], ); _assertLocalVarType('fieldRead', "T Function(T)"); @@ -4995,12 +4851,12 @@ void test() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 116, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 124, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 132, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 142, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 162, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 182, 2), + error(WarningCode.unusedLocalVariable, 116, 2), + error(WarningCode.unusedLocalVariable, 124, 2), + error(WarningCode.unusedLocalVariable, 132, 2), + error(WarningCode.unusedLocalVariable, 142, 2), + error(WarningCode.unusedLocalVariable, 162, 2), + error(WarningCode.unusedLocalVariable, 182, 2), ], ); _assertLocalVarType('ai', "A"); @@ -5021,13 +4877,13 @@ class D extends C {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 69, 1, contextMessages: [message(testFile, 69, 1)], ), error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 69, 1, contextMessages: [message(testFile, 69, 1)], @@ -5047,10 +4903,10 @@ void test() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 73, 1), - error(CompileTimeErrorCode.COULD_NOT_INFER, 81, 1), + error(WarningCode.unusedLocalVariable, 73, 1), + error(CompileTimeErrorCode.couldNotInfer, 81, 1), error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 81, 1, contextMessages: [message(testFile, 81, 1)], @@ -5066,13 +4922,7 @@ void test() { class C, T1 extends List> {} C c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 55, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 55, 1)], ); _assertTopVarType('c', 'C, List>'); } @@ -5083,13 +4933,7 @@ C c; class C> {} C c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 29, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 29, 1)], ); _assertTopVarType('c', 'C>'); } @@ -5101,13 +4945,7 @@ class A {} class C> {} C c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 43, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 43, 1)], ); _assertTopVarType('c', 'C>'); } @@ -5121,16 +4959,12 @@ C c; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 48, 1, contextMessages: [message(testFile, 48, 1), message(testFile, 48, 1)], ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 50, - 1, - ), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 50, 1), ], ); _assertTopVarType('c', 'C'); @@ -5142,13 +4976,7 @@ C c; class C, T1 extends List, T2 extends int> {} C c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 70, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 70, 1)], ); _assertTopVarType('c', 'C, int>, List, int>'); } @@ -5159,13 +4987,7 @@ C c; class C {} C c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 44, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 44, 1)], ); _assertTopVarType('c', 'C'); } @@ -5176,13 +4998,7 @@ C c; class C, T1 extends int> {} C c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 53, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 53, 1)], ); _assertTopVarType('c', 'C, int>'); } @@ -5193,13 +5009,7 @@ C c; class C {} C c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 44, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 44, 1)], ); _assertTopVarType('c', 'C'); } @@ -5210,13 +5020,7 @@ C c; class C, T1 extends List, T2 extends int> {} C c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 74, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 74, 1)], ); _assertTopVarType('c', 'C, int>, List, int>'); } @@ -5236,10 +5040,10 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 114, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 121, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 128, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 135, 1), + error(WarningCode.unusedLocalVariable, 114, 1), + error(WarningCode.unusedLocalVariable, 121, 1), + error(WarningCode.unusedLocalVariable, 128, 1), + error(WarningCode.unusedLocalVariable, 135, 1), ], ); _assertLocalVarType('a', 'A'); @@ -5260,9 +5064,9 @@ void g() { } ''', [ - error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 3, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 69, 1), - error(CompileTimeErrorCode.COULD_NOT_INFER, 73, 1), + error(CompileTimeErrorCode.bodyMightCompleteNormally, 3, 1), + error(WarningCode.unusedLocalVariable, 69, 1), + error(CompileTimeErrorCode.couldNotInfer, 73, 1), ], ); _assertLocalVarType('c', 'List'); @@ -5280,8 +5084,8 @@ class C { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 97, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 103, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 97, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 103, 4), ], ); @@ -5327,7 +5131,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 69, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 69, 4)], ); var node = findNode.singleMethodInvocation; @@ -5359,7 +5163,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 67, 4)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 67, 4)], ); var node = findNode.singleMethodInvocation; @@ -5397,7 +5201,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 37, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 37, 4)], ); var node = findNode.singleMethodInvocation; @@ -5425,7 +5229,7 @@ class C { static final h = g; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 37, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 37, 4)], ); } @@ -5456,12 +5260,12 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 69, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 94, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 117, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 183, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 210, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 235, 2), + error(WarningCode.unusedLocalVariable, 69, 2), + error(WarningCode.unusedLocalVariable, 94, 2), + error(WarningCode.unusedLocalVariable, 117, 2), + error(WarningCode.unusedLocalVariable, 183, 2), + error(WarningCode.unusedLocalVariable, 210, 2), + error(WarningCode.unusedLocalVariable, 235, 2), ], ); } @@ -5493,81 +5297,69 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 63, 2), + error(WarningCode.unusedLocalVariable, 63, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 68, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 88, 2), + error(WarningCode.unusedLocalVariable, 88, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 93, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 111, 2), + error(WarningCode.unusedLocalVariable, 111, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 116, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 177, 2), + error(WarningCode.unusedLocalVariable, 177, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 183, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 204, 2), + error(WarningCode.unusedLocalVariable, 204, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 210, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 229, 2), + error(WarningCode.unusedLocalVariable, 229, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 235, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 276, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 293, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 308, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 361, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 380, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 397, 1, ), @@ -5602,13 +5394,13 @@ void main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 16, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 71, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 96, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 119, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 185, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 212, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 237, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 16, 4), + error(WarningCode.unusedLocalVariable, 71, 2), + error(WarningCode.unusedLocalVariable, 96, 2), + error(WarningCode.unusedLocalVariable, 119, 2), + error(WarningCode.unusedLocalVariable, 185, 2), + error(WarningCode.unusedLocalVariable, 212, 2), + error(WarningCode.unusedLocalVariable, 237, 2), ], ); } @@ -5642,81 +5434,69 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 107, 2), + error(WarningCode.unusedLocalVariable, 107, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 112, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 132, 2), + error(WarningCode.unusedLocalVariable, 132, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 137, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 155, 2), + error(WarningCode.unusedLocalVariable, 155, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 160, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 221, 2), + error(WarningCode.unusedLocalVariable, 221, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 227, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 248, 2), + error(WarningCode.unusedLocalVariable, 248, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 254, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 273, 2), + error(WarningCode.unusedLocalVariable, 273, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 279, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 320, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 337, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 352, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 405, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 424, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 441, 1, ), @@ -5727,7 +5507,7 @@ void main() { test_returnOfInvalidType_object_void() async { await assertErrorsInCode( "Object f() { void voidFn() => null; return voidFn(); }", - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 43, 8)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 43, 8)], ); } @@ -5740,8 +5520,8 @@ class A { dynamic set g(int x) => null; ''', [ - error(CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, 12, 7), - error(CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, 47, 7), + error(CompileTimeErrorCode.nonVoidReturnForSetter, 12, 7), + error(CompileTimeErrorCode.nonVoidReturnForSetter, 47, 7), ], ); } @@ -5766,7 +5546,7 @@ class A { } set g(int x) => 42; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 41, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 41, 4)], ); } @@ -5789,10 +5569,10 @@ class A { Object set g(x) => null; ''', [ - error(CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, 12, 6), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 38, 4), - error(CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, 46, 6), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 65, 4), + error(CompileTimeErrorCode.nonVoidReturnForSetter, 12, 6), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 38, 4), + error(CompileTimeErrorCode.nonVoidReturnForSetter, 46, 6), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 65, 4), ], ); } @@ -5805,8 +5585,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 3), - error(WarningCode.DEAD_CODE, 37, 1), + error(WarningCode.unusedLocalVariable, 15, 3), + error(WarningCode.deadCode, 37, 1), ], ); expectInitializerType('foo', 'int?'); @@ -5820,8 +5600,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 3), - error(WarningCode.DEAD_CODE, 34, 4), + error(WarningCode.unusedLocalVariable, 15, 3), + error(WarningCode.deadCode, 34, 4), ], ); expectInitializerType('foo', 'int?'); diff --git a/pkg/analyzer/test/generated/top_level_parser_test.dart b/pkg/analyzer/test/generated/top_level_parser_test.dart index d6c427e48c7..7967a8a4cd2 100644 --- a/pkg/analyzer/test/generated/top_level_parser_test.dart +++ b/pkg/analyzer/test/generated/top_level_parser_test.dart @@ -80,10 +80,10 @@ class TopLevelParserTest extends FastaParserTestCase { expect(member, isNotNull); assertErrors( errors: [ - expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 12, 2), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 13, 1), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 14, 0), - expectedError(ParserErrorCode.MISSING_IDENTIFIER, 14, 0), + expectedError(ParserErrorCode.expectedTypeName, 12, 2), + expectedError(ParserErrorCode.expectedToken, 13, 1), + expectedError(ParserErrorCode.missingIdentifier, 14, 0), + expectedError(ParserErrorCode.missingIdentifier, 14, 0), ], ); @@ -299,9 +299,7 @@ class TopLevelParserTest extends FastaParserTestCase { CompilationUnitMember member = parseFullCompilationUnitMember(); expect(member, isNotNull); if (!allowNativeClause) { - assertErrorsWithCodes([ - ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, - ]); + assertErrorsWithCodes([ParserErrorCode.nativeClauseShouldBeAnnotation]); } else { assertNoErrors(); } @@ -340,9 +338,7 @@ class A native 'something' { if (allowNativeClause) { assertNoErrors(); } else { - assertErrorsWithCodes([ - ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION, - ]); + assertErrorsWithCodes([ParserErrorCode.nativeClauseShouldBeAnnotation]); } expect(member, TypeMatcher()); var declaration = member as ClassDeclaration; @@ -443,7 +439,7 @@ class A native 'something' { void test_parseClassDeclaration_typeParameters_extends_void() { parseCompilationUnit( 'class C{}', - errors: [expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 18, 4)], + errors: [expectedError(ParserErrorCode.expectedTypeName, 18, 4)], ); } @@ -463,7 +459,7 @@ class A native 'something' { var diagnosticCodes = []; // This used to be deferred to later in the pipeline, but is now being // reported by the parser. - diagnosticCodes.add(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE); + diagnosticCodes.add(CompileTimeErrorCode.builtInIdentifierAsType); CompilationUnit unit = parseCompilationUnit( 'abstract _abstract = new abstract.A();', codes: diagnosticCodes, @@ -556,7 +552,7 @@ class A native 'something' { expect(unit, isNotNull); // This used to be deferred to later in the pipeline, but is now being // reported by the parser. - assertErrorsWithCodes([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); + assertErrorsWithCodes([CompileTimeErrorCode.builtInIdentifierAsType]); expect(unit.scriptTag, isNull); expect(unit.directives, hasLength(0)); expect(unit.declarations, hasLength(1)); @@ -568,7 +564,7 @@ class A native 'something' { expect(unit, isNotNull); // This used to be deferred to later in the pipeline, but is now being // reported by the parser. - assertErrorsWithCodes([CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); + assertErrorsWithCodes([CompileTimeErrorCode.builtInIdentifierAsType]); expect(unit.scriptTag, isNull); expect(unit.directives, hasLength(0)); expect(unit.declarations, hasLength(1)); @@ -1736,7 +1732,7 @@ enum E { parseFullCompilationUnitMember() as GenericTypeAlias; expect(alias, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 11, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 11, 1)], ); expect(alias.name, isNotNull); expect(alias.name.lexeme, 'F'); @@ -1754,7 +1750,7 @@ enum E { parseFullCompilationUnitMember() as GenericTypeAlias; expect(alias, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 10, 2)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 10, 2)], ); expect(alias.name, isNotNull); expect(alias.name.lexeme, 'F'); @@ -1772,7 +1768,7 @@ enum E { parseFullCompilationUnitMember() as GenericTypeAlias; expect(alias, isNotNull); assertErrors( - errors: [expectedError(ParserErrorCode.MISSING_IDENTIFIER, 10, 1)], + errors: [expectedError(ParserErrorCode.missingIdentifier, 10, 1)], ); expect(alias.name, isNotNull); expect(alias.name.lexeme, 'F'); @@ -2148,7 +2144,7 @@ mixin A { void test_parseTopLevelVariable_external_late() { var unit = parseCompilationUnit( 'external late int? i;', - errors: [expectedError(ParserErrorCode.EXTERNAL_LATE_FIELD, 0, 8)], + errors: [expectedError(ParserErrorCode.externalLateField, 0, 8)], ); var declaration = unit.declarations[0] as TopLevelVariableDeclaration; expect(declaration.externalKeyword, isNotNull); @@ -2157,7 +2153,7 @@ mixin A { void test_parseTopLevelVariable_external_late_final() { var unit = parseCompilationUnit( 'external late final int? i;', - errors: [expectedError(ParserErrorCode.EXTERNAL_LATE_FIELD, 0, 8)], + errors: [expectedError(ParserErrorCode.externalLateField, 0, 8)], ); var declaration = unit.declarations[0] as TopLevelVariableDeclaration; expect(declaration.externalKeyword, isNotNull); @@ -2166,7 +2162,7 @@ mixin A { void test_parseTopLevelVariable_final_late() { var unit = parseCompilationUnit( 'final late a;', - errors: [expectedError(ParserErrorCode.MODIFIER_OUT_OF_ORDER, 6, 4)], + errors: [expectedError(ParserErrorCode.modifierOutOfOrder, 6, 4)], ); var declaration = unit.declarations[0] as TopLevelVariableDeclaration; var declarationList = declaration.variables; @@ -2178,9 +2174,7 @@ mixin A { void test_parseTopLevelVariable_late() { var unit = parseCompilationUnit( 'late a;', - errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 5, 1), - ], + errors: [expectedError(ParserErrorCode.missingConstFinalVarOrType, 5, 1)], ); var declaration = unit.declarations[0] as TopLevelVariableDeclaration; var declarationList = declaration.variables; @@ -2201,9 +2195,7 @@ mixin A { void test_parseTopLevelVariable_late_init() { var unit = parseCompilationUnit( 'late a = 0;', - errors: [ - expectedError(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 5, 1), - ], + errors: [expectedError(ParserErrorCode.missingConstFinalVarOrType, 5, 1)], ); var declaration = unit.declarations[0] as TopLevelVariableDeclaration; var declarationList = declaration.variables; diff --git a/pkg/analyzer/test/generated/variance_parser_test.dart b/pkg/analyzer/test/generated/variance_parser_test.dart index 7466da7a756..8654b034291 100644 --- a/pkg/analyzer/test/generated/variance_parser_test.dart +++ b/pkg/analyzer/test/generated/variance_parser_test.dart @@ -47,21 +47,9 @@ class VarianceParserTest extends FastaParserTestCase { parseCompilationUnit( 'class A { }', errors: [ - expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - 8, - 2, - ), - expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - 14, - 5, - ), - expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - 23, - 3, - ), + expectedError(ParserErrorCode.experimentNotEnabledOffByDefault, 8, 2), + expectedError(ParserErrorCode.experimentNotEnabledOffByDefault, 14, 5), + expectedError(ParserErrorCode.experimentNotEnabledOffByDefault, 23, 3), ], featureSet: _disabledFeatureSet, ); @@ -71,11 +59,7 @@ class VarianceParserTest extends FastaParserTestCase { parseCompilationUnit( 'class A { }', errors: [ - expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - 8, - 3, - ), + expectedError(ParserErrorCode.experimentNotEnabledOffByDefault, 8, 3), ], featureSet: _disabledFeatureSet, ); @@ -129,8 +113,8 @@ class VarianceParserTest extends FastaParserTestCase { var unit = parseCompilationUnit( 'class A { }', errors: [ - expectedError(ParserErrorCode.MULTIPLE_VARIANCE_MODIFIERS, 11, 3), - expectedError(ParserErrorCode.MULTIPLE_VARIANCE_MODIFIERS, 15, 5), + expectedError(ParserErrorCode.multipleVarianceModifiers, 11, 3), + expectedError(ParserErrorCode.multipleVarianceModifiers, 15, 5), ], ); expect(unit.declarations, hasLength(1)); @@ -162,12 +146,8 @@ class VarianceParserTest extends FastaParserTestCase { parseCompilationUnit( 'void A(in int value) {}', errors: [ - expectedError( - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, - 7, - 2, - ), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 3), + expectedError(ParserErrorCode.expectedIdentifierButGotKeyword, 7, 2), + expectedError(ParserErrorCode.expectedToken, 10, 3), ], featureSet: _disabledFeatureSet, ); @@ -177,12 +157,8 @@ class VarianceParserTest extends FastaParserTestCase { parseCompilationUnit( 'void A(in int value) {}', errors: [ - expectedError( - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, - 7, - 2, - ), - expectedError(ParserErrorCode.EXPECTED_TOKEN, 10, 3), + expectedError(ParserErrorCode.expectedIdentifierButGotKeyword, 7, 2), + expectedError(ParserErrorCode.expectedToken, 10, 3), ], ); } @@ -190,7 +166,7 @@ class VarianceParserTest extends FastaParserTestCase { void test_list_disabled() { parseCompilationUnit( 'List stringList = [];', - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 6)], + errors: [expectedError(ParserErrorCode.expectedToken, 9, 6)], featureSet: _disabledFeatureSet, ); } @@ -198,7 +174,7 @@ class VarianceParserTest extends FastaParserTestCase { void test_list_enabled() { parseCompilationUnit( 'List stringList = [];', - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 6)], + errors: [expectedError(ParserErrorCode.expectedToken, 9, 6)], ); } @@ -206,16 +182,8 @@ class VarianceParserTest extends FastaParserTestCase { parseCompilationUnit( 'mixin A { }', errors: [ - expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - 8, - 5, - ), - expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - 17, - 3, - ), + expectedError(ParserErrorCode.experimentNotEnabledOffByDefault, 8, 5), + expectedError(ParserErrorCode.experimentNotEnabledOffByDefault, 17, 3), ], featureSet: _disabledFeatureSet, ); @@ -225,11 +193,7 @@ class VarianceParserTest extends FastaParserTestCase { parseCompilationUnit( 'mixin A { }', errors: [ - expectedError( - ParserErrorCode.EXPERIMENT_NOT_ENABLED_OFF_BY_DEFAULT, - 8, - 5, - ), + expectedError(ParserErrorCode.experimentNotEnabledOffByDefault, 8, 5), ], featureSet: _disabledFeatureSet, ); @@ -249,7 +213,7 @@ class VarianceParserTest extends FastaParserTestCase { void test_typedef_disabled() { parseCompilationUnit( 'typedef A = X Function(X);', - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 16, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 16, 1)], featureSet: _disabledFeatureSet, ); } @@ -257,7 +221,7 @@ class VarianceParserTest extends FastaParserTestCase { void test_typedef_enabled() { parseCompilationUnit( 'typedef A = X Function(X);', - errors: [expectedError(ParserErrorCode.EXPECTED_TOKEN, 16, 1)], + errors: [expectedError(ParserErrorCode.expectedToken, 16, 1)], ); } } diff --git a/pkg/analyzer/test/id_tests/constant_test.dart b/pkg/analyzer/test/id_tests/constant_test.dart index f00f748a54a..e2e7d9a4590 100644 --- a/pkg/analyzer/test/id_tests/constant_test.dart +++ b/pkg/analyzer/test/id_tests/constant_test.dart @@ -60,9 +60,7 @@ class ConstantsDataComputer extends DataComputer { var diagnosticCodes = diagnostics .map((e) => e.diagnosticCode) .where( - (c) => - c != - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + (c) => c != CompileTimeErrorCode.constInitializedWithNonConstantValue, ); return diagnosticCodes.isNotEmpty ? diagnosticCodes.join(',') : null; } diff --git a/pkg/analyzer/test/id_tests/definite_assignment_test.dart b/pkg/analyzer/test/id_tests/definite_assignment_test.dart index 65a687d6233..97cde8d1c4d 100644 --- a/pkg/analyzer/test/id_tests/definite_assignment_test.dart +++ b/pkg/analyzer/test/id_tests/definite_assignment_test.dart @@ -55,8 +55,7 @@ class _DefiniteAssignmentDataComputer extends DataComputer { .map((e) => e.diagnosticCode) .where( (c) => - c != - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + c != CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, ); return diagnosticCodes.isNotEmpty ? diagnosticCodes.join(',') : null; } diff --git a/pkg/analyzer/test/id_tests/definite_unassignment_test.dart b/pkg/analyzer/test/id_tests/definite_unassignment_test.dart index 7680b4a0521..edca4d31d08 100644 --- a/pkg/analyzer/test/id_tests/definite_unassignment_test.dart +++ b/pkg/analyzer/test/id_tests/definite_unassignment_test.dart @@ -55,8 +55,7 @@ class _DefiniteAssignmentDataComputer extends DataComputer { .map((e) => e.diagnosticCode) .where( (c) => - c != - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + c != CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, ); return diagnosticCodes.isNotEmpty ? diagnosticCodes.join(',') : null; } diff --git a/pkg/analyzer/test/source/error_processor_test.dart b/pkg/analyzer/test/source/error_processor_test.dart index fcc269dc134..294845eea86 100644 --- a/pkg/analyzer/test/source/error_processor_test.dart +++ b/pkg/analyzer/test/source/error_processor_test.dart @@ -21,7 +21,7 @@ main() { source: TestSource(), offset: 0, length: 1, - diagnosticCode: CompileTimeErrorCode.INVALID_ASSIGNMENT, + diagnosticCode: CompileTimeErrorCode.invalidAssignment, arguments: [ ['x'], ['y'], @@ -32,7 +32,7 @@ main() { source: TestSource(), offset: 0, length: 1, - diagnosticCode: WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, + diagnosticCode: WarningCode.assignmentOfDoNotStore, arguments: [ ['x'], ], @@ -42,7 +42,7 @@ main() { source: TestSource(), offset: 0, length: 1, - diagnosticCode: WarningCode.UNUSED_LOCAL_VARIABLE, + diagnosticCode: WarningCode.unusedLocalVariable, arguments: [ ['x'], ], @@ -52,7 +52,7 @@ main() { source: TestSource(), offset: 0, length: 1, - diagnosticCode: CompileTimeErrorCode.USE_OF_VOID_RESULT, + diagnosticCode: CompileTimeErrorCode.useOfVoidResult, ); // We in-line a lint code here in order to avoid adding a dependency on the 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 62495891885..54594841b46 100644 --- a/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart +++ b/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart @@ -62,7 +62,7 @@ int b = a; // `strict-cast: true`, so has errors. assertErrorsInList(await _computeTestFileDiagnostics(), [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 23, 1), + error(CompileTimeErrorCode.invalidAssignment, 23, 1), ]); } diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart index d563531842f..02964c3263e 100644 --- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart +++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart @@ -2679,7 +2679,7 @@ linter: library my.lib; part 'a.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 21, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 21, 8)], ); } @@ -2697,7 +2697,7 @@ linter: library my.lib; part 'a.dart'; ''', - [error(CompileTimeErrorCode.PART_OF_NON_PART, 21, 8)], + [error(CompileTimeErrorCode.partOfNonPart, 21, 8)], ); } @@ -2717,7 +2717,7 @@ part of other.lib; library my.lib; part 'a.dart'; ''', - [error(CompileTimeErrorCode.PART_OF_DIFFERENT_LIBRARY, 21, 8)], + [error(CompileTimeErrorCode.partOfDifferentLibrary, 21, 8)], ); } @@ -2737,7 +2737,7 @@ part of 'not_test.dart'; library my.lib; part 'a.dart'; ''', - [error(CompileTimeErrorCode.PART_OF_DIFFERENT_LIBRARY, 21, 8)], + [error(CompileTimeErrorCode.partOfDifferentLibrary, 21, 8)], ); } @@ -3317,7 +3317,7 @@ elementFactory var result = await driver.getErrors(a.path); result as ErrorsResult; assertErrorsInList(result.diagnostics, [ - error(CompileTimeErrorCode.MISSING_DART_LIBRARY, 0, 0), + error(CompileTimeErrorCode.missingDartLibrary, 0, 0), ]); } @@ -3330,7 +3330,7 @@ elementFactory var result = await driver.getErrors(a.path); result as ErrorsResult; assertErrorsInList(result.diagnostics, [ - error(CompileTimeErrorCode.MISSING_DART_LIBRARY, 0, 0), + error(CompileTimeErrorCode.missingDartLibrary, 0, 0), ]); } diff --git a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart index 6955339d7f9..be95cb676a2 100644 --- a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart +++ b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart @@ -90,7 +90,7 @@ int 6 ''' const int x = 'foo'; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 14, 5)], + [error(CompileTimeErrorCode.invalidAssignment, 14, 5)], ); } @@ -143,12 +143,8 @@ class A { const v = .new() == A(); ''', [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 36, - 6, - ), - error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 37, 3), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 36, 6), + error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 37, 3), ], ); } @@ -179,12 +175,8 @@ class A { const v = A() == .method(); ''', [ - error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 51, 3), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 51, - 3, - ), + error(CompileTimeErrorCode.constWithNonConst, 51, 3), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 51, 3), ], ); } @@ -197,7 +189,7 @@ class A { } const A a = .method(); ''', - [error(CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, 52, 9)], + [error(CompileTimeErrorCode.constEvalMethodInvocation, 52, 9)], ); } @@ -207,12 +199,8 @@ const A a = .method(); const a = .new(); ''', [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 10, - 6, - ), - error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 11, 3), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 6), + error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 11, 3), ], ); } @@ -223,12 +211,8 @@ const a = .new(); const a = .id; ''', [ - error(CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, 10, 3), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 10, - 3, - ), + error(CompileTimeErrorCode.dotShorthandMissingContext, 10, 3), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 3), ], ); } @@ -277,7 +261,7 @@ enum E { final Iterable strings; } ''', - [error(CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, 21, 22)], + [error(CompileTimeErrorCode.constEvalMethodInvocation, 21, 22)], ); } @@ -537,12 +521,8 @@ bool false const v = a == 1; ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 10, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 10, - 1, - ), + error(CompileTimeErrorCode.undefinedIdentifier, 10, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 1), ], ); } @@ -553,12 +533,8 @@ const v = a == 1; const v = 1 == a; ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 15, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 15, - 1, - ), + error(CompileTimeErrorCode.undefinedIdentifier, 15, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 15, 1), ], ); } @@ -695,7 +671,7 @@ class A { const v = A() == 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, 72, 8)], + [error(CompileTimeErrorCode.constEvalPrimitiveEquality, 72, 8)], ); var result = _topLevelVar('v'); _assertNull(result); @@ -711,7 +687,7 @@ class A { const v = A() == 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, 61, 8)], + [error(CompileTimeErrorCode.constEvalPrimitiveEquality, 61, 8)], ); var result = _topLevelVar('v'); _assertNull(result); @@ -743,7 +719,7 @@ class A { const v = A() == 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, 52, 8)], + [error(CompileTimeErrorCode.constEvalTypeBoolNumString, 52, 8)], ); var result = _topLevelVar('v'); _assertNull(result); @@ -775,7 +751,7 @@ class A { const v = A() == A(); ''', - [error(CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, 72, 10)], + [error(CompileTimeErrorCode.constEvalPrimitiveEquality, 72, 10)], ); } @@ -1422,8 +1398,8 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 49, 1), - error(CompileTimeErrorCode.CONST_TYPE_PARAMETER, 53, 1), + error(WarningCode.unusedLocalVariable, 49, 1), + error(CompileTimeErrorCode.constTypeParameter, 53, 1), ], ); var result = _localVar('x'); @@ -1440,7 +1416,7 @@ extension on Object { const Object v1 = 0; const v2 = v1 + v1; ''', - [error(CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, 94, 7)], + [error(CompileTimeErrorCode.constEvalExtensionMethod, 94, 7)], ); var result = _topLevelVar('v2'); _assertNull(result); @@ -1456,7 +1432,7 @@ extension type const A(int it) { const v1 = A(1); const v2 = v1 + 2; ''', - [error(CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, 101, 6)], + [error(CompileTimeErrorCode.constEvalExtensionTypeMethod, 101, 6)], ); var result = _topLevelVar('v2'); _assertNull(result); @@ -1537,7 +1513,7 @@ int 0 ''' const c = 0xFFFFFFFF >>> -2; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 10, 17)], + [error(CompileTimeErrorCode.constEvalThrowsException, 10, 17)], ); var result = _topLevelVar('c'); _assertNull(result); @@ -1594,7 +1570,7 @@ int 0 ''' const c = 0xFF >>> -2; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 10, 11)], + [error(CompileTimeErrorCode.constEvalThrowsException, 10, 11)], ); var result = _topLevelVar('c'); _assertNull(result); @@ -1641,13 +1617,9 @@ final x = 0; const c = x ?? 1; ''', [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 23, - 1, - ), - error(WarningCode.DEAD_CODE, 25, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 28, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 23, 1), + error(WarningCode.deadCode, 25, 4), + error(StaticWarningCode.deadNullAwareExpression, 28, 1), ], ); } @@ -1659,13 +1631,9 @@ final x = 1; const c = 0 ?? x; ''', [ - error(WarningCode.DEAD_CODE, 25, 4), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 28, - 1, - ), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 28, 1), + error(WarningCode.deadCode, 25, 4), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 28, 1), + error(StaticWarningCode.deadNullAwareExpression, 28, 1), ], ); } @@ -1676,8 +1644,8 @@ const c = 0 ?? x; const c = null ? 1 : 0; ''', [ - error(CompileTimeErrorCode.NON_BOOL_CONDITION, 10, 4), - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, 10, 4), + error(CompileTimeErrorCode.nonBoolCondition, 10, 4), + error(CompileTimeErrorCode.constEvalTypeBool, 10, 4), ], ); } @@ -1726,12 +1694,8 @@ class A { } ''', [ - error(CompileTimeErrorCode.INVALID_CONSTANT, 76, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 76, - 1, - ), + error(CompileTimeErrorCode.invalidConstant, 76, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 76, 1), ], ); var result = _topLevelVar('x'); @@ -1745,13 +1709,9 @@ const bool kIsWeb = identical(0, 0.0); const x = kIsWeb ? a : b; ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 58, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 58, - 1, - ), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 62, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 58, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 58, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 62, 1), ], ); var result = _topLevelVar('x'); @@ -1767,7 +1727,7 @@ class A { } ''', - [error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 31, 1)], + [error(CompileTimeErrorCode.recursiveConstantConstructor, 31, 1)], ); } @@ -1794,8 +1754,8 @@ class EmptyInjector extends BaseInjector implements Injector { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 110, 12), - error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 344, 13), + error(CompileTimeErrorCode.recursiveConstantConstructor, 110, 12), + error(CompileTimeErrorCode.recursiveConstantConstructor, 344, 13), ], ); } @@ -1811,8 +1771,7 @@ class A { ''', [ error( - CompileTimeErrorCode - .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, + CompileTimeErrorCode.constConstructorWithFieldInitializedByNonConst, 27, 5, ), @@ -2175,7 +2134,7 @@ class C { ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 83, 1, ), @@ -2238,7 +2197,7 @@ void Function(int) void f(T a) {} const g = f; ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 42, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 42, 6)], ); var result = _topLevelVar('g'); assertDartObjectText(result, r''' @@ -2257,10 +2216,10 @@ void foo(T a) {} const g = foo; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_NUM, 30, 8), - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 33, 1), - error(ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, 38, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 39, 1), + error(CompileTimeErrorCode.constEvalTypeNum, 30, 8), + error(CompileTimeErrorCode.undefinedOperator, 33, 1), + error(ParserErrorCode.equalityCannotBeEqualityOperand, 38, 1), + error(ParserErrorCode.missingIdentifier, 39, 1), ], ); var result = _topLevelVar('g'); @@ -2273,13 +2232,7 @@ const g = foo; void foo(T a, U b) {} const g = foo; ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 41, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 41, 5)], ); var result = _topLevelVar('g'); _assertNull(result); @@ -2291,13 +2244,7 @@ const g = foo; void foo(T a) {} const g = foo; ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 33, - 13, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 33, 13)], ); var result = _topLevelVar('g'); _assertNull(result); @@ -2315,9 +2262,9 @@ class C { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 55, 1), + error(WarningCode.unusedLocalVariable, 55, 1), error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 61, 1, ), @@ -2567,13 +2514,9 @@ test() { } ''', [ - error(WarningCode.DEAD_CODE, 11, 11), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 35, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 35, - 1, - ), + error(WarningCode.deadCode, 11, 11), + error(CompileTimeErrorCode.undefinedIdentifier, 35, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 35, 1), ], ); } @@ -2594,12 +2537,8 @@ class A { const a = A(x: false); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 58, 5), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 55, - 8, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 58, 5), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 55, 8), ], ); } @@ -2616,12 +2555,8 @@ class B extends A { const a = B(x: false); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 113, 5), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 110, - 8, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 113, 5), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 110, 8), ], ); } @@ -2635,12 +2570,8 @@ class A { const a = A(false); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 42, 5), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 42, - 5, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 42, 5), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 42, 5), ], ); } @@ -2657,12 +2588,8 @@ class B extends A { const a = B(false); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 84, 5), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 84, - 5, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 84, 5), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 84, 5), ], ); } @@ -2675,7 +2602,7 @@ class A { } const a = A(); ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 52, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 52, 1)], ); } @@ -2691,14 +2618,14 @@ class B extends A { const a = B(); ''', [ - error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 106, 1), + error(CompileTimeErrorCode.missingRequiredArgument, 106, 1), error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 106, 3, ), error( - CompileTimeErrorCode.INVALID_CONSTANT, + CompileTimeErrorCode.invalidConstant, 106, 3, contextMessages: [message(testFile, 88, 1)], @@ -2717,7 +2644,7 @@ const a = A(); ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 42, 1, ), @@ -2738,17 +2665,13 @@ const a = B(); ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 84, 1, ), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 82, 3), error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 82, - 3, - ), - error( - CompileTimeErrorCode.INVALID_CONSTANT, + CompileTimeErrorCode.invalidConstant, 82, 3, contextMessages: [message(testFile, 66, 1)], @@ -2780,12 +2703,8 @@ class A {} const a = A(); ''', [ - error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 21, 3), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 21, - 3, - ), + error(CompileTimeErrorCode.constWithNonConst, 21, 3), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 21, 3), ], ); } @@ -2821,16 +2740,12 @@ const x = C.(); // TODO(kallentu): This should not be reported. // https://github.com/dart-lang/sdk/issues/50441 error( - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_UNKNOWN_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToUnknownMember, 45, 8, ), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 45, - 8, - ), - error(ParserErrorCode.MISSING_IDENTIFIER, 52, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 45, 8), + error(ParserErrorCode.missingIdentifier, 52, 1), ], ); } @@ -2840,7 +2755,7 @@ const x = C.(); r''' const x = '${const [2]}'; ''', - [error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, 11, 12)], + [error(CompileTimeErrorCode.constEvalTypeBoolNumString, 11, 12)], ); } @@ -2850,7 +2765,7 @@ const x = '${const [2]}'; void foo(int a) {} const c = foo is void Function(int); ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 29, 25)], + [error(WarningCode.unnecessaryTypeCheckTrue, 29, 25)], ); var result = _topLevelVar('c'); assertDartObjectText(result, r''' @@ -2868,7 +2783,7 @@ class A { const A(); } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 31, 6)], + [error(WarningCode.unnecessaryTypeCheckTrue, 31, 6)], ); var result = _topLevelVar('b'); assertDartObjectText(result, r''' @@ -2889,7 +2804,7 @@ class B extends A { const B(); } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 31, 6)], + [error(WarningCode.unnecessaryTypeCheckTrue, 31, 6)], ); var result = _topLevelVar('b'); assertDartObjectText(result, r''' @@ -2945,7 +2860,7 @@ class A { const A(); } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 31, 7)], + [error(WarningCode.unnecessaryTypeCheckFalse, 31, 7)], ); var result = _topLevelVar('b'); assertDartObjectText(result, r''' @@ -2966,7 +2881,7 @@ class B extends A { const B(); } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 31, 7)], + [error(WarningCode.unnecessaryTypeCheckFalse, 31, 7)], ); var result = _topLevelVar('b'); assertDartObjectText(result, r''' @@ -2995,11 +2910,11 @@ const x = [for (int i = 0; i < 3; i++) i]; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 31, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 11, 29), + error(CompileTimeErrorCode.constEvalForElement, 11, 29), ], ); var result = _topLevelVar('x'); @@ -3012,7 +2927,7 @@ const x = [for (int i = 0; i < 3; i++) i]; const dynamic c = 2; const x = [1, if (c) 2 else 3, 4]; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 39, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 39, 1)], ); var result = _topLevelVar('x'); _assertNull(result); @@ -3023,7 +2938,7 @@ const x = [1, if (c) 2 else 3, 4]; r''' const x = [1, if (1) 2 else 3, 4]; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 18, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 18, 1)], ); var result = _topLevelVar('x'); _assertNull(result); @@ -3066,7 +2981,7 @@ class A { List foo() => const [bar]; } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 79, 3)], + [error(CompileTimeErrorCode.nonConstantListElement, 79, 3)], ); } @@ -3122,7 +3037,7 @@ List const dynamic a = 5; const x = [...a]; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, 40, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedListOrSet, 40, 1)], ); var result = _topLevelVar('x'); _assertNull(result); @@ -3173,7 +3088,7 @@ int f() { } const a = f(); ''', - [error(CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, 34, 3)], + [error(CompileTimeErrorCode.constEvalMethodInvocation, 34, 3)], ); } @@ -3184,7 +3099,7 @@ void f(Object? x) { if (x case const (T)) {} } ''', - [error(CompileTimeErrorCode.CONST_TYPE_PARAMETER, 43, 1)], + [error(CompileTimeErrorCode.constTypeParameter, 43, 1)], ); } @@ -3195,7 +3110,7 @@ void f(Object? x) { if (x case const (List)) {} } ''', - [error(CompileTimeErrorCode.CONST_TYPE_PARAMETER, 43, 7)], + [error(CompileTimeErrorCode.constTypeParameter, 43, 7)], ); } @@ -3292,7 +3207,7 @@ class RequiresNonEmptyList { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, + CompileTimeErrorCode.constEvalPropertyAccess, 16, 31, contextMessages: [ @@ -3330,7 +3245,7 @@ extension on Object { const Object v1 = 1; const v2 = -v1; ''', - [error(CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, 82, 3)], + [error(CompileTimeErrorCode.constEvalExtensionMethod, 82, 3)], ); var result = _topLevelVar('v2'); _assertNull(result); @@ -3346,7 +3261,7 @@ extension type const A(int it) { const v1 = A(1); const v2 = -v1; ''', - [error(CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, 89, 3)], + [error(CompileTimeErrorCode.constEvalExtensionTypeMethod, 89, 3)], ); var result = _topLevelVar('v2'); _assertNull(result); @@ -3383,8 +3298,8 @@ bool false const c = -true; ''', [ - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 10, 1), - error(CompileTimeErrorCode.CONST_EVAL_TYPE_NUM, 10, 5), + error(CompileTimeErrorCode.undefinedOperator, 10, 1), + error(CompileTimeErrorCode.constEvalTypeNum, 10, 5), ], ); } @@ -3544,7 +3459,7 @@ Record({int f1, int f2}) final bar = ''; ({String bar, }) foo() => const (bar: bar, ); ''', - [error(CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD, 54, 3)], + [error(CompileTimeErrorCode.nonConstantRecordField, 54, 3)], ); } @@ -3595,7 +3510,7 @@ Record(int, int, int) final bar = ''; (String, ) foo() => const (bar, ); ''', - [error(CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD, 43, 3)], + [error(CompileTimeErrorCode.nonConstantRecordField, 43, 3)], ); } @@ -3621,7 +3536,7 @@ Record(int, String, {bool c}) const l = []; const ambiguous = {...l, 1: 2}; ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH, 32, 12)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralBoth, 32, 12)], ); } @@ -3631,7 +3546,7 @@ const ambiguous = {...l, 1: 2}; const int? i = 1; const res = {...?i}; ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, 31, 7)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, 31, 7)], ); } @@ -3641,7 +3556,7 @@ const res = {...?i}; const m = {1: 1}; const res = {...m, 2}; ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH, 30, 9)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralBoth, 30, 9)], ); } @@ -3652,7 +3567,7 @@ const l = []; const ambiguous = {...l, 1: 2}; const anotherList = [...ambiguous]; ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH, 32, 12)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralBoth, 32, 12)], ); } @@ -3692,11 +3607,11 @@ const x = {1: null, for (final i in const []) i: null}; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 44, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 20, 33), + error(CompileTimeErrorCode.constEvalForElement, 20, 33), ], ); var result = _topLevelVar('x'); @@ -3710,11 +3625,11 @@ const x = {1: null, if (true) for (final i in const []) i: null}; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 54, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 30, 33), + error(CompileTimeErrorCode.constEvalForElement, 30, 33), ], ); var result = _topLevelVar('x'); @@ -3727,7 +3642,7 @@ const x = {1: null, if (true) for (final i in const []) i: null}; const dynamic nonBool = null; const c = const {if (nonBool) 'a' : 1}; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 51, 7)], + [error(CompileTimeErrorCode.nonBoolCondition, 51, 7)], ); var result = _topLevelVar('c'); _assertNull(result); @@ -3783,8 +3698,8 @@ const Map alwaysInclude = { }; ''', [ - error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, 90, 1), - error(CompileTimeErrorCode.NOT_MAP_SPREAD, 90, 1), + error(CompileTimeErrorCode.constSpreadExpectedMap, 90, 1), + error(CompileTimeErrorCode.notMapSpread, 90, 1), ], ); } @@ -3850,11 +3765,11 @@ const x = {for (final i in set) i}; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 30, 24, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 31, 22), + error(CompileTimeErrorCode.constEvalForElement, 31, 22), ], ); var result = _topLevelVar('x'); @@ -3867,7 +3782,7 @@ const x = {for (final i in set) i}; const dynamic nonBool = 'a'; const c = const {if (nonBool) 3}; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 50, 7)], + [error(CompileTimeErrorCode.nonBoolCondition, 50, 7)], ); var result = _topLevelVar('c'); _assertNull(result); @@ -4065,7 +3980,7 @@ extension type const A(int it) { const v1 = A(1); const v2 = -v1; ''', - [error(CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, 89, 3)], + [error(CompileTimeErrorCode.constEvalExtensionTypeMethod, 89, 3)], ); var result = _topLevelVar('v2'); _assertNull(result); @@ -4357,7 +4272,7 @@ class B extends A { const B(); } ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 31, 6)], + [error(CompileTimeErrorCode.constEvalThrowsException, 31, 6)], ); var result = _topLevelVar('b'); _assertNull(result); @@ -4375,7 +4290,7 @@ class B { const B(); } ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 31, 6)], + [error(CompileTimeErrorCode.constEvalThrowsException, 31, 6)], ); var result = _topLevelVar('b'); _assertNull(result); @@ -4416,8 +4331,8 @@ class C { const c = C() + 1; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_NUM_STRING, 80, 7), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 86, 1), + error(CompileTimeErrorCode.constEvalTypeNumString, 80, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 86, 1), ], ); } @@ -4462,12 +4377,8 @@ final a = false; const c = false && a; ''', [ - error(WarningCode.DEAD_CODE, 33, 4), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 36, - 1, - ), + error(WarningCode.deadCode, 33, 4), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 36, 1), ], ); } @@ -4478,13 +4389,7 @@ const c = false && a; final a = false; const c = a && false; ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 27, - 1, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 27, 1)], ); } @@ -4494,13 +4399,7 @@ const c = a && false; final a = false; const c = a && true; ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 27, - 1, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 27, 1)], ); } @@ -4527,13 +4426,7 @@ const c = false & b; final a = false; const c = true && a; ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 27, - 9, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 27, 9)], ); } @@ -4573,8 +4466,8 @@ int 10 const c = 3 & false; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT, 10, 9), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 14, 5), + error(CompileTimeErrorCode.constEvalTypeBoolInt, 10, 9), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 14, 5), ], ); } @@ -4628,7 +4521,7 @@ double Infinity ''' const c = double.nan == 2.3; ''', - [error(WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE, 10, 13)], + [error(WarningCode.unnecessaryNanComparisonFalse, 10, 13)], ); // This test case produces a warning, but the value of the constant should // be `false`. @@ -4644,7 +4537,7 @@ bool false ''' const c = 2.3 == double.nan; ''', - [error(WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE, 14, 13)], + [error(WarningCode.unnecessaryNanComparisonFalse, 14, 13)], ); // This test case produces a warning, but the value of the constant should // be `false`. @@ -4705,12 +4598,8 @@ bool true const c = a != 3; ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 10, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 10, - 1, - ), + error(CompileTimeErrorCode.undefinedIdentifier, 10, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 1), ], ); } @@ -4721,12 +4610,8 @@ const c = a != 3; const c = 2 != a; ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 15, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 15, - 1, - ), + error(CompileTimeErrorCode.undefinedIdentifier, 15, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 15, 1), ], ); } @@ -4750,7 +4635,7 @@ const c = false || a; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 27, 10, ), @@ -4764,13 +4649,7 @@ const c = false || a; final a = false; const c = a || false; ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 27, - 1, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 27, 1)], ); } @@ -4780,13 +4659,7 @@ const c = a || false; final a = false; const c = a || true; ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 27, - 1, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 27, 1)], ); } @@ -4814,12 +4687,8 @@ final a = false; const c = true || a; ''', [ - error(WarningCode.DEAD_CODE, 32, 4), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 35, - 1, - ), + error(WarningCode.deadCode, 32, 4), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 35, 1), ], ); } @@ -4856,7 +4725,7 @@ const c = 3 | 5; ''' const c = true || false; ''', - [error(WarningCode.DEAD_CODE, 15, 8)], + [error(WarningCode.deadCode, 15, 8)], ); var result = _topLevelVar('c'); assertDartObjectText(result, r''' @@ -4871,8 +4740,8 @@ bool true const c = 3 | false; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT, 10, 9), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 14, 5), + error(CompileTimeErrorCode.constEvalTypeBoolInt, 10, 9), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 14, 5), ], ); } @@ -4892,13 +4761,7 @@ const c = 'a' ?? 'b'; const c = null ?? new C(); class C {} ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 18, - 7, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 18, 7)], ); } @@ -4969,8 +4832,8 @@ const c = 3 ^ 5; const c = 3 ^ false; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT, 10, 9), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 14, 5), + error(CompileTimeErrorCode.constEvalTypeBoolInt, 10, 9), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 14, 5), ], ); } @@ -5004,7 +4867,7 @@ bool true ''' const c = false ? 1 : 0; ''', - [error(WarningCode.DEAD_CODE, 18, 1)], + [error(WarningCode.deadCode, 18, 1)], ); var result = _topLevelVar('c'); assertDartObjectText(result, r''' @@ -5018,7 +4881,7 @@ int 0 ''' const c = true ? 1 : 0; ''', - [error(WarningCode.DEAD_CODE, 21, 1)], + [error(WarningCode.deadCode, 21, 1)], ); var result = _topLevelVar('c'); assertDartObjectText(result, r''' @@ -5033,13 +4896,9 @@ int 1 const c = true ? 1 : x; ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 21, 1), - error(WarningCode.DEAD_CODE, 21, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 21, - 1, - ), + error(CompileTimeErrorCode.undefinedIdentifier, 21, 1), + error(WarningCode.deadCode, 21, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 21, 1), ], ); } @@ -5050,13 +4909,9 @@ const c = true ? 1 : x; const c = true ? x : 0; ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 17, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 17, - 1, - ), - error(WarningCode.DEAD_CODE, 21, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 17, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 17, 1), + error(WarningCode.deadCode, 21, 1), ], ); } @@ -5066,7 +4921,7 @@ const c = true ? x : 0; ''' const c = false ? 1 : 0; ''', - [error(WarningCode.DEAD_CODE, 18, 1)], + [error(WarningCode.deadCode, 18, 1)], ); var result = _topLevelVar('c'); assertDartObjectText(result, r''' @@ -5081,13 +4936,9 @@ int 0 const c = false ? 1 : new C(); ''', [ - error(WarningCode.DEAD_CODE, 18, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 22, - 7, - ), - error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 26, 1), + error(WarningCode.deadCode, 18, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 22, 7), + error(CompileTimeErrorCode.newWithNonType, 26, 1), ], ); } @@ -5098,13 +4949,9 @@ const c = false ? 1 : new C(); const c = false ? new C() : 0; ''', [ - error(WarningCode.DEAD_CODE, 18, 7), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 18, - 7, - ), - error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 22, 1), + error(WarningCode.deadCode, 18, 7), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 18, 7), + error(CompileTimeErrorCode.newWithNonType, 22, 1), ], ); } @@ -5115,8 +4962,8 @@ const c = false ? new C() : 0; const c = 3 ? 1 : 0; ''', [ - error(CompileTimeErrorCode.NON_BOOL_CONDITION, 10, 1), - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, 10, 1), + error(CompileTimeErrorCode.nonBoolCondition, 10, 1), + error(CompileTimeErrorCode.constEvalTypeBool, 10, 1), ], ); } @@ -5126,7 +4973,7 @@ const c = 3 ? 1 : 0; ''' const c = true ? 1 : 0; ''', - [error(WarningCode.DEAD_CODE, 21, 1)], + [error(WarningCode.deadCode, 21, 1)], ); var result = _topLevelVar('c'); assertDartObjectText(result, r''' @@ -5141,13 +4988,9 @@ int 1 const c = true ? 1: new C(); ''', [ - error(WarningCode.DEAD_CODE, 20, 7), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 20, - 7, - ), - error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 24, 1), + error(WarningCode.deadCode, 20, 7), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 20, 7), + error(CompileTimeErrorCode.newWithNonType, 24, 1), ], ); } @@ -5159,12 +5002,8 @@ const c = true ? new C() : 0; class C {} ''', [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 17, - 7, - ), - error(WarningCode.DEAD_CODE, 27, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 17, 7), + error(WarningCode.deadCode, 27, 1), ], ); } @@ -5176,7 +5015,7 @@ const c = identical(0, 0.0) ? 1 : new Object(); ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 34, 12, ), @@ -5191,7 +5030,7 @@ const c = identical(0, 0.0) ? 1 : new Object(); ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 34, 12, ), @@ -5296,7 +5135,7 @@ const a = null; const b = a is dynamic; class A {} ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 26, 12)], + [error(WarningCode.unnecessaryTypeCheckTrue, 26, 12)], ); var result = _topLevelVar('b'); assertDartObjectText(result, r''' @@ -5312,7 +5151,7 @@ const a = null; const b = a is Null; class A {} ''', - [error(WarningCode.TYPE_CHECK_IS_NULL, 26, 9)], + [error(WarningCode.typeCheckIsNull, 26, 9)], ); var result = _topLevelVar('b'); assertDartObjectText(result, r''' @@ -5415,7 +5254,7 @@ const b = B(''); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, + CompileTimeErrorCode.constEvalExtensionMethod, 128, 5, contextMessages: [ @@ -5442,7 +5281,7 @@ extension type const A(String it) { const v1 = A(''); const v2 = v1.length; ''', - [error(CompileTimeErrorCode.CONST_EVAL_EXTENSION_TYPE_METHOD, 91, 9)], + [error(CompileTimeErrorCode.constEvalExtensionTypeMethod, 91, 9)], ); var result = _topLevelVar('v2'); _assertNull(result); @@ -5474,7 +5313,7 @@ const y = B(x); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_TYPE_STRING, + CompileTimeErrorCode.constEvalTypeString, 70, 4, contextMessages: [ @@ -5487,8 +5326,8 @@ const y = B(x); ), ], ), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 72, 1), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 72, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 72, 1), + error(CompileTimeErrorCode.constWithNonConstantArgument, 72, 1), ], ); } @@ -5550,18 +5389,9 @@ test() { } ''', [ - error( - WarningCode.UNUSED_LOCAL_VARIABLE, - 35, - 1, - messageContains: ["'c'"], - ), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 39, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 39, - 1, - ), + error(WarningCode.unusedLocalVariable, 35, 1, messageContains: ["'c'"]), + error(CompileTimeErrorCode.undefinedIdentifier, 39, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 39, 1), ], ); } @@ -5601,12 +5431,8 @@ String abc const c = 'a${f()}c'; ''', [ - error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 14, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 14, - 3, - ), + error(CompileTimeErrorCode.undefinedFunction, 14, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 14, 3), ], ); } @@ -5716,9 +5542,9 @@ class A { const a = const A(null); ''', [ - error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 31, 9), + error(WarningCode.unnecessaryTypeCheckFalse, 31, 9), error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 56, 13, contextMessages: [ @@ -5731,7 +5557,7 @@ const a = const A(null); ), ], ), - error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 64, 4), + error(CompileTimeErrorCode.extraPositionalArguments, 64, 4), ], ); } @@ -5747,7 +5573,7 @@ const a = const A(); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 60, 15, contextMessages: [ @@ -5773,7 +5599,7 @@ class A { const a = const A(null); ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 67, 4)], + [error(CompileTimeErrorCode.extraPositionalArguments, 67, 4)], ); var result = _topLevelVar('a'); assertDartObjectText(result, ''' @@ -5797,7 +5623,7 @@ const c = const A(E.a); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 73, 12, contextMessages: [ @@ -5854,7 +5680,7 @@ main() { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 124, 10, contextMessages: [ @@ -5886,7 +5712,7 @@ class A { } const a = const A(0); ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 38, 11)], + [error(WarningCode.unnecessaryTypeCheckTrue, 38, 11)], ); var result = _topLevelVar('a'); assertDartObjectText(result, ''' @@ -5909,7 +5735,7 @@ const a = const A(1); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 71, 10, contextMessages: [ @@ -5954,7 +5780,7 @@ const a = const A(); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 56, 9, contextMessages: [ @@ -5979,7 +5805,7 @@ class A { } const a = const A(); ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 30, 8)], + [error(WarningCode.unnecessaryTypeCheckTrue, 30, 8)], ); var result = _topLevelVar('a'); assertDartObjectText(result, ''' @@ -6003,7 +5829,7 @@ const b = const B(); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 101, 9, contextMessages: [ @@ -6038,7 +5864,7 @@ class B extends A { } const b = const B(); ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 30, 8)], + [error(WarningCode.unnecessaryTypeCheckTrue, 30, 8)], ); var result = _topLevelVar('b'); assertDartObjectText(result, ''' @@ -6062,7 +5888,7 @@ const a = const A(0); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 55, 10, contextMessages: [ @@ -6089,7 +5915,7 @@ const a = const A(0); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 84, 10, contextMessages: [ @@ -6115,11 +5941,11 @@ class A { const a = const A(0); ''', [ - error(CompileTimeErrorCode.INVALID_CONSTANT, 45, 8), - error(CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION, 45, 8), - error(WarningCode.DEAD_CODE, 54, 3), + error(CompileTimeErrorCode.invalidConstant, 45, 8), + error(CompileTimeErrorCode.constConstructorThrowsException, 45, 8), + error(WarningCode.deadCode, 54, 3), error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 70, 10, contextMessages: [ @@ -6309,7 +6135,7 @@ class A { const A(List p); } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 91, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 91, 1)], ); } @@ -6374,7 +6200,7 @@ class A { const A(List p); } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 98, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 98, 1)], ); } @@ -6401,7 +6227,7 @@ class A { const A((int, ) p); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 84, 1)], + [error(CompileTimeErrorCode.invalidConstant, 84, 1)], ); } @@ -6431,9 +6257,9 @@ class A { const A a = .new(); ''', [ - error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 31, 9), + error(WarningCode.unnecessaryTypeCheckFalse, 31, 9), error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 58, 6, contextMessages: [ @@ -6478,7 +6304,7 @@ const A a = .new(.a); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 74, 8, contextMessages: [ @@ -6530,7 +6356,7 @@ class B extends A { } const B b = .new(); ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 30, 8)], + [error(WarningCode.unnecessaryTypeCheckTrue, 30, 8)], ); var result = _topLevelVar('b'); assertDartObjectText(result, ''' @@ -6622,9 +6448,9 @@ extension type const B(A a) {} const B b = .new(A()); ''', [ - error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 108, 3), + error(CompileTimeErrorCode.constWithNonConst, 108, 3), error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 108, 3, ), @@ -6655,7 +6481,7 @@ main() { ''', [ error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_CONSTANT_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.constConstructorConstantFromDeferredLibrary, 93, 2, ), @@ -6778,9 +6604,9 @@ class A { const a = const A(); ''', [ - error(CompileTimeErrorCode.INVALID_CONSTANT, 62, 1), + error(CompileTimeErrorCode.invalidConstant, 62, 1), error( - CompileTimeErrorCode.INVALID_CONSTANT, + CompileTimeErrorCode.invalidConstant, 77, 14, contextMessages: [ @@ -6794,7 +6620,7 @@ const a = const A(); ], ), error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 77, 14, ), @@ -6864,12 +6690,8 @@ int bar = 2; const a = const Foo(bar); ''', [ - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 88, 3), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 88, - 3, - ), + error(CompileTimeErrorCode.constWithNonConstantArgument, 88, 3), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 88, 3), ], ); } @@ -6886,7 +6708,7 @@ void main() { const C(() {}); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 83, 5)], + [error(CompileTimeErrorCode.constWithNonConstantArgument, 83, 5)], ); } @@ -6906,7 +6728,7 @@ void main() { [ // TODO(kallentu): Fix [InvalidConstant.genericError] to handle // NamedExpressions. - error(CompileTimeErrorCode.INVALID_CONSTANT, 148, 4), + error(CompileTimeErrorCode.invalidConstant, 148, 4), ], ); } @@ -6922,7 +6744,7 @@ class A { const A(List p); } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 28, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 28, 1)], ); } @@ -7341,7 +7163,7 @@ const f = const E('0.0'); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 153, 14, contextMessages: [ @@ -7461,12 +7283,8 @@ class A { } ''', [ - error(CompileTimeErrorCode.INVALID_CONSTANT, 63, 1), - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 63, - 1, - ), + error(CompileTimeErrorCode.invalidConstant, 63, 1), + error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 63, 1), ], ); } diff --git a/pkg/analyzer/test/src/dart/element/class_element_test.dart b/pkg/analyzer/test/src/dart/element/class_element_test.dart index 81b44a6fc90..8ab5a66416e 100644 --- a/pkg/analyzer/test/src/dart/element/class_element_test.dart +++ b/pkg/analyzer/test/src/dart/element/class_element_test.dart @@ -412,8 +412,8 @@ class A extends B {} class B extends A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 27, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 27, 1), ], ); var B = findElement2.class_('B'); @@ -703,8 +703,8 @@ class A extends B {} class B extends A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 27, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 27, 1), ], ); var B = findElement2.class_('B'); @@ -994,8 +994,8 @@ class A extends B {} class B extends A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 27, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 27, 1), ], ); var B = findElement2.class_('B'); @@ -1255,8 +1255,8 @@ class A extends B {} class B extends A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 27, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 27, 1), ], ); var B = findElement2.class_('B'); diff --git a/pkg/analyzer/test/src/dart/element/display_string_test.dart b/pkg/analyzer/test/src/dart/element/display_string_test.dart index efdc3380194..76f19df43b4 100644 --- a/pkg/analyzer/test/src/dart/element/display_string_test.dart +++ b/pkg/analyzer/test/src/dart/element/display_string_test.dart @@ -307,7 +307,7 @@ final class A {} r''' import 'src/f.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 12)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 12)], ); var import = findElement2.libraryFragment.libraryImports[0] as LibraryImportImpl; @@ -410,7 +410,7 @@ void f() { f: 0; } ''', - [error(WarningCode.UNUSED_LABEL, 13, 2)], + [error(WarningCode.unusedLabel, 13, 2)], ); var element = findElement2.label('f'); expect(element.displayString(), 'f'); @@ -429,7 +429,7 @@ library f; r''' export 'src/f.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 12)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 12)], ); var export = findElement2.libraryFragment.libraryExports.single as LibraryExportImpl; @@ -441,7 +441,7 @@ export 'src/f.dart'; r''' import 'src/f.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 12)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 12)], ); var import = findElement2.libraryFragment.libraryImports[0] as LibraryImportImpl; @@ -455,7 +455,7 @@ void f() { void g() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var element = findElement2.localFunction('g'); expect(element.displayString(), "void g()"); @@ -468,7 +468,7 @@ void f() { void g(int a, bool b, {String? c}) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var element = findElement2.localFunction('g'); expect(element.displayString(), "void g(int a, bool b, {String? c})"); @@ -481,7 +481,7 @@ void f() { void g() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var element = findElement2.localFunction('g'); expect(element.displayString(), "void g()"); @@ -530,7 +530,7 @@ mixin M {} r''' Never a; ''', - [error(CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, 6, 1)], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 6, 1)], ); var element = findElement2.topVar('a'); expect(element.displayString(), "Never a"); @@ -541,7 +541,7 @@ Never a; r''' part 'src/f.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 12)], + [error(CompileTimeErrorCode.uriDoesNotExist, 5, 12)], ); var element = findElement2.libraryFragment.partIncludes.single as PartIncludeImpl; @@ -555,8 +555,8 @@ import 'src/f.dart' as a; import 'src/bar.dart' as a; ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 12), - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 33, 14), + error(CompileTimeErrorCode.uriDoesNotExist, 7, 12), + error(CompileTimeErrorCode.uriDoesNotExist, 33, 14), ], ); var prefix = findElement2.prefix('a'); @@ -571,7 +571,7 @@ import 'src/bar.dart' as a; r''' import 'src/f.dart' as a; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 12)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 12)], ); var prefix = findElement2.prefix('a'); expect(prefix.displayString(), "import 'src/f.dart' as a;"); 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 0a9749b805a..cacf5ad6c0b 100644 --- a/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart +++ b/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart @@ -605,7 +605,7 @@ class GenericFunctionInferenceTest extends AbstractTypeSystemTest { if (expectError) { expect( listener.diagnostics.map((e) => e.diagnosticCode).toList(), - [CompileTimeErrorCode.COULD_NOT_INFER], + [CompileTimeErrorCode.couldNotInfer], reason: 'expected exactly 1 could not infer error.', ); } else { 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 6898f848e66..b1f98fc6004 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 @@ -431,7 +431,7 @@ void f(A a, B b) {} result = await resolveFile(b); assertErrorsInResolvedUnit(result, [ - error(CompileTimeErrorCode.UNDEFINED_CLASS, 29, 1), + error(CompileTimeErrorCode.undefinedClass, 29, 1), ]); newFile(a.path, r''' @@ -461,7 +461,7 @@ void f(A a) { result = await resolveFile(b); assertErrorsInResolvedUnit(result, [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 36, 3), + error(CompileTimeErrorCode.assignmentToFinal, 36, 3), ]); newFile(a.path, r''' @@ -488,7 +488,7 @@ part of 'a.dart'; result = await resolveFile(a); assertErrorsInResolvedUnit(result, [ - error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 24, 1), + error(CompileTimeErrorCode.undefinedFunction, 24, 1), ]); // Update a.dart, and notify the resolver. We need this to have at least @@ -858,7 +858,7 @@ analyzer: num a = 0; int b = a; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 19, 1)], ); } @@ -874,7 +874,7 @@ analyzer: num a = 0; int b = a; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 19, 1)], ); } @@ -898,7 +898,7 @@ analyzer: num a = 0; int b = a; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 19, 1)], ); } @@ -922,7 +922,7 @@ analyzer: num a = 0; int b = a; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 19, 1)], ); } @@ -1046,7 +1046,7 @@ String f(Map a) { ''', [ error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, + CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 40, 4, messageContains: ["'String'", 'String?'], @@ -1371,7 +1371,7 @@ var foo = 0; expect(result.path, convertPath('/workspace/dart/test/lib/test.dart')); expect(result.uri.toString(), 'package:dart.test/test.dart'); assertErrorsInList(result.diagnostics, [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 8, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 8, 1), ]); expect(result.lineInfo.lineStarts, [0, 11, 24]); } @@ -1395,7 +1395,7 @@ var a = 42 var errorsResult = await fileResolver.getErrors2(path: a.path); assertErrorsInList(errorsResult.diagnostics, [ - error(ParserErrorCode.EXPECTED_TOKEN, 8, 2), + error(ParserErrorCode.expectedToken, 8, 2), ]); } @@ -1411,7 +1411,7 @@ var a = 42 var errorsResult = await fileResolver.getErrors2(path: b.path); assertErrorsInList(errorsResult.diagnostics, [ - error(ParserErrorCode.EXPECTED_TOKEN, 26, 2), + error(ParserErrorCode.expectedToken, 26, 2), ]); } @@ -1794,7 +1794,7 @@ byteStore expect(result.path, testFile.path); expect(result.uri.toString(), 'package:dart.test/test.dart'); assertErrorsInList(result.diagnostics, [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 8, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 8, 1), ]); expect(result.lineInfo.lineStarts, [0, 11, 24]); @@ -2582,7 +2582,7 @@ void f(MyEnum myEnum) { r''' import 'foo:bar'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 9)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 9)], ); } @@ -2591,7 +2591,7 @@ import 'foo:bar'; r''' import 'dart:math'; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); } diff --git a/pkg/analyzer/test/src/dart/parser/class_test.dart b/pkg/analyzer/test/src/dart/parser/class_test.dart index b45bb63bd65..de2bd25f7d3 100644 --- a/pkg/analyzer/test/src/dart/parser/class_test.dart +++ b/pkg/analyzer/test/src/dart/parser/class_test.dart @@ -54,11 +54,7 @@ class A { } '''); parseResult.assertErrors([ - error( - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS, - 39, - 4, - ), + error(ParserErrorCode.externalConstructorWithFieldInitializers, 39, 4), ]); var node = parseResult.findNode.singleConstructorDeclaration; @@ -93,11 +89,7 @@ class A { } '''); parseResult.assertErrors([ - error( - ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_FIELD_INITIALIZERS, - 38, - 4, - ), + error(ParserErrorCode.externalConstructorWithFieldInitializers, 38, 4), ]); var node = parseResult.findNode.singleConstructorDeclaration; @@ -126,7 +118,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_INITIALIZER, 40, 1), + error(ParserErrorCode.externalConstructorWithInitializer, 40, 1), ]); var node = parseResult.findNode.singleConstructorDeclaration; @@ -158,7 +150,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.MISSING_METHOD_PARAMETERS, 16, 3), + error(ParserErrorCode.missingMethodParameters, 16, 3), ]); var node = parseResult.findNode.singleMethodDeclaration; @@ -185,7 +177,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, 16, 3), + error(ParserErrorCode.wrongNumberOfParametersForSetter, 16, 3), ]); var node = parseResult.findNode.singleMethodDeclaration; @@ -212,7 +204,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, 16, 3), + error(ParserErrorCode.wrongNumberOfParametersForSetter, 16, 3), ]); var node = parseResult.findNode.singleMethodDeclaration; @@ -239,7 +231,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, 16, 3), + error(ParserErrorCode.wrongNumberOfParametersForSetter, 16, 3), ]); var node = parseResult.findNode.singleMethodDeclaration; @@ -266,7 +258,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, 16, 3), + error(ParserErrorCode.wrongNumberOfParametersForSetter, 16, 3), ]); var node = parseResult.findNode.singleMethodDeclaration; diff --git a/pkg/analyzer/test/src/dart/parser/doc_comment_test.dart b/pkg/analyzer/test/src/dart/parser/doc_comment_test.dart index cdd2f51757e..5d7431f782f 100644 --- a/pkg/analyzer/test/src/dart/parser/doc_comment_test.dart +++ b/pkg/analyzer/test/src/dart/parser/doc_comment_test.dart @@ -55,7 +55,7 @@ int x = 0; class A {} '''); parseResult.assertErrors([ - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE, 73, 1), + error(WarningCode.docDirectiveMissingClosingBrace, 73, 1), ]); var node = parseResult.findNode.comment('animation'); @@ -87,7 +87,7 @@ int x = 0; class A {} '''); parseResult.assertErrors([ - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE, 68, 1), + error(WarningCode.docDirectiveMissingClosingBrace, 68, 1), ]); var node = parseResult.findNode.comment('animation'); @@ -522,7 +522,7 @@ Comment /// @docImport 'dart:html' class A {} '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 15, 11)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 15, 11)]); var node = parseResult.findNode.comment('docImport'); assertParsedNodeText(node, r''' @@ -546,10 +546,10 @@ Comment class A {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_TOKEN, 8, 6), - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 15, 4), - error(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 15, 4), - error(ParserErrorCode.EXPECTED_TOKEN, 15, 4), + error(ParserErrorCode.expectedToken, 8, 6), + error(ParserErrorCode.expectedStringLiteral, 15, 4), + error(ParserErrorCode.missingConstFinalVarOrType, 15, 4), + error(ParserErrorCode.expectedToken, 15, 4), ]); var node = parseResult.findNode.comment('docImport'); @@ -631,8 +631,8 @@ Comment class A {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_TOKEN, 15, 11), - error(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 17, 1), + error(ParserErrorCode.expectedToken, 15, 11), + error(ScannerErrorCode.unterminatedStringLiteral, 17, 1), ]); var node = parseResult.findNode.comment('docImport'); @@ -723,7 +723,7 @@ int x = 0; class A {} '''); parseResult.assertErrors([ - error(WarningCode.DOC_DIRECTIVE_MISSING_OPENING_TAG, 26, 15), + error(WarningCode.docDirectiveMissingOpeningTag, 26, 15), ]); var node = parseResult.findNode.comment('endtemplate'); @@ -1577,7 +1577,7 @@ int x = 0; class A {} '''); parseResult.assertErrors([ - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG, 26, 17), + error(WarningCode.docDirectiveMissingClosingTag, 26, 17), ]); var node = parseResult.findNode.comment('template name'); @@ -1609,8 +1609,8 @@ int x = 0; class A {} '''); parseResult.assertErrors([ - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG, 26, 17), - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG, 62, 18), + error(WarningCode.docDirectiveMissingClosingTag, 26, 17), + error(WarningCode.docDirectiveMissingClosingTag, 62, 18), ]); var node = parseResult.findNode.comment('template name2'); @@ -1649,7 +1649,7 @@ int x = 0; class A {} '''); parseResult.assertErrors([ - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG, 26, 17), + error(WarningCode.docDirectiveMissingClosingTag, 26, 17), ]); var node = parseResult.findNode.comment('template name'); @@ -1692,8 +1692,8 @@ int x = 0; class A {} '''); parseResult.assertErrors([ - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_TAG, 62, 15), - error(WarningCode.DOC_DIRECTIVE_MISSING_OPENING_TAG, 110, 19), + error(WarningCode.docDirectiveMissingClosingTag, 62, 15), + error(WarningCode.docDirectiveMissingOpeningTag, 110, 19), ]); var node = parseResult.findNode.comment('template name'); @@ -1772,7 +1772,7 @@ int x = 0; /// {@yotube 123} class A {} '''); - parseResult.assertErrors([error(WarningCode.DOC_DIRECTIVE_UNKNOWN, 28, 6)]); + parseResult.assertErrors([error(WarningCode.docDirectiveUnknown, 28, 6)]); var node = parseResult.findNode.comment('yotube'); assertParsedNodeText(node, r''' @@ -1817,7 +1817,7 @@ Comment class A {} '''); parseResult.assertErrors([ - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE, 39, 1), + error(WarningCode.docDirectiveMissingClosingBrace, 39, 1), ]); var node = parseResult.findNode.comment('youtube'); diff --git a/pkg/analyzer/test/src/dart/parser/export_directive_test.dart b/pkg/analyzer/test/src/dart/parser/export_directive_test.dart index 71a73178c33..1428f090847 100644 --- a/pkg/analyzer/test/src/dart/parser/export_directive_test.dart +++ b/pkg/analyzer/test/src/dart/parser/export_directive_test.dart @@ -21,7 +21,7 @@ part 'a.dart'; export 'b.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, 15, 6), + error(ParserErrorCode.exportDirectiveAfterPartDirective, 15, 6), ]); var node = parseResult.findNode.singleExportDirective; @@ -107,7 +107,7 @@ part of 'a.dart'; export 'b.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, 33, 6), + error(ParserErrorCode.nonPartOfDirectiveInPart, 33, 6), ]); var node = parseResult.findNode.singleExportDirective; @@ -127,7 +127,7 @@ export 'b.dart'; part of 'a.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, 32, 4), + error(ParserErrorCode.nonPartOfDirectiveInPart, 32, 4), ]); var node = parseResult.findNode.singleExportDirective; @@ -144,7 +144,7 @@ ExportDirective var parseResult = parseStringWithErrors(r''' export 'a.dart' '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 7, 8)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 7, 8)]); var node = parseResult.findNode.singleExportDirective; assertParsedNodeText(node, r''' @@ -161,7 +161,7 @@ ExportDirective export ; '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 7, 1), + error(ParserErrorCode.expectedStringLiteral, 7, 1), ]); var node = parseResult.findNode.singleExportDirective; @@ -179,8 +179,8 @@ ExportDirective export '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_TOKEN, 0, 6), - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 7, 0), + error(ParserErrorCode.expectedToken, 0, 6), + error(ParserErrorCode.expectedStringLiteral, 7, 0), ]); var node = parseResult.findNode.singleExportDirective; diff --git a/pkg/analyzer/test/src/dart/parser/extension_test.dart b/pkg/analyzer/test/src/dart/parser/extension_test.dart index 2629cecebc9..b7c4dcbd93e 100644 --- a/pkg/analyzer/test/src/dart/parser/extension_test.dart +++ b/pkg/analyzer/test/src/dart/parser/extension_test.dart @@ -60,7 +60,7 @@ ExtensionDeclaration augment extension E on int {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTENSION_AUGMENTATION_HAS_ON_CLAUSE, 20, 2), + error(ParserErrorCode.extensionAugmentationHasOnClause, 20, 2), ]); var node = parseResult.findNode.singleExtensionDeclaration; diff --git a/pkg/analyzer/test/src/dart/parser/extension_type_test.dart b/pkg/analyzer/test/src/dart/parser/extension_type_test.dart index 3b33ea6b048..6a6a21ae439 100644 --- a/pkg/analyzer/test/src/dart/parser/extension_type_test.dart +++ b/pkg/analyzer/test/src/dart/parser/extension_type_test.dart @@ -44,7 +44,7 @@ ExtensionTypeDeclaration extension type A(const int it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER, 17, 5), + error(ParserErrorCode.extraneousModifier, 17, 5), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -69,7 +69,7 @@ ExtensionTypeDeclaration extension type A(covariant int it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR, 17, 9), + error(ParserErrorCode.extraneousModifierInPrimaryConstructor, 17, 9), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -94,8 +94,8 @@ ExtensionTypeDeclaration extension type A(covariant final int it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER_IN_PRIMARY_CONSTRUCTOR, 17, 9), - error(ParserErrorCode.REPRESENTATION_FIELD_MODIFIER, 27, 5), + error(ParserErrorCode.extraneousModifierInPrimaryConstructor, 17, 9), + error(ParserErrorCode.representationFieldModifier, 27, 5), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -120,7 +120,7 @@ ExtensionTypeDeclaration extension type A(final int it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.REPRESENTATION_FIELD_MODIFIER, 17, 5), + error(ParserErrorCode.representationFieldModifier, 17, 5), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -145,7 +145,7 @@ ExtensionTypeDeclaration extension type A(required int it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER, 17, 8), + error(ParserErrorCode.extraneousModifier, 17, 8), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -170,7 +170,7 @@ ExtensionTypeDeclaration extension type A(static int it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER, 17, 6), + error(ParserErrorCode.extraneousModifier, 17, 6), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -195,7 +195,7 @@ ExtensionTypeDeclaration extension type A(int A) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 21, 1), + error(ParserErrorCode.memberWithClassName, 21, 1), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -222,7 +222,7 @@ extension type A(int it) { } '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE, 38, 9), + error(ParserErrorCode.extraneousModifierInExtensionType, 38, 9), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -266,7 +266,7 @@ extension type A(int it) { } '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER_IN_EXTENSION_TYPE, 45, 9), + error(ParserErrorCode.extraneousModifierInExtensionType, 45, 9), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -309,7 +309,7 @@ ExtensionTypeDeclaration extension type A(int a, String b) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.MULTIPLE_REPRESENTATION_FIELDS, 22, 1), + error(ParserErrorCode.multipleRepresentationFields, 22, 1), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -334,7 +334,7 @@ ExtensionTypeDeclaration extension type A() {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_REPRESENTATION_FIELD, 17, 1), + error(ParserErrorCode.expectedRepresentationField, 17, 1), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -359,7 +359,7 @@ ExtensionTypeDeclaration extension type A(it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_REPRESENTATION_TYPE, 17, 2), + error(ParserErrorCode.expectedRepresentationType, 17, 2), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -384,8 +384,8 @@ ExtensionTypeDeclaration extension type A(var it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_REPRESENTATION_TYPE, 17, 3), - error(ParserErrorCode.REPRESENTATION_FIELD_MODIFIER, 17, 3), + error(ParserErrorCode.expectedRepresentationType, 17, 3), + error(ParserErrorCode.representationFieldModifier, 17, 3), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -410,7 +410,7 @@ ExtensionTypeDeclaration extension type A(super.it) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_REPRESENTATION_FIELD, 17, 5), + error(ParserErrorCode.expectedRepresentationField, 17, 5), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -435,7 +435,7 @@ ExtensionTypeDeclaration extension type A(int it,) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.REPRESENTATION_FIELD_TRAILING_COMMA, 23, 1), + error(ParserErrorCode.representationFieldTrailingComma, 23, 1), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -460,13 +460,13 @@ ExtensionTypeDeclaration extension type A._(T _) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_REPRESENTATION_FIELD, 16, 0), - error(ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR_PARAMETERS, 17, 1), - error(ParserErrorCode.EXPECTED_EXTENSION_TYPE_BODY, 17, 1), - error(ParserErrorCode.EXPECTED_EXECUTABLE, 18, 1), - error(ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 19, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 19, 1), - error(ParserErrorCode.TOP_LEVEL_OPERATOR, 20, 1), + error(ParserErrorCode.expectedRepresentationField, 16, 0), + error(ParserErrorCode.missingPrimaryConstructorParameters, 17, 1), + error(ParserErrorCode.expectedExtensionTypeBody, 17, 1), + error(ParserErrorCode.expectedExecutable, 18, 1), + error(ParserErrorCode.missingConstFinalVarOrType, 19, 1), + error(ParserErrorCode.expectedToken, 19, 1), + error(ParserErrorCode.topLevelOperator, 20, 1), ]); var node = parseResult.findNode.singleExtensionTypeDeclaration; @@ -497,7 +497,7 @@ extension type B(int it) {} class C {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 36, 4), + error(ParserErrorCode.experimentNotEnabled, 36, 4), ]); var node = parseResult.findNode.unit; @@ -832,7 +832,7 @@ ExtensionTypeDeclaration extension type E {} '''); parseResult.assertErrors([ - error(ParserErrorCode.MISSING_PRIMARY_CONSTRUCTOR, 15, 1), + error(ParserErrorCode.missingPrimaryConstructor, 15, 1), ]); var node = parseResult.findNode.extensionTypeDeclaration('E'); diff --git a/pkg/analyzer/test/src/dart/parser/import_directive_test.dart b/pkg/analyzer/test/src/dart/parser/import_directive_test.dart index ce039641748..64384c5e46d 100644 --- a/pkg/analyzer/test/src/dart/parser/import_directive_test.dart +++ b/pkg/analyzer/test/src/dart/parser/import_directive_test.dart @@ -21,7 +21,7 @@ part 'a.dart'; import 'b.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE, 15, 6), + error(ParserErrorCode.importDirectiveAfterPartDirective, 15, 6), ]); var node = parseResult.findNode.singleImportDirective; @@ -107,7 +107,7 @@ part of 'a.dart'; import 'b.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, 33, 6), + error(ParserErrorCode.nonPartOfDirectiveInPart, 33, 6), ]); var node = parseResult.findNode.singleImportDirective; @@ -127,7 +127,7 @@ import 'b.dart'; part of 'a.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, 32, 4), + error(ParserErrorCode.nonPartOfDirectiveInPart, 32, 4), ]); var node = parseResult.findNode.singleImportDirective; @@ -144,7 +144,7 @@ ImportDirective var parseResult = parseStringWithErrors(r''' import 'a.dart' '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 7, 8)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 7, 8)]); var node = parseResult.findNode.singleImportDirective; assertParsedNodeText(node, r''' @@ -161,7 +161,7 @@ ImportDirective import ; '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 7, 1), + error(ParserErrorCode.expectedStringLiteral, 7, 1), ]); var node = parseResult.findNode.singleImportDirective; @@ -179,8 +179,8 @@ ImportDirective import '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_TOKEN, 0, 6), - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 7, 0), + error(ParserErrorCode.expectedToken, 0, 6), + error(ParserErrorCode.expectedStringLiteral, 7, 0), ]); var node = parseResult.findNode.singleImportDirective; diff --git a/pkg/analyzer/test/src/dart/parser/mixin_test.dart b/pkg/analyzer/test/src/dart/parser/mixin_test.dart index 9a5b596f263..2abd4375a42 100644 --- a/pkg/analyzer/test/src/dart/parser/mixin_test.dart +++ b/pkg/analyzer/test/src/dart/parser/mixin_test.dart @@ -22,7 +22,7 @@ mixin A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR, 12, 1), + error(ParserErrorCode.mixinDeclaresConstructor, 12, 1), ]); // Mixins cannot have constructors. diff --git a/pkg/analyzer/test/src/dart/parser/part_directive_test.dart b/pkg/analyzer/test/src/dart/parser/part_directive_test.dart index 9a8561e649e..cab827ab5c7 100644 --- a/pkg/analyzer/test/src/dart/parser/part_directive_test.dart +++ b/pkg/analyzer/test/src/dart/parser/part_directive_test.dart @@ -72,7 +72,7 @@ part 'foo.dart' if (dart.library.html) 'foo_html.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 33, 2), + error(ParserErrorCode.experimentNotEnabled, 33, 2), ]); var node = parseResult.findNode.singlePartDirective; @@ -108,7 +108,7 @@ part of 'a.dart'; part 'b.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, 33, 4), + error(ParserErrorCode.nonPartOfDirectiveInPart, 33, 4), ]); var node = parseResult.findNode.singlePartDirective; @@ -128,7 +128,7 @@ part 'b.dart'; part of 'a.dart'; '''); parseResult.assertErrors([ - error(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, 30, 4), + error(ParserErrorCode.nonPartOfDirectiveInPart, 30, 4), ]); var node = parseResult.findNode.singlePartDirective; @@ -145,7 +145,7 @@ PartDirective var parseResult = parseStringWithErrors(r''' part 'a.dart' '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 5, 8)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 5, 8)]); var node = parseResult.findNode.singlePartDirective; assertParsedNodeText(node, r''' @@ -162,7 +162,7 @@ PartDirective part ; '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 5, 1), + error(ParserErrorCode.expectedStringLiteral, 5, 1), ]); var node = parseResult.findNode.singlePartDirective; @@ -180,8 +180,8 @@ PartDirective part '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_TOKEN, 0, 4), - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 5, 0), + error(ParserErrorCode.expectedToken, 0, 4), + error(ParserErrorCode.expectedStringLiteral, 5, 0), ]); var node = parseResult.findNode.singlePartDirective; diff --git a/pkg/analyzer/test/src/dart/parser/part_of_directive_test.dart b/pkg/analyzer/test/src/dart/parser/part_of_directive_test.dart index baa10a13323..fe6abd2b1ba 100644 --- a/pkg/analyzer/test/src/dart/parser/part_of_directive_test.dart +++ b/pkg/analyzer/test/src/dart/parser/part_of_directive_test.dart @@ -19,7 +19,7 @@ class PartOfDirectiveParserTest extends ParserDiagnosticsTest { var parseResult = parseStringWithErrors(r''' part of my.library; '''); - parseResult.assertErrors([error(ParserErrorCode.PART_OF_NAME, 8, 10)]); + parseResult.assertErrors([error(ParserErrorCode.partOfName, 8, 10)]); var node = parseResult.findNode.singlePartOfDirective; assertParsedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/parser/top_level_function_test.dart b/pkg/analyzer/test/src/dart/parser/top_level_function_test.dart index 7d6c4de822b..d8d895c81f1 100644 --- a/pkg/analyzer/test/src/dart/parser/top_level_function_test.dart +++ b/pkg/analyzer/test/src/dart/parser/top_level_function_test.dart @@ -153,7 +153,7 @@ FunctionDeclaration set foo {} '''); parseResult.assertErrors([ - error(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 4, 3), + error(ParserErrorCode.missingFunctionParameters, 4, 3), ]); var node = parseResult.findNode.singleFunctionDeclaration; @@ -179,7 +179,7 @@ FunctionDeclaration set foo({a}) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, 4, 3), + error(ParserErrorCode.wrongNumberOfParametersForSetter, 4, 3), ]); var node = parseResult.findNode.singleFunctionDeclaration; @@ -205,7 +205,7 @@ FunctionDeclaration set foo([a]) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, 4, 3), + error(ParserErrorCode.wrongNumberOfParametersForSetter, 4, 3), ]); var node = parseResult.findNode.singleFunctionDeclaration; @@ -231,7 +231,7 @@ FunctionDeclaration set foo(a, b, c) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, 4, 3), + error(ParserErrorCode.wrongNumberOfParametersForSetter, 4, 3), ]); var node = parseResult.findNode.singleFunctionDeclaration; @@ -257,7 +257,7 @@ FunctionDeclaration set foo() {} '''); parseResult.assertErrors([ - error(ParserErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, 4, 3), + error(ParserErrorCode.wrongNumberOfParametersForSetter, 4, 3), ]); var node = parseResult.findNode.singleFunctionDeclaration; diff --git a/pkg/analyzer/test/src/dart/parser/type_alias_test.dart b/pkg/analyzer/test/src/dart/parser/type_alias_test.dart index 5a4c0f6bcd8..638275821e3 100644 --- a/pkg/analyzer/test/src/dart/parser/type_alias_test.dart +++ b/pkg/analyzer/test/src/dart/parser/type_alias_test.dart @@ -61,7 +61,7 @@ GenericTypeAlias var parseResult = parseStringWithErrors(r''' typedef = int; '''); - parseResult.assertErrors([error(ParserErrorCode.MISSING_IDENTIFIER, 8, 1)]); + parseResult.assertErrors([error(ParserErrorCode.missingIdentifier, 8, 1)]); var node = parseResult.findNode.unit; assertParsedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/parser/variable_declaration_statement_test.dart b/pkg/analyzer/test/src/dart/parser/variable_declaration_statement_test.dart index 40adee26ae2..984301de4bd 100644 --- a/pkg/analyzer/test/src/dart/parser/variable_declaration_statement_test.dart +++ b/pkg/analyzer/test/src/dart/parser/variable_declaration_statement_test.dart @@ -23,8 +23,8 @@ void f() async { } '''); parseResult.assertErrors([ - error(ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, 27, 5), - error(ParserErrorCode.EXPECTED_TOKEN, 27, 5), + error(ParserErrorCode.asyncKeywordUsedAsIdentifier, 27, 5), + error(ParserErrorCode.expectedToken, 27, 5), ]); var node = parseResult.findNode.singleBlock; @@ -62,7 +62,7 @@ void f() async { await y.foo(); } '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 30, 1)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 30, 1)]); var node = parseResult.findNode.singleBlock; assertParsedNodeText(node, r''' @@ -101,7 +101,7 @@ void f() { bar(); } '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 21, 3)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 21, 3)]); var node = parseResult.findNode.singleBlock; assertParsedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/as_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/as_expression_test.dart index 00397ca088c..7d89cda800b 100644 --- a/pkg/analyzer/test/src/dart/resolution/as_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/as_expression_test.dart @@ -22,7 +22,7 @@ class AsExpressionResolutionTest extends PubPackageResolutionTest { const num a = 1.2; const int b = a as int; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 33, 8)], + [error(CompileTimeErrorCode.constEvalThrowsException, 33, 8)], ); var node = findNode.asExpression('as int'); @@ -74,7 +74,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 30, 5)], + [error(ParserErrorCode.missingAssignableSelector, 30, 5)], ); var node = findNode.singleAsExpression; diff --git a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart index e547c091afe..a2e8e949587 100644 --- a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart @@ -731,8 +731,8 @@ void f(int c) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 18, 1), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 20, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 18, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 20, 1), ], ); @@ -777,8 +777,8 @@ void f(int a, int c) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 26, 3), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 27, 1), + error(CompileTimeErrorCode.undefinedOperator, 26, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 27, 1), ], ); @@ -826,7 +826,7 @@ void f(A a, int c) { a[b] = c; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 73, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 73, 1)], ); var assignment = findNode.assignment('a[b] = c'); @@ -873,8 +873,8 @@ void f(A a) { } ''', [ - error(ParserErrorCode.MISSING_IDENTIFIER, 30, 7), - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 67, 3), + error(ParserErrorCode.missingIdentifier, 30, 7), + error(CompileTimeErrorCode.undefinedOperator, 67, 3), ], ); } @@ -886,7 +886,7 @@ void f() { a[0] += 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 13, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 13, 1)], ); var node = findNode.singleAssignmentExpression; @@ -929,8 +929,8 @@ class A { } ''', [ - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 27, 5), - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 27, 5), + error(ParserErrorCode.missingAssignableSelector, 27, 5), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 27, 5), ], ); @@ -962,8 +962,8 @@ void f(int a, int b, double c) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 35, 5), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 35, 5), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 35, 5), + error(ParserErrorCode.missingAssignableSelector, 35, 5), ], ); @@ -1008,8 +1008,8 @@ void f(int a, int b, double c) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 35, 7), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 35, 7), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 35, 7), + error(ParserErrorCode.missingAssignableSelector, 35, 7), ], ); @@ -1059,11 +1059,11 @@ void f(int a, double b) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 29, 1, ), - error(ParserErrorCode.EXPECTED_TOKEN, 31, 1), + error(ParserErrorCode.expectedToken, 31, 1), ], ); @@ -1097,8 +1097,8 @@ void f(int a, double b) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 44, 7), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 44, 7), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 44, 7), + error(ParserErrorCode.missingAssignableSelector, 44, 7), ], ); @@ -1145,8 +1145,8 @@ void f(num x, int y) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 25, 3), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 25, 3), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 25, 3), + error(ParserErrorCode.missingAssignableSelector, 25, 3), ], ); @@ -1189,8 +1189,8 @@ void f(num x, int y) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 25, 3), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 25, 3), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 25, 3), + error(ParserErrorCode.missingAssignableSelector, 25, 3), ], ); @@ -1233,8 +1233,8 @@ void f(num x, int y) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 25, 3), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 25, 3), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 25, 3), + error(ParserErrorCode.missingAssignableSelector, 25, 3), ], ); @@ -1277,8 +1277,8 @@ void f(num x, int y) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 25, 3), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 25, 3), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 25, 3), + error(ParserErrorCode.missingAssignableSelector, 25, 3), ], ); @@ -1321,8 +1321,8 @@ void f(num x, int y) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 25, 3), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 25, 3), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 25, 3), + error(ParserErrorCode.missingAssignableSelector, 25, 3), ], ); @@ -1365,8 +1365,8 @@ void f(num x, int y) { } ''', [ - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 25, 3), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 25, 3), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 25, 3), + error(ParserErrorCode.missingAssignableSelector, 25, 3), ], ); @@ -1412,7 +1412,7 @@ void f() { C = 0; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 47, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 47, 1)], ); var assignment = findNode.assignment('C = 0'); @@ -1448,7 +1448,7 @@ void f() { C = 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 25, 1)], + [error(CompileTimeErrorCode.assignmentToType, 25, 1)], ); var assignment = findNode.assignment('C = 0'); @@ -1647,7 +1647,7 @@ void f(A a) { a.x = 2; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 49, 1)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 49, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -1700,7 +1700,7 @@ void f(A a) { a.foo = 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 46, 3)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 46, 3)], ); var node = findNode.singleAssignmentExpression; @@ -1869,7 +1869,7 @@ void f() { A.foo = 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 43, 3)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 43, 3)], ); var node = findNode.singleAssignmentExpression; @@ -2171,7 +2171,7 @@ void f() { A.x = 2; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 53, 1)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 53, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -2298,7 +2298,7 @@ void f(int c) { a.b = c; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 18, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 18, 1)], ); var assignment = findNode.assignment('a.b = c'); @@ -2340,8 +2340,8 @@ void f(int a, int c) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_GETTER, 27, 1), - error(CompileTimeErrorCode.UNDEFINED_SETTER, 27, 1), + error(CompileTimeErrorCode.undefinedGetter, 27, 1), + error(CompileTimeErrorCode.undefinedSetter, 27, 1), ], ); @@ -2778,8 +2778,8 @@ void f(({int bar}) r) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_GETTER, 28, 3), - error(CompileTimeErrorCode.UNDEFINED_SETTER, 28, 3), + error(CompileTimeErrorCode.undefinedGetter, 28, 3), + error(CompileTimeErrorCode.undefinedSetter, 28, 3), ], ); @@ -2822,7 +2822,7 @@ void f(({int bar}) r) { r.foo = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 28, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 28, 3)], ); var node = findNode.assignment('= 0'); @@ -2868,7 +2868,7 @@ void f(({int bar}) r) { r.foo += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 80, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 80, 3)], ); var node = findNode.assignment('+= 0'); @@ -2957,7 +2957,7 @@ void f(({int bar}) r) { r.foo += 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 80, 3)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 80, 3)], ); var node = findNode.assignment('+= 0'); @@ -3003,7 +3003,7 @@ void f(({int bar}) r) { r.foo = 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 80, 3)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 80, 3)], ); var node = findNode.assignment('= 0'); @@ -3133,7 +3133,7 @@ void f(({int foo, String bar}) r) { r.foo += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 40, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 40, 3)], ); var node = findNode.assignment('+= 0'); @@ -3175,7 +3175,7 @@ void f(({int foo, String bar}) r) { r.foo = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 40, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 40, 3)], ); var node = findNode.assignment('= 0'); @@ -3221,7 +3221,7 @@ void f(({int foo, String bar}) r) { r.foo += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 104, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 104, 3)], ); var node = findNode.assignment('+= 0'); @@ -3267,7 +3267,7 @@ void f(({int foo, String bar}) r) { r.foo = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 104, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 104, 3)], ); var node = findNode.assignment('= 0'); @@ -3313,7 +3313,7 @@ void f(({int foo, String bar}) r) { r.foo += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 104, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 104, 3)], ); var node = findNode.assignment('+= 0'); @@ -3359,7 +3359,7 @@ void f(({int foo, String bar}) r) { r.foo = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 104, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 104, 3)], ); var node = findNode.assignment('= 0'); @@ -3406,7 +3406,7 @@ void f(({int foo, String bar}) r) { r.foo += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 124, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 124, 3)], ); var node = findNode.assignment('+= 0'); @@ -3453,7 +3453,7 @@ void f(({int foo, String bar}) r) { r.foo = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 124, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 124, 3)], ); var node = findNode.assignment('= 0'); @@ -3496,8 +3496,8 @@ void f((int, String) r) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_GETTER, 30, 2), - error(CompileTimeErrorCode.UNDEFINED_SETTER, 30, 2), + error(CompileTimeErrorCode.undefinedGetter, 30, 2), + error(CompileTimeErrorCode.undefinedSetter, 30, 2), ], ); @@ -3540,7 +3540,7 @@ void f((int, String) r) { r.$4 = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 30, 2)], + [error(CompileTimeErrorCode.undefinedSetter, 30, 2)], ); var node = findNode.assignment('= 0'); @@ -3586,7 +3586,7 @@ void f((int, String) r) { r.$3 += 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 83, 2)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 83, 2)], ); var node = findNode.assignment('+= 0'); @@ -3632,7 +3632,7 @@ void f((int, String) r) { r.$3 = 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 83, 2)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 83, 2)], ); var node = findNode.assignment('= 0'); @@ -3674,7 +3674,7 @@ void f((int, String) r) { r.$1 += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 30, 2)], + [error(CompileTimeErrorCode.undefinedSetter, 30, 2)], ); var node = findNode.assignment('+= 0'); @@ -3716,7 +3716,7 @@ void f((int, String) r) { r.$1 = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 30, 2)], + [error(CompileTimeErrorCode.undefinedSetter, 30, 2)], ); var node = findNode.assignment('= 0'); @@ -3762,7 +3762,7 @@ void f((int, String) r) { r.$1 += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 83, 2)], + [error(CompileTimeErrorCode.undefinedSetter, 83, 2)], ); var node = findNode.assignment('+= 0'); @@ -3808,7 +3808,7 @@ void f((int, String) r) { r.$1 = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 83, 2)], + [error(CompileTimeErrorCode.undefinedSetter, 83, 2)], ); var node = findNode.assignment('= 0'); @@ -3931,7 +3931,7 @@ void f(int c) { (a).b = c; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 19, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 19, 1)], ); var assignment = findNode.assignment('(a).b = c'); @@ -3975,7 +3975,7 @@ void f(int a, int c) { (a).b = c; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 29, 1)], + [error(CompileTimeErrorCode.undefinedSetter, 29, 1)], ); var assignment = findNode.assignment('(a).b = c'); @@ -4021,7 +4021,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 39, 5)], + [error(ParserErrorCode.missingAssignableSelector, 39, 5)], ); var node = findNode.singleAssignmentExpression; @@ -4121,7 +4121,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 46, 1)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 46, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -4157,7 +4157,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 53, 1)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 53, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -4191,7 +4191,7 @@ void f() { x = 2; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 30, 1)], + [error(CompileTimeErrorCode.assignmentToFinal, 30, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -4231,13 +4231,7 @@ class B extends A { } } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 85, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 85, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -4271,13 +4265,7 @@ main() { x = 2; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 37, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 37, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -4373,7 +4361,7 @@ void f() { x = 2; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_CONST, 66, 1)], + [error(CompileTimeErrorCode.assignmentToConst, 66, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -4407,7 +4395,7 @@ void f() { x = 2; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 66, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 66, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -4472,7 +4460,7 @@ void f(B? x) { x ??= C(); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 77, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 77, 3)], ); var assignment = findNode.assignment('x ??='); @@ -4512,7 +4500,7 @@ void f(double? a, int b) { a ??= b; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 35, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 35, 1)], ); var assignment = findNode.assignment('a ??='); @@ -4549,10 +4537,10 @@ void f(int x) { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 23, 3), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 35, 3), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 47, 3), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 59, 3), + error(CompileTimeErrorCode.invalidAssignment, 23, 3), + error(CompileTimeErrorCode.invalidAssignment, 35, 3), + error(CompileTimeErrorCode.invalidAssignment, 47, 3), + error(CompileTimeErrorCode.invalidAssignment, 59, 3), ], ); assertType(findNode.assignment('+='), 'double'); @@ -4645,7 +4633,7 @@ void f(int x) { x = true; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 22, 4)], + [error(CompileTimeErrorCode.invalidAssignment, 22, 4)], ); var assignment = findNode.assignment('x = true'); @@ -4677,7 +4665,7 @@ void f(final int x) { x = 2; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 24, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 24, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -4718,8 +4706,8 @@ class B extends A { } ''', [ - error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 68, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 94, 1), + error(CompileTimeErrorCode.conflictingStaticAndInstance, 68, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 94, 1), ], ); @@ -4761,8 +4749,8 @@ class B extends A { } ''', [ - error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 65, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 90, 1), + error(CompileTimeErrorCode.conflictingStaticAndInstance, 65, 1), + error(CompileTimeErrorCode.assignmentToMethod, 90, 1), ], ); @@ -4830,7 +4818,7 @@ void f(int y) { = y; } ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 18, 1)], + [error(ParserErrorCode.missingIdentifier, 18, 1)], ); var assignment = findNode.assignment('= y'); @@ -5018,7 +5006,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 86, 1)], + [error(CompileTimeErrorCode.assignmentToFinal, 86, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -5089,7 +5077,7 @@ class C extends A {} B? get x => B(); set x(B? _) {} ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 19, 3)], ); var assignment = findNode.assignment('x ??='); @@ -5196,7 +5184,7 @@ void f() { x = true; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 29, 4)], + [error(CompileTimeErrorCode.invalidAssignment, 29, 4)], ); var assignment = findNode.assignment('x = true'); @@ -5230,7 +5218,7 @@ void f() { x = 2; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 31, 1)], + [error(CompileTimeErrorCode.assignmentToFinal, 31, 1)], ); var assignment = findNode.assignment('x = 2'); @@ -5262,7 +5250,7 @@ void f() { int += 3; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 13, 3)], + [error(CompileTimeErrorCode.assignmentToType, 13, 3)], ); var assignment = findNode.assignment('int += 3'); @@ -5294,7 +5282,7 @@ void f() { int = 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 13, 3)], + [error(CompileTimeErrorCode.assignmentToType, 13, 3)], ); var assignment = findNode.assignment('int = 0'); @@ -5326,7 +5314,7 @@ void f() { x += 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 13, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 13, 1)], ); var assignment = findNode.assignment('x += 1'); @@ -5358,7 +5346,7 @@ void f(int a) { x = a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 18, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 18, 1)], ); var assignment = findNode.assignment('x = a'); diff --git a/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart b/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart index f8f7f014c4d..68a88339e8a 100644 --- a/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart @@ -186,8 +186,8 @@ abstract class C extends A { void Function() f(A a, bool b, C c, dynamic d) => b ? d : c ?? a; ''', [ - error(WarningCode.DEAD_CODE, 127, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 130, 1), + error(WarningCode.deadCode, 127, 4), + error(StaticWarningCode.deadNullAwareExpression, 130, 1), ], ); // `c` is on the LHS of an if-null expression, so implicit call tearoff @@ -616,7 +616,7 @@ class A { } Function f(Y y) => y; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 75, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 75, 1)], ); // Verify that no ImplicitCallReference was inserted. @@ -637,7 +637,7 @@ class A { } Function f(X? x) => x; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 62, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 62, 1)], ); // Verify that no ImplicitCallReference was inserted. @@ -878,7 +878,7 @@ void f() { X(0); } ''', - [error(CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION, 33, 1)], + [error(CompileTimeErrorCode.invocationOfNonFunction, 33, 1)], ); // Not rewritten. @@ -953,7 +953,7 @@ f() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 50, 5, messageContains: ["The constructor 'prefix.A.named'"], @@ -1022,7 +1022,7 @@ f() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 48, 5, messageContains: ["The constructor 'prefix.A.new'"], @@ -1233,7 +1233,7 @@ f() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 52, 13, messageContains: ["The constructor 'A.named'"], @@ -1299,7 +1299,7 @@ f() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 48, 13, messageContains: ["The constructor 'A.new'"], @@ -1606,7 +1606,7 @@ void f() { C.new = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 27, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 27, 3)], ); var identifier = findNode.prefixed('C.new'); diff --git a/pkg/analyzer/test/src/dart/resolution/augmented_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/augmented_expression_test.dart index 8abc09a812d..e4625a74b7c 100644 --- a/pkg/analyzer/test/src/dart/resolution/augmented_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/augmented_expression_test.dart @@ -146,7 +146,7 @@ augment class A { } } ''', - [error(CompileTimeErrorCode.AUGMENTED_EXPRESSION_IS_NOT_SETTER, 65, 9)], + [error(CompileTimeErrorCode.augmentedExpressionIsNotSetter, 65, 9)], ); var node = findNode.singleAssignmentExpression; @@ -193,7 +193,7 @@ augment class A { } } ''', - [error(CompileTimeErrorCode.AUGMENTED_EXPRESSION_IS_NOT_SETTER, 64, 9)], + [error(CompileTimeErrorCode.augmentedExpressionIsNotSetter, 64, 9)], ); var node = findNode.singleAssignmentExpression; diff --git a/pkg/analyzer/test/src/dart/resolution/await_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/await_expression_test.dart index 9ef5a6daa7e..ada5c96b386 100644 --- a/pkg/analyzer/test/src/dart/resolution/await_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/await_expression_test.dart @@ -69,7 +69,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 39, 5)], + [error(ParserErrorCode.missingAssignableSelector, 39, 5)], ); var node = findNode.singleAwaitExpression; @@ -117,7 +117,7 @@ void f() async { await unresolved; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 25, 10)], + [error(CompileTimeErrorCode.undefinedIdentifier, 25, 10)], ); var node = findNode.singleAwaitExpression; @@ -141,7 +141,7 @@ void f() async { await prefix.unresolved; } ''', - [error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 63, 10)], + [error(CompileTimeErrorCode.undefinedPrefixedName, 63, 10)], ); var node = findNode.singleAwaitExpression; @@ -171,7 +171,7 @@ void f() async { await 0.isEven.unresolved; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 34, 10)], + [error(CompileTimeErrorCode.undefinedGetter, 34, 10)], ); var node = findNode.singleAwaitExpression; diff --git a/pkg/analyzer/test/src/dart/resolution/binary_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/binary_expression_test.dart index 4f186da1932..80e2aaeca3d 100644 --- a/pkg/analyzer/test/src/dart/resolution/binary_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/binary_expression_test.dart @@ -175,7 +175,7 @@ void f((String,) a) { a + 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 26, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 26, 1)], ); var node = findNode.binary('+ 0'); @@ -382,7 +382,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 50, 9)], + [error(CompileTimeErrorCode.undefinedIdentifier, 50, 9)], ); var node = findNode.singleBinaryExpression; @@ -464,7 +464,7 @@ augment class A { } } ''', - [error(CompileTimeErrorCode.AUGMENTED_EXPRESSION_NOT_OPERATOR, 76, 9)], + [error(CompileTimeErrorCode.augmentedExpressionNotOperator, 76, 9)], ); var node = findNode.singleBinaryExpression; @@ -585,7 +585,7 @@ augment class A { } } ''', - [error(CompileTimeErrorCode.AUGMENTED_EXPRESSION_IS_SETTER, 68, 9)], + [error(CompileTimeErrorCode.augmentedExpressionIsSetter, 68, 9)], ); var node = findNode.singleBinaryExpression; @@ -673,8 +673,8 @@ f(Never a, int b) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 22, 1), - error(WarningCode.DEAD_CODE, 24, 3), + error(WarningCode.receiverOfTypeNever, 22, 1), + error(WarningCode.deadCode, 24, 3), ], ); @@ -792,9 +792,9 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 23, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 25, 1), + error(WarningCode.unusedLocalVariable, 19, 1), + error(ParserErrorCode.missingIdentifier, 23, 1), + error(ParserErrorCode.missingIdentifier, 25, 1), ], ); @@ -825,8 +825,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 23, 1), + error(WarningCode.unusedLocalVariable, 19, 1), + error(ParserErrorCode.missingIdentifier, 23, 1), ], ); @@ -856,8 +856,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 27, 1), + error(WarningCode.unusedLocalVariable, 19, 1), + error(ParserErrorCode.missingIdentifier, 27, 1), ], ); @@ -975,7 +975,7 @@ void f(int a) { E(a) != 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 46, 2)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 46, 2)], ); assertResolvedNodeText(findNode.binary('!= 0'), r''' @@ -1012,7 +1012,7 @@ f(int a, int b) { a !== b; } ''', - [error(ScannerErrorCode.UNSUPPORTED_OPERATOR, 22, 1)], + [error(ScannerErrorCode.unsupportedOperator, 22, 1)], ); assertResolvedNodeText(findNode.binary('a !== b'), r''' @@ -1067,7 +1067,7 @@ void f(int a) { E(a) == 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 46, 2)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 46, 2)], ); assertResolvedNodeText(findNode.binary('== 0'), r''' @@ -1130,7 +1130,7 @@ void f(A a) { a == 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 7, 1)], + [error(CompileTimeErrorCode.undefinedClass, 7, 1)], ); var node = findNode.binary('a == 0'); @@ -1158,7 +1158,7 @@ f(int a, int b) { a === b; } ''', - [error(ScannerErrorCode.UNSUPPORTED_OPERATOR, 22, 1)], + [error(ScannerErrorCode.unsupportedOperator, 22, 1)], ); assertResolvedNodeText(findNode.binary('a === b'), r''' @@ -1444,7 +1444,7 @@ g(double a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 45, 7)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 45, 7)], ); var node = findNode.methodInvocation('f()'); @@ -1609,7 +1609,7 @@ g(int a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 98, 10)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 98, 10)], ); var node = findNode.methodInvocation('f()'); @@ -1862,7 +1862,7 @@ void f() { x + 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 13, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 13, 1)], ); var node = findNode.binary('x + 0'); @@ -1892,7 +1892,7 @@ g(num a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 42, 7)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 42, 7)], ); var node = findNode.methodInvocation('f()'); @@ -1925,7 +1925,7 @@ g(A a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 88, 7)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 88, 7)], ); var node = findNode.methodInvocation('f()'); @@ -1959,7 +1959,7 @@ g(A a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 105, 10)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 105, 10)], ); var node = findNode.methodInvocation('f()'); @@ -1993,7 +1993,7 @@ g(A a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 105, 7)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 105, 7)], ); var node = findNode.methodInvocation('f()'); diff --git a/pkg/analyzer/test/src/dart/resolution/cast_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/cast_pattern_test.dart index df571f49356..4cf3ecd3b6e 100644 --- a/pkg/analyzer/test/src/dart/resolution/cast_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/cast_pattern_test.dart @@ -22,7 +22,7 @@ void f(x) { if (x case var y as int) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1)], + [error(WarningCode.unusedLocalVariable, 29, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -78,7 +78,7 @@ void f(x) { var (a as int) = x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 1)], + [error(WarningCode.unusedLocalVariable, 19, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/class_alias_test.dart b/pkg/analyzer/test/src/dart/resolution/class_alias_test.dart index 1a30a800bd8..16a044782bf 100644 --- a/pkg/analyzer/test/src/dart/resolution/class_alias_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/class_alias_test.dart @@ -68,13 +68,7 @@ ClassTypeAlias mixin class A {} class X = Function with A; ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 27, - 8, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 27, 8)], ); var x = findElement2.class_('X'); assertType(x.supertype, 'Object'); @@ -89,7 +83,7 @@ class X = Object with A implements A, Function, B; ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 66, 8, ), @@ -106,7 +100,7 @@ mixin class A {} mixin class B {} class X = Object with A, Function, B; ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 59, 8)], + [error(CompileTimeErrorCode.classUsedAsMixin, 59, 8)], ); var x = findElement2.class_('X'); assertElementTypes(x.mixins, ['A', 'B']); @@ -142,12 +136,8 @@ class C = A with M; const x = const C(); ''', [ - error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 83, 5), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 83, - 5, - ), + error(CompileTimeErrorCode.constWithNonConst, 83, 5), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 83, 5), ], ); } diff --git a/pkg/analyzer/test/src/dart/resolution/class_test.dart b/pkg/analyzer/test/src/dart/resolution/class_test.dart index 019cc4c7266..c000b2864e3 100644 --- a/pkg/analyzer/test/src/dart/resolution/class_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/class_test.dart @@ -95,9 +95,9 @@ class C extends A {} class X extends A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 27, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 48, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 27, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 48, 1), ], ); @@ -109,13 +109,7 @@ class X extends A {} r''' class A extends Function {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 16, - 8, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 16, 8)], ); var a = findElement2.class_('A'); assertType(a.supertype, 'Object'); @@ -127,7 +121,7 @@ class A extends Function {} // @dart = 2.19 class A extends Function {} ''', - [error(WarningCode.DEPRECATED_EXTENDS_FUNCTION, 32, 8)], + [error(WarningCode.deprecatedExtendsFunction, 32, 8)], ); var a = findElement2.class_('A'); assertType(a.supertype, 'Object'); @@ -140,7 +134,7 @@ mixin A {} mixin B {} class C extends Object with A, Function, B {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 53, 8)], + [error(CompileTimeErrorCode.classUsedAsMixin, 53, 8)], ); assertElementTypes(findElement2.class_('C').mixins, ['A', 'B']); @@ -154,7 +148,7 @@ mixin A {} mixin B {} class C extends Object with A, Function, B {} ''', - [error(WarningCode.DEPRECATED_MIXIN_FUNCTION, 69, 8)], + [error(WarningCode.deprecatedMixinFunction, 69, 8)], ); assertElementTypes(findElement2.class_('C').mixins, ['A', 'B']); @@ -174,15 +168,14 @@ main() { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 33, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 33, 1), error( - CompileTimeErrorCode - .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFivePlus, 60, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 150, 1), + error(WarningCode.unusedLocalVariable, 150, 1), ], ); } diff --git a/pkg/analyzer/test/src/dart/resolution/comment_test.dart b/pkg/analyzer/test/src/dart/resolution/comment_test.dart index e1b16e594fb..062fa9eeea3 100644 --- a/pkg/analyzer/test/src/dart/resolution/comment_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/comment_test.dart @@ -1861,8 +1861,8 @@ library; main() {} ''', [ - error(WarningCode.DEPRECATED_NEW_IN_COMMENT_REFERENCE, 42, 3), - error(WarningCode.DEPRECATED_NEW_IN_COMMENT_REFERENCE, 53, 3), + error(WarningCode.deprecatedNewInCommentReference, 42, 3), + error(WarningCode.deprecatedNewInCommentReference, 53, 3), ], ); @@ -2054,8 +2054,8 @@ class A { main() {} ''', [ - error(WarningCode.DEPRECATED_NEW_IN_COMMENT_REFERENCE, 38, 3), - error(WarningCode.DEPRECATED_NEW_IN_COMMENT_REFERENCE, 49, 3), + error(WarningCode.deprecatedNewInCommentReference, 38, 3), + error(WarningCode.deprecatedNewInCommentReference, 49, 3), ], ); diff --git a/pkg/analyzer/test/src/dart/resolution/conditional_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/conditional_expression_test.dart index d1110f75a61..da3de8b3711 100644 --- a/pkg/analyzer/test/src/dart/resolution/conditional_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/conditional_expression_test.dart @@ -28,7 +28,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 27, 5)], + [error(CompileTimeErrorCode.nonBoolCondition, 27, 5)], ); var node = findNode.singleConditionalExpression; @@ -84,7 +84,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 41, 5)], + [error(ParserErrorCode.missingAssignableSelector, 41, 5)], ); var node = findNode.singleConditionalExpression; @@ -154,7 +154,7 @@ T f(T t, bool b) { } } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 79, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 79, 1)], ); var node = findNode.conditionalExpression('b ?'); @@ -242,7 +242,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 37, 5)], + [error(ParserErrorCode.missingAssignableSelector, 37, 5)], ); var node = findNode.singleConditionalExpression; diff --git a/pkg/analyzer/test/src/dart/resolution/constant_test.dart b/pkg/analyzer/test/src/dart/resolution/constant_test.dart index 51f3fdce31f..1ca2db771e5 100644 --- a/pkg/analyzer/test/src/dart/resolution/constant_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/constant_test.dart @@ -29,13 +29,7 @@ class A { import 'a.dart'; const a = const A(); ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 27, - 9, - ), - ], + [error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 27, 9)], ); var aLib = findElement2.import('package:test/a.dart').importedLibrary!; @@ -83,7 +77,7 @@ class A { } } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_ELEMENT, 51, 1)], + [error(StaticWarningCode.invalidNullAwareElement, 51, 1)], ); assertType(findNode.listLiteral('const ['), 'List'); } @@ -98,7 +92,7 @@ class A { } } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_KEY, 51, 1)], + [error(StaticWarningCode.invalidNullAwareMapEntryKey, 51, 1)], ); assertType(findNode.setOrMapLiteral('const {'), 'Map'); } @@ -113,7 +107,7 @@ class A { } } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_VALUE, 54, 1)], + [error(StaticWarningCode.invalidNullAwareMapEntryValue, 54, 1)], ); assertType(findNode.setOrMapLiteral('const {'), 'Map'); } @@ -130,7 +124,7 @@ class C extends B { const C() : super(a); } ''', - [error(CompileTimeErrorCode.CONST_NOT_INITIALIZED, 62, 1)], + [error(CompileTimeErrorCode.constNotInitialized, 62, 1)], ); } @@ -144,7 +138,7 @@ class A { } } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_ELEMENT, 51, 1)], + [error(StaticWarningCode.invalidNullAwareElement, 51, 1)], ); assertType(findNode.setOrMapLiteral('const {'), 'Set'); } diff --git a/pkg/analyzer/test/src/dart/resolution/constructor_field_initializer_test.dart b/pkg/analyzer/test/src/dart/resolution/constructor_field_initializer_test.dart index c83c65eac0d..d62842b15fb 100644 --- a/pkg/analyzer/test/src/dart/resolution/constructor_field_initializer_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/constructor_field_initializer_test.dart @@ -199,7 +199,7 @@ const a = 0; ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, + CompileTimeErrorCode.fieldInitializedInInitializerAndDeclaration, 39, 1, ), @@ -230,7 +230,7 @@ class A { const a = 0; class X {} ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 24, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 24, 5)], ); var node = findNode.singleConstructorFieldInitializer; @@ -257,7 +257,7 @@ class A { } const a = 0; ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 18, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 18, 5)], ); var node = findNode.singleConstructorFieldInitializer; @@ -285,8 +285,8 @@ class A { const a = 0; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 12), - error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 44, 5), + error(WarningCode.unusedImport, 7, 12), + error(CompileTimeErrorCode.initializerForNonExistentField, 44, 5), ], ); @@ -314,7 +314,7 @@ class A { } const a = 0; ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 18, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 18, 5)], ); var node = findNode.singleConstructorFieldInitializer; @@ -341,7 +341,7 @@ class A { } const a = 0; ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 18, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 18, 5)], ); var node = findNode.singleConstructorFieldInitializer; @@ -368,7 +368,7 @@ class A { const a = 0; void x() {} ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 18, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 18, 5)], ); var node = findNode.singleConstructorFieldInitializer; @@ -395,7 +395,7 @@ class A { const a = 0; var x = 0; ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 18, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 18, 5)], ); var node = findNode.singleConstructorFieldInitializer; @@ -421,7 +421,7 @@ class A { } const a = 0; ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 21, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 21, 5)], ); var node = findNode.singleConstructorFieldInitializer; @@ -447,7 +447,7 @@ class A { } const a = 0; ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 18, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 18, 5)], ); var node = findNode.singleConstructorFieldInitializer; diff --git a/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart b/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart index bbccccd1ee0..b91374aaa5b 100644 --- a/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart @@ -64,8 +64,7 @@ foo() { ''', [ error( - CompileTimeErrorCode - .TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS, + CompileTimeErrorCode.tearoffOfGenerativeConstructorOfAbstractClass, 39, 5, ), @@ -105,8 +104,7 @@ foo() { ''', [ error( - CompileTimeErrorCode - .TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS, + CompileTimeErrorCode.tearoffOfGenerativeConstructorOfAbstractClass, 63, 5, ), @@ -144,7 +142,7 @@ A Function() bar() { ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 41, 6, contextMessages: [message(testFile, 39, 9)], @@ -828,7 +826,7 @@ void main() { var x = const Function(int)>[Direct.new]; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 87, 1)], + [error(WarningCode.unusedLocalVariable, 87, 1)], ); } @@ -886,7 +884,7 @@ void bar() { TA.new; } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 75, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 75, 6)], ); var node = findNode.constructorReference('TA.new;'); @@ -1011,9 +1009,9 @@ void bar() { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 43, 1), - error(ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, 47, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 48, 2), + error(CompileTimeErrorCode.undefinedOperator, 43, 1), + error(ParserErrorCode.equalityCannotBeEqualityOperand, 47, 1), + error(ParserErrorCode.missingIdentifier, 48, 2), ], ); // The parser produces nonsense here because the `<` disambiguates as a @@ -1033,9 +1031,9 @@ void bar() { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 43, 1), - error(ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, 47, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 48, 2), + error(CompileTimeErrorCode.undefinedOperator, 43, 1), + error(ParserErrorCode.equalityCannotBeEqualityOperand, 47, 1), + error(ParserErrorCode.missingIdentifier, 48, 2), ], ); // The parser produces nonsense here because the `<` disambiguates as a @@ -1056,7 +1054,7 @@ void bar() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 52, 5, messageContains: ["The constructor 'A.foo'"], @@ -1107,7 +1105,7 @@ void bar() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 52, 5, messageContains: ["The constructor 'A.new'"], @@ -1158,7 +1156,7 @@ void bar() { ''', [ error( - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToStaticMember, 51, 8, ), @@ -1202,7 +1200,7 @@ void bar() { A.; } ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 49, 1)], + [error(ParserErrorCode.missingIdentifier, 49, 1)], ); var node = findNode.constructorReference('A.;'); @@ -1365,7 +1363,7 @@ void bar() { A.new; } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 52, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 52, 6)], ); var node = findNode.constructorReference('A.new;'); @@ -1606,7 +1604,7 @@ void bar() { A.i; } ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 52, 5)], + [error(ParserErrorCode.experimentNotEnabled, 52, 5)], ); var node = findNode.constructorReference('A.i;'); @@ -1646,7 +1644,7 @@ void bar() { A.foo; } ''', - [error(WarningCode.SDK_VERSION_CONSTRUCTOR_TEAROFFS, 39, 5)], + [error(WarningCode.sdkVersionConstructorTearoffs, 39, 5)], ); var node = findNode.constructorReference('A.foo;'); diff --git a/pkg/analyzer/test/src/dart/resolution/constructor_test.dart b/pkg/analyzer/test/src/dart/resolution/constructor_test.dart index 4e6f9f658af..e9e5a6c49aa 100644 --- a/pkg/analyzer/test/src/dart/resolution/constructor_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/constructor_test.dart @@ -55,13 +55,7 @@ class A { A(var _) : v = _; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 45, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 45, 1)], ); var node = findNode.constructorFieldInitializer('v = _'); @@ -233,7 +227,7 @@ class B { factory B() = A.named; } ''', - [error(CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR, 59, 7)], + [error(CompileTimeErrorCode.redirectToMissingConstructor, 59, 7)], ); var node = findNode.constructorDeclaration('factory B'); @@ -366,7 +360,7 @@ class B { factory B.named() = A; } ''', - [error(CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR, 71, 1)], + [error(CompileTimeErrorCode.redirectToMissingConstructor, 71, 1)], ); var node = findNode.constructorDeclaration('factory B'); diff --git a/pkg/analyzer/test/src/dart/resolution/declared_variable_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/declared_variable_pattern_test.dart index 7ab2b7ffeff..b64928b0286 100644 --- a/pkg/analyzer/test/src/dart/resolution/declared_variable_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/declared_variable_pattern_test.dart @@ -25,7 +25,7 @@ void f(int x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1)], + [error(WarningCode.unusedLocalVariable, 46, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -49,7 +49,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1)], + [error(WarningCode.unusedLocalVariable, 46, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -235,7 +235,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1)], + [error(WarningCode.unusedLocalVariable, 40, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -261,7 +261,7 @@ void f(T x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1)], + [error(WarningCode.unusedLocalVariable, 54, 1)], ); var node = findNode.singleGuardedPattern.pattern; @@ -283,7 +283,7 @@ void f(int x) { if (x case var y) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1)], + [error(WarningCode.unusedLocalVariable, 33, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -304,7 +304,7 @@ void f(Never? x) { if (x case var y) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1)], + [error(WarningCode.unusedLocalVariable, 36, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -325,7 +325,7 @@ void f(Null x) { if (x case var y) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1)], + [error(WarningCode.unusedLocalVariable, 34, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -349,7 +349,7 @@ void f(int x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 44, 1)], + [error(WarningCode.unusedLocalVariable, 44, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -373,7 +373,7 @@ void f(num x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 44, 1)], + [error(WarningCode.unusedLocalVariable, 44, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/dot_shorthand_constructor_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/dot_shorthand_constructor_invocation_test.dart index bc23a32d6e5..fde9fbd7872 100644 --- a/pkg/analyzer/test/src/dart/resolution/dot_shorthand_constructor_invocation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/dot_shorthand_constructor_invocation_test.dart @@ -26,7 +26,7 @@ Function getFunction() { return .new(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 34, 6)], + [error(CompileTimeErrorCode.instantiateAbstractClass, 34, 6)], ); } @@ -254,7 +254,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 69, 5)], + [error(CompileTimeErrorCode.constWithNonConst, 69, 5)], ); } @@ -272,7 +272,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, 107, 2)], + [error(CompileTimeErrorCode.constWithUndefinedConstructor, 107, 2)], ); } @@ -366,7 +366,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 65, 5, ), @@ -618,8 +618,8 @@ void main() { } ''', [ - error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 35, 3), - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 40, 2), + error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 35, 3), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 40, 2), ], ); } @@ -635,8 +635,8 @@ void main() { } ''', [ - error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 37, 3), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 41, 1), + error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 37, 3), + error(ParserErrorCode.missingAssignableSelector, 41, 1), ], ); } @@ -654,7 +654,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 69, 3)], + [error(CompileTimeErrorCode.missingRequiredArgument, 69, 3)], ); } @@ -673,7 +673,7 @@ void main() { [ error( CompileTimeErrorCode - .WRONG_NUMBER_OF_TYPE_ARGUMENTS_DOT_SHORTHAND_CONSTRUCTOR, + .wrongNumberOfTypeArgumentsDotShorthandConstructor, 46, 5, ), @@ -696,7 +696,7 @@ void main() { [ error( CompileTimeErrorCode - .WRONG_NUMBER_OF_TYPE_ARGUMENTS_DOT_SHORTHAND_CONSTRUCTOR, + .wrongNumberOfTypeArgumentsDotShorthandConstructor, 58, 5, ), @@ -712,7 +712,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, 24, 17)], + [error(CompileTimeErrorCode.dotShorthandMissingContext, 24, 17)], ); } } diff --git a/pkg/analyzer/test/src/dart/resolution/dot_shorthand_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/dot_shorthand_invocation_test.dart index 22d07f4e899..59098e08dcb 100644 --- a/pkg/analyzer/test/src/dart/resolution/dot_shorthand_invocation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/dot_shorthand_invocation_test.dart @@ -31,7 +31,7 @@ class CAssert { : assert(const .named(1) == ctor); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, 114, 15)], + [error(CompileTimeErrorCode.dotShorthandMissingContext, 114, 15)], ); } @@ -199,13 +199,7 @@ void main() { print(c1); } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 77, - 4, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 77, 4)], ); } @@ -387,7 +381,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 47, 6)], + [error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 47, 6)], ); } @@ -399,7 +393,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 25, 6)], + [error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 25, 6)], ); } @@ -413,7 +407,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 36, 6)], + [error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 36, 6)], ); } @@ -429,7 +423,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 49, 3)], + [error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 49, 3)], ); } @@ -651,8 +645,8 @@ void main() { } ''', [ - error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 87, 6), - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 95, 2), + error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 87, 6), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 95, 2), ], ); } @@ -672,8 +666,8 @@ void main() { } ''', [ - error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 89, 6), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 96, 1), + error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 89, 6), + error(ParserErrorCode.missingAssignableSelector, 96, 1), ], ); } @@ -692,7 +686,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 103, 6)], + [error(CompileTimeErrorCode.missingRequiredArgument, 103, 6)], ); } @@ -746,7 +740,7 @@ void main() { } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 105, 9)], + [error(CompileTimeErrorCode.invalidAssignment, 105, 9)], ); } } diff --git a/pkg/analyzer/test/src/dart/resolution/dot_shorthand_property_access_test.dart b/pkg/analyzer/test/src/dart/resolution/dot_shorthand_property_access_test.dart index 6c988bc983d..4659d6c6c18 100644 --- a/pkg/analyzer/test/src/dart/resolution/dot_shorthand_property_access_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/dot_shorthand_property_access_test.dart @@ -394,7 +394,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, 46, 7)], + [error(CompileTimeErrorCode.dotShorthandMissingContext, 46, 7)], ); } @@ -406,7 +406,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, 24, 7)], + [error(CompileTimeErrorCode.dotShorthandMissingContext, 24, 7)], ); } @@ -420,7 +420,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_GETTER, 36, 6)], + [error(CompileTimeErrorCode.dotShorthandUndefinedGetter, 36, 6)], ); } @@ -436,7 +436,7 @@ void main() { print(c); } ''', - [error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_GETTER, 49, 3)], + [error(CompileTimeErrorCode.dotShorthandUndefinedGetter, 49, 3)], ); } @@ -598,8 +598,8 @@ void main() { } ''', [ - error(CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, 88, 7), - error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 95, 2), + error(CompileTimeErrorCode.dotShorthandMissingContext, 88, 7), + error(ParserErrorCode.illegalAssignmentToNonAssignable, 95, 2), ], ); } @@ -619,8 +619,8 @@ void main() { } ''', [ - error(CompileTimeErrorCode.DOT_SHORTHAND_MISSING_CONTEXT, 90, 7), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 91, 6), + error(CompileTimeErrorCode.dotShorthandMissingContext, 90, 7), + error(ParserErrorCode.missingAssignableSelector, 91, 6), ], ); } @@ -663,8 +663,7 @@ Function fn() { ''', [ error( - CompileTimeErrorCode - .TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS, + CompileTimeErrorCode.tearoffOfGenerativeConstructorOfAbstractClass, 25, 4, ), diff --git a/pkg/analyzer/test/src/dart/resolution/enum_test.dart b/pkg/analyzer/test/src/dart/resolution/enum_test.dart index 59dc0f482fe..8529dbec7d5 100644 --- a/pkg/analyzer/test/src/dart/resolution/enum_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/enum_test.dart @@ -265,7 +265,7 @@ enum E { const E(int a); } ''', - [error(CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_NAMED, 13, 5)], + [error(CompileTimeErrorCode.undefinedEnumConstructorNamed, 13, 5)], ); var node = findNode.enumConstantDeclaration('v.'); @@ -300,7 +300,7 @@ enum E { const E.named(int a); } ''', - [error(CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_UNNAMED, 11, 1)], + [error(CompileTimeErrorCode.undefinedEnumConstructorUnnamed, 11, 1)], ); var node = findNode.enumConstantDeclaration('v('); diff --git a/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart b/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart index f73c0b6ad39..5e7483a69b0 100644 --- a/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart @@ -50,9 +50,9 @@ extension E { } ''', [ - error(ParserErrorCode.EXPECTED_TOKEN, 10, 1), - error(ParserErrorCode.EXPECTED_TYPE_NAME, 12, 1), - error(ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR, 16, 1), + error(ParserErrorCode.expectedToken, 10, 1), + error(ParserErrorCode.expectedTypeName, 12, 1), + error(ParserErrorCode.extensionDeclaresConstructor, 16, 1), ], ); } @@ -65,9 +65,9 @@ extension E { } ''', [ - error(ParserErrorCode.EXPECTED_TOKEN, 10, 1), - error(ParserErrorCode.EXPECTED_TYPE_NAME, 12, 1), - error(ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR, 16, 7), + error(ParserErrorCode.expectedToken, 10, 1), + error(ParserErrorCode.expectedTypeName, 12, 1), + error(ParserErrorCode.extensionDeclaresConstructor, 16, 7), ], ); } @@ -172,7 +172,7 @@ f(C c) { c.a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 40, 1)], ); } @@ -191,7 +191,7 @@ f(C c) { c.a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 40, 1)], ); } @@ -210,7 +210,7 @@ f(C c) { c._a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 33, 2)], + [error(CompileTimeErrorCode.undefinedGetter, 33, 2)], ); } @@ -297,7 +297,7 @@ f(C c) { c.a; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 38, 1)], + [error(WarningCode.unusedLocalVariable, 38, 1)], ); var access = findNode.prefixed('c.a'); assertResolvedNodeText(access, r''' @@ -328,7 +328,7 @@ f(C c) { c.a; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 68, 1)], + [error(WarningCode.unusedLocalVariable, 68, 1)], ); var access = findNode.prefixed('c.a'); assertResolvedNodeText(access, r''' @@ -1004,7 +1004,7 @@ f(Never a) { a.foo; } ''', - [error(WarningCode.DEAD_CODE, 63, 4)], + [error(WarningCode.deadCode, 63, 4)], ); var access = findNode.prefixed('a.foo'); assertResolvedNodeText(access, r''' @@ -1434,8 +1434,8 @@ f(Never a) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 57, 1), - error(WarningCode.DEAD_CODE, 62, 3), + error(WarningCode.receiverOfTypeNever, 57, 1), + error(WarningCode.deadCode, 62, 3), ], ); @@ -1850,8 +1850,8 @@ extension on Object {} var a = b + c; ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 31, 1), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 35, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 31, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 35, 1), ], ); } @@ -3088,7 +3088,7 @@ extension E2 on int { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 104, 3)], + [error(CompileTimeErrorCode.assignmentToFinalNoSetter, 104, 3)], ); var assignment = findNode.assignment('foo = 0'); assertResolvedNodeText(assignment, r''' @@ -3499,7 +3499,7 @@ extension E2 on int { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 104, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 104, 3)], ); var node = findNode.simple('foo;'); assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart b/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart index 032b4a8fc06..87c1eb9cdcb 100644 --- a/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart @@ -879,7 +879,7 @@ f(){ E(0).v++; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, 45, 1)], + [error(CompileTimeErrorCode.undefinedExtensionSetter, 45, 1)], ); var node = findNode.postfix('++;'); diff --git a/pkg/analyzer/test/src/dart/resolution/field_test.dart b/pkg/analyzer/test/src/dart/resolution/field_test.dart index 538af1a82eb..b9ab594f91c 100644 --- a/pkg/analyzer/test/src/dart/resolution/field_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/field_test.dart @@ -24,7 +24,7 @@ class A { late Object f = super; } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 28, 5)], + [error(ParserErrorCode.missingAssignableSelector, 28, 5)], ); var node = findNode.singleFieldDeclaration; @@ -86,13 +86,7 @@ class A { final int b = a; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 45, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 45, 1)], ); var node = findNode.fieldDeclaration('b ='); @@ -126,13 +120,7 @@ class A { final int b = a; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 44, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 44, 1)], ); var node = findNode.fieldDeclaration('b ='); @@ -166,13 +154,7 @@ class A { final int b = a(); } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 42, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 42, 1)], ); var node = findNode.fieldDeclaration('b ='); @@ -211,7 +193,7 @@ class A { final a = this; } ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 22, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 22, 4)], ); var node = findNode.singleFieldDeclaration; diff --git a/pkg/analyzer/test/src/dart/resolution/for_element_test.dart b/pkg/analyzer/test/src/dart/resolution/for_element_test.dart index b06171646e3..73992a7ab99 100644 --- a/pkg/analyzer/test/src/dart/resolution/for_element_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/for_element_test.dart @@ -147,7 +147,7 @@ void f(Object x) { [for (var (a) in x) a]; } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 38, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 38, 1)], ); var node = findNode.forElement('for'); assertResolvedNodeText(node, r''' @@ -469,7 +469,7 @@ void f(Object x) async { [await for (var (a) in x) a]; } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 50, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 50, 1)], ); var node = findNode.forElement('for'); assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/for_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/for_statement_test.dart index 8477cf4c190..83d5b9882e2 100644 --- a/pkg/analyzer/test/src/dart/resolution/for_statement_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/for_statement_test.dart @@ -81,7 +81,7 @@ void f(dynamic values) { for (var v in values) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1)], + [error(WarningCode.unusedLocalVariable, 36, 1)], ); var node = findNode.singleForStatement; @@ -117,7 +117,7 @@ void f() { } } ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 26, 1)], + [error(ParserErrorCode.missingIdentifier, 26, 1)], ); var node = findNode.forStatement('for'); @@ -161,8 +161,8 @@ abstract class A implements Iterable { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 70, 1), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 75, 5), + error(WarningCode.unusedLocalVariable, 70, 1), + error(ParserErrorCode.missingAssignableSelector, 75, 5), ], ); @@ -502,7 +502,7 @@ abstract class A implements Iterable { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 76, 5)], + [error(ParserErrorCode.missingAssignableSelector, 76, 5)], ); var node = findNode.singleForStatement; assertResolvedNodeText(node, r''' @@ -626,7 +626,7 @@ void f(Object x) { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 37, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 37, 1)], ); var node = findNode.forStatement('for'); assertResolvedNodeText(node, r''' @@ -674,8 +674,8 @@ abstract class A implements Iterable { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 71, 1), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 77, 5), + error(WarningCode.unusedLocalVariable, 71, 1), + error(ParserErrorCode.missingAssignableSelector, 77, 5), ], ); var node = findNode.singleForStatement; @@ -715,7 +715,7 @@ void f() { T g() => throw 0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 27, 1)], + [error(WarningCode.unusedLocalVariable, 27, 1)], ); var node = findNode.forStatement('for'); assertResolvedNodeText(node, r''' @@ -767,7 +767,7 @@ void f() { T g() => throw 0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 23, 1)], + [error(WarningCode.unusedLocalVariable, 23, 1)], ); var node = findNode.forStatement('for'); assertResolvedNodeText(node, r''' @@ -956,7 +956,7 @@ void f(Object x) async { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 49, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 49, 1)], ); var node = findNode.singleForStatement; assertResolvedNodeText(node, r''' @@ -1341,7 +1341,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 35, 5)], + [error(ParserErrorCode.missingAssignableSelector, 35, 5)], ); var node = findNode.singleForStatement; diff --git a/pkg/analyzer/test/src/dart/resolution/function_declaration_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/function_declaration_statement_test.dart index abdffe35d53..ae308ca5f05 100644 --- a/pkg/analyzer/test/src/dart/resolution/function_declaration_statement_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/function_declaration_statement_test.dart @@ -23,7 +23,7 @@ void f() { T g(T a, U b) => a; } ''', - [error(WarningCode.UNUSED_ELEMENT, 15, 1)], + [error(WarningCode.unusedElement, 15, 1)], ); var node = findNode.singleFunctionDeclarationStatement; @@ -93,7 +93,7 @@ void f() { void g(T x, U y, V z) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var node = findNode.singleFunctionDeclarationStatement; @@ -183,7 +183,7 @@ void f() { void g({T? a}) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var node = findNode.singleFunctionDeclarationStatement; @@ -244,7 +244,7 @@ void f() { void g([T? a]) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var node = findNode.singleFunctionDeclarationStatement; @@ -305,7 +305,7 @@ void f() { void g({required T? a}) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var node = findNode.singleFunctionDeclarationStatement; @@ -367,7 +367,7 @@ void f() { void g(T a) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var node = findNode.singleFunctionDeclarationStatement; @@ -421,7 +421,7 @@ void f() { g() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 13, 1)], + [error(WarningCode.unusedElement, 13, 1)], ); var node = findNode.singleFunctionDeclarationStatement; @@ -454,7 +454,7 @@ void f() { g() => 0; } ''', - [error(WarningCode.UNUSED_ELEMENT, 13, 1)], + [error(WarningCode.unusedElement, 13, 1)], ); var node = findNode.singleFunctionDeclarationStatement; diff --git a/pkg/analyzer/test/src/dart/resolution/function_declaration_test.dart b/pkg/analyzer/test/src/dart/resolution/function_declaration_test.dart index dcf18112173..638c60f44c8 100644 --- a/pkg/analyzer/test/src/dart/resolution/function_declaration_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/function_declaration_test.dart @@ -25,7 +25,7 @@ Stream f() async* { return 0; } ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 49, 6)], + [error(CompileTimeErrorCode.returnInGenerator, 49, 6)], ); var node = findNode.singleFunctionDeclaration; @@ -78,7 +78,7 @@ import 'dart:async'; Stream f() async* => 0; ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 45, 2)], + [error(CompileTimeErrorCode.returnInGenerator, 45, 2)], ); var node = findNode.singleFunctionDeclaration; @@ -265,7 +265,7 @@ void f() { void m>() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var node = findNode.singleFunctionDeclarationStatement.functionDeclaration; @@ -322,7 +322,7 @@ void f() { void m() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 18, 1)], + [error(WarningCode.unusedElement, 18, 1)], ); var node = findNode.singleFunctionDeclarationStatement.functionDeclaration; @@ -369,7 +369,7 @@ FunctionDeclaration ''' int get foo(double a) => 0; ''', - [error(ParserErrorCode.GETTER_WITH_PARAMETERS, 11, 1)], + [error(ParserErrorCode.getterWithParameters, 11, 1)], ); var node = findNode.singleFunctionDeclaration; @@ -417,7 +417,7 @@ Iterable f() sync* { return 0; } ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 28, 6)], + [error(CompileTimeErrorCode.returnInGenerator, 28, 6)], ); var node = findNode.singleFunctionDeclaration; @@ -468,7 +468,7 @@ FunctionDeclaration ''' Iterable f() sync* => 0; ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 24, 2)], + [error(CompileTimeErrorCode.returnInGenerator, 24, 2)], ); var node = findNode.singleFunctionDeclaration; @@ -514,7 +514,7 @@ FunctionDeclaration ''' _() {} ''', - [error(WarningCode.UNUSED_ELEMENT, 0, 1)], + [error(WarningCode.unusedElement, 0, 1)], ); var node = findNode.singleFunctionDeclaration; @@ -547,7 +547,7 @@ FunctionDeclaration _() {} ''', - [error(WarningCode.UNUSED_ELEMENT, 44, 1)], + [error(WarningCode.unusedElement, 44, 1)], ); var node = findNode.singleFunctionDeclaration; @@ -581,8 +581,8 @@ FunctionDeclaration void f<_ extends void Function<_>(_, _), _>() {} ''', [ - error(CompileTimeErrorCode.UNDEFINED_CLASS, 34, 1), - error(CompileTimeErrorCode.UNDEFINED_CLASS, 37, 1), + error(CompileTimeErrorCode.undefinedClass, 34, 1), + error(CompileTimeErrorCode.undefinedClass, 37, 1), ], ); diff --git a/pkg/analyzer/test/src/dart/resolution/function_expression_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/function_expression_invocation_test.dart index f9f9caeb353..b82c6f024c7 100644 --- a/pkg/analyzer/test/src/dart/resolution/function_expression_invocation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/function_expression_invocation_test.dart @@ -316,13 +316,7 @@ void f((String,) a) { a(); } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 24, - 1, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 24, 1)], ); var node = findNode.functionExpressionInvocation('();'); assertResolvedNodeText(node, r''' @@ -420,7 +414,7 @@ void f(int Function() g, int a) { g(a); } ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 38, 1)], + [error(CompileTimeErrorCode.extraPositionalArguments, 38, 1)], ); var node = findNode.singleFunctionExpressionInvocation; @@ -530,13 +524,7 @@ const a = 0; const b = 0; const c = id(a, b); ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 58, - 8, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 58, 8)], ); var node = findNode.singleFunctionExpressionInvocation; @@ -574,8 +562,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 26, 8), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 26, 8), ], ); @@ -626,13 +614,7 @@ void f(Never? x) { x(1 + 2); } ''', - [ - error( - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, - 21, - 1, - ), - ], + [error(CompileTimeErrorCode.uncheckedInvocationOfNullableValue, 21, 1)], ); var node = findNode.functionExpressionInvocation('x(1 + 2)'); diff --git a/pkg/analyzer/test/src/dart/resolution/function_reference_test.dart b/pkg/analyzer/test/src/dart/resolution/function_reference_test.dart index f9aa2b62f80..9e67b76fd22 100644 --- a/pkg/analyzer/test/src/dart/resolution/function_reference_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/function_reference_test.dart @@ -117,7 +117,7 @@ var x = A.foo; ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 42, 5, messageContains: ["'A.foo'"], @@ -160,7 +160,7 @@ var x = a.Future.delayed; ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 50, 5, messageContains: ["'a.Future.delayed'"], @@ -212,7 +212,7 @@ void bar() { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 31, 1, ), @@ -248,7 +248,7 @@ void bar() { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 31, 1, ), @@ -284,7 +284,7 @@ foo() { ''', [ error( - CompileTimeErrorCode.GENERIC_METHOD_TYPE_INSTANTIATION_ON_DYNAMIC, + CompileTimeErrorCode.genericMethodTypeInstantiationOnDynamic, 29, 23, ), @@ -332,7 +332,7 @@ bar() { a.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 10, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 10, 1)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -368,7 +368,7 @@ bar() { a.b.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 10, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 10, 1)], ); var node = findNode.functionReference('foo;'); @@ -416,7 +416,7 @@ void foo() { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 44, 1, ), @@ -456,7 +456,7 @@ void foo() { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 38, 3, ), @@ -505,7 +505,7 @@ bar(A a) { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 67, 8, ), @@ -689,7 +689,7 @@ bar(A a) { E(a)..foo; } ''', - [error(CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE, 85, 1)], + [error(CompileTimeErrorCode.extensionOverrideWithCascade, 85, 1)], ); var reference = findNode.functionReference('foo;'); @@ -731,7 +731,7 @@ bar(A a) { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, 81, 3, ), @@ -787,7 +787,7 @@ bar(A a) { E(a).foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, 51, 3)], + [error(CompileTimeErrorCode.undefinedExtensionGetter, 51, 3)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -869,9 +869,9 @@ extension on double { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 24, 3), + error(WarningCode.unusedElement, 24, 3), error( - CompileTimeErrorCode.UNDEFINED_METHOD, + CompileTimeErrorCode.undefinedMethod, 36, 3, messageContains: ["for the type 'double'"], @@ -943,13 +943,7 @@ void bar() { foo.call; } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 52, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 52, 5)], ); assertResolvedNodeText(findNode.functionReference('foo.call;'), r''' @@ -990,13 +984,7 @@ void bar() { foo.call; } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 46, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 46, 5)], ); assertResolvedNodeText(findNode.functionReference('foo.call;'), r''' @@ -1118,7 +1106,7 @@ extension E on Function { static void m(T t) {} } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 40, 1)], ); assertResolvedNodeText(findNode.functionReference('foo.m;'), r''' @@ -1405,13 +1393,7 @@ foo() { C(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 57, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 57, 5)], ); var node = findNode.implicitCallReference('C();'); @@ -1455,13 +1437,7 @@ foo() { C(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 50, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 50, 5)], ); var node = findNode.implicitCallReference('C();'); @@ -1608,7 +1584,7 @@ void foo(A a) { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 61, 1, ), @@ -1654,7 +1630,7 @@ void foo(A a) { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 63, 1, ), @@ -1873,7 +1849,7 @@ void f(A a) { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 97, 3, ), @@ -2125,7 +2101,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, 30, 3)], + [error(CompileTimeErrorCode.undefinedSuperGetter, 30, 3)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -2159,7 +2135,7 @@ bar() { super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 10, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 10, 5)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -2372,7 +2348,7 @@ bar() { prefix.a.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 47, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 47, 3)], ); var node = findNode.functionReference('foo;'); @@ -2416,7 +2392,7 @@ bar() { T.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 15, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 15, 3)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -2666,7 +2642,7 @@ class A { ''', [ error( - CompileTimeErrorCode.UNDEFINED_METHOD, + CompileTimeErrorCode.undefinedMethod, 24, 3, messageContains: ["for the type 'A'"], @@ -2703,7 +2679,7 @@ void f() { prefix.loadLibrary; } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 8)], + [error(WarningCode.unusedImport, 7, 8)], ); var node = findNode.expressionStatement('prefix.loadLibrary'); @@ -2835,13 +2811,7 @@ void bar() { fn.call; } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 74, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 74, 5)], ); var reference = findNode.functionReference('fn.call;'); @@ -2883,7 +2853,7 @@ void bar(T foo) { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 40, 3, ), @@ -2946,7 +2916,7 @@ void bar(T foo) { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 23, 3, ), @@ -2983,7 +2953,7 @@ void bar() { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 38, 1, ), @@ -3019,13 +2989,7 @@ class A { } } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 44, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 44, 5)], ); var reference = findNode.functionReference('foo;'); @@ -3068,8 +3032,7 @@ void f(void Function(T a) foo, void Function(T a) bar) { ''', [ error( - CompileTimeErrorCode - .WRONG_NUMBER_OF_TYPE_ARGUMENTS_ANONYMOUS_FUNCTION, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsAnonymousFunction, 85, 13, ), @@ -3092,7 +3055,7 @@ bar(dynamic a) { ''', [ error( - CompileTimeErrorCode.GENERIC_METHOD_TYPE_INSTANTIATION_ON_DYNAMIC, + CompileTimeErrorCode.genericMethodTypeInstantiationOnDynamic, 19, 5, ), @@ -3132,7 +3095,7 @@ void f(({T Function(T) f1, String f2}) r) { int Function(int) v = r.f1; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 67, 1)], + [error(WarningCode.unusedLocalVariable, 67, 1)], ); var node = findNode.functionReference(r'.f1;'); @@ -3162,7 +3125,7 @@ void f((T Function(T), String) r) { int Function(int) v = r.$1; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 59, 1)], + [error(WarningCode.unusedLocalVariable, 59, 1)], ); var node = findNode.functionReference(r'.$1;'); @@ -3461,7 +3424,7 @@ class B extends A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 70, 5)], + [error(ParserErrorCode.missingAssignableSelector, 70, 5)], ); var node = findNode.singleImplicitCallReference; @@ -3496,13 +3459,7 @@ class A { } } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 58, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 58, 5)], ); var reference = findNode.functionReference('foo;'); @@ -3538,13 +3495,7 @@ class A { } } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 50, - 10, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 50, 10)], ); var reference = findNode.functionReference('foo;'); @@ -3694,7 +3645,7 @@ bar() { prefix.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 10, 6)], + [error(CompileTimeErrorCode.undefinedIdentifier, 10, 6)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -3843,7 +3794,7 @@ bar() { prefix.a.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 45, 1)], + [error(CompileTimeErrorCode.undefinedPrefixedName, 45, 1)], ); var node = findNode.functionReference('foo;'); @@ -3887,7 +3838,7 @@ typedef Cb = void Function(); var a = Cb.foo; ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 42, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 42, 3)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -3923,7 +3874,7 @@ typedef T = E; var a = T.foo; ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 29, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 29, 3)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -3959,7 +3910,7 @@ void bar() { foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 15, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 15, 3)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -3991,7 +3942,7 @@ class B { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 41, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 41, 3)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -4030,7 +3981,7 @@ void bar() { a.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 40, 3)], + [error(CompileTimeErrorCode.undefinedPrefixedName, 40, 3)], ); assertResolvedNodeText(findNode.functionReference('foo;'), r''' @@ -4662,7 +4613,7 @@ void bar(void Function(T a) foo) { foo; } ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 43, 5)], + [error(ParserErrorCode.experimentNotEnabled, 43, 5)], ); var reference = findNode.functionReference('foo;'); diff --git a/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart b/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart index 82c6b444334..159d5273884 100644 --- a/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart @@ -93,7 +93,7 @@ C? x; ''', [ error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, 47, 1, ), @@ -118,7 +118,7 @@ C? x; ''', [ error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, 59, 1, ), @@ -136,7 +136,7 @@ C()>? x; ''', [ error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, 31, 13, ), @@ -156,7 +156,7 @@ main() { ''', [ error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, 44, 13, ), @@ -176,7 +176,7 @@ main() { ''', [ error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, 54, 13, ), @@ -198,7 +198,7 @@ main() { ''', [ error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, 66, 13, ), @@ -216,7 +216,7 @@ F()>? x; ''', [ error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_TYPE_ARGUMENT, + CompileTimeErrorCode.genericFunctionTypeCannotBeTypeArgument, 38, 13, ), @@ -254,8 +254,8 @@ void f() { } ''', [ - error(ParserErrorCode.EXPECTED_TYPE_NAME, 15, 1), - error(CompileTimeErrorCode.UNDEFINED_GETTER, 33, 1), + error(ParserErrorCode.expectedTypeName, 15, 1), + error(CompileTimeErrorCode.undefinedGetter, 33, 1), ], ); } @@ -272,7 +272,7 @@ void f() { p.F.a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 40, 1)], ); } diff --git a/pkg/analyzer/test/src/dart/resolution/if_element_test.dart b/pkg/analyzer/test/src/dart/resolution/if_element_test.dart index e7e5468baa1..70c04eb1694 100644 --- a/pkg/analyzer/test/src/dart/resolution/if_element_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/if_element_test.dart @@ -105,12 +105,12 @@ void f(Object x) { ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, 62, 1, ), error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 62, 1, contextMessages: [message(testFile, 56, 1)], @@ -194,7 +194,7 @@ void f(Object x) { ]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 79, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 79, 1)], ); var node = findNode.ifElement('if'); @@ -257,8 +257,8 @@ class A { } ''', [ - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 32, 5), - error(CompileTimeErrorCode.NON_BOOL_CONDITION, 32, 5), + error(ParserErrorCode.missingAssignableSelector, 32, 5), + error(CompileTimeErrorCode.nonBoolCondition, 32, 5), ], ); diff --git a/pkg/analyzer/test/src/dart/resolution/if_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/if_statement_test.dart index 9288d282096..613575af5c3 100644 --- a/pkg/analyzer/test/src/dart/resolution/if_statement_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/if_statement_test.dart @@ -137,7 +137,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.DEAD_CODE, 45, 8)], + [error(WarningCode.deadCode, 45, 8)], ); var node = findNode.ifStatement('if'); @@ -221,13 +221,7 @@ void f(Object? x) { } } ''', - [ - error( - CompileTimeErrorCode.INCONSISTENT_PATTERN_VARIABLE_LOGICAL_OR, - 53, - 1, - ), - ], + [error(CompileTimeErrorCode.inconsistentPatternVariableLogicalOr, 53, 1)], ); var node = findNode.ifStatement('if'); @@ -310,13 +304,7 @@ void f(Object? x) { } } ''', - [ - error( - CompileTimeErrorCode.INCONSISTENT_PATTERN_VARIABLE_LOGICAL_OR, - 50, - 1, - ), - ], + [error(CompileTimeErrorCode.inconsistentPatternVariableLogicalOr, 50, 1)], ); var node = findNode.ifStatement('if'); @@ -399,8 +387,8 @@ void f(Object? x) { } ''', [ - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 42, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 47, 1), + error(CompileTimeErrorCode.missingVariablePattern, 42, 1), + error(CompileTimeErrorCode.missingVariablePattern, 47, 1), ], ); @@ -480,7 +468,7 @@ void f(Object? x) { } } ''', - [error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 51, 1)], + [error(CompileTimeErrorCode.missingVariablePattern, 51, 1)], ); var node = findNode.ifStatement('if'); @@ -650,7 +638,7 @@ void f(Object? x) { } } ''', - [error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 42, 1)], + [error(CompileTimeErrorCode.missingVariablePattern, 42, 1)], ); var node = findNode.ifStatement('if'); @@ -735,8 +723,8 @@ void f(Object? x) { } ''', [ - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 33, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 47, 1), + error(CompileTimeErrorCode.missingVariablePattern, 33, 1), + error(CompileTimeErrorCode.missingVariablePattern, 47, 1), ], ); @@ -816,7 +804,7 @@ void f(Object? x) { } } ''', - [error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 33, 1)], + [error(CompileTimeErrorCode.missingVariablePattern, 33, 1)], ); var node = findNode.ifStatement('if'); @@ -911,12 +899,12 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, 57, 1, ), error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 57, 1, contextMessages: [message(testFile, 51, 1)], @@ -1013,8 +1001,8 @@ void f(Object? x) { } ''', [ - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 56, 1), - error(CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, 56, 1), + error(CompileTimeErrorCode.missingVariablePattern, 56, 1), + error(CompileTimeErrorCode.referencedBeforeDeclaration, 56, 1), ], ); @@ -1091,7 +1079,7 @@ void f(Object? x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 75, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 75, 1)], ); var node = findNode.ifStatement('if'); @@ -1166,8 +1154,8 @@ class A { } ''', [ - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 31, 5), - error(CompileTimeErrorCode.NON_BOOL_CONDITION, 31, 5), + error(ParserErrorCode.missingAssignableSelector, 31, 5), + error(CompileTimeErrorCode.nonBoolCondition, 31, 5), ], ); diff --git a/pkg/analyzer/test/src/dart/resolution/index_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/index_expression_test.dart index 6e1acc8a0ad..49bd7e5ad58 100644 --- a/pkg/analyzer/test/src/dart/resolution/index_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/index_expression_test.dart @@ -96,7 +96,7 @@ void f(A a) { T g() => throw 0; ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 107, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 107, 3)], ); var node = findNode.methodInvocation('g()'); @@ -309,7 +309,7 @@ class A { int operator[](Object index) => 0; } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 32, 5)], + [error(ParserErrorCode.missingAssignableSelector, 32, 5)], ); var node = findNode.singleIndexExpression; @@ -335,7 +335,7 @@ void f(List a) { a[b]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 26, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 26, 1)], ); var node = findNode.singleIndexExpression; @@ -545,7 +545,7 @@ void f() { a[0]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 13, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 13, 1)], ); var node = findNode.singleIndexExpression; diff --git a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart index 657d66ff1c5..a5b3100ae1c 100644 --- a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart @@ -36,7 +36,7 @@ void f() { A.new(0); } ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 40, 3)], + [error(ParserErrorCode.experimentNotEnabled, 40, 3)], ); // Resolution should continue even though the experiment is not enabled. @@ -201,7 +201,7 @@ void f() { A(0); } ''', - [error(WarningCode.UNUSED_ELEMENT, 33, 1)], + [error(WarningCode.unusedElement, 33, 1)], ); var node = findNode.singleInstanceCreationExpression; @@ -539,7 +539,7 @@ void f() { A(); } ''', - [error(WarningCode.UNUSED_ELEMENT, 30, 1)], + [error(WarningCode.unusedElement, 30, 1)], ); var node = findNode.singleInstanceCreationExpression; @@ -640,7 +640,7 @@ void f() { } ''', - [error(CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, 31, 10)], + [error(CompileTimeErrorCode.newWithUndefinedConstructor, 31, 10)], ); var node = findNode.singleInstanceCreationExpression; @@ -715,7 +715,7 @@ InstanceCreationExpression r''' final foo = Map(); ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 12, 8)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 12, 8)], ); var node = findNode.instanceCreation('Map'); @@ -757,7 +757,7 @@ main() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 53, 5, messageContains: ["The constructor 'Foo.bar'"], @@ -812,7 +812,7 @@ main() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 53, 5, messageContains: ["The constructor 'Foo.new'"], @@ -868,7 +868,7 @@ main() { new p.Foo.bar(); } ''', - [error(ParserErrorCode.CONSTRUCTOR_WITH_TYPE_ARGUMENTS, 44, 3)], + [error(ParserErrorCode.constructorWithTypeArguments, 44, 3)], ); // TODO(brianwilkerson): Test this more carefully after we can re-write the @@ -924,7 +924,7 @@ main() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 49, 5, ), @@ -980,7 +980,7 @@ main() { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_CONSTRUCTOR, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsConstructor, 43, 5, ), @@ -1237,7 +1237,7 @@ void f() { new A.named(0); } ''', - [error(CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, 48, 5)], + [error(CompileTimeErrorCode.newWithUndefinedConstructor, 48, 5)], ); var node = findNode.singleInstanceCreationExpression; @@ -1277,7 +1277,7 @@ void f() { } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 48, 6)], + [error(CompileTimeErrorCode.newWithNonType, 48, 6)], ); var node = findNode.singleInstanceCreationExpression; @@ -1746,7 +1746,7 @@ void f() { } ''', - [error(CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, 54, 3)], + [error(CompileTimeErrorCode.newWithUndefinedConstructor, 54, 3)], ); var node = findNode.singleInstanceCreationExpression; @@ -1790,7 +1790,7 @@ void f() { } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 55, 3)], + [error(CompileTimeErrorCode.newWithNonType, 55, 3)], ); var node = findNode.singleInstanceCreationExpression; @@ -2010,7 +2010,7 @@ void f() { X(0); } ''', - [error(WarningCode.UNUSED_ELEMENT, 33, 1)], + [error(WarningCode.unusedElement, 33, 1)], ); var node = findNode.singleInstanceCreationExpression; @@ -2225,7 +2225,7 @@ void f() { B.named(0); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 77, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 77, 1)], ); var node = findNode.instanceCreation('B.named(0)'); @@ -2273,7 +2273,7 @@ void f() { B(0); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 65, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 65, 1)], ); var node = findNode.instanceCreation('B(0)'); @@ -2369,7 +2369,7 @@ void f() { X(); } ''', - [error(WarningCode.UNUSED_ELEMENT, 30, 1)], + [error(WarningCode.unusedElement, 30, 1)], ); var node = findNode.singleInstanceCreationExpression; @@ -2507,7 +2507,7 @@ void f() { } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 17, 10)], + [error(CompileTimeErrorCode.newWithNonType, 17, 10)], ); var node = findNode.singleInstanceCreationExpression; @@ -2540,7 +2540,7 @@ void f() { } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 17, 16)], + [error(CompileTimeErrorCode.newWithNonType, 17, 16)], ); var node = findNode.singleInstanceCreationExpression; @@ -2577,7 +2577,7 @@ void f() { } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 17, 14)], + [error(CompileTimeErrorCode.newWithNonType, 17, 14)], ); var node = findNode.singleInstanceCreationExpression; diff --git a/pkg/analyzer/test/src/dart/resolution/interpolation_string_test.dart b/pkg/analyzer/test/src/dart/resolution/interpolation_string_test.dart index 102157d7253..e06a7171050 100644 --- a/pkg/analyzer/test/src/dart/resolution/interpolation_string_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/interpolation_string_test.dart @@ -76,7 +76,7 @@ var f = "foo${bar} ; '''; await assertErrorsInCode(code, [ - error(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, code.indexOf('}'), 1), + error(ScannerErrorCode.unterminatedStringLiteral, code.indexOf('}'), 1), ]); var string = findNode.stringInterpolation(r'"foo${bar}'); expect(string.elements, hasLength(3)); @@ -96,7 +96,7 @@ var f = "foo${bar}' ; '''; await assertErrorsInCode(code, [ - error(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, code.indexOf("'"), 1), + error(ScannerErrorCode.unterminatedStringLiteral, code.indexOf("'"), 1), ]); var string = findNode.stringInterpolation('"foo\${bar}\''); expect(string.elements, hasLength(3)); diff --git a/pkg/analyzer/test/src/dart/resolution/is_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/is_expression_test.dart index 550ec294e66..d84b07fe37c 100644 --- a/pkg/analyzer/test/src/dart/resolution/is_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/is_expression_test.dart @@ -24,7 +24,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 30, 5)], + [error(ParserErrorCode.missingAssignableSelector, 30, 5)], ); var node = findNode.singleIsExpression; diff --git a/pkg/analyzer/test/src/dart/resolution/library_export_test.dart b/pkg/analyzer/test/src/dart/resolution/library_export_test.dart index 3cfe7e5c790..8f22e0d9a3e 100644 --- a/pkg/analyzer/test/src/dart/resolution/library_export_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/library_export_test.dart @@ -47,7 +47,7 @@ ExportDirective r''' export 'dart:math' hide Unresolved; ''', - [error(WarningCode.UNDEFINED_HIDDEN_NAME, 24, 10)], + [error(WarningCode.undefinedHiddenName, 24, 10)], ); var node = findNode.singleExportDirective; @@ -102,7 +102,7 @@ ExportDirective r''' export 'dart:math' show Unresolved; ''', - [error(WarningCode.UNDEFINED_SHOWN_NAME, 24, 10)], + [error(WarningCode.undefinedShownName, 24, 10)], ); var node = findNode.singleExportDirective; @@ -373,7 +373,7 @@ ExportDirective r''' export 'a.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 8)], ); var node = findNode.export('a.dart'); @@ -431,7 +431,7 @@ export 'a.dart'; r''' export ':net'; ''', - [error(CompileTimeErrorCode.INVALID_URI, 7, 6)], + [error(CompileTimeErrorCode.invalidUri, 7, 6)], ); var node = findNode.export('export'); @@ -452,7 +452,7 @@ ExportDirective r''' export '${'foo'}.dart'; ''', - [error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 7, 15)], + [error(CompileTimeErrorCode.uriWithInterpolation, 7, 15)], ); var node = findNode.export('export'); @@ -483,7 +483,7 @@ ExportDirective r''' export 'foo:bar'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 9)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 9)], ); var node = findNode.export('export'); @@ -508,7 +508,7 @@ part of my.lib; r''' export 'a.dart'; ''', - [error(CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, 7, 8)], + [error(CompileTimeErrorCode.exportOfNonLibrary, 7, 8)], ); var node = findNode.export('a.dart'); @@ -533,7 +533,7 @@ part of 'test.dart'; r''' export 'a.dart'; ''', - [error(CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, 7, 8)], + [error(CompileTimeErrorCode.exportOfNonLibrary, 7, 8)], ); var node = findNode.export('a.dart'); @@ -564,7 +564,7 @@ ExportDirective r''' export 'package:foo/foo2.dart'; ''', - [error(CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, 7, 23)], + [error(CompileTimeErrorCode.exportOfNonLibrary, 7, 23)], ); var node = findNode.export('package:foo'); @@ -619,9 +619,7 @@ export 'c.dart'; '''); await resolveFile2(b); - assertErrorsInResult([ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 25, 8), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.uriDoesNotExist, 25, 8)]); var node = findNode.export('c.dart'); assertResolvedNodeText(node, r''' @@ -647,7 +645,7 @@ export ':net'; '''); await resolveFile2(b); - assertErrorsInResult([error(CompileTimeErrorCode.INVALID_URI, 25, 6)]); + assertErrorsInResult([error(CompileTimeErrorCode.invalidUri, 25, 6)]); var node = findNode.export('export'); assertResolvedNodeText(node, r''' @@ -674,7 +672,7 @@ export '${'foo'}.dart'; await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 25, 15), + error(CompileTimeErrorCode.uriWithInterpolation, 25, 15), ]); var node = findNode.export('export'); @@ -711,9 +709,7 @@ export 'foo:bar'; '''); await resolveFile2(b); - assertErrorsInResult([ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 25, 9), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.uriDoesNotExist, 25, 9)]); var node = findNode.export('export'); assertResolvedNodeText(node, r''' @@ -744,7 +740,7 @@ part of my.lib; await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, 25, 8), + error(CompileTimeErrorCode.exportOfNonLibrary, 25, 8), ]); var node = findNode.export('c.dart'); @@ -776,7 +772,7 @@ part of 'b.dart'; await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, 25, 8), + error(CompileTimeErrorCode.exportOfNonLibrary, 25, 8), ]); var node = findNode.export('c.dart'); diff --git a/pkg/analyzer/test/src/dart/resolution/library_import_prefix_test.dart b/pkg/analyzer/test/src/dart/resolution/library_import_prefix_test.dart index a88b19b7ab6..750b6b1eb0d 100644 --- a/pkg/analyzer/test/src/dart/resolution/library_import_prefix_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/library_import_prefix_test.dart @@ -24,13 +24,7 @@ main() { p; // use } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 38, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 38, 1)], ); var node = findNode.simple('p; // use'); @@ -52,12 +46,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1), - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 52, - 1, - ), + error(WarningCode.unusedLocalVariable, 47, 1), + error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 52, 1), ], ); @@ -99,12 +89,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 66, 1), - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 76, - 1, - ), + error(WarningCode.unusedLocalVariable, 66, 1), + error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 76, 1), ], ); @@ -201,7 +187,7 @@ f() { ''', [ // String extensions are found but `_` is not bound. - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 86, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 86, 1), ], ); } diff --git a/pkg/analyzer/test/src/dart/resolution/library_import_test.dart b/pkg/analyzer/test/src/dart/resolution/library_import_test.dart index cf0f5d64d08..bc18ffb8682 100644 --- a/pkg/analyzer/test/src/dart/resolution/library_import_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/library_import_test.dart @@ -20,7 +20,7 @@ class ImportDirectiveResolutionTest extends PubPackageResolutionTest { r''' import 'dart:math' hide Random; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); var node = findNode.singleImportDirective; @@ -50,8 +50,8 @@ ImportDirective import 'dart:math' hide Unresolved; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), - error(WarningCode.UNDEFINED_HIDDEN_NAME, 24, 10), + error(WarningCode.unusedImport, 7, 11), + error(WarningCode.undefinedHiddenName, 24, 10), ], ); @@ -81,7 +81,7 @@ ImportDirective r''' import 'dart:math' show Random; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); var node = findNode.singleImportDirective; @@ -111,8 +111,8 @@ ImportDirective import 'dart:math' show Unresolved; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), - error(WarningCode.UNDEFINED_SHOWN_NAME, 24, 10), + error(WarningCode.unusedImport, 7, 11), + error(WarningCode.undefinedShownName, 24, 10), ], ); @@ -585,7 +585,7 @@ ImportDirective r''' import 'a.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 8)], ); var node = findNode.import('import'); @@ -630,7 +630,7 @@ ImportDirective r''' import ':net'; ''', - [error(CompileTimeErrorCode.INVALID_URI, 7, 6)], + [error(CompileTimeErrorCode.invalidUri, 7, 6)], ); var node = findNode.import('import'); @@ -651,7 +651,7 @@ ImportDirective r''' import '${'foo'}.dart'; ''', - [error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 7, 15)], + [error(CompileTimeErrorCode.uriWithInterpolation, 7, 15)], ); var node = findNode.import('import'); @@ -682,7 +682,7 @@ ImportDirective r''' import 'foo:bar'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 9)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 9)], ); var node = findNode.import('import'); @@ -707,7 +707,7 @@ part of my.lib; r''' import 'a.dart'; ''', - [error(CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, 7, 8)], + [error(CompileTimeErrorCode.importOfNonLibrary, 7, 8)], ); var node = findNode.import('a.dart'); @@ -732,7 +732,7 @@ part of 'test.dart'; r''' import 'a.dart'; ''', - [error(CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, 7, 8)], + [error(CompileTimeErrorCode.importOfNonLibrary, 7, 8)], ); var node = findNode.import('a.dart'); @@ -763,7 +763,7 @@ ImportDirective r''' import 'package:foo/foo2.dart'; ''', - [error(CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, 7, 23)], + [error(CompileTimeErrorCode.importOfNonLibrary, 7, 23)], ); var node = findNode.import('package:foo'); @@ -821,9 +821,7 @@ import 'c.dart'; '''); await resolveFile2(b); - assertErrorsInResult([ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 25, 8), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.uriDoesNotExist, 25, 8)]); var node = findNode.import('c.dart'); assertResolvedNodeText(node, r''' @@ -849,7 +847,7 @@ import ':net'; '''); await resolveFile2(b); - assertErrorsInResult([error(CompileTimeErrorCode.INVALID_URI, 25, 6)]); + assertErrorsInResult([error(CompileTimeErrorCode.invalidUri, 25, 6)]); var node = findNode.import('import'); assertResolvedNodeText(node, r''' @@ -876,7 +874,7 @@ import '${'foo'}.dart'; await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 25, 15), + error(CompileTimeErrorCode.uriWithInterpolation, 25, 15), ]); var node = findNode.import('import'); @@ -913,9 +911,7 @@ import 'foo:bar'; '''); await resolveFile2(b); - assertErrorsInResult([ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 25, 9), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.uriDoesNotExist, 25, 9)]); var node = findNode.import('import'); assertResolvedNodeText(node, r''' @@ -946,7 +942,7 @@ part of my.lib; await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, 25, 8), + error(CompileTimeErrorCode.importOfNonLibrary, 25, 8), ]); var node = findNode.import('c.dart'); @@ -978,7 +974,7 @@ part of 'b.dart'; await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, 25, 8), + error(CompileTimeErrorCode.importOfNonLibrary, 25, 8), ]); var node = findNode.import('c.dart'); diff --git a/pkg/analyzer/test/src/dart/resolution/list_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/list_literal_test.dart index 2e0d27aea8f..f24a4bd8050 100644 --- a/pkg/analyzer/test/src/dart/resolution/list_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/list_literal_test.dart @@ -46,7 +46,7 @@ void f() { []; } ''', - [error(CompileTimeErrorCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, 13, 13)], + [error(CompileTimeErrorCode.expectedOneListTypeArguments, 13, 13)], ); var node = findNode.singleListLiteral; diff --git a/pkg/analyzer/test/src/dart/resolution/list_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/list_pattern_test.dart index 188f95f239c..e5b3ff4fca6 100644 --- a/pkg/analyzer/test/src/dart/resolution/list_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/list_pattern_test.dart @@ -25,7 +25,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 1)], + [error(WarningCode.unusedLocalVariable, 41, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -58,7 +58,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 1)], + [error(WarningCode.unusedLocalVariable, 41, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -88,7 +88,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1)], + [error(WarningCode.unusedLocalVariable, 46, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -147,7 +147,7 @@ void f(List x) { if (x case [0, ...var rest]) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 4)], + [error(WarningCode.unusedLocalVariable, 46, 4)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -184,7 +184,7 @@ void f(List x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 51, 1)], + [error(WarningCode.unusedLocalVariable, 51, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -214,7 +214,7 @@ void f(List x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 1)], + [error(WarningCode.unusedLocalVariable, 56, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -296,7 +296,7 @@ void f(Object x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 48, 1)], + [error(WarningCode.unusedLocalVariable, 48, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -329,7 +329,7 @@ void f(Object x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 48, 1)], + [error(WarningCode.unusedLocalVariable, 48, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -392,7 +392,7 @@ void f(Object x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 53, 1)], + [error(WarningCode.unusedLocalVariable, 53, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -433,7 +433,7 @@ void f(Object x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 53, 1)], + [error(WarningCode.unusedLocalVariable, 53, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -468,7 +468,7 @@ void f(List x) { var [a] = x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1)], + [error(WarningCode.unusedLocalVariable, 29, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' @@ -504,7 +504,7 @@ void f() { T g() => throw 0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 23, 1)], + [error(WarningCode.unusedLocalVariable, 23, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' @@ -556,7 +556,7 @@ void f() { T g() => throw 0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1)], + [error(WarningCode.unusedLocalVariable, 22, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/local_function_test.dart b/pkg/analyzer/test/src/dart/resolution/local_function_test.dart index 295d6c1a551..5dbee0a8961 100644 --- a/pkg/analyzer/test/src/dart/resolution/local_function_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/local_function_test.dart @@ -53,7 +53,7 @@ f() { g() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 23, 1)], + [error(WarningCode.unusedElement, 23, 1)], ); var node = findNode.functionDeclaration('g() {}'); var fragment = node.declaredFragment!; diff --git a/pkg/analyzer/test/src/dart/resolution/local_variable_test.dart b/pkg/analyzer/test/src/dart/resolution/local_variable_test.dart index d543bf5cf73..82dd775b522 100644 --- a/pkg/analyzer/test/src/dart/resolution/local_variable_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/local_variable_test.dart @@ -60,7 +60,7 @@ void f() { int x = 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); var x = findElement2.localVar('x'); @@ -77,7 +77,7 @@ void f() { const int x = 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 23, 1)], + [error(WarningCode.unusedLocalVariable, 23, 1)], ); var x = findElement2.localVar('x'); @@ -94,7 +94,7 @@ void f() { final int x = 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 23, 1)], + [error(WarningCode.unusedLocalVariable, 23, 1)], ); var x = findElement2.localVar('x'); @@ -112,7 +112,7 @@ void f() { int x = 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1)], + [error(WarningCode.unusedLocalVariable, 32, 1)], ); var x = findElement2.localVar('x'); @@ -129,7 +129,7 @@ void f() { late int x = 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1)], + [error(WarningCode.unusedLocalVariable, 22, 1)], ); var x = findElement2.localVar('x'); @@ -148,8 +148,8 @@ f() { } ''', [ - error(WarningCode.DEAD_CODE, 8, 6), - error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 17, 1), + error(WarningCode.deadCode, 8, 6), + error(CompileTimeErrorCode.undefinedFunction, 17, 1), ], ); } diff --git a/pkg/analyzer/test/src/dart/resolution/logical_and_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/logical_and_pattern_test.dart index 7270549f3b3..98b7796483b 100644 --- a/pkg/analyzer/test/src/dart/resolution/logical_and_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/logical_and_pattern_test.dart @@ -82,8 +82,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 23, 1), + error(WarningCode.unusedLocalVariable, 18, 1), + error(WarningCode.unusedLocalVariable, 23, 1), ], ); var node = findNode.singlePatternVariableDeclarationStatement; diff --git a/pkg/analyzer/test/src/dart/resolution/map_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/map_pattern_test.dart index 261c15ddd2d..183c566b54d 100644 --- a/pkg/analyzer/test/src/dart/resolution/map_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/map_pattern_test.dart @@ -25,7 +25,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1)], + [error(WarningCode.unusedLocalVariable, 47, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -63,7 +63,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 44, 1)], + [error(WarningCode.unusedLocalVariable, 44, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -98,7 +98,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 57, 1)], + [error(WarningCode.unusedLocalVariable, 57, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -142,7 +142,7 @@ void f(Map x) { if (x case {}) {} } ''', - [error(CompileTimeErrorCode.EMPTY_MAP_PATTERN, 42, 2)], + [error(CompileTimeErrorCode.emptyMapPattern, 42, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -161,7 +161,7 @@ void f(Map x) { if (x case {..., 0: ''}) {} } ''', - [error(CompileTimeErrorCode.REST_ELEMENT_IN_MAP_PATTERN, 43, 3)], + [error(CompileTimeErrorCode.restElementInMapPattern, 43, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -192,7 +192,7 @@ void f(Map x) { if (x case {0: '', ...}) {} } ''', - [error(CompileTimeErrorCode.REST_ELEMENT_IN_MAP_PATTERN, 50, 3)], + [error(CompileTimeErrorCode.restElementInMapPattern, 50, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -224,8 +224,8 @@ void f(Map x) { } ''', [ - error(CompileTimeErrorCode.REST_ELEMENT_IN_MAP_PATTERN, 43, 3), - error(CompileTimeErrorCode.REST_ELEMENT_IN_MAP_PATTERN, 55, 3), + error(CompileTimeErrorCode.restElementInMapPattern, 43, 3), + error(CompileTimeErrorCode.restElementInMapPattern, 55, 3), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -260,8 +260,8 @@ void f(Map x) { } ''', [ - error(CompileTimeErrorCode.REST_ELEMENT_IN_MAP_PATTERN, 50, 11), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 57, 4), + error(CompileTimeErrorCode.restElementInMapPattern, 50, 11), + error(WarningCode.unusedLocalVariable, 57, 4), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -300,7 +300,7 @@ void f(Map x) { if (x case {0: var a}) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 50, 1)], + [error(WarningCode.unusedLocalVariable, 50, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -332,7 +332,7 @@ void f(Map x) { if (x case {true: var a}) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1)], + [error(WarningCode.unusedLocalVariable, 62, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -403,7 +403,7 @@ void f(Object x) { if (x case {}) {} } ''', - [error(CompileTimeErrorCode.EMPTY_MAP_PATTERN, 32, 2)], + [error(CompileTimeErrorCode.emptyMapPattern, 32, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -422,7 +422,7 @@ void f(Object x) { if (x case {true: int a}) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 43, 1)], + [error(WarningCode.unusedLocalVariable, 43, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -457,7 +457,7 @@ void f(Object x) { if (x case {true: var a}) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 43, 1)], + [error(WarningCode.unusedLocalVariable, 43, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -528,7 +528,7 @@ void f(Object x) { if (x case {true: var a}) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1)], + [error(WarningCode.unusedLocalVariable, 54, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -572,7 +572,7 @@ void f(x, bool Function() a) { if (x case {a(): 0}) {} } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_PATTERN_KEY, 45, 3)], + [error(CompileTimeErrorCode.nonConstantMapPatternKey, 45, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -610,7 +610,7 @@ void f(Map x) { var {true: a} = x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1)], + [error(WarningCode.unusedLocalVariable, 40, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' @@ -651,7 +651,7 @@ void f() { T g() => throw 0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 1)], + [error(WarningCode.unusedLocalVariable, 35, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' @@ -712,7 +712,7 @@ void f() { T g() => throw 0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 28, 1)], + [error(WarningCode.unusedLocalVariable, 28, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/metadata_test.dart b/pkg/analyzer/test/src/dart/resolution/metadata_test.dart index 6b69c7929e8..2a44551675e 100644 --- a/pkg/analyzer/test/src/dart/resolution/metadata_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/metadata_test.dart @@ -326,7 +326,7 @@ const foo = 42; part 'a.dart'; const foo = 42; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 10, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 10, 8)], ); _assertAtFoo42(); diff --git a/pkg/analyzer/test/src/dart/resolution/method_declaration_test.dart b/pkg/analyzer/test/src/dart/resolution/method_declaration_test.dart index 4ca8c5281bc..a003b305f17 100644 --- a/pkg/analyzer/test/src/dart/resolution/method_declaration_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/method_declaration_test.dart @@ -88,7 +88,7 @@ class C { _() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 12, 1)], + [error(WarningCode.unusedElement, 12, 1)], ); var node = findNode.methodDeclaration('_'); @@ -118,7 +118,7 @@ class C { _() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 56, 1)], + [error(WarningCode.unusedElement, 56, 1)], ); var node = findNode.methodDeclaration('_'); diff --git a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart index b979bbe51a4..f457f53b3c5 100644 --- a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart @@ -31,7 +31,7 @@ class A { void g(Object a) {} ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 29, 5)], + [error(ParserErrorCode.missingAssignableSelector, 29, 5)], ); var node = findNode.singleMethodInvocation; @@ -63,8 +63,8 @@ void f() { void g(int a, int b) {} ''', [ - error(ParserErrorCode.MISSING_IDENTIFIER, 15, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 16, 1), + error(ParserErrorCode.missingIdentifier, 15, 1), + error(ParserErrorCode.missingIdentifier, 16, 1), ], ); @@ -217,7 +217,7 @@ g(double a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 45, 17)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 45, 17)], ); var node = findNode.methodInvocation('h(a'); @@ -495,7 +495,7 @@ g(int a) { } h(double x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 42, 17)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 42, 17)], ); var node = findNode.methodInvocation('h(a'); @@ -1114,7 +1114,7 @@ f(int a, Never b, int c) { a.clamp(b, c); } ''', - [error(WarningCode.DEAD_CODE, 40, 3)], + [error(WarningCode.deadCode, 40, 3)], ); var node = findNode.methodInvocation('clamp'); @@ -1156,8 +1156,8 @@ f(Never a, int b, int c) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 29, 1), - error(WarningCode.DEAD_CODE, 36, 7), + error(WarningCode.receiverOfTypeNever, 29, 1), + error(WarningCode.deadCode, 36, 7), ], ); @@ -1204,7 +1204,7 @@ g(A a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 94, 17)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 94, 17)], ); var node = findNode.methodInvocation('h(a'); @@ -1650,7 +1650,7 @@ main() { foo(0); } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 46, 3)], + [error(CompileTimeErrorCode.ambiguousImport, 46, 3)], ); var node = findNode.methodInvocation('foo(0)'); @@ -1692,7 +1692,7 @@ main() { p.foo(0); } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 58, 3)], + [error(CompileTimeErrorCode.ambiguousImport, 58, 3)], ); var node = findNode.methodInvocation('foo(0)'); @@ -1733,7 +1733,7 @@ void f(A a) { a.foo(0); } ''', - [error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 59, 3)], + [error(CompileTimeErrorCode.instanceAccessToStaticMember, 59, 3)], ); var node = findNode.methodInvocation('a.foo(0)'); @@ -1772,13 +1772,7 @@ void f(C c) { c(); } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 69, - 1, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 69, 1)], ); var node = findNode.functionExpressionInvocation('c();'); @@ -1962,13 +1956,7 @@ main(Object foo) { foo(); } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 21, - 3, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 21, 3)], ); var node = findNode.functionExpressionInvocation('foo();'); @@ -2021,13 +2009,7 @@ main() { C.foo(); } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 46, - 5, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 46, 5)], ); var node = findNode.functionExpressionInvocation('foo();'); @@ -2064,13 +2046,7 @@ class C { } } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 48, - 3, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 48, 3)], ); var node = findNode.functionExpressionInvocation('foo();'); @@ -2102,13 +2078,7 @@ class B extends A { } } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 68, - 9, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 68, 9)], ); var node = findNode.functionExpressionInvocation('foo();'); @@ -2146,13 +2116,7 @@ main() { prefix?.foo(); } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 39, - 6, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 39, 6)], ); var node = findNode.methodInvocation('foo();'); @@ -2184,13 +2148,7 @@ main() { math?.loadLibrary(); } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 49, - 4, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 49, 4)], ); var node = findNode.methodInvocation('loadLibrary()'); @@ -2222,13 +2180,7 @@ main() { foo(); } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 39, - 3, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 39, 3)], ); var node = findNode.methodInvocation('foo()'); @@ -2253,7 +2205,7 @@ main() { foo(0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 11, 3)], + [error(CompileTimeErrorCode.undefinedFunction, 11, 3)], ); var node = findNode.methodInvocation('foo(0)'); @@ -2285,7 +2237,7 @@ main() { math.foo(0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 45, 3)], + [error(CompileTimeErrorCode.undefinedFunction, 45, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -2320,7 +2272,7 @@ main() { bar.foo(0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 11, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 11, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -2356,7 +2308,7 @@ main() { C.foo(0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 24, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 24, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -2394,7 +2346,7 @@ main() { C.foo(x); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 36, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 36, 3)], ); var node = findNode.methodInvocation('foo(x);'); @@ -2436,7 +2388,7 @@ main() { C.foo(0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 76, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 76, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -2473,7 +2425,7 @@ main() { C.foo(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 25, 3)], ); var node = findNode.methodInvocation('foo();'); @@ -2513,7 +2465,7 @@ class C { static main() => C.T(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 34, 1)], + [error(CompileTimeErrorCode.undefinedMethod, 34, 1)], ); var node = findNode.methodInvocation('C.T();'); @@ -2543,7 +2495,7 @@ main() { 42.foo(0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 14, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 14, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -2578,7 +2530,7 @@ main() { v.foo(0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 30, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 30, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -2615,7 +2567,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 25, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -2645,7 +2597,7 @@ main() { null.foo(); } ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 16, 3)], + [error(CompileTimeErrorCode.invalidUseOfNullValue, 16, 3)], ); var node = findNode.methodInvocation('foo();'); @@ -2674,7 +2626,7 @@ main(Object o) { o.call(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 21, 4)], + [error(CompileTimeErrorCode.undefinedMethod, 21, 4)], ); } @@ -2694,7 +2646,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 53, 4)], + [error(CompileTimeErrorCode.undefinedMethod, 53, 4)], ); var node = findNode.methodInvocation('_foo(0);'); @@ -2728,7 +2680,7 @@ main() { C..foo(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 50, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 50, 3)], ); } @@ -2741,8 +2693,8 @@ main() { } ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 23, 2), - error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 8), + error(StaticWarningCode.invalidNullAwareOperator, 23, 2), + error(CompileTimeErrorCode.undefinedMethod, 25, 8), ], ); } @@ -2762,11 +2714,11 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, + CompileTimeErrorCode.unqualifiedReferenceToNonLocalStaticMember, 71, 3, ), - error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 75, 1), + error(CompileTimeErrorCode.extraPositionalArguments, 75, 1), ], ); @@ -2803,7 +2755,7 @@ main() { p.bar(2); } ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 14)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 14)], ); var node = findNode.methodInvocation('foo(1);'); @@ -2844,7 +2796,7 @@ main() { bar(2); } ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 14)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 14)], ); var node = findNode.methodInvocation('foo(1);'); @@ -2879,7 +2831,7 @@ void f(C c) { c.foo(); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 61, 5)], + [error(CompileTimeErrorCode.useOfVoidResult, 61, 5)], ); var node = findNode.functionExpressionInvocation('foo();'); @@ -2915,7 +2867,7 @@ main() { foo(); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 23, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 23, 3)], ); var node = findNode.functionExpressionInvocation('foo();'); @@ -2943,7 +2895,7 @@ main() { foo()(); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 26, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 26, 3)], ); var node = findNode.methodInvocation('foo()()'); @@ -2970,7 +2922,7 @@ main() { foo(); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 22, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 22, 3)], ); var node = findNode.functionExpressionInvocation('foo();'); @@ -2997,7 +2949,7 @@ main() { foo.toString(); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 23, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 23, 3)], ); var node = findNode.methodInvocation('toString()'); @@ -3028,7 +2980,7 @@ main() { foo..toString(); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 23, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 23, 3)], ); var node = findNode.methodInvocation('toString()'); @@ -3055,7 +3007,7 @@ main() { foo?.toString(); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 23, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 23, 3)], ); var node = findNode.methodInvocation('toString()'); @@ -3087,13 +3039,7 @@ main() { foo(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - 29, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, 29, 5)], ); var node = findNode.methodInvocation('foo()'); @@ -3128,13 +3074,7 @@ main() { foo(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - 67, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, 67, 5)], ); var node = findNode.methodInvocation('foo()'); @@ -3455,7 +3395,7 @@ main() { math.loadLibrary(); } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); var node = findNode.methodInvocation('loadLibrary()'); @@ -3488,8 +3428,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), - error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 66, 5), + error(WarningCode.unusedImport, 7, 11), + error(CompileTimeErrorCode.extraPositionalArguments, 66, 5), ], ); @@ -4309,7 +4249,7 @@ void f(Function? foo) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 30, 4, ), @@ -4645,7 +4585,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 67, 3, ), @@ -4753,7 +4693,7 @@ void f(X x) { x.foo(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 109, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 109, 3)], ); var node = findNode.singleMethodInvocation; @@ -5092,7 +5032,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 48, 3, ), @@ -5136,7 +5076,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 86, 3, ), @@ -5242,7 +5182,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 31, 3, ), @@ -5284,7 +5224,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 69, 3, ), @@ -5528,7 +5468,7 @@ void f((int, String)? r) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 86, 3, ), @@ -6003,13 +5943,7 @@ class A { } } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 45, - 3, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 45, 3)], ); var node = findNode.functionExpressionInvocation('foo(0)'); @@ -6136,7 +6070,7 @@ void f() { foo(p: 0, p: a); } ''', - [error(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, 60, 1)], + [error(CompileTimeErrorCode.duplicateNamedArgument, 60, 1)], ); var node = findNode.singleMethodInvocation; @@ -6187,13 +6121,7 @@ void f() { foo(0); } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 29, - 3, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 29, 3)], ); var node = findNode.functionExpressionInvocation('foo(0)'); @@ -6435,7 +6363,7 @@ class A { const a = 0; const b = A.foo(a); ''', - [error(CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, 66, 8)], + [error(CompileTimeErrorCode.constEvalMethodInvocation, 66, 8)], ); var node = findNode.singleMethodInvocation; @@ -6470,7 +6398,7 @@ MethodInvocation const a = 0; const b = 'abc'.codeUnitAt(a); ''', - [error(CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, 23, 19)], + [error(CompileTimeErrorCode.constEvalMethodInvocation, 23, 19)], ); var node = findNode.singleMethodInvocation; @@ -6984,13 +6912,7 @@ main() { math(); } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 40, - 4, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 40, 4)], ); var node = findNode.methodInvocation('math()'); @@ -7682,7 +7604,7 @@ g(int a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 98, 19)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 98, 19)], ); var node = findNode.methodInvocation('f()'); @@ -7848,7 +7770,7 @@ g(A a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 105, 19)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 105, 19)], ); var node = findNode.methodInvocation('f()'); @@ -7882,7 +7804,7 @@ g(A a) { } h(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 105, 16)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 105, 16)], ); var node = findNode.methodInvocation('f()'); @@ -8063,7 +7985,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, 62, 3)], + [error(CompileTimeErrorCode.undefinedSuperMethod, 62, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -8100,7 +8022,7 @@ enum E { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, 37, 3)], + [error(CompileTimeErrorCode.undefinedSuperMethod, 37, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -8138,7 +8060,7 @@ mixin M on A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_METHOD, 52, 3)], + [error(CompileTimeErrorCode.undefinedSuperMethod, 52, 3)], ); var node = findNode.methodInvocation('foo(0);'); @@ -8176,8 +8098,8 @@ class A { } ''', [ - error(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 18, 1), - error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 18, 13), + error(ParserErrorCode.missingAssignmentInInitializer, 18, 1), + error(CompileTimeErrorCode.initializerForNonExistentField, 18, 13), ], ); @@ -8271,7 +8193,7 @@ main() { bool v = foo(0); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 52, 1)], + [error(WarningCode.unusedLocalVariable, 52, 1)], ); var node = findNode.methodInvocation('foo(0)'); @@ -8402,7 +8324,7 @@ main() { foo(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 45, 4)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 45, 4)], ); var node = findNode.methodInvocation('foo();'); @@ -8439,13 +8361,7 @@ main() { foo(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - 32, - 13, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, 32, 13)], ); var node = findNode.methodInvocation('foo();'); diff --git a/pkg/analyzer/test/src/dart/resolution/mixin_test.dart b/pkg/analyzer/test/src/dart/resolution/mixin_test.dart index 7da01bf2387..7e7c0b854c7 100644 --- a/pkg/analyzer/test/src/dart/resolution/mixin_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/mixin_test.dart @@ -162,11 +162,10 @@ mixin M on A { abstract class X extends A with U1, U2, M {} ''', [ - error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 121, 2), - error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 125, 2), + error(CompileTimeErrorCode.mixinOfNonClass, 121, 2), + error(CompileTimeErrorCode.mixinOfNonClass, 125, 2), error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedMember, 129, 1, ), @@ -243,7 +242,7 @@ class C {} mixin M on C {} ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 26, 1)], + [error(WarningCode.unusedLocalVariable, 26, 1)], ); var node = findNode.functionExpressionInvocation('f()'); diff --git a/pkg/analyzer/test/src/dart/resolution/named_type_test.dart b/pkg/analyzer/test/src/dart/resolution/named_type_test.dart index 12d60b1bd37..2dcb15a2c3f 100644 --- a/pkg/analyzer/test/src/dart/resolution/named_type_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/named_type_test.dart @@ -130,7 +130,7 @@ import 'dart:core' as myCore; dynamic a; ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 31, 7)], + [error(CompileTimeErrorCode.undefinedClass, 31, 7)], ); var node = findNode.namedType('dynamic a;'); @@ -187,7 +187,7 @@ class A {} class B extends A {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 34, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 34, 6)], ); var node = findNode.namedType('A'); @@ -214,7 +214,7 @@ class A {} class B extends A {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 31, 14)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 31, 14)], ); var node = findNode.namedType('A'); @@ -244,8 +244,8 @@ NamedType class A extends T {} ''', [ - error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 19, 6), - error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 19, 1), + error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 19, 6), + error(CompileTimeErrorCode.extendsNonClass, 19, 1), ], ); @@ -436,7 +436,7 @@ import 'dart:math' as math; void f(math.Unresolved a) {} ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 36, 15)], + [error(CompileTimeErrorCode.undefinedClass, 36, 15)], ); var node = findNode.namedType('math.Unresolved'); @@ -469,7 +469,7 @@ main() { new math.A(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 49, 1)], + [error(CompileTimeErrorCode.newWithNonType, 49, 1)], ); var node = findNode.namedType('A();'); @@ -510,7 +510,7 @@ main() { new A(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 15, 1)], + [error(CompileTimeErrorCode.newWithNonType, 15, 1)], ); var node = findNode.namedType('A();'); @@ -532,8 +532,8 @@ void f() { } ''', [ - error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 53, 17), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 71, 1), + error(CompileTimeErrorCode.typeAnnotationDeferredClass, 53, 17), + error(WarningCode.unusedLocalVariable, 71, 1), ], ); @@ -567,7 +567,7 @@ void f(prefix a) {} ''', [ error( - CompileTimeErrorCode.NOT_A_TYPE, + CompileTimeErrorCode.notAType, 38, 6, contextMessages: [message(testFile, 22, 6)], @@ -593,7 +593,7 @@ void f(prefix a) {} ''', [ error( - CompileTimeErrorCode.NOT_A_TYPE, + CompileTimeErrorCode.notAType, 38, 6, contextMessages: [message(testFile, 22, 6)], @@ -625,7 +625,7 @@ void f() { new int.double.other(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 17, 10)], + [error(CompileTimeErrorCode.newWithNonType, 17, 10)], ); var node = findNode.namedType('int.double'); @@ -648,7 +648,7 @@ void f() { 0 as int.double; } ''', - [error(CompileTimeErrorCode.NOT_A_TYPE, 18, 10)], + [error(CompileTimeErrorCode.notAType, 18, 10)], ); var node = findNode.namedType('int.double'); @@ -673,7 +673,7 @@ void T() {} ''', [ error( - CompileTimeErrorCode.NOT_A_TYPE, + CompileTimeErrorCode.notAType, 7, 1, contextMessages: [message(testFile, 21, 1)], @@ -699,7 +699,7 @@ void T() {} ''', [ error( - CompileTimeErrorCode.NOT_A_TYPE, + CompileTimeErrorCode.notAType, 7, 1, contextMessages: [message(testFile, 26, 1)], @@ -729,7 +729,7 @@ NamedType r''' void f(T.name a) {} ''', - [error(CompileTimeErrorCode.PREFIX_SHADOWED_BY_LOCAL_DECLARATION, 10, 1)], + [error(CompileTimeErrorCode.prefixShadowedByLocalDeclaration, 10, 1)], ); var node = findNode.namedType('T.name'); @@ -769,7 +769,7 @@ import 'b.dart'; void f(A a) {} ''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 42, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 42, 1)], ); var node = findNode.namedType('A a'); @@ -1085,7 +1085,7 @@ NamedType r''' void f(Unresolved a) {} ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 7, 10)], + [error(CompileTimeErrorCode.undefinedClass, 7, 10)], ); var node = findNode.namedType('Unresolved'); @@ -1110,7 +1110,7 @@ NamedType r''' void f(unresolved.List a) {} ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 7, 15)], + [error(CompileTimeErrorCode.undefinedClass, 7, 15)], ); var node = findNode.namedType('unresolved.List'); diff --git a/pkg/analyzer/test/src/dart/resolution/non_nullable_test.dart b/pkg/analyzer/test/src/dart/resolution/non_nullable_test.dart index 664c9a37b6a..b09dde7c8cb 100644 --- a/pkg/analyzer/test/src/dart/resolution/non_nullable_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/non_nullable_test.dart @@ -92,8 +92,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 16, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1), + error(WarningCode.unusedLocalVariable, 16, 1), + error(WarningCode.unusedLocalVariable, 29, 1), ], ); @@ -112,10 +112,10 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 23, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 44, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 65, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 85, 1), + error(WarningCode.unusedLocalVariable, 23, 1), + error(WarningCode.unusedLocalVariable, 44, 1), + error(WarningCode.unusedLocalVariable, 65, 1), + error(WarningCode.unusedLocalVariable, 85, 1), ], ); @@ -169,8 +169,8 @@ void f(T a) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 21, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), + error(WarningCode.unusedLocalVariable, 21, 1), + error(WarningCode.unusedLocalVariable, 33, 1), ], ); @@ -185,7 +185,7 @@ main() { int? Function(bool, String?)? a; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 1)], + [error(WarningCode.unusedLocalVariable, 41, 1)], ); assertType( @@ -201,7 +201,7 @@ main() { f(int? a, int b) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 11, 1)], + [error(WarningCode.unusedElement, 11, 1)], ); assertType(findNode.namedType('int? a'), 'int?'); @@ -217,8 +217,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 16, 1), - error(WarningCode.UNUSED_ELEMENT, 32, 1), + error(WarningCode.unusedElement, 16, 1), + error(WarningCode.unusedElement, 32, 1), ], ); @@ -417,9 +417,9 @@ f() { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 13, 2), - error(WarningCode.UNUSED_ELEMENT, 37, 2), - error(WarningCode.UNUSED_ELEMENT, 62, 2), + error(WarningCode.unusedElement, 13, 2), + error(WarningCode.unusedElement, 37, 2), + error(WarningCode.unusedElement, 62, 2), ], ); @@ -584,7 +584,7 @@ main() { F? a; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 50, 1)], + [error(WarningCode.unusedLocalVariable, 50, 1)], ); assertType(findNode.namedType('F? a'), 'int? Function(bool, String?)?'); @@ -599,7 +599,7 @@ main() { F? a; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 66, 1)], + [error(WarningCode.unusedLocalVariable, 66, 1)], ); assertType( @@ -630,8 +630,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 52, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 68, 1), + error(WarningCode.unusedLocalVariable, 52, 1), + error(WarningCode.unusedLocalVariable, 68, 1), ], ); diff --git a/pkg/analyzer/test/src/dart/resolution/null_assert_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/null_assert_pattern_test.dart index efc3e5e40b2..28c0914cac5 100644 --- a/pkg/analyzer/test/src/dart/resolution/null_assert_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/null_assert_pattern_test.dart @@ -22,7 +22,7 @@ void f(int? x) { if (x case var y!) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1)], + [error(WarningCode.unusedLocalVariable, 34, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -49,7 +49,7 @@ void f(int? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1)], + [error(WarningCode.unusedLocalVariable, 45, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -73,7 +73,7 @@ void f(int? x) { var (a!) = x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 24, 1)], + [error(WarningCode.unusedLocalVariable, 24, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/null_check_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/null_check_pattern_test.dart index 8f101c2a7c0..355d2a4f3c2 100644 --- a/pkg/analyzer/test/src/dart/resolution/null_check_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/null_check_pattern_test.dart @@ -22,7 +22,7 @@ void f(int? x) { if (x case var y?) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1)], + [error(WarningCode.unusedLocalVariable, 34, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -49,7 +49,7 @@ void f(int? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1)], + [error(WarningCode.unusedLocalVariable, 45, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -74,12 +74,8 @@ void f(int? x) { } ''', [ - error( - CompileTimeErrorCode.REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT, - 24, - 2, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 24, 1), + error(CompileTimeErrorCode.refutablePatternInIrrefutableContext, 24, 2), + error(WarningCode.unusedLocalVariable, 24, 1), ], ); var node = findNode.singlePatternVariableDeclaration; diff --git a/pkg/analyzer/test/src/dart/resolution/object_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/object_pattern_test.dart index 0367ca070ee..1758e484dc2 100644 --- a/pkg/analyzer/test/src/dart/resolution/object_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/object_pattern_test.dart @@ -155,7 +155,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 90, 4)], + [error(WarningCode.unusedLocalVariable, 90, 4)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -283,7 +283,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 83, 1)], + [error(WarningCode.unusedLocalVariable, 83, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -327,7 +327,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 97, 1)], + [error(WarningCode.unusedLocalVariable, 97, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -369,7 +369,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 84, 4)], + [error(WarningCode.unusedLocalVariable, 84, 4)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -411,7 +411,7 @@ void f(x) { } } ''', - [error(CompileTimeErrorCode.MISSING_NAMED_PATTERN_FIELD_NAME, 75, 3)], + [error(CompileTimeErrorCode.missingNamedPatternFieldName, 75, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -450,7 +450,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 81, 3)], + [error(WarningCode.unusedLocalVariable, 81, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -491,7 +491,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 82, 3)], + [error(WarningCode.unusedLocalVariable, 82, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -539,7 +539,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 82, 3)], + [error(WarningCode.unusedLocalVariable, 82, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -583,7 +583,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 82, 3)], + [error(WarningCode.unusedLocalVariable, 82, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -627,7 +627,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 82, 3)], + [error(WarningCode.unusedLocalVariable, 82, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -665,7 +665,7 @@ void f(Object? x) { if (x case Object(0)) {} } ''', - [error(CompileTimeErrorCode.POSITIONAL_FIELD_IN_OBJECT_PATTERN, 40, 1)], + [error(CompileTimeErrorCode.positionalFieldInObjectPattern, 40, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -700,7 +700,7 @@ void f(x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 59, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 59, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -739,8 +739,8 @@ void f(x) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_GETTER, 65, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 65, 3), + error(CompileTimeErrorCode.undefinedGetter, 65, 3), + error(WarningCode.unusedLocalVariable, 65, 3), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -819,7 +819,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 96, 3)], + [error(WarningCode.unusedLocalVariable, 96, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -858,7 +858,7 @@ void f(x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 67, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 67, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -898,7 +898,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 55, 1, ), @@ -941,7 +941,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 77, 1)], + [error(WarningCode.unusedLocalVariable, 77, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -985,7 +985,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 145, 1)], + [error(WarningCode.unusedLocalVariable, 145, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -1040,7 +1040,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 141, 1)], + [error(WarningCode.unusedLocalVariable, 141, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -1081,7 +1081,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 90, 1)], + [error(WarningCode.unusedLocalVariable, 90, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -1123,8 +1123,8 @@ void f(Object? x) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_GETTER, 76, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 85, 1), + error(CompileTimeErrorCode.undefinedGetter, 76, 3), + error(WarningCode.unusedLocalVariable, 85, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -1166,7 +1166,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 73, 1)], + [error(WarningCode.unusedLocalVariable, 73, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -1207,7 +1207,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 71, 1)], + [error(WarningCode.unusedLocalVariable, 71, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -1247,7 +1247,7 @@ class A { T get foo => throw 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1)], + [error(WarningCode.unusedLocalVariable, 32, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' @@ -1296,7 +1296,7 @@ class A { T get foo => throw 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1)], + [error(WarningCode.unusedLocalVariable, 29, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' @@ -1363,7 +1363,7 @@ class A { T get foo => throw 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 28, 1)], + [error(WarningCode.unusedLocalVariable, 28, 1)], ); var node = findNode.singlePatternVariableDeclaration; assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/parenthesized_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/parenthesized_expression_test.dart index 0c2d2621114..a4e07021f51 100644 --- a/pkg/analyzer/test/src/dart/resolution/parenthesized_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/parenthesized_expression_test.dart @@ -24,7 +24,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 28, 5)], + [error(ParserErrorCode.missingAssignableSelector, 28, 5)], ); var node = findNode.singleParenthesizedExpression; diff --git a/pkg/analyzer/test/src/dart/resolution/part_test.dart b/pkg/analyzer/test/src/dart/resolution/part_test.dart index 3de17f8d2ab..e0cc3db6970 100644 --- a/pkg/analyzer/test/src/dart/resolution/part_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/part_test.dart @@ -449,7 +449,7 @@ CompilationUnit r''' part 'a.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 5, 8)], ); var node = findNode.singlePartDirective; @@ -470,7 +470,7 @@ PartDirective ''' part 'part.g.dart'; ''', - [error(CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, 5, 13)], + [error(CompileTimeErrorCode.uriHasNotBeenGenerated, 5, 13)], ); } @@ -479,7 +479,7 @@ part 'part.g.dart'; r''' part ':net'; ''', - [error(CompileTimeErrorCode.INVALID_URI, 5, 6)], + [error(CompileTimeErrorCode.invalidUri, 5, 6)], ); var node = findNode.singlePartDirective; @@ -500,7 +500,7 @@ PartDirective r''' part '${'foo'}.dart'; ''', - [error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 5, 15)], + [error(CompileTimeErrorCode.uriWithInterpolation, 5, 15)], ); var node = findNode.singlePartDirective; @@ -531,7 +531,7 @@ PartDirective r''' part 'foo:bar'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 9)], + [error(CompileTimeErrorCode.uriDoesNotExist, 5, 9)], ); var node = findNode.singlePartDirective; @@ -626,7 +626,7 @@ part of bar; await resolveFile2(a); assertErrorsInResult([ - error(CompileTimeErrorCode.PART_OF_DIFFERENT_LIBRARY, 33, 8), + error(CompileTimeErrorCode.partOfDifferentLibrary, 33, 8), ]); var node = findNode.singlePartDirective; @@ -673,7 +673,7 @@ part of 'x.dart'; r''' part 'a.dart'; ''', - [error(CompileTimeErrorCode.PART_OF_DIFFERENT_LIBRARY, 5, 8)], + [error(CompileTimeErrorCode.partOfDifferentLibrary, 5, 8)], ); var node = findNode.singlePartDirective; @@ -726,7 +726,7 @@ PartDirective r''' part 'a.dart'; ''', - [error(CompileTimeErrorCode.PART_OF_NON_PART, 5, 8)], + [error(CompileTimeErrorCode.partOfNonPart, 5, 8)], ); var node = findNode.singlePartDirective; @@ -753,9 +753,7 @@ part 'c.dart'; '''); await resolveFile2(b); - assertErrorsInResult([ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 23, 8), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.uriDoesNotExist, 23, 8)]); var node = findNode.singlePartDirective; assertResolvedNodeText(node, r''' @@ -781,7 +779,7 @@ part ':net'; '''); await resolveFile2(b); - assertErrorsInResult([error(CompileTimeErrorCode.INVALID_URI, 23, 6)]); + assertErrorsInResult([error(CompileTimeErrorCode.invalidUri, 23, 6)]); var node = findNode.singlePartDirective; assertResolvedNodeText(node, r''' @@ -808,7 +806,7 @@ part '${'foo'}.dart'; await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 23, 15), + error(CompileTimeErrorCode.uriWithInterpolation, 23, 15), ]); var node = findNode.singlePartDirective; @@ -845,9 +843,7 @@ part 'foo:bar'; '''); await resolveFile2(b); - assertErrorsInResult([ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 23, 9), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.uriDoesNotExist, 23, 9)]); var node = findNode.singlePartDirective; assertResolvedNodeText(node, r''' @@ -877,7 +873,7 @@ part of my.lib; '''); await resolveFile2(c); - assertErrorsInResult([error(ParserErrorCode.PART_OF_NAME, 8, 6)]); + assertErrorsInResult([error(ParserErrorCode.partOfName, 8, 6)]); // We already reported an error above. await resolveFile2(b); @@ -942,7 +938,7 @@ part of 'a.dart'; await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.PART_OF_DIFFERENT_LIBRARY, 23, 8), + error(CompileTimeErrorCode.partOfDifferentLibrary, 23, 8), ]); var node = findNode.singlePartDirective; @@ -971,7 +967,7 @@ part 'c.dart'; newFile('$testPackageLibPath/c.dart', ''); await resolveFile2(b); - assertErrorsInResult([error(CompileTimeErrorCode.PART_OF_NON_PART, 23, 8)]); + assertErrorsInResult([error(CompileTimeErrorCode.partOfNonPart, 23, 8)]); var node = findNode.singlePartDirective; assertResolvedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/dart/resolution/pattern_assignment_test.dart b/pkg/analyzer/test/src/dart/resolution/pattern_assignment_test.dart index 6a2969e2ddc..3feeb531b73 100644 --- a/pkg/analyzer/test/src/dart/resolution/pattern_assignment_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/pattern_assignment_test.dart @@ -26,7 +26,7 @@ void f() { a; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 38, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 38, 1)], ); } @@ -52,7 +52,7 @@ void f(bool flag) { a; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 67, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 67, 1)], ); } @@ -66,7 +66,7 @@ void f() { a; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 43, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 43, 1)], ); } @@ -353,9 +353,9 @@ void f(a, y) { [ // The reference doesn't resolve so the errors include // UNUSED_LOCAL_VARIABLE and UNDEFINED_IDENTIFIER. - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 25, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 25, 1), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 35, 1), + error(ParserErrorCode.patternAssignmentDeclaresVariable, 25, 1), + error(WarningCode.unusedLocalVariable, 25, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 35, 1), ], ); } @@ -371,8 +371,8 @@ void f(a, y) { } ''', [ - error(ParserErrorCode.PATTERN_ASSIGNMENT_DECLARES_VARIABLE, 25, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 25, 1), + error(ParserErrorCode.patternAssignmentDeclaresVariable, 25, 1), + error(WarningCode.unusedLocalVariable, 25, 1), ], ); } @@ -387,7 +387,7 @@ void f() { a = 1; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 44, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 44, 1)], ); } diff --git a/pkg/analyzer/test/src/dart/resolution/pattern_variable_declaration_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/pattern_variable_declaration_statement_test.dart index 2908dbc7a14..b5c69532cc1 100644 --- a/pkg/analyzer/test/src/dart/resolution/pattern_variable_declaration_statement_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/pattern_variable_declaration_statement_test.dart @@ -92,7 +92,7 @@ void f() { class A {} ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1)], + [error(WarningCode.unusedLocalVariable, 18, 1)], ); var node = findNode.singlePatternVariableDeclarationStatement; assertResolvedNodeText(node, r''' @@ -170,7 +170,7 @@ void f() { T g() => throw 0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1)], + [error(WarningCode.unusedLocalVariable, 22, 1)], ); var node = findNode.singlePatternVariableDeclarationStatement; assertResolvedNodeText(node, r''' @@ -248,8 +248,8 @@ void f((int, String) x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1), + error(WarningCode.unusedLocalVariable, 33, 1), + error(WarningCode.unusedLocalVariable, 36, 1), ], ); var node = findNode.singlePatternVariableDeclarationStatement; @@ -297,7 +297,7 @@ void f() { T g(T a) => throw 0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1)], + [error(WarningCode.unusedLocalVariable, 18, 1)], ); var node = findNode.singlePatternVariableDeclarationStatement; assertResolvedNodeText(node, r''' @@ -354,7 +354,7 @@ void f() { ''', [ error( - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT, + ParserErrorCode.variablePatternKeywordInDeclarationContext, 18, 5, ), @@ -372,7 +372,7 @@ void f() { ''', [ error( - ParserErrorCode.VARIABLE_PATTERN_KEYWORD_IN_DECLARATION_CONTEXT, + ParserErrorCode.variablePatternKeywordInDeclarationContext, 18, 3, ), diff --git a/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart index 1ac04a63e9f..7e5e21c5658 100644 --- a/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart @@ -71,7 +71,7 @@ void f(int x) { x ++ ++; } ''', - [error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 23, 2)], + [error(ParserErrorCode.illegalAssignmentToNonAssignable, 23, 2)], ); var node = findNode.postfix('++;'); @@ -108,7 +108,7 @@ void f(A a) { a++; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 29, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 29, 2)], ); var node = findNode.postfix('++;'); @@ -159,7 +159,7 @@ void f(int x) { ++x++; } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 21, 2)], + [error(ParserErrorCode.missingAssignableSelector, 21, 2)], ); var node = findNode.prefix('++x'); @@ -308,7 +308,7 @@ void f() { (0)++; } ''', - [error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 16, 2)], + [error(ParserErrorCode.illegalAssignmentToNonAssignable, 16, 2)], ); var node = findNode.postfix('(0)++'); @@ -338,7 +338,7 @@ void f() { int++; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 13, 3)], + [error(CompileTimeErrorCode.assignmentToType, 13, 3)], ); var node = findNode.postfix('int++'); @@ -365,7 +365,7 @@ void f() { T++; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 16, 1)], + [error(CompileTimeErrorCode.assignmentToType, 16, 1)], ); var node = findNode.postfix('T++'); @@ -848,7 +848,7 @@ class A { } } ''', - [error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 32, 2)], + [error(ParserErrorCode.illegalAssignmentToNonAssignable, 32, 2)], ); var node = findNode.singlePostfixExpression; @@ -876,7 +876,7 @@ void f(Object? x) { }++); } ''', - [error(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, 51, 2)], + [error(ParserErrorCode.illegalAssignmentToNonAssignable, 51, 2)], ); var node = findNode.postfix('++'); @@ -920,7 +920,7 @@ void f() { x++; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 13, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 13, 1)], ); var node = findNode.singlePostfixExpression; @@ -1043,7 +1043,7 @@ void f(Null x) { x!; } ''', - [error(WarningCode.NULL_CHECK_ALWAYS_FAILS, 19, 2)], + [error(WarningCode.nullCheckAlwaysFails, 19, 2)], ); assertType(findNode.postfix('x!'), 'Never'); @@ -1124,8 +1124,8 @@ void test9(Foo? foo, int? a) => foo?[a]!.baz; void test10(Foo? foo, int? a, int b) => foo?[a]![b]; ''', [ - error(StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION, 107, 1), - error(StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION, 173, 1), + error(StaticWarningCode.unnecessaryNonNullAssertion, 107, 1), + error(StaticWarningCode.unnecessaryNonNullAssertion, 173, 1), ], ); @@ -1185,7 +1185,7 @@ class B extends A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 70, 6)], + [error(ParserErrorCode.missingAssignableSelector, 70, 6)], ); var node = findNode.methodInvocation('foo();'); diff --git a/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart index 561c5e66d6c..d1491e31f39 100644 --- a/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart @@ -71,7 +71,7 @@ void f(int x) { !x; } ''', - [error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 19, 1)], + [error(CompileTimeErrorCode.nonBoolNegationExpression, 19, 1)], ); var node = findNode.prefix('!x'); @@ -100,7 +100,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, 55, 6, ), @@ -136,8 +136,8 @@ class A { } ''', [ - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 28, 5), - error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 28, 5), + error(ParserErrorCode.missingAssignableSelector, 28, 5), + error(CompileTimeErrorCode.nonBoolNegationExpression, 28, 5), ], ); @@ -160,7 +160,7 @@ void f(int x) { ++ ++ x; } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 24, 1)], + [error(ParserErrorCode.missingAssignableSelector, 24, 1)], ); var node = findNode.prefix('++ ++ x'); @@ -197,7 +197,7 @@ void f(A a) { ++a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 28, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 28, 2)], ); var node = findNode.prefix('++a'); @@ -338,7 +338,7 @@ void f() { ++x; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 15, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 15, 1)], ); var node = findNode.prefix('++x'); @@ -446,7 +446,7 @@ augment class A { } } ''', - [error(CompileTimeErrorCode.AUGMENTED_EXPRESSION_NOT_OPERATOR, 65, 9)], + [error(CompileTimeErrorCode.augmentedExpressionNotOperator, 65, 9)], ); var node = findNode.singlePrefixExpression; @@ -484,7 +484,7 @@ augment class A { } } ''', - [error(CompileTimeErrorCode.AUGMENTED_EXPRESSION_IS_SETTER, 69, 9)], + [error(CompileTimeErrorCode.augmentedExpressionIsSetter, 69, 9)], ); var node = findNode.singlePrefixExpression; @@ -570,7 +570,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 50, 1, ), @@ -660,7 +660,7 @@ void f(C c) { ++Ext(c); } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 103, 1)], + [error(ParserErrorCode.missingAssignableSelector, 103, 1)], ); var node = findNode.prefix('++Ext'); @@ -697,7 +697,7 @@ void f() { ++int; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 15, 3)], + [error(CompileTimeErrorCode.assignmentToType, 15, 3)], ); var node = findNode.prefix('++int'); @@ -1057,7 +1057,7 @@ void f(T x) { ++x; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 31, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 31, 3)], ); var node = findNode.prefix('++x'); @@ -1203,7 +1203,7 @@ class A { } } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 29, 5)], + [error(ParserErrorCode.missingAssignableSelector, 29, 5)], ); var node = findNode.singlePrefixExpression; @@ -1231,7 +1231,7 @@ void f(Object? x) { }; } ''', - [error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 51, 1)], + [error(ParserErrorCode.missingAssignableSelector, 51, 1)], ); var node = findNode.prefix('++switch'); @@ -1316,7 +1316,7 @@ augment class A { } } ''', - [error(CompileTimeErrorCode.AUGMENTED_EXPRESSION_NOT_OPERATOR, 77, 9)], + [error(CompileTimeErrorCode.augmentedExpressionNotOperator, 77, 9)], ); var node = findNode.singlePrefixExpression; @@ -1347,7 +1347,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 50, 1, ), diff --git a/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart b/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart index f2515adc822..f4eba9352bd 100644 --- a/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart @@ -424,7 +424,7 @@ int Function() foo() { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 50, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 50, 1)], ); var node = findNode.simple('a;'); @@ -569,7 +569,7 @@ void f() { prefix.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 48, 3)], + [error(CompileTimeErrorCode.undefinedPrefixedName, 48, 3)], ); var node = findNode.prefixed('prefix.'); @@ -887,7 +887,7 @@ void f(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 69, 3, ), @@ -1150,7 +1150,7 @@ void f(int a) { a.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 20, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 20, 3)], ); var node = findNode.prefixed('foo;'); diff --git a/pkg/analyzer/test/src/dart/resolution/property_access_test.dart b/pkg/analyzer/test/src/dart/resolution/property_access_test.dart index 7d0002977d4..06de971dba7 100644 --- a/pkg/analyzer/test/src/dart/resolution/property_access_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/property_access_test.dart @@ -201,7 +201,7 @@ int Function() foo() { return B().a; // ref } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 85, 5)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 85, 5)], ); var identifier = findNode.simple('a; // ref'); @@ -335,7 +335,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, 54, 3)], + [error(CompileTimeErrorCode.undefinedSuperGetter, 54, 3)], ); var node = findNode.propertyAccess('foo;'); @@ -428,7 +428,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, 97, 3)], + [error(CompileTimeErrorCode.undefinedSuperGetter, 97, 3)], ); var node = findNode.propertyAccess('foo;'); @@ -1749,7 +1749,7 @@ void f(A a) { (a).foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 49, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 49, 3)], ); var node = findNode.singlePropertyAccess; @@ -2154,7 +2154,7 @@ void f((int, String) r) { r.$3; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 30, 2)], + [error(CompileTimeErrorCode.undefinedGetter, 30, 2)], ); var node = findNode.propertyAccess(r'$3;'); @@ -2180,7 +2180,7 @@ void f((int, String) r) { r.$0a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 30, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 30, 3)], ); var node = findNode.propertyAccess(r'$0a;'); @@ -2206,7 +2206,7 @@ void f((int, String) r) { r.$zero; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 30, 5)], + [error(CompileTimeErrorCode.undefinedGetter, 30, 5)], ); var node = findNode.propertyAccess(r'$zero;'); @@ -2261,7 +2261,7 @@ void f((int, String) r) { r.a$0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 30, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 30, 3)], ); var node = findNode.propertyAccess(r'a$0;'); @@ -2310,7 +2310,7 @@ void f(({int foo}) r) { r.bar; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 28, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 28, 3)], ); var node = findNode.propertyAccess('bar;'); @@ -2338,7 +2338,7 @@ void f((int foo, String) r) { r.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 34, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 34, 3)], ); var node = findNode.propertyAccess('foo;'); @@ -2584,7 +2584,7 @@ class C { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 37, 3, ), @@ -2638,7 +2638,7 @@ void f() { (a).foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 14, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 14, 1)], ); var node = findNode.singlePropertyAccess; diff --git a/pkg/analyzer/test/src/dart/resolution/record_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/record_literal_test.dart index fe35005b955..b234623d291 100644 --- a/pkg/analyzer/test/src/dart/resolution/record_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/record_literal_test.dart @@ -925,12 +925,8 @@ VariableDeclaration final x = const (0); ''', [ - error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 32, 1), - error( - ParserErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, - 34, - 1, - ), + error(ParserErrorCode.experimentNotEnabled, 32, 1), + error(ParserErrorCode.recordLiteralOnePositionalNoTrailingComma, 34, 1), ], ); @@ -956,7 +952,7 @@ VariableDeclaration // @dart = 2.19 final x = (0,); ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 26, 1)], + [error(ParserErrorCode.experimentNotEnabled, 26, 1)], ); var node = findNode.singleVariableDeclaration; @@ -981,7 +977,7 @@ VariableDeclaration // @dart = 2.19 final x = (0, 1); ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 26, 1)], + [error(ParserErrorCode.experimentNotEnabled, 26, 1)], ); var node = findNode.singleVariableDeclaration; @@ -1006,7 +1002,7 @@ VariableDeclaration // @dart = 2.19 final x = (); ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 26, 1)], + [error(ParserErrorCode.experimentNotEnabled, 26, 1)], ); var node = findNode.singleVariableDeclaration; @@ -1147,7 +1143,7 @@ void f() {} g() => (f(),); ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 21, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 21, 3)], ); var node = findNode.recordLiteral('(f(),'); diff --git a/pkg/analyzer/test/src/dart/resolution/record_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/record_pattern_test.dart index bd4adcc387c..094ebb470f9 100644 --- a/pkg/analyzer/test/src/dart/resolution/record_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/record_pattern_test.dart @@ -43,7 +43,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1)], + [error(WarningCode.unusedLocalVariable, 46, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -77,7 +77,7 @@ void f(x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 1)], + [error(WarningCode.unusedLocalVariable, 41, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -155,7 +155,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1)], + [error(WarningCode.unusedLocalVariable, 54, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -192,7 +192,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1)], + [error(WarningCode.unusedLocalVariable, 54, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -252,7 +252,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 49, 1)], + [error(WarningCode.unusedLocalVariable, 49, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -286,7 +286,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 49, 1)], + [error(WarningCode.unusedLocalVariable, 49, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -319,8 +319,8 @@ void f(() x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 39, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1), + error(WarningCode.patternNeverMatchesValueType, 39, 10), + error(WarningCode.unusedLocalVariable, 47, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -357,8 +357,8 @@ void f(() x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 39, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1), + error(WarningCode.patternNeverMatchesValueType, 39, 9), + error(WarningCode.unusedLocalVariable, 46, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -393,8 +393,8 @@ void f(({int b}) x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 46, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 53, 1), + error(WarningCode.patternNeverMatchesValueType, 46, 9), + error(WarningCode.unusedLocalVariable, 53, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -429,8 +429,8 @@ void f(({int a, int b}) x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 53, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 60, 1), + error(WarningCode.patternNeverMatchesValueType, 53, 9), + error(WarningCode.unusedLocalVariable, 60, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -466,8 +466,8 @@ void f(() x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 39, 8), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 44, 1), + error(WarningCode.patternNeverMatchesValueType, 39, 8), + error(WarningCode.unusedLocalVariable, 44, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -500,8 +500,8 @@ void f((int, String) x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 50, 8), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 55, 1), + error(WarningCode.patternNeverMatchesValueType, 50, 8), + error(WarningCode.unusedLocalVariable, 55, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -535,8 +535,8 @@ void f(() x) { } ''', [ - error(WarningCode.DEAD_CODE, 60, 7), - error(WarningCode.UNREACHABLE_SWITCH_DEFAULT, 60, 7), + error(WarningCode.deadCode, 60, 7), + error(WarningCode.unreachableSwitchDefault, 60, 7), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -559,9 +559,9 @@ void f((int, double, {String foo}) x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 69, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 81, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 88, 1), + error(WarningCode.unusedLocalVariable, 69, 1), + error(WarningCode.unusedLocalVariable, 81, 1), + error(WarningCode.unusedLocalVariable, 88, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -615,8 +615,8 @@ void f(({int foo}) x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 48, 12), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 58, 1), + error(WarningCode.patternNeverMatchesValueType, 48, 12), + error(WarningCode.unusedLocalVariable, 58, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -651,7 +651,7 @@ void f(({int foo}) x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 58, 1)], + [error(WarningCode.unusedLocalVariable, 58, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -686,8 +686,8 @@ void f(({int foo}) x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 48, 5), - error(CompileTimeErrorCode.MISSING_NAMED_PATTERN_FIELD_NAME, 49, 3), + error(WarningCode.patternNeverMatchesValueType, 48, 5), + error(CompileTimeErrorCode.missingNamedPatternFieldName, 49, 3), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -719,7 +719,7 @@ void f(({int foo}) x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 55, 3)], + [error(WarningCode.unusedLocalVariable, 55, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -752,7 +752,7 @@ void f(({int? foo}) x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 3)], + [error(WarningCode.unusedLocalVariable, 56, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -792,7 +792,7 @@ void f(({int? foo}) x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 3)], + [error(WarningCode.unusedLocalVariable, 56, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -828,7 +828,7 @@ void f(({int? foo}) x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 3)], + [error(WarningCode.unusedLocalVariable, 56, 3)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -864,7 +864,7 @@ void f((int,) x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 48, 1)], + [error(WarningCode.unusedLocalVariable, 48, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -893,8 +893,8 @@ void f((int, String) x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1), + error(WarningCode.unusedLocalVariable, 33, 1), + error(WarningCode.unusedLocalVariable, 36, 1), ], ); var node = findNode.singlePatternVariableDeclaration; @@ -941,8 +941,8 @@ void f() { (T, U) g() => throw 0; ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1), + error(WarningCode.unusedLocalVariable, 22, 1), + error(WarningCode.unusedLocalVariable, 32, 1), ], ); var node = findNode.singlePatternVariableDeclaration; diff --git a/pkg/analyzer/test/src/dart/resolution/record_type_annotation_test.dart b/pkg/analyzer/test/src/dart/resolution/record_type_annotation_test.dart index 0b02b679048..4cdfd94c806 100644 --- a/pkg/analyzer/test/src/dart/resolution/record_type_annotation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/record_type_annotation_test.dart @@ -75,7 +75,7 @@ RecordTypeAnnotation // @dart = 2.19 void f(({int f1, String f2}) x) {} ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 23, 1)], + [error(ParserErrorCode.experimentNotEnabled, 23, 1)], ); var node = findNode.singleFormalParameterList; @@ -101,7 +101,7 @@ FormalParameterList // @dart = 2.19 void f((int, String) x) {} ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 23, 1)], + [error(ParserErrorCode.experimentNotEnabled, 23, 1)], ); var node = findNode.singleFormalParameterList; diff --git a/pkg/analyzer/test/src/dart/resolution/redirecting_constructor_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/redirecting_constructor_invocation_test.dart index b69efbe1d6f..b3050fabdc5 100644 --- a/pkg/analyzer/test/src/dart/resolution/redirecting_constructor_invocation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/redirecting_constructor_invocation_test.dart @@ -54,7 +54,7 @@ class C { ''', [ error( - CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, + CompileTimeErrorCode.redirectGenerativeToMissingConstructor, 24, 13, ), @@ -116,7 +116,7 @@ class C { ''', [ error( - CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, + CompileTimeErrorCode.redirectGenerativeToMissingConstructor, 37, 7, ), diff --git a/pkg/analyzer/test/src/dart/resolution/relational_pattern_test.dart b/pkg/analyzer/test/src/dart/resolution/relational_pattern_test.dart index dd008b08c41..1ffe71c4ec8 100644 --- a/pkg/analyzer/test/src/dart/resolution/relational_pattern_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/relational_pattern_test.dart @@ -127,7 +127,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 50, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 50, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -205,7 +205,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 50, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 50, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -305,7 +305,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 50, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 50, 1)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -383,7 +383,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 50, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 50, 2)], ); var node = findNode.singleGuardedPattern.pattern; assertResolvedNodeText(node, r''' @@ -457,7 +457,7 @@ void f(x, int Function() a) { ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, 57, 3, ), diff --git a/pkg/analyzer/test/src/dart/resolution/scope_test.dart b/pkg/analyzer/test/src/dart/resolution/scope_test.dart index 6cdd5eef78d..e8c10134d82 100644 --- a/pkg/analyzer/test/src/dart/resolution/scope_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/scope_test.dart @@ -22,7 +22,7 @@ class PrefixedNamespaceTest extends PubPackageResolutionTest { r''' import 'dart:math' as prefix; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); var namespace = findElement2.import('dart:math').namespace; return namespace as PrefixedNamespace; diff --git a/pkg/analyzer/test/src/dart/resolution/set_or_map_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/set_or_map_literal_test.dart index d8cf78cc58d..17ab93696b4 100644 --- a/pkg/analyzer/test/src/dart/resolution/set_or_map_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/set_or_map_literal_test.dart @@ -76,7 +76,7 @@ void f() { var v = {0}; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); var node = findNode.singleSetOrMapLiteral; @@ -100,7 +100,7 @@ void f() { var v = {0: ''}; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); var node = findNode.singleSetOrMapLiteral; @@ -128,7 +128,7 @@ void f() { var v = {}; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); var node = findNode.singleSetOrMapLiteral; diff --git a/pkg/analyzer/test/src/dart/resolution/simple_identifier_test.dart b/pkg/analyzer/test/src/dart/resolution/simple_identifier_test.dart index b2ae7ea617a..c486350132b 100644 --- a/pkg/analyzer/test/src/dart/resolution/simple_identifier_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/simple_identifier_test.dart @@ -197,7 +197,7 @@ main() { dynamic; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 42, 7)], + [error(CompileTimeErrorCode.undefinedIdentifier, 42, 7)], ); var node = findNode.simple('dynamic;'); @@ -273,7 +273,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, 43, 1)], + [error(CompileTimeErrorCode.returnInGenerativeConstructor, 43, 1)], ); var node = findNode.simple('a;'); @@ -295,12 +295,8 @@ class C { } ''', [ - error(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, 30, 5), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, - 33, - 1, - ), + error(CompileTimeErrorCode.returnInGenerativeConstructor, 30, 5), + error(CompileTimeErrorCode.returnOfInvalidTypeFromConstructor, 33, 1), ], ); @@ -365,7 +361,7 @@ int Function() foo(A? a) { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 68, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 68, 1)], ); var identifier = findNode.simple('a;'); @@ -552,7 +548,7 @@ extension E on ({int foo}) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 46, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 46, 3)], ); var node = findNode.simple('bar;'); @@ -629,7 +625,7 @@ extension E on (int, String) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 48, 2)], + [error(CompileTimeErrorCode.undefinedIdentifier, 48, 2)], ); var node = findNode.simple(r'$3;'); diff --git a/pkg/analyzer/test/src/dart/resolution/super_constructor_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/super_constructor_invocation_test.dart index f4fa88eca0d..5899d6d60eb 100644 --- a/pkg/analyzer/test/src/dart/resolution/super_constructor_invocation_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/super_constructor_invocation_test.dart @@ -59,13 +59,7 @@ class B extends A { B() : super.named(0); } ''', - [ - error( - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, - 53, - 14, - ), - ], + [error(CompileTimeErrorCode.undefinedConstructorInInitializer, 53, 14)], ); var node = findNode.singleSuperConstructorInvocation; @@ -101,13 +95,7 @@ class B extends A { const B() : super(5); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, - 71, - 8, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithNonConstSuper, 71, 8)], ); var node = findNode.singleSuperConstructorInvocation; @@ -166,7 +154,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, + CompileTimeErrorCode.undefinedConstructorInInitializerDefault, 59, 8, ), diff --git a/pkg/analyzer/test/src/dart/resolution/super_formal_parameter_test.dart b/pkg/analyzer/test/src/dart/resolution/super_formal_parameter_test.dart index 11ff196c1eb..24e0f57ec28 100644 --- a/pkg/analyzer/test/src/dart/resolution/super_formal_parameter_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/super_formal_parameter_test.dart @@ -102,13 +102,7 @@ SuperFormalParameter r''' void f(super.a) {} ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 7, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 7, 5)], ); var node = findNode.superFormalParameter('super.'); diff --git a/pkg/analyzer/test/src/dart/resolution/switch_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/switch_expression_test.dart index 97c12f851f6..6ec1365b170 100644 --- a/pkg/analyzer/test/src/dart/resolution/switch_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/switch_expression_test.dart @@ -78,7 +78,7 @@ SwitchExpression r''' final a = switch (0) {}; ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 10, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchExpression, 10, 6)], ); var node = findNode.singleSwitchExpression; @@ -153,7 +153,7 @@ void f(void x) { }); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 27, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 27, 1)], ); var node = findNode.singleSwitchExpression; @@ -532,7 +532,7 @@ void f(Object? x) { }); } ''', - [error(WarningCode.DEAD_CODE, 52, 8)], + [error(WarningCode.deadCode, 52, 8)], ); var node = findNode.switchExpression('switch'); @@ -612,12 +612,12 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, 64, 1, ), error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 64, 1, contextMessages: [message(testFile, 58, 1)], @@ -707,7 +707,7 @@ void f(Object? x) { }); } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 72, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 72, 1)], ); var node = findNode.switchExpression('switch'); diff --git a/pkg/analyzer/test/src/dart/resolution/switch_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/switch_statement_test.dart index 58016dc30d2..d7def9113f5 100644 --- a/pkg/analyzer/test/src/dart/resolution/switch_statement_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/switch_statement_test.dart @@ -604,7 +604,7 @@ void f(Object? x) { [ error( CompileTimeErrorCode - .PATTERN_VARIABLE_SHARED_CASE_SCOPE_DIFFERENT_FINALITY_OR_TYPE, + .patternVariableSharedCaseScopeDifferentFinalityOrType, 101, 1, ), @@ -707,7 +707,7 @@ void f(Object? x) { [ error( CompileTimeErrorCode - .PATTERN_VARIABLE_SHARED_CASE_SCOPE_DIFFERENT_FINALITY_OR_TYPE, + .patternVariableSharedCaseScopeDifferentFinalityOrType, 101, 1, ), @@ -810,7 +810,7 @@ void f(Object? x) { [ error( CompileTimeErrorCode - .PATTERN_VARIABLE_SHARED_CASE_SCOPE_DIFFERENT_FINALITY_OR_TYPE, + .patternVariableSharedCaseScopeDifferentFinalityOrType, 95, 1, ), @@ -911,7 +911,7 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES, + CompileTimeErrorCode.patternVariableSharedCaseScopeNotAllCases, 80, 1, ), @@ -992,7 +992,7 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES, + CompileTimeErrorCode.patternVariableSharedCaseScopeNotAllCases, 80, 1, ), @@ -1073,7 +1073,7 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_HAS_LABEL, + CompileTimeErrorCode.patternVariableSharedCaseScopeHasLabel, 81, 1, ), @@ -1148,11 +1148,11 @@ void f(Object? x) { } ''', [ - error(WarningCode.DEAD_CODE, 55, 4), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 55, 4), - error(WarningCode.DEAD_CODE, 71, 7), + error(WarningCode.deadCode, 55, 4), + error(WarningCode.unreachableSwitchCase, 55, 4), + error(WarningCode.deadCode, 71, 7), error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_HAS_LABEL, + CompileTimeErrorCode.patternVariableSharedCaseScopeHasLabel, 86, 1, ), @@ -1219,9 +1219,9 @@ void f(Object? x) { } ''', [ - error(WarningCode.UNUSED_LABEL, 39, 8), + error(WarningCode.unusedLabel, 39, 8), error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_HAS_LABEL, + CompileTimeErrorCode.patternVariableSharedCaseScopeHasLabel, 81, 1, ), @@ -1303,17 +1303,17 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES, + CompileTimeErrorCode.patternVariableSharedCaseScopeNotAllCases, 95, 1, ), error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES, + CompileTimeErrorCode.patternVariableSharedCaseScopeNotAllCases, 104, 1, ), error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES, + CompileTimeErrorCode.patternVariableSharedCaseScopeNotAllCases, 113, 1, ), @@ -1407,7 +1407,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.DEAD_CODE, 56, 8)], + [error(WarningCode.deadCode, 56, 8)], ); var node = findNode.switchStatement('switch'); @@ -1481,12 +1481,12 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, 68, 1, ), error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 68, 1, contextMessages: [message(testFile, 62, 1)], diff --git a/pkg/analyzer/test/src/dart/resolution/top_level_variable_test.dart b/pkg/analyzer/test/src/dart/resolution/top_level_variable_test.dart index b77736b80ce..9a293f8a79c 100644 --- a/pkg/analyzer/test/src/dart/resolution/top_level_variable_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/top_level_variable_test.dart @@ -27,7 +27,7 @@ final x = f(g, (z) => z.length); ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 108, 6, ), diff --git a/pkg/analyzer/test/src/dart/resolution/top_type_inference_test.dart b/pkg/analyzer/test/src/dart/resolution/top_type_inference_test.dart index 7fb6cc11922..aab41c53a79 100644 --- a/pkg/analyzer/test/src/dart/resolution/top_type_inference_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/top_type_inference_test.dart @@ -36,8 +36,8 @@ class A { final b = new A().a; ''', [ - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 18, 1), - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 37, 1), + error(CompileTimeErrorCode.topLevelCycle, 18, 1), + error(CompileTimeErrorCode.topLevelCycle, 37, 1), ], ); diff --git a/pkg/analyzer/test/src/dart/resolution/try_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/try_statement_test.dart index c08de581ecc..8c62d954ec7 100644 --- a/pkg/analyzer/test/src/dart/resolution/try_statement_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/try_statement_test.dart @@ -23,7 +23,7 @@ void f() { try {} catch () {} } ''', - [error(ParserErrorCode.CATCH_SYNTAX, 27, 1)], + [error(ParserErrorCode.catchSyntax, 27, 1)], ); var node = findNode.singleTryStatement; @@ -57,8 +57,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_CATCH_STACK, 30, 1), - error(ParserErrorCode.CATCH_SYNTAX_EXTRA_PARAMETERS, 31, 1), + error(WarningCode.unusedCatchStack, 30, 1), + error(ParserErrorCode.catchSyntaxExtraParameters, 31, 1), ], ); @@ -99,8 +99,8 @@ void f() { } ''', [ - error(ParserErrorCode.CATCH_SYNTAX, 30, 1), - error(WarningCode.UNUSED_CATCH_STACK, 31, 2), + error(ParserErrorCode.catchSyntax, 30, 1), + error(WarningCode.unusedCatchStack, 31, 2), ], ); @@ -141,8 +141,8 @@ void f() { } ''', [ - error(ParserErrorCode.CATCH_SYNTAX, 30, 1), - error(WarningCode.UNUSED_CATCH_STACK, 31, 2), + error(ParserErrorCode.catchSyntax, 30, 1), + error(WarningCode.unusedCatchStack, 31, 2), ], ); @@ -182,7 +182,7 @@ void f() { try {} catch (e, st) {} } ''', - [error(WarningCode.UNUSED_CATCH_STACK, 30, 2)], + [error(WarningCode.unusedCatchStack, 30, 2)], ); var node = findNode.singleTryStatement; @@ -221,7 +221,7 @@ void f() { try {} on int catch (e, st) {} } ''', - [error(WarningCode.UNUSED_CATCH_STACK, 37, 2)], + [error(WarningCode.unusedCatchStack, 37, 2)], ); var node = findNode.singleTryStatement; diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/collection_elements_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/collection_elements_test.dart index 37d942276a2..77ef2693e23 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/collection_elements_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/collection_elements_test.dart @@ -26,7 +26,7 @@ void f() async { T a() => throw ''; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 50, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 50, 1)], ); var node = findNode.singleMethodInvocation; @@ -107,7 +107,7 @@ void f() { T a() => throw ''; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 38, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 38, 1)], ); var node = findNode.singleMethodInvocation; @@ -163,8 +163,8 @@ void f() async { T a() => throw ''; ''', [ - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 55, 1), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 59, 1), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 55, 1), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 59, 1), ], ); @@ -247,8 +247,8 @@ void f() { T a() => throw ''; ''', [ - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 43, 1), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 47, 1), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 43, 1), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 47, 1), ], ); @@ -304,7 +304,7 @@ void f() async { T a() => throw ''; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 50, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 50, 1)], ); var node = findNode.singleMethodInvocation; @@ -385,7 +385,7 @@ void f() { T a() => throw ''; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 38, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 38, 1)], ); var node = findNode.singleMethodInvocation; diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/extension_methods_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/extension_methods_test.dart index ba232438090..450d1c26b06 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/extension_methods_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/extension_methods_test.dart @@ -393,13 +393,7 @@ main() { E({}).foo(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION, - 58, - 11, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsExtension, 58, 11)], ); var literal = findNode.setOrMapLiteral('{}).'); assertType(literal, 'Set'); @@ -663,7 +657,7 @@ f(String s) { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE, + CompileTimeErrorCode.extensionOverrideArgumentNotAssignable, 71, 1, ), diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart index f0a9a3dc212..58bad93b0f1 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart @@ -26,7 +26,7 @@ FutureOr Function() v = () async { return 0; }; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 72, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 72, 1)], ); _assertReturnType('() async {', 'Future'); } @@ -38,7 +38,7 @@ Future Function() v = () async { return 0; }; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 48, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 48, 1)], ); _assertReturnType('() async {', 'Future'); } @@ -327,7 +327,7 @@ void Function() v = () { return 0; }; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 34, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 34, 1)], ); _assertReturnType('() {', 'void'); } @@ -536,7 +536,7 @@ void f() { final v = (T a) => [a]; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 1)], + [error(WarningCode.unusedLocalVariable, 19, 1)], ); var node = findNode.functionExpression('('); @@ -882,7 +882,7 @@ int test(T Function() createT) { return createT()(''); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 81, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 81, 2)], ); var node = findNode.functionExpressionInvocation("('')"); diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/function_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/function_test.dart index 57235e9d304..5a85757982c 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/function_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/function_test.dart @@ -63,7 +63,7 @@ f() { foo(x: 1); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 54, 3)], + [error(CompileTimeErrorCode.missingRequiredArgument, 54, 3)], ); var node = findNode.methodInvocation('foo('); @@ -110,7 +110,7 @@ f() { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL, + CompileTimeErrorCode.notEnoughPositionalArgumentsNamePlural, 39, 1, ), @@ -150,7 +150,7 @@ f() { foo(1, 2, 3); } ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 44, 1)], + [error(CompileTimeErrorCode.extraPositionalArguments, 44, 1)], ); var node = findNode.methodInvocation('foo('); @@ -196,7 +196,7 @@ f() { foo(1, 2, z: 3); } ''', - [error(CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, 44, 1)], + [error(CompileTimeErrorCode.undefinedNamedParameter, 44, 1)], ); var node = findNode.methodInvocation('foo('); diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/inference_update_1_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/inference_update_1_test.dart index 1d60930b3f1..2049d2d45f4 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/inference_update_1_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/inference_update_1_test.dart @@ -88,7 +88,7 @@ example(List list) { '''; if (_isEnabled) { await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1), + error(WarningCode.unusedLocalVariable, 32, 1), ]); assertType(findElement2.localVar('a').type, 'int'); assertType(findElement2.parameter('x').type, 'int'); @@ -96,9 +96,9 @@ example(List list) { expect(findNode.binary('x + y').element!.enclosingElement!.name, 'num'); } else { await assertErrorsInCode(code, [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1), + error(WarningCode.unusedLocalVariable, 32, 1), error( - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue, 61, 1, ), @@ -118,13 +118,9 @@ test() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 60, 1), + error(WarningCode.unusedLocalVariable, 60, 1), if (!_isEnabled) - error( - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, - 83, - 1, - ), + error(CompileTimeErrorCode.uncheckedInvocationOfNullableValue, 83, 1), ], ); assertType( @@ -164,11 +160,10 @@ test(List list) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1), + error(WarningCode.unusedLocalVariable, 29, 1), if (!_isEnabled) error( - CompileTimeErrorCode - .UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue, 62, 1, ), @@ -197,7 +192,7 @@ test() { var a = f((x) => [x], () => 0); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 71, 1)], + [error(WarningCode.unusedLocalVariable, 71, 1)], ); assertType(findNode.methodInvocation('f(').typeArgumentTypes![0], 'int'); assertType( @@ -228,7 +223,7 @@ test() { var a = f(() => 0, (x) => [x]); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 71, 1)], + [error(WarningCode.unusedLocalVariable, 71, 1)], ); assertType(findNode.methodInvocation('f(').typeArgumentTypes![0], 'int'); assertType( @@ -259,7 +254,7 @@ test() { var a = f(0, (x) => [x]); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 60, 1)], + [error(WarningCode.unusedLocalVariable, 60, 1)], ); assertType(findNode.methodInvocation('f(').typeArgumentTypes![0], 'int'); assertType( @@ -405,7 +400,7 @@ test(List list) { var a = list.fold(null, (int? x, y) => (x ?? 0) + y); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1)], + [error(WarningCode.unusedLocalVariable, 29, 1)], ); assertType(findElement2.localVar('a').type, 'int?'); assertType(findElement2.parameter('x').type, 'int?'); @@ -423,7 +418,7 @@ test() { var a = f(null, ({int? x, required y}) => (x ?? 0) + y); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 86, 1)], + [error(WarningCode.unusedLocalVariable, 86, 1)], ); assertType(findElement2.localVar('a').type, 'int?'); assertType(findElement2.parameter('x').type, 'int?'); diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/list_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/list_literal_test.dart index 82940c722d0..42aa10beec9 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/list_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/list_literal_test.dart @@ -20,7 +20,7 @@ class ListLiteralTest extends PubPackageResolutionTest { ''' List a = ['a']; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 15, 3)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 15, 3)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -55,7 +55,7 @@ class A> { E a = []; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 39, 2)], + [error(CompileTimeErrorCode.invalidAssignment, 39, 2)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -67,7 +67,7 @@ class A> { E a = []; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 43, 2)], + [error(CompileTimeErrorCode.invalidAssignment, 43, 2)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -110,7 +110,7 @@ MethodInvocation ''' List a = [0]; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 17, 8)], + [error(CompileTimeErrorCode.invalidAssignment, 17, 8)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -120,7 +120,7 @@ List a = [0]; ''' List a = [0]; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 26, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 26, 1)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -147,7 +147,7 @@ List a = ['a']; ''' List a = []; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 17, 7)], + [error(CompileTimeErrorCode.invalidAssignment, 17, 7)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -206,7 +206,7 @@ var a = [1, '2', 3]; ''' var a = [x]; ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 9, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 9, 1)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -216,7 +216,7 @@ var a = [x]; ''' var a = [0, x, 2]; ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 12, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 12, 1)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -366,7 +366,7 @@ void f(Never a) async { var v = [...?a]; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 69, 4)], + [error(StaticWarningCode.invalidNullAwareOperator, 69, 4)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -399,7 +399,7 @@ void f(T a) async { var v = [...?a]; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 82, 4)], + [error(StaticWarningCode.invalidNullAwareOperator, 82, 4)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -442,7 +442,7 @@ void f(T a) { var v = [...a]; } ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 77, 1)], + [error(CompileTimeErrorCode.notIterableSpread, 77, 1)], ); assertType(findNode.listLiteral('[...'), 'List'); } @@ -455,7 +455,7 @@ void f(T a) { var v = [...a, 0]; } ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 77, 1)], + [error(CompileTimeErrorCode.notIterableSpread, 77, 1)], ); assertType(findNode.listLiteral('[...'), 'List'); } @@ -465,7 +465,7 @@ void f(T a) { ''' var a = [1]; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 17, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 17, 1)], ); assertType(findNode.listLiteral('['), 'List'); } @@ -477,7 +477,7 @@ var a = [(null as String?)]; ''', [ error( - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, 17, 17, ), diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/map_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/map_literal_test.dart index 3b69d5074c9..bbfe043fc12 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/map_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/map_literal_test.dart @@ -23,7 +23,7 @@ class MapLiteralTest extends PubPackageResolutionTest { ''' Map a = {'a' : 1}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 19, 3)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 19, 3)], ); assertType(setOrMapLiteral('{'), 'Map'); } @@ -33,7 +33,7 @@ Map a = {'a' : 1}; ''' Map a = {1 : 'a'}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 23, 3)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 23, 3)], ); assertType(setOrMapLiteral('{'), 'Map'); } @@ -95,7 +95,7 @@ class A> { E a = {}; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 46, 2)], + [error(CompileTimeErrorCode.invalidAssignment, 46, 2)], ); assertType(setOrMapLiteral('{}'), 'Map'); } @@ -107,7 +107,7 @@ class A> { E a = {}; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 51, 2)], + [error(CompileTimeErrorCode.invalidAssignment, 51, 2)], ); assertType(setOrMapLiteral('{}'), 'Map'); } @@ -150,7 +150,7 @@ MethodInvocation ''' Map a = {0 : 'a'}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 41, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 41, 1)], ); assertType(setOrMapLiteral('{'), 'Map'); } @@ -160,7 +160,7 @@ Map a = {0 : 'a'}; ''' Map a = {'a' : 1}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 47, 1)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 47, 1)], ); assertType(setOrMapLiteral('{'), 'Map'); } @@ -177,7 +177,7 @@ Map a = {'a' : 'b'}; ''' Map a = {}; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 24, 12)], + [error(CompileTimeErrorCode.invalidAssignment, 24, 12)], ); assertType(setOrMapLiteral('{'), 'Map'); } @@ -369,7 +369,7 @@ void f(Never a, bool b) async { var v = {...a, if (b) throw 0: throw 0}; } ''', - [error(WarningCode.DEAD_CODE, 87, 21)], + [error(WarningCode.deadCode, 87, 21)], ); assertType(setOrMapLiteral('{...'), 'Map'); } @@ -383,8 +383,8 @@ void f(Never a, bool b) async { } ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 77, 4), - error(WarningCode.DEAD_CODE, 88, 21), + error(StaticWarningCode.invalidNullAwareOperator, 77, 4), + error(WarningCode.deadCode, 88, 21), ], ); assertType(setOrMapLiteral('{...'), 'Map'); @@ -398,7 +398,7 @@ void f(Null a, bool b) async { var v = {...?a, if (b) throw 0: throw 0}; } ''', - [error(WarningCode.DEAD_CODE, 99, 7)], + [error(WarningCode.deadCode, 99, 7)], ); assertType(setOrMapLiteral('{...'), 'Map'); } @@ -431,7 +431,7 @@ void f(Null a) { var v = {...?a}; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, 61, 7)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, 61, 7)], ); assertType(setOrMapLiteral('{...'), 'dynamic'); } @@ -445,8 +445,8 @@ void f(T a, bool b) async { } ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 90, 4), - error(WarningCode.DEAD_CODE, 101, 21), + error(StaticWarningCode.invalidNullAwareOperator, 90, 4), + error(WarningCode.deadCode, 101, 21), ], ); assertType(setOrMapLiteral('{...'), 'Map'); @@ -460,7 +460,7 @@ void f(T a, bool b) async { var v = {...?a, if (b) throw 0: throw 0}; } ''', - [error(WarningCode.DEAD_CODE, 112, 7)], + [error(WarningCode.deadCode, 112, 7)], ); assertType(setOrMapLiteral('{...'), 'Map'); } @@ -483,7 +483,7 @@ void f(T a, bool b) async { var v = {...a, if (b) throw 0: throw 0}; } ''', - [error(WarningCode.DEAD_CODE, 100, 21)], + [error(WarningCode.deadCode, 100, 21)], ); assertType(setOrMapLiteral('{...'), 'Map'); } @@ -497,7 +497,7 @@ void f(T a) { var v = {...a}; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, 73, 6)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, 73, 6)], ); assertType(setOrMapLiteral('{...'), 'dynamic'); } @@ -511,7 +511,7 @@ void f(T a) { var v = {...a, 0: 1}; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, 73, 12)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, 73, 12)], ); assertType(setOrMapLiteral('{...'), 'dynamic'); } @@ -521,7 +521,7 @@ void f(T a) { ''' var a = {1 : 2}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 22, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 22, 1)], ); assertType(setOrMapLiteral('{'), 'Map'); } @@ -531,7 +531,7 @@ var a = {1 : 2}; ''' var a = {'a' : 'b'}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 28, 3)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 28, 3)], ); assertType(setOrMapLiteral('{'), 'Map'); } @@ -548,7 +548,7 @@ var a = {1 : 2}; ''' var a = {1}; ''', - [error(CompileTimeErrorCode.EXPRESSION_IN_MAP, 22, 1)], + [error(CompileTimeErrorCode.expressionInMap, 22, 1)], ); assertType(setOrMapLiteral('{'), 'Map'); } diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/set_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/set_literal_test.dart index bd057bd068d..4fb598d000a 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/set_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/set_literal_test.dart @@ -25,7 +25,7 @@ class SetLiteralTest extends PubPackageResolutionTest { ''' Set a = {'a'}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 14, 3)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 14, 3)], ); assertType(setLiteral('{'), 'Set'); } @@ -80,7 +80,7 @@ class A> { E a = {}; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 38, 2)], + [error(CompileTimeErrorCode.invalidAssignment, 38, 2)], ); assertType(setLiteral('{}'), 'Set'); } @@ -92,7 +92,7 @@ class A> { E a = {}; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 42, 2)], + [error(CompileTimeErrorCode.invalidAssignment, 42, 2)], ); assertType(setLiteral('{}'), 'Set'); } @@ -124,7 +124,7 @@ class C { ''' Set a = {0}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 25, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 25, 1)], ); assertType(setLiteral('{'), 'Set'); } @@ -149,7 +149,7 @@ Set a = {'a'}; ''' Set a = {}; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 16, 7)], + [error(CompileTimeErrorCode.invalidAssignment, 16, 7)], ); assertType(setLiteral('{'), 'Set'); } @@ -310,7 +310,7 @@ void f(Never a, bool b) async { var v = {...a, if (b) throw 0}; } ''', - [error(WarningCode.DEAD_CODE, 87, 12)], + [error(WarningCode.deadCode, 87, 12)], ); assertType(setLiteral('{...'), 'Set'); } @@ -324,8 +324,8 @@ void f(Never a, bool b) async { } ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 77, 4), - error(WarningCode.DEAD_CODE, 88, 12), + error(StaticWarningCode.invalidNullAwareOperator, 77, 4), + error(WarningCode.deadCode, 88, 12), ], ); assertType(setLiteral('{...'), 'Set'); @@ -360,8 +360,8 @@ void f(T a, bool b) async { } ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 90, 4), - error(WarningCode.DEAD_CODE, 101, 12), + error(StaticWarningCode.invalidNullAwareOperator, 90, 4), + error(WarningCode.deadCode, 101, 12), ], ); assertType(setLiteral('{...'), 'Set'); @@ -395,7 +395,7 @@ void f(T a, bool b) async { var v = {...a, if (b) throw 0}; } ''', - [error(WarningCode.DEAD_CODE, 100, 12)], + [error(WarningCode.deadCode, 100, 12)], ); assertType(setLiteral('{...'), 'Set'); } @@ -408,7 +408,7 @@ void f(T a) { var v = {...a}; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, 73, 6)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, 73, 6)], ); assertType(setLiteral('{...'), 'dynamic'); } @@ -421,7 +421,7 @@ void f(T a) { var v = {...a, 0}; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, 73, 9)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, 73, 9)], ); assertType(setLiteral('{...'), 'dynamic'); } @@ -431,7 +431,7 @@ void f(T a) { ''' var a = {1}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 17, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 17, 1)], ); assertType(setLiteral('{'), 'Set'); } diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/statements_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/statements_test.dart index 987930674bc..f213b46c2f9 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/statements_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/statements_test.dart @@ -83,7 +83,7 @@ void f() async { } T a() => throw ''; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1)], + [error(WarningCode.unusedLocalVariable, 34, 1)], ); var node = findNode.singleMethodInvocation; @@ -111,7 +111,7 @@ void f() async { } T a() => throw ''; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1)], + [error(WarningCode.unusedLocalVariable, 34, 1)], ); var node = findNode.singleMethodInvocation; @@ -175,7 +175,7 @@ void f() { } T a() => throw ''; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1)], + [error(WarningCode.unusedLocalVariable, 22, 1)], ); var node = findNode.singleMethodInvocation; @@ -203,7 +203,7 @@ void f() { } T a() => throw ''; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1)], + [error(WarningCode.unusedLocalVariable, 22, 1)], ); var node = findNode.singleMethodInvocation; diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/tear_off_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/tear_off_test.dart index 98903c87afa..5f0db151f31 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_inference/tear_off_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_inference/tear_off_test.dart @@ -25,7 +25,7 @@ void test() { context = f; // 1 } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 52, 7)], + [error(WarningCode.unusedLocalVariable, 52, 7)], ); var node = findNode.simple('f; // 1'); @@ -48,7 +48,7 @@ void test() { context = f; // 1 } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 7)], + [error(WarningCode.unusedLocalVariable, 54, 7)], ); var node = findNode.simple('f; // 1'); diff --git a/pkg/analyzer/test/src/dart/resolution/type_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/type_literal_test.dart index c27572efeb5..9c9ca85e7f7 100644 --- a/pkg/analyzer/test/src/dart/resolution/type_literal_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/type_literal_test.dart @@ -81,7 +81,7 @@ TypeLiteral class C {} var t = C; ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 26, 5)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 26, 5)], ); var node = findNode.typeLiteral('C;'); @@ -109,7 +109,7 @@ TypeLiteral class C {} var t = C; ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 23, 10)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 23, 10)], ); var node = findNode.typeLiteral('C;'); @@ -143,7 +143,7 @@ var t = C; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 36, 6, contextMessages: [message(testFile, 34, 9)], @@ -312,7 +312,7 @@ var t = CA; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 59, 6, contextMessages: [message(testFile, 56, 10)], @@ -476,7 +476,7 @@ extension E on Type { void foo() {} } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD_ON_FUNCTION_TYPE, 58, 3)], + [error(CompileTimeErrorCode.undefinedMethodOnFunctionType, 58, 3)], ); var node = findNode.typeLiteral('Fn'); @@ -517,7 +517,7 @@ extension E on Type { void foo() {} } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD_ON_FUNCTION_TYPE, 48, 3)], + [error(CompileTimeErrorCode.undefinedMethodOnFunctionType, 48, 3)], ); var node = findNode.typeLiteral('Fn'); @@ -594,7 +594,7 @@ extension E on Type { int get foo => 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER_ON_FUNCTION_TYPE, 58, 3)], + [error(CompileTimeErrorCode.undefinedGetterOnFunctionType, 58, 3)], ); var node = findNode.typeLiteral('Fn'); @@ -667,7 +667,7 @@ extension E on Type { set foo(int value) {} } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER_ON_FUNCTION_TYPE, 58, 3)], + [error(CompileTimeErrorCode.undefinedSetterOnFunctionType, 58, 3)], ); var node = findNode.typeLiteral('Fn'); @@ -733,7 +733,7 @@ TypeLiteral typedef Fn = void Function(T, U); var t = Fn; ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 50, 5)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 50, 5)], ); var node = findNode.typeLiteral('Fn;'); @@ -765,7 +765,7 @@ TypeLiteral typedef Fn = void Function(T); var t = Fn; ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 44, 13)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 44, 13)], ); var node = findNode.typeLiteral('Fn;'); @@ -802,7 +802,7 @@ var t = Fn; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 57, 6, contextMessages: [message(testFile, 54, 10)], @@ -934,7 +934,7 @@ class TypeLiteralResolutionTest_WithoutConstructorTearoffs class C {} var t = C; ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 23, 5)], + [error(ParserErrorCode.experimentNotEnabled, 23, 5)], ); } @@ -947,7 +947,7 @@ class C {} import 'a.dart' as a; var t = a.C; ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 33, 5)], + [error(ParserErrorCode.experimentNotEnabled, 33, 5)], ); } } diff --git a/pkg/analyzer/test/src/dart/resolution/variable_declaration_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/variable_declaration_statement_test.dart index 311c5c190c8..d4f3f7b4bd6 100644 --- a/pkg/analyzer/test/src/dart/resolution/variable_declaration_statement_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/variable_declaration_statement_test.dart @@ -27,8 +27,8 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 37, 5), + error(WarningCode.unusedLocalVariable, 33, 1), + error(ParserErrorCode.missingAssignableSelector, 37, 5), ], ); @@ -60,7 +60,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1)], + [error(WarningCode.unusedLocalVariable, 33, 1)], ); var node = findNode.singleVariableDeclarationStatement; diff --git a/pkg/analyzer/test/src/dart/resolution/variance_test.dart b/pkg/analyzer/test/src/dart/resolution/variance_test.dart index 68a2e57cc62..b627e7a63fd 100644 --- a/pkg/analyzer/test/src/dart/resolution/variance_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/variance_test.dart @@ -59,7 +59,7 @@ main() { B b = B([])..x=2.2; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 76, 1)], + [error(WarningCode.unusedLocalVariable, 76, 1)], ); var node = findNode.instanceCreation('B('); @@ -92,9 +92,9 @@ main() { } ''', [ - error(CompileTimeErrorCode.COULD_NOT_INFER, 147, 11), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 159, 19), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 180, 16), + error(CompileTimeErrorCode.couldNotInfer, 147, 11), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 159, 19), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 180, 16), ], ); diff --git a/pkg/analyzer/test/src/dart/resolution/while_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/while_statement_test.dart index d673a379d98..1a22158de8f 100644 --- a/pkg/analyzer/test/src/dart/resolution/while_statement_test.dart +++ b/pkg/analyzer/test/src/dart/resolution/while_statement_test.dart @@ -93,7 +93,7 @@ void f() { } } ''', - [error(CompileTimeErrorCode.LABEL_UNDEFINED, 38, 1)], + [error(CompileTimeErrorCode.labelUndefined, 38, 1)], ); var node = findNode.singleWhileStatement; @@ -129,8 +129,8 @@ class A { } ''', [ - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 34, 5), - error(CompileTimeErrorCode.NON_BOOL_CONDITION, 34, 5), + error(ParserErrorCode.missingAssignableSelector, 34, 5), + error(CompileTimeErrorCode.nonBoolCondition, 34, 5), ], ); @@ -226,7 +226,7 @@ void f() { } } ''', - [error(CompileTimeErrorCode.LABEL_UNDEFINED, 41, 1)], + [error(CompileTimeErrorCode.labelUndefined, 41, 1)], ); var node = findNode.singleWhileStatement; diff --git a/pkg/analyzer/test/src/diagnostics/abi_specific_integer_mapping_test.dart b/pkg/analyzer/test/src/diagnostics/abi_specific_integer_mapping_test.dart index a239c79f796..4f32c4a2b1c 100644 --- a/pkg/analyzer/test/src/diagnostics/abi_specific_integer_mapping_test.dart +++ b/pkg/analyzer/test/src/diagnostics/abi_specific_integer_mapping_test.dart @@ -25,7 +25,7 @@ final class UintPtr extends AbiSpecificInteger { const UintPtr(); } ''', - [error(FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_EXTRA, 51, 25)], + [error(FfiCode.abiSpecificIntegerMappingExtra, 51, 25)], ); } @@ -44,13 +44,13 @@ final class UintPtr extends AbiSpecificInteger { ''', [ error( - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED, + FfiCode.abiSpecificIntegerMappingUnsupported, 96, 8, messageContains: ["Invalid mapping to 'IntPtr'"], ), error( - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED, + FfiCode.abiSpecificIntegerMappingUnsupported, 125, 9, messageContains: ["Invalid mapping to 'UintPtr'"], @@ -75,13 +75,13 @@ final class UintPtr extends AbiSpecificInteger { ''', [ error( - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED, + FfiCode.abiSpecificIntegerMappingUnsupported, 149, 1, messageContains: ["Invalid mapping to 'IntPtr'"], ), error( - FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_UNSUPPORTED, + FfiCode.abiSpecificIntegerMappingUnsupported, 149, 1, messageContains: ["Invalid mapping to 'UintPtr'"], @@ -98,7 +98,7 @@ final class UintPtr extends AbiSpecificInteger { const UintPtr(); } ''', - [error(FfiCode.ABI_SPECIFIC_INTEGER_MAPPING_MISSING, 31, 7)], + [error(FfiCode.abiSpecificIntegerMappingMissing, 31, 7)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/abstract_field_constructor_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/abstract_field_constructor_initializer_test.dart index 1ab61371691..b5e81ebbb01 100644 --- a/pkg/analyzer/test/src/diagnostics/abstract_field_constructor_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/abstract_field_constructor_initializer_test.dart @@ -23,13 +23,7 @@ abstract class A { A() : x = 0; } ''', - [ - error( - CompileTimeErrorCode.ABSTRACT_FIELD_CONSTRUCTOR_INITIALIZER, - 45, - 1, - ), - ], + [error(CompileTimeErrorCode.abstractFieldConstructorInitializer, 45, 1)], ); } @@ -41,13 +35,7 @@ abstract class A { A() : x = 0; } ''', - [ - error( - CompileTimeErrorCode.ABSTRACT_FIELD_CONSTRUCTOR_INITIALIZER, - 51, - 1, - ), - ], + [error(CompileTimeErrorCode.abstractFieldConstructorInitializer, 51, 1)], ); } @@ -59,13 +47,7 @@ abstract class A { A(this.x); } ''', - [ - error( - CompileTimeErrorCode.ABSTRACT_FIELD_CONSTRUCTOR_INITIALIZER, - 52, - 1, - ), - ], + [error(CompileTimeErrorCode.abstractFieldConstructorInitializer, 52, 1)], ); } @@ -86,13 +68,7 @@ abstract class A { A(this.x); } ''', - [ - error( - CompileTimeErrorCode.ABSTRACT_FIELD_CONSTRUCTOR_INITIALIZER, - 46, - 1, - ), - ], + [error(CompileTimeErrorCode.abstractFieldConstructorInitializer, 46, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/abstract_field_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/abstract_field_initializer_test.dart index 7685f6f78d9..84f16741579 100644 --- a/pkg/analyzer/test/src/diagnostics/abstract_field_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/abstract_field_initializer_test.dart @@ -22,7 +22,7 @@ abstract class A { abstract final int x = 0; } ''', - [error(CompileTimeErrorCode.ABSTRACT_FIELD_INITIALIZER, 40, 1)], + [error(CompileTimeErrorCode.abstractFieldInitializer, 40, 1)], ); } @@ -41,7 +41,7 @@ abstract class A { abstract int x = 0; } ''', - [error(CompileTimeErrorCode.ABSTRACT_FIELD_INITIALIZER, 34, 1)], + [error(CompileTimeErrorCode.abstractFieldInitializer, 34, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/abstract_super_member_reference_test.dart b/pkg/analyzer/test/src/diagnostics/abstract_super_member_reference_test.dart index cab81948f07..607fc33e1f1 100644 --- a/pkg/analyzer/test/src/diagnostics/abstract_super_member_reference_test.dart +++ b/pkg/analyzer/test/src/diagnostics/abstract_super_member_reference_test.dart @@ -28,7 +28,7 @@ mixin M implements A { } } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 82, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 82, 3)], ); var node = findNode.methodInvocation('super.foo(0)'); @@ -104,7 +104,7 @@ class B extends Object with A { noSuchMethod(im) => 87; } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 107, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 107, 3)], ); var node = findNode.methodInvocation('super.foo()'); @@ -141,7 +141,7 @@ abstract class B extends A { void foo(int _) {} // does not matter } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 95, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 95, 3)], ); var node = findNode.methodInvocation('super.foo(0)'); @@ -285,7 +285,7 @@ abstract class B extends A { } } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 86, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 86, 3)], ); var node = findNode.singlePropertyAccess; @@ -316,7 +316,7 @@ mixin M implements A { } } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 81, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 81, 3)], ); var node = findNode.singlePropertyAccess; @@ -347,7 +347,7 @@ class B extends Object with A { noSuchMethod(im) => 2; } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 108, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 108, 3)], ); var node = findNode.singlePropertyAccess; @@ -407,7 +407,7 @@ class C extends B { int get foo => super.foo; // ref } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 111, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 111, 3)], ); var node = findNode.singlePropertyAccess; @@ -468,7 +468,7 @@ abstract class B extends A { } } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 90, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 90, 3)], ); var node = findNode.singlePropertyAccess; @@ -499,7 +499,7 @@ abstract class B extends A { } } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 94, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 94, 3)], ); assertResolvedNodeText(findNode.assignment('foo ='), r''' @@ -541,7 +541,7 @@ mixin M implements A { } } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 81, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 81, 3)], ); assertResolvedNodeText(findNode.assignment('foo ='), r''' @@ -583,7 +583,7 @@ class B extends Object with A { noSuchMethod(im) {} } ''', - [error(CompileTimeErrorCode.ABSTRACT_SUPER_MEMBER_REFERENCE, 111, 3)], + [error(CompileTimeErrorCode.abstractSuperMemberReference, 111, 3)], ); assertResolvedNodeText(findNode.assignment('foo ='), r''' diff --git a/pkg/analyzer/test/src/diagnostics/ambiguous_export_test.dart b/pkg/analyzer/test/src/diagnostics/ambiguous_export_test.dart index f98f43c1d5d..1e13cb84f11 100644 --- a/pkg/analyzer/test/src/diagnostics/ambiguous_export_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ambiguous_export_test.dart @@ -27,7 +27,7 @@ class N {} export 'lib1.dart'; export 'lib2.dart'; ''', - [error(CompileTimeErrorCode.AMBIGUOUS_EXPORT, 27, 11)], + [error(CompileTimeErrorCode.ambiguousExport, 27, 11)], ); } @@ -43,7 +43,7 @@ extension E on String {} export 'lib1.dart'; export 'lib2.dart'; ''', - [error(CompileTimeErrorCode.AMBIGUOUS_EXPORT, 27, 11)], + [error(CompileTimeErrorCode.ambiguousExport, 27, 11)], ); } @@ -80,7 +80,7 @@ export 'lib2.dart'; await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.AMBIGUOUS_EXPORT, 25, 11), + error(CompileTimeErrorCode.ambiguousExport, 25, 11), ]); } @@ -113,7 +113,7 @@ export 'lib2.dart'; await assertErrorsInFile2(b, []); await assertErrorsInFile2(c, [ - error(CompileTimeErrorCode.AMBIGUOUS_EXPORT, 25, 11), + error(CompileTimeErrorCode.ambiguousExport, 25, 11), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/ambiguous_extension_member_access_test.dart b/pkg/analyzer/test/src/diagnostics/ambiguous_extension_member_access_test.dart index b7c37f87d00..a65cd850400 100644 --- a/pkg/analyzer/test/src/diagnostics/ambiguous_extension_member_access_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ambiguous_extension_member_access_test.dart @@ -30,13 +30,7 @@ extension E2 on A { int f(A a) => a(); ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 110, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 110, 1)], ); } @@ -55,13 +49,7 @@ f() { 0.a; } ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 98, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 98, 1)], ); var node = findNode.propertyAccess('0.a'); @@ -124,13 +112,7 @@ f() { 0.a; } ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 91, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 91, 1)], ); var node = findNode.propertyAccess('0.a'); @@ -163,13 +145,7 @@ f() { 0.a; } ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 96, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 96, 1)], ); var node = findNode.propertyAccess('0.a'); @@ -199,7 +175,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 129, 3, messageContains: [ @@ -228,7 +204,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 87, 3, messageContains: [ @@ -253,7 +229,7 @@ extension on Iterable { void foo() {} } ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 66, 3, messageContains: [ @@ -264,8 +240,8 @@ extension on Iterable { void foo() {} } ], contextMessages: [message(testFile, -1, 0), message(testFile, -1, 0)], ), - error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 97, 6), - error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 145, 6), + error(CompileTimeErrorCode.nonTypeAsTypeArgument, 97, 6), + error(CompileTimeErrorCode.nonTypeAsTypeArgument, 145, 6), ], ); } @@ -293,7 +269,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 129, 3, messageContains: [ @@ -330,13 +306,7 @@ f() { 0.a(); } ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 88, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 88, 1)], ); var node = findNode.methodInvocation('0.a()'); @@ -370,7 +340,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 129, 3, messageContains: [ @@ -394,7 +364,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_THREE_OR_MORE, + CompileTimeErrorCode.ambiguousExtensionMemberAccessThreeOrMore, 167, 3, messageContains: [ @@ -438,7 +408,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_THREE_OR_MORE, + CompileTimeErrorCode.ambiguousExtensionMemberAccessThreeOrMore, 108, 3, contextMessages: [message(one, 10, 1), message(two, 10, 1)], @@ -469,13 +439,7 @@ f(SubTarget t) { t.foo; } ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 396, - 3, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 396, 3)], ); } @@ -494,13 +458,7 @@ extension E2 on A { A f(A a) => a + a; ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 122, - 5, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 122, 5)], ); } @@ -521,13 +479,7 @@ void f(A a) { a += 0; } ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 130, - 2, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 130, 2)], ); } @@ -546,13 +498,7 @@ extension E2 on A { int f(A a) => a[0]; ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 134, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 134, 1)], ); } @@ -571,13 +517,7 @@ f() { 0[1] += 2; } ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 136, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 136, 1)], ); } @@ -596,13 +536,7 @@ extension E2 on A { int f(A a) => -a; ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 123, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 123, 1)], ); } @@ -621,13 +555,7 @@ f() { 0.a = 3; } ''', - [ - error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, - 88, - 1, - ), - ], + [error(CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 88, 1)], ); assertResolvedNodeText(findNode.assignment('= 3'), r''' @@ -679,7 +607,7 @@ int h(List x) => x(); ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_EXTENSION_MEMBER_ACCESS_TWO, + CompileTimeErrorCode.ambiguousExtensionMemberAccessTwo, 167, 1, messageContains: [ diff --git a/pkg/analyzer/test/src/diagnostics/ambiguous_import_test.dart b/pkg/analyzer/test/src/diagnostics/ambiguous_import_test.dart index 20b1615a9a8..ffcaa9b2998 100644 --- a/pkg/analyzer/test/src/diagnostics/ambiguous_import_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ambiguous_import_test.dart @@ -37,8 +37,8 @@ import 'b.dart'; class A {} ''', [ - error(CompileTimeErrorCode.INVALID_ANNOTATION, 35, 4), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 36, 3), + error(CompileTimeErrorCode.invalidAnnotation, 35, 4), + error(CompileTimeErrorCode.ambiguousImport, 36, 3), ], ); } @@ -55,7 +55,7 @@ class N {}'''); import 'lib1.dart'; import 'lib2.dart'; f(p) {p as N;}''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 51, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 51, 1)], ); } @@ -72,8 +72,8 @@ import 'lib1.dart'; import 'lib2.dart'; class A extends N {}''', [ - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 56, 1), - error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 56, 1), + error(CompileTimeErrorCode.ambiguousImport, 56, 1), + error(CompileTimeErrorCode.extendsNonClass, 56, 1), ], ); } @@ -91,8 +91,8 @@ import 'lib1.dart'; import 'lib2.dart'; class A implements N {}''', [ - error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 59, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 59, 1), + error(CompileTimeErrorCode.implementsNonClass, 59, 1), + error(CompileTimeErrorCode.ambiguousImport, 59, 1), ], ); } @@ -119,8 +119,8 @@ part 'part.dart'; GatheringDiagnosticListener() ..addAll(partResult.diagnostics) ..assertErrors([ - error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 36, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 36, 1), + error(CompileTimeErrorCode.extendsNonClass, 36, 1), + error(CompileTimeErrorCode.ambiguousImport, 36, 1), ]); } @@ -137,7 +137,7 @@ library L; import 'lib1.dart'; import 'lib2.dart'; f() {new N();}''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 60, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 60, 1)], ); } @@ -158,8 +158,8 @@ f() { print(n); }''', [ - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 59, 1), - error(CompileTimeErrorCode.DOT_SHORTHAND_UNDEFINED_INVOCATION, 66, 3), + error(CompileTimeErrorCode.ambiguousImport, 59, 1), + error(CompileTimeErrorCode.dotShorthandUndefinedInvocation, 66, 3), ], ); } @@ -176,7 +176,7 @@ class N {}'''); import 'lib1.dart'; import 'lib2.dart'; f(p) {p is N;}''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 51, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 51, 1)], ); } @@ -192,7 +192,7 @@ class N {}'''); import 'lib1.dart'; import 'lib2.dart'; g() { N.FOO; }''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 46, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 46, 1)], ); } @@ -217,7 +217,7 @@ import 'dart:html'; import 'dart:io'; g(File f) {} ''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 40, 4)], + [error(CompileTimeErrorCode.ambiguousImport, 40, 4)], ); } @@ -242,14 +242,14 @@ class A { } class B {}''', [ - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 48, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 53, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 59, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 63, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 72, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 74, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 106, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 149, 1), + error(CompileTimeErrorCode.ambiguousImport, 48, 1), + error(CompileTimeErrorCode.ambiguousImport, 53, 1), + error(CompileTimeErrorCode.ambiguousImport, 59, 1), + error(CompileTimeErrorCode.ambiguousImport, 63, 1), + error(CompileTimeErrorCode.ambiguousImport, 72, 1), + error(WarningCode.unusedLocalVariable, 74, 1), + error(CompileTimeErrorCode.ambiguousImport, 106, 1), + error(CompileTimeErrorCode.ambiguousImport, 149, 1), ], ); } @@ -267,7 +267,7 @@ import 'lib1.dart'; import 'lib2.dart'; class A {} A? f() { return null; }''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 56, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 56, 1)], ); } @@ -284,7 +284,7 @@ import 'lib1.dart'; import 'lib2.dart'; class A {} f() {new A();}''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 65, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 65, 1)], ); } @@ -306,7 +306,7 @@ void f() { x; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 48, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 48, 1)], ); } @@ -328,7 +328,7 @@ void f() { p.x; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 60, 1)], + [error(CompileTimeErrorCode.ambiguousImport, 60, 1)], ); } @@ -355,14 +355,14 @@ void f() { ''', [ error( - CompileTimeErrorCode.AMBIGUOUS_IMPORT, + CompileTimeErrorCode.ambiguousImport, 48, 1, messageContains: ["'x'"], ), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 57, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 69, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 74, 1), + error(CompileTimeErrorCode.ambiguousImport, 57, 1), + error(CompileTimeErrorCode.ambiguousImport, 69, 1), + error(CompileTimeErrorCode.ambiguousImport, 74, 1), ], ); } @@ -389,10 +389,10 @@ void f() { } ''', [ - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 60, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 71, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 85, 1), - error(CompileTimeErrorCode.AMBIGUOUS_IMPORT, 92, 1), + error(CompileTimeErrorCode.ambiguousImport, 60, 1), + error(CompileTimeErrorCode.ambiguousImport, 71, 1), + error(CompileTimeErrorCode.ambiguousImport, 85, 1), + error(CompileTimeErrorCode.ambiguousImport, 92, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/ambiguous_set_or_map_literal_test.dart b/pkg/analyzer/test/src/diagnostics/ambiguous_set_or_map_literal_test.dart index d1d19ed2bf2..6bfb78f8adc 100644 --- a/pkg/analyzer/test/src/diagnostics/ambiguous_set_or_map_literal_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ambiguous_set_or_map_literal_test.dart @@ -87,7 +87,7 @@ f(Map map, Set set) { return {...set, ...map}; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH, 46, 16)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralBoth, 46, 16)], ); } @@ -98,7 +98,7 @@ f(Map map, Set set) { return {...set, ...map}; } ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH, 48, 16)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralBoth, 48, 16)], ); } } @@ -111,7 +111,7 @@ class AmbiguousSetOrMapLiteralEitherTest extends PubPackageResolutionTest { ''' union(a, b) => !{...a, ...b}; ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, 16, 12)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, 16, 12)], ); } @@ -122,7 +122,7 @@ var map; var set; var c = {...set, ...map}; ''', - [error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_EITHER, 26, 16)], + [error(CompileTimeErrorCode.ambiguousSetOrMapLiteralEither, 26, 16)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_not_found_test.dart b/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_not_found_test.dart index c6331e092a5..66ccd114f62 100644 --- a/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_not_found_test.dart +++ b/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_not_found_test.dart @@ -20,7 +20,7 @@ class IncludeFileNotFoundTest extends AbstractAnalysisOptionsTest { ''' include: "./analysis_options.yaml" ''', - [error(AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, 9, 25)], + [error(AnalysisOptionsWarningCode.recursiveIncludeFile, 9, 25)], ); } @@ -29,7 +29,7 @@ include: "./analysis_options.yaml" ''' include: ./analysis_options.yaml ''', - [error(AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, 9, 23)], + [error(AnalysisOptionsWarningCode.recursiveIncludeFile, 9, 23)], ); } @@ -38,7 +38,7 @@ include: ./analysis_options.yaml ''' include: './analysis_options.yaml' ''', - [error(AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, 9, 25)], + [error(AnalysisOptionsWarningCode.recursiveIncludeFile, 9, 25)], ); } @@ -50,7 +50,7 @@ include: "package:pedantic/analysis_options.yaml" ''', [ error( - AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND, + AnalysisOptionsWarningCode.includeFileNotFound, 74, 40, text: @@ -69,7 +69,7 @@ include: package:pedantic/analysis_options.yaml ''', [ error( - AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND, + AnalysisOptionsWarningCode.includeFileNotFound, 74, 38, text: @@ -88,7 +88,7 @@ include: 'package:pedantic/analysis_options.yaml' ''', [ error( - AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND, + AnalysisOptionsWarningCode.includeFileNotFound, 74, 40, text: diff --git a/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_warning_test.dart b/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_warning_test.dart index 932ba9ff60f..2f88cca3381 100644 --- a/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_warning_test.dart +++ b/pkg/analyzer/test/src/diagnostics/analysis_options/include_file_warning_test.dart @@ -26,7 +26,7 @@ include: a.yaml ''', [ error( - AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING, + AnalysisOptionsWarningCode.includedFileWarning, 9, 6, messageContains: [ diff --git a/pkg/analyzer/test/src/diagnostics/analysis_options/recursive_include_file_test.dart b/pkg/analyzer/test/src/diagnostics/analysis_options/recursive_include_file_test.dart index 51cff613be8..df2f5c0f6a1 100644 --- a/pkg/analyzer/test/src/diagnostics/analysis_options/recursive_include_file_test.dart +++ b/pkg/analyzer/test/src/diagnostics/analysis_options/recursive_include_file_test.dart @@ -22,7 +22,7 @@ include: analysis_options.yaml ''', [ error( - AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, + AnalysisOptionsWarningCode.recursiveIncludeFile, 9, 21, text: @@ -41,7 +41,7 @@ include: ''', [ error( - AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, + AnalysisOptionsWarningCode.recursiveIncludeFile, 13, 21, text: @@ -65,7 +65,7 @@ include: a.yaml ''', [ error( - AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, + AnalysisOptionsWarningCode.recursiveIncludeFile, 9, 6, text: @@ -86,7 +86,7 @@ include: a.yaml ''', [ error( - AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING, + AnalysisOptionsWarningCode.includedFileWarning, 9, 6, messageContains: [ @@ -115,7 +115,7 @@ include: ''', [ error( - AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, + AnalysisOptionsWarningCode.recursiveIncludeFile, 13, 10, text: @@ -143,7 +143,7 @@ include: a.yaml ''', [ error( - AnalysisOptionsWarningCode.RECURSIVE_INCLUDE_FILE, + AnalysisOptionsWarningCode.recursiveIncludeFile, 9, 6, text: @@ -167,7 +167,7 @@ include: a.yaml ''', [ error( - AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING, + AnalysisOptionsWarningCode.includedFileWarning, 9, 6, messageContains: [ diff --git a/pkg/analyzer/test/src/diagnostics/annotation_on_pointer_field_test.dart b/pkg/analyzer/test/src/diagnostics/annotation_on_pointer_field_test.dart index 62f6779cb41..9bceb4dacba 100644 --- a/pkg/analyzer/test/src/diagnostics/annotation_on_pointer_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/annotation_on_pointer_field_test.dart @@ -24,7 +24,7 @@ final class C extends Struct { external Pointer x; } ''', - [error(FfiCode.ANNOTATION_ON_POINTER_FIELD, 52, 9)], + [error(FfiCode.annotationOnPointerField, 52, 9)], ); } @@ -37,7 +37,7 @@ final class C extends Struct { external Pointer x; } ''', - [error(FfiCode.ANNOTATION_ON_POINTER_FIELD, 52, 8)], + [error(FfiCode.annotationOnPointerField, 52, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/annotation_syntax_test.dart b/pkg/analyzer/test/src/diagnostics/annotation_syntax_test.dart index ac3bbcdf466..e59ab432b2f 100644 --- a/pkg/analyzer/test/src/diagnostics/annotation_syntax_test.dart +++ b/pkg/analyzer/test/src/diagnostics/annotation_syntax_test.dart @@ -32,8 +32,8 @@ class C { } ''', [ - error(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 146, 11), - error(ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT, 158, 19), + error(ParserErrorCode.annotationOnTypeArgument, 146, 11), + error(ParserErrorCode.annotationOnTypeArgument, 158, 19), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/argument_must_be_a_constant_test.dart b/pkg/analyzer/test/src/diagnostics/argument_must_be_a_constant_test.dart index e442d310620..1e1621571be 100644 --- a/pkg/analyzer/test/src/diagnostics/argument_must_be_a_constant_test.dart +++ b/pkg/analyzer/test/src/diagnostics/argument_must_be_a_constant_test.dart @@ -28,7 +28,7 @@ doThings() { f(8); } ''', - [error(FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, 231, 6)], + [error(FfiCode.argumentMustBeAConstant, 231, 6)], ); } @@ -45,7 +45,7 @@ doThings() { f(8); } ''', - [error(FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, 233, 6)], + [error(FfiCode.argumentMustBeAConstant, 233, 6)], ); } @@ -61,7 +61,7 @@ doThings(bool isLeaf) { f(8); } ''', - [error(FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, 221, 6)], + [error(FfiCode.argumentMustBeAConstant, 221, 6)], ); } @@ -76,7 +76,7 @@ void testFromFunctionFunctionExceptionValueMustBeConst() { Pointer.fromFunction(myTimesThree, notAConst); } ''', - [error(FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, 250, 9)], + [error(FfiCode.argumentMustBeAConstant, 250, 9)], ); } @@ -91,7 +91,7 @@ doThings(bool isLeaf) { l.lookupFunction("timesFour", isLeaf:isLeaf); } ''', - [error(FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, 230, 6)], + [error(FfiCode.argumentMustBeAConstant, 230, 6)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart index 260c4d38a8e..6461afc9654 100644 --- a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart @@ -29,7 +29,7 @@ class _A {} f() { g((_A a) {}); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 42, 9)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 42, 9)], ); // The name _A is private to the library it's defined in, so this is a type // mismatch. Furthermore, the error message should mention both _A and the @@ -46,7 +46,7 @@ extension type const A(String _) {} @A(0) void f() {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 40, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 40, 1)], ); } @@ -59,7 +59,7 @@ class A { @A.fromInt('0') main() {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 49, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 49, 3)], ); } @@ -72,7 +72,7 @@ class A { @A.fromInt('0') main() { }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 55, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 55, 3)], ); } @@ -96,7 +96,7 @@ class A { @A('0') main() { }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 33, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 33, 3)], ); } @@ -109,7 +109,7 @@ class A { f(A a) { a + '0'; }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 50, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 50, 3)], ); } @@ -128,8 +128,8 @@ void f(A a, A? aq) { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 88, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 99, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 88, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 99, 1), ], ); } @@ -144,7 +144,7 @@ Predicate f() => (String s) => false; void main() { f().call(3); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 110, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 110, 1)], ); } @@ -163,7 +163,7 @@ main() { A a = new A(); a.. ma().mb(0); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 186, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 186, 1)], ); } @@ -177,12 +177,8 @@ main() { const A(42); }''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 52, 2), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 52, - 2, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 52, 2), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 52, 2), ], ); } @@ -196,7 +192,7 @@ class A { class B extends A { const B() : super(42); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 73, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 73, 2)], ); } @@ -209,7 +205,7 @@ m() { } n(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 23, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 23, 1)], ); } @@ -222,7 +218,7 @@ m() { } n(int x) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 20, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 20, 1)], ); } @@ -245,12 +241,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 13, 1), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 13, - 1, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 13, 1), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 13, 1), ], ); } @@ -296,7 +288,7 @@ class C { var g = C.new; var x = g('Hello'); ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 56, 7)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 56, 7)], ); } @@ -326,7 +318,7 @@ void f(T a) {} var g = f; var x = g('Hello'); ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 45, 7)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 45, 7)], ); } @@ -358,7 +350,7 @@ void f(Iterable Function() g, void Function(T) h) { main() { (int x) {} (''); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 23, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 23, 2)], ); } @@ -373,7 +365,7 @@ class A { n(void f(int i)) {} } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 31, 7)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 31, 7)], ); } @@ -436,7 +428,7 @@ class A { f(A a) { a['0']; }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 60, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 60, 3)], ); } @@ -453,9 +445,9 @@ f(A a) { a['0']++; }''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 103, 3), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 120, 3), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 130, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 103, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 120, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 130, 3), ], ); } @@ -469,7 +461,7 @@ class A { f(A a) { a['0'] = 0; }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 65, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 65, 3)], ); } @@ -486,9 +478,9 @@ f(A a) { a['0']++; }''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 103, 3), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 120, 3), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 130, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 103, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 120, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 130, 3), ], ); } @@ -502,7 +494,7 @@ m() { } n(int i) {} ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 24, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 24, 1)], ); } @@ -515,7 +507,7 @@ class A { f(A a) { a('0'); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 42, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 42, 3)], ); } @@ -529,7 +521,7 @@ main() { A a = new A(); a('0'); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 59, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 59, 3)], ); } @@ -539,7 +531,7 @@ main() { a(b(int p)) { b('0'); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 18, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 18, 3)], ); } @@ -551,7 +543,7 @@ class A { f(v); } }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 41, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 41, 1)], ); } @@ -563,7 +555,7 @@ void funBool(bool b) {} main() { acceptFunOptBool(funBool); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 107, 7)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 107, 7)], ); } @@ -577,7 +569,7 @@ class C { main() { acceptFunOptBool(C.funBool); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 125, 9)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 125, 9)], ); } @@ -590,7 +582,7 @@ class A { f(A a) { a.m(1); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 50, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 50, 1)], ); } @@ -601,7 +593,7 @@ f({String p = ''}) {} main() { f(p: 42); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 38, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 38, 2)], ); } @@ -612,7 +604,7 @@ f([String p = '']) {} main() { f(42); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 35, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 35, 2)], ); } @@ -623,7 +615,7 @@ f(String p) {} main() { f(42); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 28, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 28, 2)], ); } @@ -634,7 +626,7 @@ typedef A(T p); f(A a) { a('1'); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 37, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 37, 3)], ); } @@ -647,7 +639,7 @@ main() { A a = getA(); a('1'); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 69, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 69, 3)], ); } @@ -658,7 +650,7 @@ typedef A(int p); f(A a) { a('1'); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 31, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 31, 3)], ); } @@ -681,7 +673,7 @@ main() { m['x'] = 0; } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 47, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 47, 3)], ); } @@ -694,7 +686,7 @@ main() { m['x'] ??= 0; } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 47, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 47, 3)], ); } @@ -707,7 +699,7 @@ class A { main() { new A(42); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 52, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 52, 2)], ); } @@ -720,7 +712,7 @@ class A { main() { new A(42); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 53, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 53, 2)], ); } @@ -733,7 +725,7 @@ class A { main() { new A(42); }''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 46, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 46, 2)], ); } @@ -748,7 +740,7 @@ void g() { ''', [ error( - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, 44, 12, messageContains: [ @@ -775,7 +767,7 @@ main() { ''', [ error( - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, 74, 11, messageContains: ['Unexpected named argument `bb` with type `int`.'], @@ -800,7 +792,7 @@ main() { ''', [ error( - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, 74, 5, messageContains: ['Expected 2 named arguments, but got 1 instead.'], @@ -825,7 +817,7 @@ main() { ''', [ error( - CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.argumentTypeNotAssignable, 72, 9, messageContains: [ @@ -848,7 +840,7 @@ g(C c) { print(h('s')); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 99, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 99, 1)], ); } } @@ -865,7 +857,7 @@ extension type E(int i) {} dynamic a; var e = E(a); ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 49, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 49, 1)], ); } @@ -877,7 +869,7 @@ void foo(dynamic a) { f(a); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 43, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 43, 1)], ); } @@ -888,7 +880,7 @@ void foo(int i, dynamic a) { i + a; } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 35, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 35, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_to_error_handler_test.dart b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_to_error_handler_test.dart index 1f7ba4c6d36..d2b8adde870 100644 --- a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_to_error_handler_test.dart +++ b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_to_error_handler_test.dart @@ -45,7 +45,7 @@ void f(Future future, Future Function({Object a}) callback) { future.catchError(callback); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 92, 8)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 92, 8)], ); } @@ -80,13 +80,7 @@ void f(Future future) { future.catchError(({Object a = 1}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 50, - 19, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 50, 19)], ); } @@ -121,7 +115,7 @@ void f(Future future) { future.catchError(() {}); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 50, 5)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 50, 5)], ); } @@ -148,13 +142,7 @@ void f(Future future) { future.catchError((Object a, {required StackTrace b}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 50, - 38, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 50, 38)], ); } @@ -181,13 +169,7 @@ void f(Future future) { future.catchError((a, b, c) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 50, - 12, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 50, 12)], ); } @@ -198,13 +180,7 @@ void f(Future future) { future.catchError((String a) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 50, - 13, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 50, 13)], ); } @@ -215,13 +191,7 @@ void f(Future future) { future.catchError((Object a, String b) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 50, - 23, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 50, 23)], ); } @@ -232,7 +202,7 @@ void f(Future future, Future Function() callback) { future.catchError(callback); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 82, 8)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 82, 8)], ); } @@ -259,13 +229,7 @@ void f(Future future, Future Function(Object a, {StackTrace b}) callba future.catchError(callback); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 106, - 8, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 106, 8)], ); } @@ -276,7 +240,7 @@ void f(Future future, Future Function(int, int, int) callback) { future.catchError(callback); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 95, 8)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 95, 8)], ); } @@ -287,7 +251,7 @@ void f(Future future, Future Function(String) callback) { future.catchError(callback); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 88, 8)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 88, 8)], ); } @@ -298,7 +262,7 @@ void f(Future future, Future Function(Object, String) callback) { future.catchError(callback); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 96, 8)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 96, 8)], ); } } @@ -321,13 +285,7 @@ void f(Future future, Future Function({Object a}) callback) { future.then((_) {}, onError: callback); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 95, - 17, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 95, 17)], ); } @@ -338,13 +296,7 @@ void f(Future future) { future.then((_) {}, onError: ({Object a = 1}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 52, - 28, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 52, 28)], ); } @@ -363,13 +315,7 @@ void f(Future future) { future.then((_) {}, onError: () {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 52, - 14, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 52, 14)], ); } @@ -380,13 +326,7 @@ void f(Future future) { future.then((_) {}, onError: (Object a, {StackTrace? b}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 52, - 39, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 52, 39)], ); } @@ -405,13 +345,7 @@ void f(Future future) { future.then((_) {}, onError: (String a) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 52, - 22, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 52, 22)], ); } @@ -442,7 +376,7 @@ void f(Stream stream, Future Function({Object a}) callback) { stream.handleError(callback); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 94, 8)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 94, 8)], ); } @@ -453,13 +387,7 @@ void f(Stream stream) { stream.handleError(({Object a = 1}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 51, - 19, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 51, 19)], ); } @@ -478,7 +406,7 @@ void f(Stream stream) { stream.handleError(() {}); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 51, 5)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 51, 5)], ); } @@ -489,13 +417,7 @@ void f(Stream stream) { stream.handleError((Object a, {StackTrace? b}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 51, - 30, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 51, 30)], ); } @@ -514,13 +436,7 @@ void f(Stream stream) { stream.handleError((String a) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 51, - 13, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 51, 13)], ); } } @@ -543,13 +459,7 @@ void f(Stream stream, Future Function({Object a}) callback) { stream.listen((_) {}, onError: callback); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 97, - 17, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 97, 17)], ); } @@ -560,13 +470,7 @@ void f(Stream stream) { stream.listen((_) {}, onError: ({Object a = 1}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 54, - 28, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 54, 28)], ); } @@ -585,13 +489,7 @@ void f(Stream stream) { stream.listen((_) {}, onError: () {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 54, - 14, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 54, 14)], ); } @@ -602,13 +500,7 @@ void f(Stream stream) { stream.listen((_) {}, onError: (Object a, {StackTrace? b}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 54, - 39, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 54, 39)], ); } @@ -627,13 +519,7 @@ void f(Stream stream) { stream.listen((_) {}, onError: (String a) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 54, - 22, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 54, 22)], ); } } @@ -661,13 +547,7 @@ void f( subscription.onError(callback); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 144, - 8, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 144, 8)], ); } @@ -679,13 +559,7 @@ void f(StreamSubscription subscription) { subscription.onError(({Object a = 1}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 92, - 19, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 92, 19)], ); } @@ -706,7 +580,7 @@ void f(StreamSubscription subscription) { subscription.onError(() {}); } ''', - [error(WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, 92, 5)], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 92, 5)], ); } @@ -718,13 +592,7 @@ void f(StreamSubscription subscription) { subscription.onError((Object a, {StackTrace? b}) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 92, - 30, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 92, 30)], ); } @@ -745,13 +613,7 @@ void f(StreamSubscription subscription) { subscription.onError((String a) {}); } ''', - [ - error( - WarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE_TO_ERROR_HANDLER, - 92, - 13, - ), - ], + [error(WarningCode.argumentTypeNotAssignableToErrorHandler, 92, 13)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/assert_in_redirecting_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/assert_in_redirecting_constructor_test.dart index 5467d6382b2..7997a0d2e4b 100644 --- a/pkg/analyzer/test/src/diagnostics/assert_in_redirecting_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assert_in_redirecting_constructor_test.dart @@ -23,7 +23,7 @@ class A { A.name() {} } ''', - [error(CompileTimeErrorCode.ASSERT_IN_REDIRECTING_CONSTRUCTOR, 23, 13)], + [error(CompileTimeErrorCode.assertInRedirectingConstructor, 23, 13)], ); } @@ -53,7 +53,7 @@ class A { A.name() {} } ''', - [error(CompileTimeErrorCode.ASSERT_IN_REDIRECTING_CONSTRUCTOR, 36, 13)], + [error(CompileTimeErrorCode.assertInRedirectingConstructor, 36, 13)], ); } @@ -66,7 +66,7 @@ enum E { const E.name(); } ''', - [error(CompileTimeErrorCode.ASSERT_IN_REDIRECTING_CONSTRUCTOR, 37, 13)], + [error(CompileTimeErrorCode.assertInRedirectingConstructor, 37, 13)], ); } @@ -98,7 +98,7 @@ enum E { const E.name(); } ''', - [error(CompileTimeErrorCode.ASSERT_IN_REDIRECTING_CONSTRUCTOR, 50, 13)], + [error(CompileTimeErrorCode.assertInRedirectingConstructor, 50, 13)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart index 23d8babf803..c21e83c407f 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart @@ -64,7 +64,7 @@ class A { String f = A().v; ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 91, 5)], + [error(WarningCode.assignmentOfDoNotStore, 91, 5)], ); } @@ -79,7 +79,7 @@ class A { String f = A().v(); ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 89, 7)], + [error(WarningCode.assignmentOfDoNotStore, 89, 7)], ); } @@ -94,7 +94,7 @@ class A { String f = A.v; ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 98, 3)], + [error(WarningCode.assignmentOfDoNotStore, 98, 3)], ); } @@ -109,7 +109,7 @@ class A { String f = A.v(); ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 96, 5)], + [error(WarningCode.assignmentOfDoNotStore, 96, 5)], ); } @@ -129,7 +129,7 @@ class B { ''', [ error( - WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, + WarningCode.assignmentOfDoNotStore, 106, 5, messageContains: ["'v'"], @@ -152,7 +152,7 @@ class B { String f = A.v; } ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 113, 3)], + [error(WarningCode.assignmentOfDoNotStore, 113, 3)], ); } @@ -181,7 +181,7 @@ class A { final f = getV(); } ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 90, 6)], + [error(WarningCode.assignmentOfDoNotStore, 90, 6)], ); } @@ -199,7 +199,7 @@ class B { final f = A().getV(); } ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 106, 10)], + [error(WarningCode.assignmentOfDoNotStore, 106, 10)], ); } @@ -217,7 +217,7 @@ abstract class A { late String f = m.v(); } ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 126, 5)], + [error(WarningCode.assignmentOfDoNotStore, 126, 5)], ); } @@ -246,7 +246,7 @@ class A { final f = v; } ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 89, 1)], + [error(WarningCode.assignmentOfDoNotStore, 89, 1)], ); } @@ -263,8 +263,8 @@ class A { } ''', [ - error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 90, 1), - error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 95, 1), + error(WarningCode.assignmentOfDoNotStore, 90, 1), + error(WarningCode.assignmentOfDoNotStore, 95, 1), ], ); } @@ -281,7 +281,7 @@ String get v => ''; ''', [ error( - WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, + WarningCode.assignmentOfDoNotStore, 47, 1, messageContains: ["'v'"], @@ -304,7 +304,7 @@ class A{ ''', [ error( - WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, + WarningCode.assignmentOfDoNotStore, 47, 5, messageContains: ["'f'"], @@ -325,7 +325,7 @@ var c = () => _v; String v = c(); ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 82, 2)], + [error(WarningCode.assignmentOfDoNotStore, 82, 2)], ); } @@ -343,7 +343,7 @@ class A{ ''', [ error( - WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, + WarningCode.assignmentOfDoNotStore, 47, 7, messageContains: ["'v'"], @@ -370,7 +370,7 @@ class A { final f = v; } ''', - [error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 46, 1)], + [error(WarningCode.assignmentOfDoNotStore, 46, 1)], ); } @@ -388,8 +388,8 @@ class A { } ''', [ - error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 118, 1), - error(WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, 122, 1), + error(WarningCode.assignmentOfDoNotStore, 118, 1), + error(WarningCode.assignmentOfDoNotStore, 122, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_to_const_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_to_const_test.dart index 48805d86598..7bd97ce5456 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_to_const_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_to_const_test.dart @@ -24,7 +24,7 @@ class A { f() { A.v = 1; }''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_CONST, 44, 1)], + [error(CompileTimeErrorCode.assignmentToConst, 44, 1)], ); } @@ -37,7 +37,7 @@ class A { f() { A.v += 1; }''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_CONST, 44, 1)], + [error(CompileTimeErrorCode.assignmentToConst, 44, 1)], ); } @@ -49,8 +49,8 @@ f() { x = 1; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_CONST, 23, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToConst, 23, 1), ], ); } @@ -64,7 +64,7 @@ f() { print(x); } }''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_CONST, 28, 1)], + [error(CompileTimeErrorCode.assignmentToConst, 28, 1)], ); } @@ -76,8 +76,8 @@ f() { x += 1; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_CONST, 23, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToConst, 23, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_to_final_local_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_to_final_local_test.dart index d5b93dbe3b6..8ce94594480 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_to_final_local_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_to_final_local_test.dart @@ -23,8 +23,8 @@ f() { x = 1; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 23, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 23, 1), ], ); } @@ -39,7 +39,7 @@ f() { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 24, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 24, 1)], ); } @@ -52,7 +52,7 @@ f() { print(x); } }''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 28, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 28, 1)], ); } @@ -64,8 +64,8 @@ f() { x += 1; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 23, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 23, 1), ], ); } @@ -76,7 +76,7 @@ f() { f(final x) { x = 1; }''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 15, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 15, 1)], ); } @@ -101,7 +101,7 @@ class A { }); } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 65, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 65, 1)], ); } @@ -116,7 +116,7 @@ class B extends A { B(super.a) : x = (() { a = 0; }); } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 78, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 78, 1)], ); } @@ -129,7 +129,7 @@ void f() { a; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 30, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 30, 1)], ); } @@ -141,8 +141,8 @@ f() { x--; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 23, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 23, 1), ], ); } @@ -155,8 +155,8 @@ f() { x++; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 23, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 23, 1), ], ); } @@ -169,8 +169,8 @@ f() { --x; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 25, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 25, 1), ], ); } @@ -183,8 +183,8 @@ f() { ++x; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 25, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 25, 1), ], ); } @@ -197,8 +197,8 @@ f() { x--; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 23, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 23, 1), ], ); } @@ -211,8 +211,8 @@ f() { x++; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 23, 1), + error(WarningCode.unusedLocalVariable, 14, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 23, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_to_final_no_setter_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_to_final_no_setter_test.dart index 47ac2b21419..290d2563283 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_to_final_no_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_to_final_no_setter_test.dart @@ -30,10 +30,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 49, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 60, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 74, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 81, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 49, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 60, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 74, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 81, 1), ], ); } @@ -53,10 +53,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 51, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 64, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 80, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 89, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 51, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 64, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 80, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 89, 1), ], ); } @@ -76,10 +76,10 @@ void f() { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 57, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 68, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 82, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 89, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 57, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 68, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 82, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 89, 1), ], ); } @@ -99,10 +99,10 @@ class A { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 46, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 57, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 71, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 78, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 46, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 57, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 71, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 78, 1), ], ); } @@ -122,10 +122,10 @@ class A { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 53, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 64, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 78, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_NO_SETTER, 85, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 53, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 64, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 78, 1), + error(CompileTimeErrorCode.assignmentToFinalNoSetter, 85, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_to_final_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_to_final_test.dart index e7516d83e7e..78d226dc88f 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_to_final_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_to_final_test.dart @@ -60,10 +60,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 64, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 75, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 89, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 96, 1), + error(CompileTimeErrorCode.assignmentToFinal, 64, 1), + error(CompileTimeErrorCode.assignmentToFinal, 75, 1), + error(CompileTimeErrorCode.assignmentToFinal, 89, 1), + error(CompileTimeErrorCode.assignmentToFinal, 96, 1), ], ); } @@ -98,10 +98,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 64, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 75, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 89, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 96, 1), + error(CompileTimeErrorCode.assignmentToFinal, 64, 1), + error(CompileTimeErrorCode.assignmentToFinal, 75, 1), + error(CompileTimeErrorCode.assignmentToFinal, 89, 1), + error(CompileTimeErrorCode.assignmentToFinal, 96, 1), ], ); } @@ -121,10 +121,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 46, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 57, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 71, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 78, 1), + error(CompileTimeErrorCode.assignmentToFinal, 46, 1), + error(CompileTimeErrorCode.assignmentToFinal, 57, 1), + error(CompileTimeErrorCode.assignmentToFinal, 71, 1), + error(CompileTimeErrorCode.assignmentToFinal, 78, 1), ], ); } @@ -159,10 +159,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 64, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 75, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 89, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 96, 1), + error(CompileTimeErrorCode.assignmentToFinal, 64, 1), + error(CompileTimeErrorCode.assignmentToFinal, 75, 1), + error(CompileTimeErrorCode.assignmentToFinal, 89, 1), + error(CompileTimeErrorCode.assignmentToFinal, 96, 1), ], ); } @@ -182,10 +182,10 @@ void f() { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 68, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 79, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 93, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 100, 1), + error(CompileTimeErrorCode.assignmentToFinal, 68, 1), + error(CompileTimeErrorCode.assignmentToFinal, 79, 1), + error(CompileTimeErrorCode.assignmentToFinal, 93, 1), + error(CompileTimeErrorCode.assignmentToFinal, 100, 1), ], ); } @@ -220,10 +220,10 @@ void f() { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 68, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 79, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 93, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 100, 1), + error(CompileTimeErrorCode.assignmentToFinal, 68, 1), + error(CompileTimeErrorCode.assignmentToFinal, 79, 1), + error(CompileTimeErrorCode.assignmentToFinal, 93, 1), + error(CompileTimeErrorCode.assignmentToFinal, 100, 1), ], ); } @@ -258,10 +258,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 66, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 79, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 95, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 104, 1), + error(CompileTimeErrorCode.assignmentToFinal, 66, 1), + error(CompileTimeErrorCode.assignmentToFinal, 79, 1), + error(CompileTimeErrorCode.assignmentToFinal, 95, 1), + error(CompileTimeErrorCode.assignmentToFinal, 104, 1), ], ); } @@ -281,7 +281,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 96, 3)], + [error(CompileTimeErrorCode.assignmentToFinal, 96, 3)], ); } @@ -315,10 +315,10 @@ abstract class A { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 61, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 72, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 86, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 93, 1), + error(CompileTimeErrorCode.assignmentToFinal, 61, 1), + error(CompileTimeErrorCode.assignmentToFinal, 72, 1), + error(CompileTimeErrorCode.assignmentToFinal, 86, 1), + error(CompileTimeErrorCode.assignmentToFinal, 93, 1), ], ); } @@ -353,10 +353,10 @@ abstract class A { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 68, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 79, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 93, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 100, 1), + error(CompileTimeErrorCode.assignmentToFinal, 68, 1), + error(CompileTimeErrorCode.assignmentToFinal, 79, 1), + error(CompileTimeErrorCode.assignmentToFinal, 93, 1), + error(CompileTimeErrorCode.assignmentToFinal, 100, 1), ], ); } @@ -374,10 +374,10 @@ void f() { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 30, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 39, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 51, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 56, 1), + error(CompileTimeErrorCode.assignmentToFinal, 30, 1), + error(CompileTimeErrorCode.assignmentToFinal, 39, 1), + error(CompileTimeErrorCode.assignmentToFinal, 51, 1), + error(CompileTimeErrorCode.assignmentToFinal, 56, 1), ], ); } @@ -421,10 +421,10 @@ void f() { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 32, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 41, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 53, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 58, 1), + error(CompileTimeErrorCode.assignmentToFinal, 32, 1), + error(CompileTimeErrorCode.assignmentToFinal, 41, 1), + error(CompileTimeErrorCode.assignmentToFinal, 53, 1), + error(CompileTimeErrorCode.assignmentToFinal, 58, 1), ], ); } @@ -442,10 +442,10 @@ void f() { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 27, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 36, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 48, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 53, 1), + error(CompileTimeErrorCode.assignmentToFinal, 27, 1), + error(CompileTimeErrorCode.assignmentToFinal, 36, 1), + error(CompileTimeErrorCode.assignmentToFinal, 48, 1), + error(CompileTimeErrorCode.assignmentToFinal, 53, 1), ], ); } @@ -476,10 +476,10 @@ void f() { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 36, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 45, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 57, 1), - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 62, 1), + error(CompileTimeErrorCode.assignmentToFinal, 36, 1), + error(CompileTimeErrorCode.assignmentToFinal, 45, 1), + error(CompileTimeErrorCode.assignmentToFinal, 57, 1), + error(CompileTimeErrorCode.assignmentToFinal, 62, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_to_function_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_to_function_test.dart index 1692dd07b54..84c0d294cdd 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_to_function_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_to_function_test.dart @@ -22,7 +22,7 @@ f() {} main() { f = null; }''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FUNCTION, 18, 1)], + [error(CompileTimeErrorCode.assignmentToFunction, 18, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_to_method_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_to_method_test.dart index c4c20b544d0..cd37f250b18 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_to_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_to_method_test.dart @@ -34,10 +34,10 @@ void f(C c) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 94, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 107, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 121, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 134, 3), + error(CompileTimeErrorCode.assignmentToMethod, 94, 3), + error(CompileTimeErrorCode.assignmentToMethod, 107, 3), + error(CompileTimeErrorCode.assignmentToMethod, 121, 3), + error(CompileTimeErrorCode.assignmentToMethod, 134, 3), ], ); } @@ -57,10 +57,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 47, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 60, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 74, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 87, 3), + error(CompileTimeErrorCode.assignmentToMethod, 47, 3), + error(CompileTimeErrorCode.assignmentToMethod, 60, 3), + error(CompileTimeErrorCode.assignmentToMethod, 74, 3), + error(CompileTimeErrorCode.assignmentToMethod, 87, 3), ], ); } @@ -80,10 +80,10 @@ void f(A a) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 49, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 64, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 80, 3), - error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 95, 3), + error(CompileTimeErrorCode.assignmentToMethod, 49, 3), + error(CompileTimeErrorCode.assignmentToMethod, 64, 3), + error(CompileTimeErrorCode.assignmentToMethod, 80, 3), + error(CompileTimeErrorCode.assignmentToMethod, 95, 3), ], ); } @@ -103,7 +103,7 @@ extension E on C { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_METHOD, 91, 3)], + [error(CompileTimeErrorCode.assignmentToMethod, 91, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/assignment_to_type_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_to_type_test.dart index 0523204e9d9..deb772bf7a9 100644 --- a/pkg/analyzer/test/src/diagnostics/assignment_to_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/assignment_to_type_test.dart @@ -23,7 +23,7 @@ main() { C = null; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 22, 1)], + [error(CompileTimeErrorCode.assignmentToType, 22, 1)], ); } @@ -34,7 +34,7 @@ void f() { dynamic = 1; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 13, 7)], + [error(CompileTimeErrorCode.assignmentToType, 13, 7)], ); } @@ -46,7 +46,7 @@ main() { E = null; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 24, 1)], + [error(CompileTimeErrorCode.assignmentToType, 24, 1)], ); } @@ -58,7 +58,7 @@ main() { F = null; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 29, 1)], + [error(CompileTimeErrorCode.assignmentToType, 29, 1)], ); } @@ -71,7 +71,7 @@ void f() { F = null; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 37, 1)], + [error(CompileTimeErrorCode.assignmentToType, 37, 1)], ); } @@ -84,7 +84,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_TYPE, 25, 1)], + [error(CompileTimeErrorCode.assignmentToType, 25, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/async_for_in_wrong_context_test.dart b/pkg/analyzer/test/src/diagnostics/async_for_in_wrong_context_test.dart index 8689cd01753..9f692a95792 100644 --- a/pkg/analyzer/test/src/diagnostics/async_for_in_wrong_context_test.dart +++ b/pkg/analyzer/test/src/diagnostics/async_for_in_wrong_context_test.dart @@ -24,8 +24,8 @@ f(list) { } ''', [ - error(CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT, 12, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 27, 1), + error(CompileTimeErrorCode.asyncForInWrongContext, 12, 5), + error(WarningCode.unusedLocalVariable, 27, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/async_keyword_used_as_identifier_test.dart b/pkg/analyzer/test/src/diagnostics/async_keyword_used_as_identifier_test.dart index 9b7c60bb8a8..188c75a03b4 100644 --- a/pkg/analyzer/test/src/diagnostics/async_keyword_used_as_identifier_test.dart +++ b/pkg/analyzer/test/src/diagnostics/async_keyword_used_as_identifier_test.dart @@ -25,7 +25,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 5)], + [error(WarningCode.unusedLocalVariable, 32, 5)], ); } @@ -37,8 +37,8 @@ f() async { } ''', [ - error(ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, 18, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 5), + error(ParserErrorCode.asyncKeywordUsedAsIdentifier, 18, 5), + error(WarningCode.unusedLocalVariable, 18, 5), ], ); } @@ -51,8 +51,8 @@ f() async* { } ''', [ - error(ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, 19, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 5), + error(ParserErrorCode.asyncKeywordUsedAsIdentifier, 19, 5), + error(WarningCode.unusedLocalVariable, 19, 5), ], ); } @@ -65,8 +65,8 @@ f() sync* { } ''', [ - error(ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, 18, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 5), + error(ParserErrorCode.asyncKeywordUsedAsIdentifier, 18, 5), + error(WarningCode.unusedLocalVariable, 18, 5), ], ); } @@ -79,8 +79,8 @@ f() async { } ''', [ - error(ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, 18, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 5), + error(ParserErrorCode.asyncKeywordUsedAsIdentifier, 18, 5), + error(WarningCode.unusedLocalVariable, 18, 5), ], ); } @@ -93,8 +93,8 @@ f() async* { } ''', [ - error(ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, 19, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 5), + error(ParserErrorCode.asyncKeywordUsedAsIdentifier, 19, 5), + error(WarningCode.unusedLocalVariable, 19, 5), ], ); } @@ -107,8 +107,8 @@ f() sync* { } ''', [ - error(ParserErrorCode.ASYNC_KEYWORD_USED_AS_IDENTIFIER, 18, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 5), + error(ParserErrorCode.asyncKeywordUsedAsIdentifier, 18, 5), + error(WarningCode.unusedLocalVariable, 18, 5), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_extends_clause_already_present_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_extends_clause_already_present_test.dart index e122cfc9b89..b7262116f41 100644 --- a/pkg/analyzer/test/src/diagnostics/augmentation_extends_clause_already_present_test.dart +++ b/pkg/analyzer/test/src/diagnostics/augmentation_extends_clause_already_present_test.dart @@ -34,7 +34,7 @@ augment class B extends A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_EXTENDS_CLAUSE_ALREADY_PRESENT, + CompileTimeErrorCode.augmentationExtendsClauseAlreadyPresent, 35, 7, contextMessages: [message(a, 37, 1)], @@ -67,7 +67,7 @@ augment class B extends A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_EXTENDS_CLAUSE_ALREADY_PRESENT, + CompileTimeErrorCode.augmentationExtendsClauseAlreadyPresent, 35, 7, contextMessages: [message(a, 52, 1)], diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_modifier_extra_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_modifier_extra_test.dart index 1eaaff5a3cc..16e3ad33436 100644 --- a/pkg/analyzer/test/src/diagnostics/augmentation_modifier_extra_test.dart +++ b/pkg/analyzer/test/src/diagnostics/augmentation_modifier_extra_test.dart @@ -29,7 +29,7 @@ part of 'a.dart'; augment abstract class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 27, 8)], + [error(CompileTimeErrorCode.augmentationModifierExtra, 27, 8)], ); } @@ -47,8 +47,8 @@ part of 'a.dart'; augment abstract base class A {} ''', [ - error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 27, 8), - error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 36, 4), + error(CompileTimeErrorCode.augmentationModifierExtra, 27, 8), + error(CompileTimeErrorCode.augmentationModifierExtra, 36, 4), ], ); } @@ -66,7 +66,7 @@ part of 'a.dart'; augment base class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 27, 4)], + [error(CompileTimeErrorCode.augmentationModifierExtra, 27, 4)], ); } @@ -83,7 +83,7 @@ part of 'a.dart'; augment final class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 27, 5)], + [error(CompileTimeErrorCode.augmentationModifierExtra, 27, 5)], ); } @@ -100,7 +100,7 @@ part of 'a.dart'; augment interface class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 27, 9)], + [error(CompileTimeErrorCode.augmentationModifierExtra, 27, 9)], ); } @@ -117,7 +117,7 @@ part of 'a.dart'; augment mixin class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 27, 5)], + [error(CompileTimeErrorCode.augmentationModifierExtra, 27, 5)], ); } @@ -134,7 +134,7 @@ part of 'a.dart'; augment sealed class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 27, 6)], + [error(CompileTimeErrorCode.augmentationModifierExtra, 27, 6)], ); } @@ -151,7 +151,7 @@ part of 'a.dart'; augment base mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_EXTRA, 27, 4)], + [error(CompileTimeErrorCode.augmentationModifierExtra, 27, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_modifier_missing_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_modifier_missing_test.dart index 737a0ac24dc..0b2d91eef81 100644 --- a/pkg/analyzer/test/src/diagnostics/augmentation_modifier_missing_test.dart +++ b/pkg/analyzer/test/src/diagnostics/augmentation_modifier_missing_test.dart @@ -29,7 +29,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7)], + [error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7)], ); } @@ -47,8 +47,8 @@ part of 'a.dart'; augment class A {} ''', [ - error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7), - error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7), + error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7), + error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7), ], ); } @@ -66,7 +66,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7)], + [error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7)], ); } @@ -83,7 +83,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7)], + [error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7)], ); } @@ -100,7 +100,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7)], + [error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7)], ); } @@ -117,7 +117,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7)], + [error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7)], ); } @@ -134,7 +134,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7)], + [error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7)], ); } @@ -151,7 +151,7 @@ part of 'a.dart'; augment mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_MODIFIER_MISSING, 19, 7)], + [error(CompileTimeErrorCode.augmentationModifierMissing, 19, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_of_different_declaration_kind_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_of_different_declaration_kind_test.dart index 89792c4c4bb..8f006d47ed3 100644 --- a/pkg/analyzer/test/src/diagnostics/augmentation_of_different_declaration_kind_test.dart +++ b/pkg/analyzer/test/src/diagnostics/augmentation_of_different_declaration_kind_test.dart @@ -32,7 +32,7 @@ augment enum A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -55,7 +55,7 @@ augment extension A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -78,7 +78,7 @@ augment extension type A(int it) {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -101,7 +101,7 @@ augment void A() {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -124,7 +124,7 @@ augment mixin A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -147,7 +147,7 @@ augment typedef A = int; ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -170,7 +170,7 @@ augment int A = 0; ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -215,7 +215,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -242,7 +242,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -269,7 +269,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -296,7 +296,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -323,7 +323,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -386,7 +386,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -431,7 +431,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -458,7 +458,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -485,7 +485,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -512,7 +512,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -557,7 +557,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -584,7 +584,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -607,7 +607,7 @@ augment class A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -652,7 +652,7 @@ augment enum A {; ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 39, 7, ), @@ -680,7 +680,7 @@ augment enum A { ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 38, 7, ), @@ -703,7 +703,7 @@ augment class A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -726,7 +726,7 @@ augment class A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -749,7 +749,7 @@ augment class A {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -772,7 +772,7 @@ augment class foo {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -795,7 +795,7 @@ augment class foo {} ''', [ error( - CompileTimeErrorCode.AUGMENTATION_OF_DIFFERENT_DECLARATION_KIND, + CompileTimeErrorCode.augmentationOfDifferentDeclarationKind, 19, 7, ), @@ -816,7 +816,7 @@ part of 'a.dart'; augment class foo {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_bound_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_bound_test.dart index c77df5c556c..937bdc8bba4 100644 --- a/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_bound_test.dart +++ b/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_bound_test.dart @@ -29,7 +29,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_BOUND, 45, 3)], + [error(CompileTimeErrorCode.augmentationTypeParameterBound, 45, 3)], ); } @@ -46,7 +46,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_BOUND, 35, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterBound, 35, 1)], ); } @@ -77,7 +77,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_BOUND, 45, 6)], + [error(CompileTimeErrorCode.augmentationTypeParameterBound, 45, 6)], ); } @@ -94,7 +94,7 @@ part of 'a.dart'; augment enum A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_BOUND, 44, 3)], + [error(CompileTimeErrorCode.augmentationTypeParameterBound, 44, 3)], ); } @@ -111,7 +111,7 @@ part of 'a.dart'; augment extension A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_BOUND, 49, 3)], + [error(CompileTimeErrorCode.augmentationTypeParameterBound, 49, 3)], ); } @@ -128,7 +128,7 @@ part of 'a.dart'; augment extension type A(int it) {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_BOUND, 54, 3)], + [error(CompileTimeErrorCode.augmentationTypeParameterBound, 54, 3)], ); } @@ -145,7 +145,7 @@ part of 'a.dart'; augment mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_BOUND, 45, 3)], + [error(CompileTimeErrorCode.augmentationTypeParameterBound, 45, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_count_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_count_test.dart index ca52e167e45..2f3ea58a3be 100644 --- a/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_count_test.dart +++ b/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_count_test.dart @@ -29,7 +29,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 34, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 34, 1)], ); } @@ -46,7 +46,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 33, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 33, 1)], ); } @@ -77,7 +77,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 38, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 38, 1)], ); } @@ -94,7 +94,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 36, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 36, 1)], ); } @@ -115,7 +115,7 @@ augment class A { augment void foo() {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 34, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 34, 1)], ); } @@ -132,7 +132,7 @@ part of 'a.dart'; augment enum A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 33, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 33, 1)], ); } @@ -149,7 +149,7 @@ part of 'a.dart'; augment enum A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 32, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 32, 1)], ); } @@ -180,7 +180,7 @@ part of 'a.dart'; augment enum A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 37, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 37, 1)], ); } @@ -197,7 +197,7 @@ part of 'a.dart'; augment enum A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 35, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 35, 1)], ); } @@ -214,7 +214,7 @@ part of 'a.dart'; augment extension A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 38, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 38, 1)], ); } @@ -231,7 +231,7 @@ part of 'a.dart'; augment extension A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 37, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 37, 1)], ); } @@ -262,7 +262,7 @@ part of 'a.dart'; augment extension A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 42, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 42, 1)], ); } @@ -279,7 +279,7 @@ part of 'a.dart'; augment extension A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 40, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 40, 1)], ); } @@ -296,7 +296,7 @@ part of 'a.dart'; augment extension type A(int it) {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 43, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 43, 1)], ); } @@ -313,7 +313,7 @@ part of 'a.dart'; augment extension type A(int it) {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 42, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 42, 1)], ); } @@ -344,7 +344,7 @@ part of 'a.dart'; augment extension type A(int it) {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 47, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 47, 1)], ); } @@ -361,7 +361,7 @@ part of 'a.dart'; augment extension type A(int it) {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 45, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 45, 1)], ); } @@ -378,7 +378,7 @@ part of 'a.dart'; augment mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 34, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 34, 1)], ); } @@ -395,7 +395,7 @@ part of 'a.dart'; augment mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 33, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 33, 1)], ); } @@ -426,7 +426,7 @@ part of 'a.dart'; augment mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 38, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 38, 1)], ); } @@ -443,7 +443,7 @@ part of 'a.dart'; augment mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 36, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 36, 1)], ); } @@ -464,7 +464,7 @@ augment mixin A { augment void foo() {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_COUNT, 34, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterCount, 34, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_name_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_name_test.dart index e64d529b307..57a4ea890e2 100644 --- a/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_name_test.dart @@ -29,7 +29,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_NAME, 35, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterName, 35, 1)], ); } @@ -46,7 +46,7 @@ part of 'a.dart'; augment enum A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_NAME, 34, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterName, 34, 1)], ); } @@ -63,7 +63,7 @@ part of 'a.dart'; augment extension A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_NAME, 39, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterName, 39, 1)], ); } @@ -80,7 +80,7 @@ part of 'a.dart'; augment extension type A(int it) {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_NAME, 44, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterName, 44, 1)], ); } @@ -97,7 +97,7 @@ part of 'a.dart'; augment mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_TYPE_PARAMETER_NAME, 35, 1)], + [error(CompileTimeErrorCode.augmentationTypeParameterName, 35, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_without_declaration_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_without_declaration_test.dart index 855c2bb6ce2..3d30e1906e2 100644 --- a/pkg/analyzer/test/src/diagnostics/augmentation_without_declaration_test.dart +++ b/pkg/analyzer/test/src/diagnostics/augmentation_without_declaration_test.dart @@ -27,7 +27,7 @@ part of 'a.dart'; augment class A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -46,7 +46,7 @@ augment class A { augment A.named(); } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -65,7 +65,7 @@ augment class A { augment int foo = 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -84,7 +84,7 @@ augment class A { augment static int foo = 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -103,7 +103,7 @@ augment class A { augment int get foo => 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -122,7 +122,7 @@ augment class A { augment static int get foo => 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -141,7 +141,7 @@ augment class A { augment void foo() {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -160,7 +160,7 @@ augment class A { augment static void foo() {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -197,7 +197,7 @@ augment class A { augment set foo(int _) {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -216,7 +216,7 @@ augment class A { augment static set foo(int _) {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -231,7 +231,7 @@ part of 'a.dart'; augment enum A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -250,7 +250,7 @@ augment enum A {; augment const A.named(); } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -269,7 +269,7 @@ augment enum A {; augment final int foo = 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -288,7 +288,7 @@ augment enum A {; augment int get foo => 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -307,7 +307,7 @@ augment enum A {; augment void foo() {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -326,7 +326,7 @@ augment enum A {; augment set foo(int _) {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -341,7 +341,7 @@ part of 'a.dart'; augment extension A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -360,7 +360,7 @@ augment extension A { augment int get foo => 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 43, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 43, 7)], ); } @@ -379,7 +379,7 @@ augment extension A { augment void foo() {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 43, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 43, 7)], ); } @@ -398,7 +398,7 @@ augment extension A { augment set foo(int _) {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 43, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 43, 7)], ); } @@ -413,7 +413,7 @@ part of 'a.dart'; augment extension type A(int it) {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -432,7 +432,7 @@ augment extension type A(int it) { augment A.named() : this(0); } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 56, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 56, 7)], ); } @@ -451,7 +451,7 @@ augment extension type A(int it) { augment int get foo => 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 56, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 56, 7)], ); } @@ -470,7 +470,7 @@ augment extension type A(int it) { augment void foo() {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 56, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 56, 7)], ); } @@ -489,7 +489,7 @@ augment extension type A(int it) { augment set foo(int _) {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 56, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 56, 7)], ); } @@ -504,7 +504,7 @@ part of 'a.dart'; augment mixin A {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -523,7 +523,7 @@ augment mixin A { augment int foo = 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -542,7 +542,7 @@ augment mixin A { augment int get foo => 0; } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -561,7 +561,7 @@ augment mixin A { augment void foo() {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -598,7 +598,7 @@ augment mixin A { augment set foo(int _) {} } ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 39, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 39, 7)], ); } @@ -613,7 +613,7 @@ part of 'a.dart'; augment void foo() {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -642,7 +642,7 @@ part of 'a.dart'; augment int get foo => 0; ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -657,7 +657,7 @@ part of 'a.dart'; augment set foo(int _) {} ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -672,7 +672,7 @@ part of 'a.dart'; augment int foo = 0; ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } @@ -687,7 +687,7 @@ part of 'a.dart'; augment typedef A = int; ''', - [error(CompileTimeErrorCode.AUGMENTATION_WITHOUT_DECLARATION, 19, 7)], + [error(CompileTimeErrorCode.augmentationWithoutDeclaration, 19, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/await_in_late_local_variable_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/await_in_late_local_variable_initializer_test.dart index a67cb56d8c0..5cbf784e8ae 100644 --- a/pkg/analyzer/test/src/diagnostics/await_in_late_local_variable_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/await_in_late_local_variable_initializer_test.dart @@ -16,7 +16,7 @@ main() { @reflectiveTest class AwaitInLateLocalVariableInitializerTest extends PubPackageResolutionTest { static const _errorCode = - CompileTimeErrorCode.AWAIT_IN_LATE_LOCAL_VARIABLE_INITIALIZER; + CompileTimeErrorCode.awaitInLateLocalVariableInitializer; test_closure_late_await() async { await assertErrorsInCode( diff --git a/pkg/analyzer/test/src/diagnostics/await_in_wrong_context_test.dart b/pkg/analyzer/test/src/diagnostics/await_in_wrong_context_test.dart index 0df9b6b73e3..d5e0c1de77e 100644 --- a/pkg/analyzer/test/src/diagnostics/await_in_wrong_context_test.dart +++ b/pkg/analyzer/test/src/diagnostics/await_in_wrong_context_test.dart @@ -22,7 +22,7 @@ f(x) { return await x; } ''', - [error(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 16, 5)], + [error(CompileTimeErrorCode.awaitInWrongContext, 16, 5)], ); } @@ -33,7 +33,7 @@ f(x) sync* { yield await x; } ''', - [error(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 21, 5)], + [error(CompileTimeErrorCode.awaitInWrongContext, 21, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/await_of_incompatible_type_test.dart b/pkg/analyzer/test/src/diagnostics/await_of_incompatible_type_test.dart index fb2de781077..0365e9ce857 100644 --- a/pkg/analyzer/test/src/diagnostics/await_of_incompatible_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/await_of_incompatible_type_test.dart @@ -34,7 +34,7 @@ void f(A a) async { await a; } ''', - [error(CompileTimeErrorCode.AWAIT_OF_INCOMPATIBLE_TYPE, 51, 5)], + [error(CompileTimeErrorCode.awaitOfIncompatibleType, 51, 5)], ); } @@ -57,7 +57,7 @@ void f(T a) async { await a; } ''', - [error(CompileTimeErrorCode.AWAIT_OF_INCOMPATIBLE_TYPE, 72, 5)], + [error(CompileTimeErrorCode.awaitOfIncompatibleType, 72, 5)], ); } @@ -84,7 +84,7 @@ void f(T a) async { } } ''', - [error(CompileTimeErrorCode.AWAIT_OF_INCOMPATIBLE_TYPE, 80, 5)], + [error(CompileTimeErrorCode.awaitOfIncompatibleType, 80, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/base_class_implemented_outside_of_library_test.dart b/pkg/analyzer/test/src/diagnostics/base_class_implemented_outside_of_library_test.dart index f123d08fbc4..7aa8a43cb85 100644 --- a/pkg/analyzer/test/src/diagnostics/base_class_implemented_outside_of_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/base_class_implemented_outside_of_library_test.dart @@ -34,13 +34,7 @@ base class Foo {} import 'foo.dart'; base class Bar implements Foo {} ''', - [ - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 45, - 3, - ), - ], + [error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 45, 3)], ); } @@ -57,7 +51,7 @@ base class C implements B {} ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 69, 1, text: @@ -91,7 +85,7 @@ class C implements B {} ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 64, 1, text: @@ -121,13 +115,7 @@ import 'a.dart'; base class B extends A {} base class C implements B {} ''', - [ - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 67, - 1, - ), - ], + [error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 67, 1)], ); } @@ -144,7 +132,7 @@ base class Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 45, 10, ), @@ -165,7 +153,7 @@ base class Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 71, 10, ), @@ -196,7 +184,7 @@ base class C = Object with M implements B; ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 96, 1, text: @@ -232,13 +220,7 @@ base class Foo {} import 'foo.dart'; enum Bar implements Foo { bar } ''', - [ - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 39, - 3, - ), - ], + [error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 39, 3)], ); } @@ -255,7 +237,7 @@ enum Bar implements FooTypedef { bar } ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 39, 10, ), @@ -276,7 +258,7 @@ enum Bar implements FooTypedef { bar } ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 65, 10, ), @@ -301,13 +283,7 @@ base class Foo {} import 'foo.dart'; base mixin Bar implements Foo {} ''', - [ - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 45, - 3, - ), - ], + [error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 45, 3)], ); } @@ -324,7 +300,7 @@ base mixin Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 45, 10, ), @@ -345,7 +321,7 @@ base mixin Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 71, 10, ), diff --git a/pkg/analyzer/test/src/diagnostics/base_mixin_implemented_outside_of_library_test.dart b/pkg/analyzer/test/src/diagnostics/base_mixin_implemented_outside_of_library_test.dart index a7477cd9d9e..a50a028dfb9 100644 --- a/pkg/analyzer/test/src/diagnostics/base_mixin_implemented_outside_of_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/base_mixin_implemented_outside_of_library_test.dart @@ -33,13 +33,7 @@ base mixin Foo {} import 'foo.dart'; base class Bar implements Foo {} ''', - [ - error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 45, - 3, - ), - ], + [error(CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 45, 3)], ); } @@ -57,7 +51,7 @@ class C implements B {} ''', [ error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 77, 1, contextMessages: [message(a, 11, 1)], @@ -79,7 +73,7 @@ base class Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 45, 10, ), @@ -100,7 +94,7 @@ base class Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 71, 10, ), @@ -125,13 +119,7 @@ base mixin Foo {} import 'foo.dart'; enum Bar implements Foo { bar } ''', - [ - error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 39, - 3, - ), - ], + [error(CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 39, 3)], ); } @@ -148,7 +136,7 @@ enum Bar implements FooTypedef { bar } ''', [ error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 39, 10, ), @@ -169,7 +157,7 @@ enum Bar implements FooTypedef { bar } ''', [ error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 65, 10, ), @@ -194,13 +182,7 @@ base mixin Foo {} import 'foo.dart'; base mixin Bar implements Foo {} ''', - [ - error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 45, - 3, - ), - ], + [error(CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 45, 3)], ); } @@ -217,7 +199,7 @@ base mixin Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 45, 10, ), @@ -238,7 +220,7 @@ base mixin Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.BASE_MIXIN_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseMixinImplementedOutsideOfLibrary, 71, 10, ), diff --git a/pkg/analyzer/test/src/diagnostics/binary_operator_written_out_test.dart b/pkg/analyzer/test/src/diagnostics/binary_operator_written_out_test.dart index a7f245916ed..2e1ae1fc266 100644 --- a/pkg/analyzer/test/src/diagnostics/binary_operator_written_out_test.dart +++ b/pkg/analyzer/test/src/diagnostics/binary_operator_written_out_test.dart @@ -22,7 +22,7 @@ f(var x, var y) { return x and y; } ''', - [error(ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, 29, 3)], + [error(ParserErrorCode.binaryOperatorWrittenOut, 29, 3)], ); } @@ -41,7 +41,7 @@ f(var x, var y) { return x or y; } ''', - [error(ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, 29, 2)], + [error(ParserErrorCode.binaryOperatorWrittenOut, 29, 2)], ); } @@ -60,7 +60,7 @@ f(var x) { return x shl 2; } ''', - [error(ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, 22, 3)], + [error(ParserErrorCode.binaryOperatorWrittenOut, 22, 3)], ); } @@ -79,7 +79,7 @@ f(var x) { return x shr 2; } ''', - [error(ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, 22, 3)], + [error(ParserErrorCode.binaryOperatorWrittenOut, 22, 3)], ); } @@ -98,7 +98,7 @@ f(var x, var y) { return x xor y; } ''', - [error(ParserErrorCode.BINARY_OPERATOR_WRITTEN_OUT, 29, 3)], + [error(ParserErrorCode.binaryOperatorWrittenOut, 29, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_catch_error_test.dart b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_catch_error_test.dart index 90d27aadfcd..80ff3aa55b2 100644 --- a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_catch_error_test.dart +++ b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_catch_error_test.dart @@ -41,7 +41,7 @@ void f(Future future) { future.catchError(test: (_) => false, (e, st) {}); } ''', - [error(WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR, 77, 1)], + [error(WarningCode.bodyMightCompleteNormallyCatchError, 77, 1)], ); } @@ -52,7 +52,7 @@ void f(Future future) { future.catchError((e, st) {}); } ''', - [error(WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR, 57, 1)], + [error(WarningCode.bodyMightCompleteNormallyCatchError, 57, 1)], ); } @@ -63,7 +63,7 @@ void f(Future future) { future.catchError((e, st) {}); } ''', - [error(WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_CATCH_ERROR, 58, 1)], + [error(WarningCode.bodyMightCompleteNormallyCatchError, 58, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_nullable_test.dart b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_nullable_test.dart index b2d395b728b..79eba622b4b 100644 --- a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_nullable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_nullable_test.dart @@ -21,7 +21,7 @@ class BodyMightCompleteNormallyNullableTest extends PubPackageResolutionTest { import 'dart:async'; FutureOr f(Future f) async {} ''', - [error(WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE, 36, 1)], + [error(WarningCode.bodyMightCompleteNormallyNullable, 36, 1)], ); } @@ -67,7 +67,7 @@ dynamic f() {} ''' int? f() {} ''', - [error(WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE, 5, 1)], + [error(WarningCode.bodyMightCompleteNormallyNullable, 5, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart index e4a12f83765..52f58ffa157 100644 --- a/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart +++ b/pkg/analyzer/test/src/diagnostics/body_might_complete_normally_test.dart @@ -65,10 +65,10 @@ enum E { ''', [ if (!_arePatternsEnabled) ...[ - error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 28, 5), - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 40, 13), + error(CompileTimeErrorCode.bodyMightCompleteNormally, 28, 5), + error(StaticWarningCode.missingEnumConstantInSwitch, 40, 13), ] else - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 40, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 40, 6), ], ); } @@ -80,7 +80,7 @@ class A { factory A.named() {} } ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 20, 7)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 20, 7)], ); } @@ -91,7 +91,7 @@ class A { factory A() {} } ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 20, 1)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 20, 1)], ); } @@ -100,7 +100,7 @@ class A { r''' Future foo() async {} ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 12, 3)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 12, 3)], ); } @@ -109,7 +109,7 @@ Future foo() async {} r''' Future foo() {} ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 13, 3)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 13, 3)], ); } @@ -124,7 +124,7 @@ Future foo() async {} r''' int foo() {} ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 4, 3)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 4, 3)], ); } @@ -204,10 +204,10 @@ int f(Foo foo) { ''', [ if (!_arePatternsEnabled) ...[ - error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 23, 1), - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 38, 12), + error(CompileTimeErrorCode.bodyMightCompleteNormally, 23, 1), + error(StaticWarningCode.missingEnumConstantInSwitch, 38, 12), ] else - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 38, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 38, 6), ], ); } @@ -230,10 +230,10 @@ int f(E e) { ''', [ if (!_arePatternsEnabled) ...[ - error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 47, 1), - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 58, 10), + error(CompileTimeErrorCode.bodyMightCompleteNormally, 47, 1), + error(StaticWarningCode.missingEnumConstantInSwitch, 58, 10), ] else - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 58, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 58, 6), ], ); } @@ -288,10 +288,10 @@ int f(Foo? foo) { ''', [ if (!_arePatternsEnabled) ...[ - error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 23, 1), - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 39, 12), + error(CompileTimeErrorCode.bodyMightCompleteNormally, 23, 1), + error(StaticWarningCode.missingEnumConstantInSwitch, 39, 12), ] else - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 39, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 39, 6), ], ); } @@ -312,7 +312,7 @@ void f() { foo; } ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 51, 1)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 51, 1)], ); } @@ -324,7 +324,7 @@ void f() { foo; } ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 46, 1)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 46, 1)], ); } @@ -346,7 +346,7 @@ void f() { foo; } ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 37, 1)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 37, 1)], ); } @@ -384,7 +384,7 @@ class A { Future foo() async {} } ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 24, 3)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 24, 3)], ); } @@ -395,7 +395,7 @@ class A { Future foo() {} } ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 25, 3)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 25, 3)], ); } @@ -414,7 +414,7 @@ class A { int foo() {} } ''', - [error(CompileTimeErrorCode.BODY_MIGHT_COMPLETE_NORMALLY, 16, 3)], + [error(CompileTimeErrorCode.bodyMightCompleteNormally, 16, 3)], ); } @@ -500,7 +500,7 @@ class A { r''' bool set s(int value) {} ''', - [error(CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, 0, 4)], + [error(CompileTimeErrorCode.nonVoidReturnForSetter, 0, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/break_label_on_switch_member_test.dart b/pkg/analyzer/test/src/diagnostics/break_label_on_switch_member_test.dart index 5bca0607ede..5abd794db4e 100644 --- a/pkg/analyzer/test/src/diagnostics/break_label_on_switch_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/break_label_on_switch_member_test.dart @@ -27,7 +27,7 @@ void f(int x) { } } ''', - [error(CompileTimeErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, 83, 1)], + [error(CompileTimeErrorCode.breakLabelOnSwitchMember, 83, 1)], ); } @@ -44,7 +44,7 @@ void f(int x) { } } ''', - [error(CompileTimeErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, 99, 1)], + [error(CompileTimeErrorCode.breakLabelOnSwitchMember, 99, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_extension_name_test.dart b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_extension_name_test.dart index cadab5fa36f..6d76c2af007 100644 --- a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_extension_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_extension_name_test.dart @@ -20,13 +20,7 @@ class BuiltInIdentifierAsExtensionNameTest extends PubPackageResolutionTest { r''' extension as on Object {} ''', - [ - error( - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_NAME, - 10, - 2, - ), - ], + [error(CompileTimeErrorCode.builtInIdentifierAsExtensionName, 10, 2)], ); } @@ -35,13 +29,7 @@ extension as on Object {} r''' extension Function on Object {} ''', - [ - error( - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_NAME, - 10, - 8, - ), - ], + [error(CompileTimeErrorCode.builtInIdentifierAsExtensionName, 10, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_extension_type_name_test.dart b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_extension_type_name_test.dart index 2f209bc4fa2..5c0691ed166 100644 --- a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_extension_type_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_extension_type_name_test.dart @@ -21,13 +21,7 @@ class BuiltInIdentifierAsExtensionTypeNameTest r''' extension type as(int it) {} ''', - [ - error( - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_TYPE_NAME, - 15, - 2, - ), - ], + [error(CompileTimeErrorCode.builtInIdentifierAsExtensionTypeName, 15, 2)], ); } @@ -36,13 +30,7 @@ extension type as(int it) {} r''' extension type Function(int it) {} ''', - [ - error( - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_EXTENSION_TYPE_NAME, - 15, - 8, - ), - ], + [error(CompileTimeErrorCode.builtInIdentifierAsExtensionTypeName, 15, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_prefix_name_test.dart b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_prefix_name_test.dart index b0e3833c765..e509c3b49c5 100644 --- a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_prefix_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_prefix_name_test.dart @@ -21,8 +21,8 @@ class BuiltInIdentifierAsPrefixNameTest extends PubPackageResolutionTest { import 'dart:async' as abstract; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 12), - error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_PREFIX_NAME, 23, 8), + error(WarningCode.unusedImport, 7, 12), + error(CompileTimeErrorCode.builtInIdentifierAsPrefixName, 23, 8), ], ); } @@ -33,8 +33,8 @@ import 'dart:async' as abstract; import 'dart:async' as Function; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 12), - error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_PREFIX_NAME, 23, 8), + error(WarningCode.unusedImport, 7, 12), + error(CompileTimeErrorCode.builtInIdentifierAsPrefixName, 23, 8), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_type_name_test.dart b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_type_name_test.dart index 73d22078f9d..aba89c693cb 100644 --- a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_type_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_type_name_test.dart @@ -20,7 +20,7 @@ class BuiltInIdentifierAsTypeNameTest extends PubPackageResolutionTest { ''' class as {} ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 6, 2)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 6, 2)], ); } @@ -29,7 +29,7 @@ class as {} ''' class Function {} ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 6, 8)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 6, 8)], ); } @@ -40,7 +40,7 @@ enum as { v } ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 5, 2)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 5, 2)], ); } @@ -49,7 +49,7 @@ enum as { ''' mixin as {} ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 6, 2)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 6, 2)], ); } @@ -58,7 +58,7 @@ mixin as {} ''' mixin Function {} ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 6, 8)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 6, 8)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_type_parameter_name_test.dart b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_type_parameter_name_test.dart index 71d77c5d54d..185321c569b 100644 --- a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_type_parameter_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_type_parameter_name_test.dart @@ -21,13 +21,7 @@ class BuiltInIdentifierAsTypeParameterNameTest ''' class A {} ''', - [ - error( - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, - 8, - 2, - ), - ], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeParameterName, 8, 2)], ); } @@ -36,13 +30,7 @@ class A {} ''' class A {} ''', - [ - error( - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, - 8, - 8, - ), - ], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeParameterName, 8, 8)], ); } @@ -51,13 +39,7 @@ class A {} ''' extension on List {} ''', - [ - error( - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, - 11, - 2, - ), - ], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeParameterName, 11, 2)], ); } @@ -66,13 +48,7 @@ extension on List {} ''' void f() {} ''', - [ - error( - CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, - 7, - 2, - ), - ], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeParameterName, 7, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_typedef_name_test.dart b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_typedef_name_test.dart index 2b0c3346792..7a654aff8e8 100644 --- a/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_typedef_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/built_in_identifier_as_typedef_name_test.dart @@ -23,7 +23,7 @@ class A {} mixin B {} class as = A with B; ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 28, 2)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypedefName, 28, 2)], ); } @@ -33,8 +33,8 @@ class as = A with B; typedef void as(); ''', [ - error(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 13, 2), - error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 13, 2), + error(ParserErrorCode.expectedIdentifierButGotKeyword, 13, 2), + error(CompileTimeErrorCode.builtInIdentifierAsTypedefName, 13, 2), ], ); } @@ -45,8 +45,8 @@ typedef void as(); typedef void as(); ''', [ - error(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 13, 2), - error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 13, 2), + error(ParserErrorCode.expectedIdentifierButGotKeyword, 13, 2), + error(CompileTimeErrorCode.builtInIdentifierAsTypedefName, 13, 2), ], ); } @@ -57,8 +57,8 @@ typedef void as(); typedef as = void Function(); ''', [ - error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 8, 2), - error(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 8, 2), + error(CompileTimeErrorCode.builtInIdentifierAsTypedefName, 8, 2), + error(ParserErrorCode.expectedIdentifierButGotKeyword, 8, 2), ], ); } @@ -69,8 +69,8 @@ typedef as = void Function(); typedef as = List; ''', [ - error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 8, 2), - error(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 8, 2), + error(CompileTimeErrorCode.builtInIdentifierAsTypedefName, 8, 2), + error(ParserErrorCode.expectedIdentifierButGotKeyword, 8, 2), ], ); } @@ -81,8 +81,8 @@ typedef as = List; typedef Function = List; ''', [ - error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 8, 8), - error(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 8, 8), + error(CompileTimeErrorCode.builtInIdentifierAsTypedefName, 8, 8), + error(ParserErrorCode.expectedIdentifierButGotKeyword, 8, 8), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/case_expression_type_implements_equals_test.dart b/pkg/analyzer/test/src/diagnostics/case_expression_type_implements_equals_test.dart index 593ccca0665..df86a77cfec 100644 --- a/pkg/analyzer/test/src/diagnostics/case_expression_type_implements_equals_test.dart +++ b/pkg/analyzer/test/src/diagnostics/case_expression_type_implements_equals_test.dart @@ -76,7 +76,7 @@ void f(e) { case _Variants.nullSafe: expectedErrors = [ error( - CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, + CompileTimeErrorCode.caseExpressionTypeImplementsEquals, 150, 10, ), diff --git a/pkg/analyzer/test/src/diagnostics/case_expression_type_is_not_switch_expression_subtype_test.dart b/pkg/analyzer/test/src/diagnostics/case_expression_type_is_not_switch_expression_subtype_test.dart index 573308ada67..9d81b118e0d 100644 --- a/pkg/analyzer/test/src/diagnostics/case_expression_type_is_not_switch_expression_subtype_test.dart +++ b/pkg/analyzer/test/src/diagnostics/case_expression_type_is_not_switch_expression_subtype_test.dart @@ -45,24 +45,22 @@ mixin CaseExpressionTypeIsNotSwitchExpressionSubtypeTestCases case _Variant.nullSafe: expectedErrors = [ error( - CompileTimeErrorCode - .CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE, + CompileTimeErrorCode.caseExpressionTypeIsNotSwitchExpressionSubtype, 180, 2, ), error( - CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, + CompileTimeErrorCode.caseExpressionTypeImplementsEquals, 180, 2, ), error( - CompileTimeErrorCode - .CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE, + CompileTimeErrorCode.caseExpressionTypeIsNotSwitchExpressionSubtype, 206, 10, ), error( - CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, + CompileTimeErrorCode.caseExpressionTypeImplementsEquals, 206, 10, ), @@ -101,22 +99,20 @@ void f(A e) { case _Variant.nullSafe: expectedErrors = [ error( - CompileTimeErrorCode - .CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE, + CompileTimeErrorCode.caseExpressionTypeIsNotSwitchExpressionSubtype, 145, 2, ), error( - CompileTimeErrorCode - .CASE_EXPRESSION_TYPE_IS_NOT_SWITCH_EXPRESSION_SUBTYPE, + CompileTimeErrorCode.caseExpressionTypeIsNotSwitchExpressionSubtype, 171, 10, ), ]; case _Variant.patterns: expectedErrors = [ - error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 145, 2), - error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 171, 10), + error(WarningCode.constantPatternNeverMatchesValueType, 145, 2), + error(WarningCode.constantPatternNeverMatchesValueType, 171, 10), ]; } diff --git a/pkg/analyzer/test/src/diagnostics/cast_from_null_always_fails_test.dart b/pkg/analyzer/test/src/diagnostics/cast_from_null_always_fails_test.dart index a872b784801..6a3517df064 100644 --- a/pkg/analyzer/test/src/diagnostics/cast_from_null_always_fails_test.dart +++ b/pkg/analyzer/test/src/diagnostics/cast_from_null_always_fails_test.dart @@ -22,7 +22,7 @@ void f(Null n, num m) { (m as int) = n; } ''', - [error(WarningCode.CAST_FROM_NULL_ALWAYS_FAILS, 27, 8)], + [error(WarningCode.castFromNullAlwaysFails, 27, 8)], ); } @@ -33,7 +33,7 @@ void f(Null n, num? m) { (m as int?) = n; } ''', - [error(WarningCode.UNNECESSARY_CAST_PATTERN, 30, 2)], + [error(WarningCode.unnecessaryCastPattern, 30, 2)], ); } @@ -60,7 +60,7 @@ void f(Null n) { n as Never; } ''', - [error(WarningCode.CAST_FROM_NULL_ALWAYS_FAILS, 19, 10)], + [error(WarningCode.castFromNullAlwaysFails, 19, 10)], ); } @@ -71,7 +71,7 @@ void f(Null n) { n as int; } ''', - [error(WarningCode.CAST_FROM_NULL_ALWAYS_FAILS, 19, 8)], + [error(WarningCode.castFromNullAlwaysFails, 19, 8)], ); } @@ -82,7 +82,7 @@ void f(Null n) { n as T; } ''', - [error(WarningCode.CAST_FROM_NULL_ALWAYS_FAILS, 37, 6)], + [error(WarningCode.castFromNullAlwaysFails, 37, 6)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/cast_to_non_type_test.dart b/pkg/analyzer/test/src/diagnostics/cast_to_non_type_test.dart index 8b72aa6f8f8..aaee956d0e5 100644 --- a/pkg/analyzer/test/src/diagnostics/cast_to_non_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/cast_to_non_type_test.dart @@ -21,8 +21,8 @@ class CastToNonTypeTest extends PubPackageResolutionTest { var A = 0; f(String s) { var x = s as A; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1), - error(CompileTimeErrorCode.CAST_TO_NON_TYPE, 38, 1), + error(WarningCode.unusedLocalVariable, 29, 1), + error(CompileTimeErrorCode.castToNonType, 38, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/class_instantiation_access_to_member_test.dart b/pkg/analyzer/test/src/diagnostics/class_instantiation_access_to_member_test.dart index 31a1bf666b3..da7b78b3a39 100644 --- a/pkg/analyzer/test/src/diagnostics/class_instantiation_access_to_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/class_instantiation_access_to_member_test.dart @@ -29,7 +29,7 @@ var x = TA.i; ''', [ error( - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_INSTANCE_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToInstanceMember, 60, 9, ), @@ -50,7 +50,7 @@ var x = A.i; ''', [ error( - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_UNKNOWN_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToUnknownMember, 63, 8, ), @@ -69,7 +69,7 @@ var x = A.i; ''', [ error( - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_INSTANCE_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToInstanceMember, 37, 8, ), @@ -90,7 +90,7 @@ void foo() { ''', [ error( - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_INSTANCE_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToInstanceMember, 53, 8, ), @@ -109,7 +109,7 @@ var x = A.i; ''', [ error( - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToStaticMember, 44, 8, ), @@ -130,7 +130,7 @@ void bar() { ''', [ error( - CompileTimeErrorCode.CLASS_INSTANTIATION_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.classInstantiationAccessToStaticMember, 60, 8, ), @@ -147,7 +147,7 @@ class A { var x = A.; ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 42, 1)], + [error(ParserErrorCode.missingIdentifier, 42, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/class_used_as_mixin_test.dart b/pkg/analyzer/test/src/diagnostics/class_used_as_mixin_test.dart index 7c98754c321..ea331389737 100644 --- a/pkg/analyzer/test/src/diagnostics/class_used_as_mixin_test.dart +++ b/pkg/analyzer/test/src/diagnostics/class_used_as_mixin_test.dart @@ -22,7 +22,7 @@ class Bar with Comparable { int compareTo(int x) => 0; } ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 15, 15)], + [error(CompileTimeErrorCode.classUsedAsMixin, 15, 15)], ); } @@ -41,7 +41,7 @@ class Bar with Comparable { class Foo {} class Bar with Foo {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 28, 3)], + [error(CompileTimeErrorCode.classUsedAsMixin, 28, 3)], ); } @@ -70,7 +70,7 @@ class Foo {} import 'foo.dart'; class Bar with Foo {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 34, 3)], + [error(CompileTimeErrorCode.classUsedAsMixin, 34, 3)], ); } @@ -97,7 +97,7 @@ class Foo {} import 'foo.dart'; class Bar with Foo {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 50, 3)], + [error(CompileTimeErrorCode.classUsedAsMixin, 50, 3)], ); } @@ -123,7 +123,7 @@ typedef FooTypedef = Foo; import 'foo.dart'; class Bar with FooTypedef {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 34, 10)], + [error(CompileTimeErrorCode.classUsedAsMixin, 34, 10)], ); } @@ -163,7 +163,7 @@ import 'foo.dart'; typedef FooTypedef = Foo; class Bar with FooTypedef {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 60, 10)], + [error(CompileTimeErrorCode.classUsedAsMixin, 60, 10)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/concrete_class_has_enum_superinterface_test.dart b/pkg/analyzer/test/src/diagnostics/concrete_class_has_enum_superinterface_test.dart index b6662c00b3c..83664474339 100644 --- a/pkg/analyzer/test/src/diagnostics/concrete_class_has_enum_superinterface_test.dart +++ b/pkg/analyzer/test/src/diagnostics/concrete_class_has_enum_superinterface_test.dart @@ -27,13 +27,7 @@ abstract class A implements Enum {} ''' class A implements Enum {} ''', - [ - error( - CompileTimeErrorCode.CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE, - 19, - 4, - ), - ], + [error(CompileTimeErrorCode.concreteClassHasEnumSuperinterface, 19, 4)], ); } @@ -43,13 +37,7 @@ class A implements Enum {} abstract class A implements Enum {} class B implements A {} ''', - [ - error( - CompileTimeErrorCode.CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE, - 42, - 1, - ), - ], + [error(CompileTimeErrorCode.concreteClassHasEnumSuperinterface, 42, 1)], ); } @@ -59,13 +47,7 @@ class B implements A {} class M {} class A = Object with M implements Enum; ''', - [ - error( - CompileTimeErrorCode.CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE, - 46, - 4, - ), - ], + [error(CompileTimeErrorCode.concreteClassHasEnumSuperinterface, 46, 4)], ); } @@ -76,13 +58,7 @@ mixin M {} abstract class A implements Enum {} class B = Object with M implements A; ''', - [ - error( - CompileTimeErrorCode.CONCRETE_CLASS_HAS_ENUM_SUPERINTERFACE, - 53, - 1, - ), - ], + [error(CompileTimeErrorCode.concreteClassHasEnumSuperinterface, 53, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/concrete_class_with_abstract_member_test.dart b/pkg/analyzer/test/src/diagnostics/concrete_class_with_abstract_member_test.dart index eb1215a92f7..8fa67bbeeab 100644 --- a/pkg/analyzer/test/src/diagnostics/concrete_class_with_abstract_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/concrete_class_with_abstract_member_test.dart @@ -24,7 +24,7 @@ class A { ''', [ error( - CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, + CompileTimeErrorCode.concreteClassWithAbstractMember, 12, 16, text: "'x' must have a method body because 'A' isn't abstract.", @@ -42,7 +42,7 @@ class A { ''', [ error( - CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, + CompileTimeErrorCode.concreteClassWithAbstractMember, 12, 22, text: "'x' must have a method body because 'A' isn't abstract.", @@ -57,7 +57,7 @@ class A { class A { m(); }''', - [error(CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, 12, 4)], + [error(CompileTimeErrorCode.concreteClassWithAbstractMember, 12, 4)], ); } @@ -86,7 +86,7 @@ class I { class A implements I { m(); }''', - [error(CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, 62, 4)], + [error(CompileTimeErrorCode.concreteClassWithAbstractMember, 62, 4)], ); } @@ -99,7 +99,7 @@ class A { ''', [ error( - CompileTimeErrorCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, + CompileTimeErrorCode.concreteClassWithAbstractMember, 12, 13, text: "'s' must have a method body because 'A' isn't abstract.", diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_constructor_and_static_field_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_constructor_and_static_field_test.dart index 32a9c3d8526..759f4eb7387 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_constructor_and_static_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_constructor_and_static_field_test.dart @@ -33,13 +33,7 @@ class C { static int foo = 0; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD, - 14, - 3, - ), - ], + [error(CompileTimeErrorCode.conflictingConstructorAndStaticField, 14, 3)], ); } @@ -53,7 +47,7 @@ class C { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_GETTER, + CompileTimeErrorCode.conflictingConstructorAndStaticGetter, 14, 3, ), @@ -72,7 +66,7 @@ class C { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_GETTER, + CompileTimeErrorCode.conflictingConstructorAndStaticGetter, 14, 3, ), @@ -101,7 +95,7 @@ class C { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_SETTER, + CompileTimeErrorCode.conflictingConstructorAndStaticSetter, 14, 3, ), @@ -117,13 +111,7 @@ enum E { const E.foo(); } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD, - 32, - 3, - ), - ], + [error(CompileTimeErrorCode.conflictingConstructorAndStaticField, 32, 3)], ); } @@ -146,13 +134,7 @@ enum E { static int foo = 0; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD, - 30, - 3, - ), - ], + [error(CompileTimeErrorCode.conflictingConstructorAndStaticField, 30, 3)], ); } @@ -167,7 +149,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_GETTER, + CompileTimeErrorCode.conflictingConstructorAndStaticGetter, 30, 3, ), @@ -186,7 +168,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_SETTER, + CompileTimeErrorCode.conflictingConstructorAndStaticSetter, 30, 3, ), @@ -209,13 +191,7 @@ extension type A.foo(int it) { static int foo = 0; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD, - 17, - 3, - ), - ], + [error(CompileTimeErrorCode.conflictingConstructorAndStaticField, 17, 3)], ); } @@ -227,13 +203,7 @@ extension type A(int it) { static int foo = 0; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_FIELD, - 31, - 3, - ), - ], + [error(CompileTimeErrorCode.conflictingConstructorAndStaticField, 31, 3)], ); } @@ -246,7 +216,7 @@ extension type A.foo(int it) { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_GETTER, + CompileTimeErrorCode.conflictingConstructorAndStaticGetter, 17, 3, ), @@ -263,7 +233,7 @@ extension type A.foo(int it) { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_SETTER, + CompileTimeErrorCode.conflictingConstructorAndStaticSetter, 17, 3, ), diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_constructor_and_static_method_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_constructor_and_static_method_test.dart index cf5758a665d..a4accf791c1 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_constructor_and_static_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_constructor_and_static_method_test.dart @@ -46,7 +46,7 @@ class C { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD, + CompileTimeErrorCode.conflictingConstructorAndStaticMethod, 14, 3, ), @@ -75,7 +75,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD, + CompileTimeErrorCode.conflictingConstructorAndStaticMethod, 30, 3, ), @@ -100,7 +100,7 @@ extension type A.foo(int it) { ''', [ error( - CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_AND_STATIC_METHOD, + CompileTimeErrorCode.conflictingConstructorAndStaticMethod, 17, 3, ), diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_field_and_method_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_field_and_method_test.dart index f0ac4244646..b57e84025df 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_field_and_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_field_and_method_test.dart @@ -25,7 +25,7 @@ class B extends A { int foo = 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 49, 3)], + [error(CompileTimeErrorCode.conflictingFieldAndMethod, 49, 3)], ); } @@ -39,7 +39,7 @@ class B extends A { get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 49, 3)], + [error(CompileTimeErrorCode.conflictingFieldAndMethod, 49, 3)], ); } @@ -66,7 +66,7 @@ augment class B { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 47, 3), + error(CompileTimeErrorCode.conflictingFieldAndMethod, 47, 3), ]); } @@ -91,7 +91,7 @@ augment class B extends A {} '''); await assertErrorsInFile2(a, [ - error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 65, 3), + error(CompileTimeErrorCode.conflictingFieldAndMethod, 65, 3), ]); await assertErrorsInFile2(b, []); @@ -107,7 +107,7 @@ class B extends A { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 49, 3)], + [error(CompileTimeErrorCode.conflictingFieldAndMethod, 49, 3)], ); } @@ -123,7 +123,7 @@ enum E with M { final int foo = 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 62, 3)], + [error(CompileTimeErrorCode.conflictingFieldAndMethod, 62, 3)], ); } @@ -139,7 +139,7 @@ enum E with M { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 60, 3)], + [error(CompileTimeErrorCode.conflictingFieldAndMethod, 60, 3)], ); } @@ -166,7 +166,7 @@ augment enum E {; await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 47, 3), + error(CompileTimeErrorCode.conflictingFieldAndMethod, 47, 3), ]); } @@ -192,7 +192,7 @@ augment enum E with M {} '''); await assertErrorsInFile2(a, [ - error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 69, 3), + error(CompileTimeErrorCode.conflictingFieldAndMethod, 69, 3), ]); await assertErrorsInFile2(b, []); @@ -210,7 +210,7 @@ enum E with M { set foo(int _) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 56, 3)], + [error(CompileTimeErrorCode.conflictingFieldAndMethod, 56, 3)], ); } @@ -261,7 +261,7 @@ augment mixin B { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 47, 3), + error(CompileTimeErrorCode.conflictingFieldAndMethod, 47, 3), ]); } @@ -286,7 +286,7 @@ augment mixin B on A {} '''); await assertErrorsInFile2(a, [ - error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 65, 3), + error(CompileTimeErrorCode.conflictingFieldAndMethod, 65, 3), ]); await assertErrorsInFile2(b, []); diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_generic_interfaces_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_generic_interfaces_test.dart index 94e25cb9dec..6f31a4f65b2 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_generic_interfaces_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_generic_interfaces_test.dart @@ -34,7 +34,7 @@ class B extends A {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(testFile, [ - error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 65, 1), + error(CompileTimeErrorCode.conflictingGenericInterfaces, 65, 1), ]); } @@ -46,7 +46,7 @@ class A implements I {} class B implements I {} class C extends A implements B {} ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 81, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 81, 1)], ); } @@ -67,7 +67,7 @@ class A implements I {} class B implements I {} class C extends A implements B {} ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 79, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 79, 1)], ); } @@ -79,7 +79,7 @@ class B implements A {} class C implements A {} class D extends B implements C {} ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 85, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 85, 1)], ); } @@ -91,7 +91,7 @@ class A implements I {} mixin B implements I {} class C extends A with B {} ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 81, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 81, 1)], ); } @@ -115,7 +115,7 @@ typedef A = I; mixin M implements I {} class C = A with M; ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 72, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 72, 1)], ); } @@ -136,7 +136,7 @@ class A implements I {} mixin M implements I {} class C = A with M; ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 81, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 81, 1)], ); } @@ -150,7 +150,7 @@ enum E implements A, B { v } ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 80, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 80, 1)], ); } @@ -164,7 +164,7 @@ enum E with M1, M2 { v } ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 82, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 82, 1)], ); } @@ -177,9 +177,9 @@ class B implements I {} extension type C(Never it) implements A, B {} ''', [ - error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 87, 1), + error(CompileTimeErrorCode.conflictingGenericInterfaces, 87, 1), error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_TYPE_BOTTOM, + CompileTimeErrorCode.extensionTypeRepresentationTypeBottom, 89, 5, ), @@ -195,7 +195,7 @@ class A implements I {} class B implements I {} mixin M on A implements B {} ''', - [error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 81, 1)], + [error(CompileTimeErrorCode.conflictingGenericInterfaces, 81, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_inherited_method_and_setter_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_inherited_method_and_setter_test.dart index 9c88040e3eb..1d6bae8ce04 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_inherited_method_and_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_inherited_method_and_setter_test.dart @@ -30,7 +30,7 @@ abstract class C implements A, B { set foo(int _) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 103, 3)], + [error(CompileTimeErrorCode.conflictingFieldAndMethod, 103, 3)], ); } @@ -49,7 +49,7 @@ abstract class C implements A, B {} ''', [ error( - CompileTimeErrorCode.CONFLICTING_INHERITED_METHOD_AND_SETTER, + CompileTimeErrorCode.conflictingInheritedMethodAndSetter, 77, 1, contextMessages: [message(testFile, 17, 3), message(testFile, 45, 3)], @@ -73,7 +73,7 @@ abstract class C with A implements B {} ''', [ error( - CompileTimeErrorCode.CONFLICTING_INHERITED_METHOD_AND_SETTER, + CompileTimeErrorCode.conflictingInheritedMethodAndSetter, 77, 1, contextMessages: [message(testFile, 17, 3), message(testFile, 45, 3)], @@ -97,7 +97,7 @@ abstract class C extends A implements B {} ''', [ error( - CompileTimeErrorCode.CONFLICTING_INHERITED_METHOD_AND_SETTER, + CompileTimeErrorCode.conflictingInheritedMethodAndSetter, 77, 1, contextMessages: [message(testFile, 17, 3), message(testFile, 45, 3)], @@ -121,7 +121,7 @@ abstract class C extends A with B {} ''', [ error( - CompileTimeErrorCode.CONFLICTING_INHERITED_METHOD_AND_SETTER, + CompileTimeErrorCode.conflictingInheritedMethodAndSetter, 77, 1, contextMessages: [message(testFile, 17, 3), message(testFile, 45, 3)], @@ -145,7 +145,7 @@ extension type C(Object? it) implements A, B {} ''', [ error( - CompileTimeErrorCode.CONFLICTING_INHERITED_METHOD_AND_SETTER, + CompileTimeErrorCode.conflictingInheritedMethodAndSetter, 119, 1, contextMessages: [message(testFile, 38, 3), message(testFile, 87, 3)], diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_method_and_field_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_method_and_field_test.dart index b65d21fba42..6dd9002538d 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_method_and_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_method_and_field_test.dart @@ -25,7 +25,7 @@ class B extends A { foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 49, 3)], + [error(CompileTimeErrorCode.conflictingMethodAndField, 49, 3)], ); } @@ -39,7 +39,7 @@ class B extends A { foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 50, 3)], + [error(CompileTimeErrorCode.conflictingMethodAndField, 50, 3)], ); } @@ -66,7 +66,7 @@ augment class B { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 44, 3), + error(CompileTimeErrorCode.conflictingMethodAndField, 44, 3), ]); } @@ -91,7 +91,7 @@ augment class B {} '''); await assertErrorsInFile2(a, [ - error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 76, 3), + error(CompileTimeErrorCode.conflictingMethodAndField, 76, 3), ]); await assertErrorsInFile2(b, []); @@ -107,7 +107,7 @@ class B extends A { foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 50, 3)], + [error(CompileTimeErrorCode.conflictingMethodAndField, 50, 3)], ); } @@ -123,7 +123,7 @@ enum E with M { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 61, 3)], + [error(CompileTimeErrorCode.conflictingMethodAndField, 61, 3)], ); } @@ -150,7 +150,7 @@ augment enum E {; await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 44, 3), + error(CompileTimeErrorCode.conflictingMethodAndField, 44, 3), ]); } @@ -176,7 +176,7 @@ augment enum E {} '''); await assertErrorsInFile2(a, [ - error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 77, 3), + error(CompileTimeErrorCode.conflictingMethodAndField, 77, 3), ]); await assertErrorsInFile2(b, []); @@ -194,7 +194,7 @@ enum E with M { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_METHOD_AND_FIELD, 61, 3)], + [error(CompileTimeErrorCode.conflictingMethodAndField, 61, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_static_and_instance_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_static_and_instance_test.dart index 4a3816ed4b0..5e379b7dcfc 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_static_and_instance_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_static_and_instance_test.dart @@ -26,7 +26,7 @@ class C { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 40, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 40, 3)], ); } @@ -42,7 +42,7 @@ augment class A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 61, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 61, 3)], ); } @@ -54,7 +54,7 @@ class C { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 27, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 27, 3)], ); } @@ -66,7 +66,7 @@ class C { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 27, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 27, 3)], ); } @@ -78,7 +78,7 @@ class C { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 27, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 27, 3)], ); } @@ -90,7 +90,7 @@ class C { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 24, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 24, 3)], ); } @@ -102,7 +102,7 @@ class C { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 24, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 24, 3)], ); } @@ -118,7 +118,7 @@ augment class A { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 24, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 24, 3)], ); } @@ -130,7 +130,7 @@ class C { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 24, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 24, 3)], ); } @@ -142,7 +142,7 @@ class C { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 23, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 23, 3)], ); } @@ -154,7 +154,7 @@ class C { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 23, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 23, 3)], ); } @@ -166,7 +166,7 @@ class C { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 23, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 23, 3)], ); } @@ -180,7 +180,7 @@ abstract class B implements A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 81, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 81, 3)], ); } @@ -194,7 +194,7 @@ abstract class B implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 78, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 78, 3)], ); } @@ -208,7 +208,7 @@ abstract class B implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 74, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 74, 3)], ); } @@ -222,7 +222,7 @@ abstract class B implements A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 73, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 73, 3)], ); } @@ -236,7 +236,7 @@ abstract class B implements A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 77, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 77, 3)], ); } @@ -250,7 +250,7 @@ abstract class B implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 74, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 74, 3)], ); } @@ -264,7 +264,7 @@ abstract class B implements A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 73, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 73, 3)], ); } @@ -278,7 +278,7 @@ class B extends Object with A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 81, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 81, 3)], ); } @@ -292,7 +292,7 @@ class B extends Object with A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 78, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 78, 3)], ); } @@ -306,7 +306,7 @@ class B extends Object with A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 74, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 74, 3)], ); } @@ -322,7 +322,7 @@ augment mixin A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 61, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 61, 3)], ); } @@ -336,7 +336,7 @@ class B extends Object with A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 73, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 73, 3)], ); } @@ -350,7 +350,7 @@ class B extends Object with A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 77, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 77, 3)], ); } @@ -364,7 +364,7 @@ class B extends Object with A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 74, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 74, 3)], ); } @@ -378,7 +378,7 @@ class B extends Object with A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 73, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 73, 3)], ); } @@ -394,7 +394,7 @@ augment mixin A { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 24, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 24, 3)], ); } @@ -405,7 +405,7 @@ class A { static String runtimeType() => 'x'; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 26, 11)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 26, 11)], ); } @@ -416,7 +416,7 @@ class A { static String toString() => 'x'; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 26, 8)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 26, 8)], ); } @@ -430,7 +430,7 @@ class B extends A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 69, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 69, 3)], ); } @@ -444,7 +444,7 @@ class B extends A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 66, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 66, 3)], ); } @@ -458,7 +458,7 @@ class B extends A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 66, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 66, 3)], ); } @@ -472,7 +472,7 @@ class B extends A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 62, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 62, 3)], ); } @@ -486,7 +486,7 @@ class B extends A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 61, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 61, 3)], ); } @@ -500,7 +500,7 @@ class B extends A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 65, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 65, 3)], ); } @@ -514,7 +514,7 @@ class B extends A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 62, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 62, 3)], ); } @@ -528,7 +528,7 @@ class B extends A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 61, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 61, 3)], ); } } @@ -542,7 +542,7 @@ enum E { a, hashCode, b } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 14, 8)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 14, 8)], ); } @@ -553,7 +553,7 @@ enum E { a, index, b } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 14, 5)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 14, 5)], ); } @@ -565,7 +565,7 @@ enum E { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 11, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 11, 3)], ); } @@ -576,7 +576,7 @@ enum E { a, noSuchMethod, b } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 14, 12)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 14, 12)], ); } @@ -587,7 +587,7 @@ enum E { a, runtimeType, b } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 14, 11)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 14, 11)], ); } @@ -599,7 +599,7 @@ enum E { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 11, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 11, 3)], ); } @@ -610,7 +610,7 @@ enum E { a, toString, b } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 14, 8)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 14, 8)], ); } @@ -622,7 +622,7 @@ enum E { static final int hashCode = 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 33, 8)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 33, 8)], ); } @@ -638,7 +638,7 @@ enum E with M { static final int foo = 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 73, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 73, 3)], ); } @@ -654,7 +654,7 @@ enum E with M { static final int foo = 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 69, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 69, 3)], ); } @@ -670,7 +670,7 @@ enum E with M { static final int foo = 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 73, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 73, 3)], ); } @@ -682,7 +682,7 @@ enum E { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 11, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 11, 3)], ); } @@ -695,7 +695,7 @@ enum E { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 33, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 33, 3)], ); } @@ -708,7 +708,7 @@ enum E { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 33, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 33, 3)], ); } @@ -721,7 +721,7 @@ enum E { set foo(int _) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 33, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 33, 3)], ); } @@ -733,7 +733,7 @@ enum E { static int hashCode() => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 27, 8)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 27, 8)], ); } @@ -749,7 +749,7 @@ enum E with M { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 68, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 68, 3)], ); } @@ -765,7 +765,7 @@ enum E with M { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 64, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 64, 3)], ); } @@ -781,7 +781,7 @@ enum E with M { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 68, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 68, 3)], ); } @@ -794,7 +794,7 @@ enum E { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 31, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 31, 3)], ); } @@ -807,7 +807,7 @@ enum E { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 28, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 28, 3)], ); } @@ -820,7 +820,7 @@ enum E { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 28, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 28, 3)], ); } @@ -833,7 +833,7 @@ enum E { set foo(int _) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 28, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 28, 3)], ); } @@ -846,7 +846,7 @@ enum E { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 27, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 27, 3)], ); } } @@ -862,7 +862,7 @@ extension type A(int it) { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 44, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 44, 3)], ); } @@ -874,7 +874,7 @@ extension type A(int t) { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 43, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 43, 3)], ); } @@ -886,7 +886,7 @@ extension type A(int it) { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 44, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 44, 3)], ); } @@ -898,7 +898,7 @@ extension type A(int it) { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 41, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 41, 3)], ); } @@ -910,7 +910,7 @@ extension type A(int it) { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 41, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 41, 3)], ); } @@ -922,7 +922,7 @@ extension type A(int it) { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 41, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 41, 3)], ); } @@ -934,7 +934,7 @@ extension type A(int it) { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 40, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 40, 3)], ); } @@ -946,7 +946,7 @@ extension type A(int it) { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 40, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 40, 3)], ); } @@ -958,7 +958,7 @@ extension type A(int it) { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 40, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 40, 3)], ); } @@ -973,7 +973,7 @@ extension type B(int it) implements A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 107, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 107, 3)], ); } @@ -988,7 +988,7 @@ extension type B(int it) implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 104, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 104, 3)], ); } @@ -1003,7 +1003,7 @@ extension type B(int it) implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 104, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 104, 3)], ); } @@ -1018,7 +1018,7 @@ extension type B(int it) implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 100, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 100, 3)], ); } @@ -1033,7 +1033,7 @@ extension type B(int it) implements A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 99, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 99, 3)], ); } @@ -1048,7 +1048,7 @@ extension type B(int it) implements A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 103, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 103, 3)], ); } @@ -1063,7 +1063,7 @@ extension type B(int it) implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 100, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 100, 3)], ); } @@ -1078,7 +1078,7 @@ extension type B(int it) implements A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 99, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 99, 3)], ); } } @@ -1092,7 +1092,7 @@ mixin M on Enum { static int index = 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 31, 5)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 31, 5)], ); } @@ -1103,7 +1103,7 @@ mixin M on Enum { static int get index => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 35, 5)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 35, 5)], ); } @@ -1114,7 +1114,7 @@ mixin M on Enum { static int index() => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 31, 5)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 31, 5)], ); } @@ -1125,7 +1125,7 @@ mixin M on Enum { static set index(int _) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 31, 5)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 31, 5)], ); } @@ -1136,7 +1136,7 @@ mixin M { static String runtimeType() => 'x'; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 26, 11)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 26, 11)], ); } @@ -1147,7 +1147,7 @@ mixin M { static String toString() => 'x'; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 26, 8)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 26, 8)], ); } @@ -1161,7 +1161,7 @@ mixin M on A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 64, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 64, 3)], ); } @@ -1175,7 +1175,7 @@ mixin M on A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 61, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 61, 3)], ); } @@ -1189,7 +1189,7 @@ mixin M on A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 57, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 57, 3)], ); } @@ -1203,7 +1203,7 @@ mixin M on A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 56, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 56, 3)], ); } @@ -1217,7 +1217,7 @@ mixin M on A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 60, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 60, 3)], ); } @@ -1231,7 +1231,7 @@ mixin M on A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 57, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 57, 3)], ); } @@ -1245,7 +1245,7 @@ mixin M on A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 56, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 56, 3)], ); } @@ -1259,7 +1259,7 @@ mixin M implements A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 72, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 72, 3)], ); } @@ -1273,7 +1273,7 @@ mixin M implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 69, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 69, 3)], ); } @@ -1287,7 +1287,7 @@ mixin M implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 69, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 69, 3)], ); } @@ -1301,7 +1301,7 @@ mixin M implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 65, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 65, 3)], ); } @@ -1315,7 +1315,7 @@ mixin M implements A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 64, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 64, 3)], ); } @@ -1329,7 +1329,7 @@ mixin M implements A { static int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 68, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 68, 3)], ); } @@ -1343,7 +1343,7 @@ mixin M implements A { static void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 65, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 65, 3)], ); } @@ -1357,7 +1357,7 @@ mixin M implements A { static set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 64, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 64, 3)], ); } @@ -1369,7 +1369,7 @@ mixin M { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 27, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 27, 3)], ); } @@ -1381,7 +1381,7 @@ mixin M { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 27, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 27, 3)], ); } @@ -1393,7 +1393,7 @@ mixin M { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 27, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 27, 3)], ); } @@ -1405,7 +1405,7 @@ mixin M { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 24, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 24, 3)], ); } @@ -1417,7 +1417,7 @@ mixin M { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 24, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 24, 3)], ); } @@ -1429,7 +1429,7 @@ mixin M { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 24, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 24, 3)], ); } @@ -1441,7 +1441,7 @@ mixin M { int get foo => 0; } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 23, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 23, 3)], ); } @@ -1453,7 +1453,7 @@ mixin M { void foo() {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 23, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 23, 3)], ); } @@ -1465,7 +1465,7 @@ mixin M { set foo(_) {} } ''', - [error(CompileTimeErrorCode.CONFLICTING_STATIC_AND_INSTANCE, 23, 3)], + [error(CompileTimeErrorCode.conflictingStaticAndInstance, 23, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_type_variable_and_container_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_type_variable_and_container_test.dart index 9e6a66b021b..2999037cf27 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_type_variable_and_container_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_type_variable_and_container_test.dart @@ -24,7 +24,7 @@ class ConflictingTypeVariableAndClassTest extends PubPackageResolutionTest { r''' class T {} ''', - [error(CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS, 8, 1)], + [error(CompileTimeErrorCode.conflictingTypeVariableAndClass, 8, 1)], ); } } @@ -38,7 +38,7 @@ enum E { v } ''', - [error(CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_ENUM, 7, 1)], + [error(CompileTimeErrorCode.conflictingTypeVariableAndEnum, 7, 1)], ); } } @@ -50,13 +50,7 @@ class ConflictingTypeVariableAndExtensionTest extends PubPackageResolutionTest { r''' extension T on String {} ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION, - 12, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndExtension, 12, 1)], ); } } @@ -71,7 +65,7 @@ extension type T(int it) {} ''', [ error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_EXTENSION_TYPE, + CompileTimeErrorCode.conflictingTypeVariableAndExtensionType, 17, 1, ), @@ -87,7 +81,7 @@ class ConflictingTypeVariableAndMixinTest extends PubPackageResolutionTest { r''' mixin T {} ''', - [error(CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MIXIN, 8, 1)], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMixin, 8, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_type_variable_and_member_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_type_variable_and_member_test.dart index 6d143b89313..97ce3e1655b 100644 --- a/pkg/analyzer/test/src/diagnostics/conflicting_type_variable_and_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/conflicting_type_variable_and_member_test.dart @@ -27,13 +27,7 @@ class A { A.T(); } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberClass, 8, 1)], ); } @@ -44,13 +38,7 @@ class A { var T; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberClass, 8, 1)], ); } @@ -61,13 +49,7 @@ class A { get T => null; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberClass, 8, 1)], ); } @@ -78,13 +60,7 @@ class A { T() {} } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberClass, 8, 1)], ); } @@ -95,13 +71,7 @@ class A { static T() {} } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberClass, 8, 1)], ); } @@ -112,7 +82,7 @@ class A<_> { _() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 15, 1)], + [error(WarningCode.unusedElement, 15, 1)], ); } @@ -128,11 +98,11 @@ class A<_> { ''', [ error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS, + CompileTimeErrorCode.conflictingTypeVariableAndMemberClass, 52, 1, ), - error(WarningCode.UNUSED_ELEMENT, 59, 1), + error(WarningCode.unusedElement, 59, 1), ], ); } @@ -144,13 +114,7 @@ class A { set T(x) {} } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_CLASS, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberClass, 8, 1)], ); } } @@ -166,13 +130,7 @@ enum A { get T => null; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_ENUM, - 7, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberEnum, 7, 1)], ); } @@ -184,13 +142,7 @@ enum A { void T() {} } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_ENUM, - 7, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberEnum, 7, 1)], ); } @@ -202,13 +154,7 @@ enum A { set T(x) {} } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_ENUM, - 7, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberEnum, 7, 1)], ); } } @@ -225,7 +171,7 @@ extension A on String { ''', [ error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtension, 12, 1, ), @@ -242,7 +188,7 @@ extension A on String { ''', [ error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtension, 12, 1, ), @@ -259,7 +205,7 @@ extension A on String { ''', [ error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtension, 12, 1, ), @@ -280,8 +226,7 @@ extension type A(int it) { ''', [ error( - CompileTimeErrorCode - .CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION_TYPE, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtensionType, 17, 1, ), @@ -296,8 +241,7 @@ extension type A.T(int it) {} ''', [ error( - CompileTimeErrorCode - .CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION_TYPE, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtensionType, 17, 1, ), @@ -314,8 +258,7 @@ extension type A(int it) { ''', [ error( - CompileTimeErrorCode - .CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION_TYPE, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtensionType, 17, 1, ), @@ -332,8 +275,7 @@ extension type A(int it) { ''', [ error( - CompileTimeErrorCode - .CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION_TYPE, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtensionType, 17, 1, ), @@ -350,8 +292,7 @@ extension type A(int it) { ''', [ error( - CompileTimeErrorCode - .CONFLICTING_TYPE_VARIABLE_AND_MEMBER_EXTENSION_TYPE, + CompileTimeErrorCode.conflictingTypeVariableAndMemberExtensionType, 17, 1, ), @@ -370,13 +311,7 @@ mixin M { var T; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_MIXIN, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberMixin, 8, 1)], ); } @@ -387,13 +322,7 @@ mixin M { get T => null; } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_MIXIN, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberMixin, 8, 1)], ); } @@ -404,13 +333,7 @@ mixin M { T() {} } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_MIXIN, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberMixin, 8, 1)], ); } @@ -421,13 +344,7 @@ mixin M { static T() {} } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_MIXIN, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberMixin, 8, 1)], ); } @@ -438,13 +355,7 @@ mixin M { set T(x) {} } ''', - [ - error( - CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER_MIXIN, - 8, - 1, - ), - ], + [error(CompileTimeErrorCode.conflictingTypeVariableAndMemberMixin, 8, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_field_type_mismatch_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_field_type_mismatch_test.dart index 1fe5e37dd0d..e531c3c76b4 100644 --- a/pkg/analyzer/test/src/diagnostics/const_constructor_field_type_mismatch_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_constructor_field_type_mismatch_test.dart @@ -25,7 +25,7 @@ class C { const int y = 1; var v = const C(); ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 27, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 27, 1)], ); } @@ -38,7 +38,7 @@ class A { } var v = const A(0); ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 40, 10)], + [error(CompileTimeErrorCode.undefinedClass, 40, 10)], ); } @@ -51,7 +51,7 @@ class A { } var v = const A(null); ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 40, 10)], + [error(CompileTimeErrorCode.undefinedClass, 40, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_param_type_mismatch_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_param_type_mismatch_test.dart index 6942106d8a8..80955b60137 100644 --- a/pkg/analyzer/test/src/diagnostics/const_constructor_param_type_mismatch_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_constructor_param_type_mismatch_test.dart @@ -57,12 +57,8 @@ foo(x) => 1; var v = const A(foo); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 116, 3), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 116, - 3, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 116, 3), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 116, 3), ], ); } @@ -93,7 +89,7 @@ class A { } var v = const A('foo'); ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 20, 10)], + [error(CompileTimeErrorCode.undefinedClass, 20, 10)], ); } @@ -107,7 +103,7 @@ class A { } var v = const A(null); ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 20, 10)], + [error(CompileTimeErrorCode.undefinedClass, 20, 10)], ); } @@ -202,12 +198,8 @@ class A { var v = const A(); ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 45, 5), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 64, - 9, - ), + error(CompileTimeErrorCode.invalidAssignment, 45, 5), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 64, 9), ], ); } @@ -229,12 +221,8 @@ const A u = const A(); var v = const C(u); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 143, 1), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 143, - 1, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 143, 1), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 143, 1), ], ); } @@ -253,12 +241,8 @@ int foo(String x) => 1; var v = const A(foo); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 127, 3), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 127, - 3, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 127, 3), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 127, 3), ], ); } @@ -273,12 +257,8 @@ class A { var v = const A('foo'); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 62, 5), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 62, - 5, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 62, 5), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 62, 5), ], ); } @@ -292,7 +272,7 @@ class A { } var v = const A('foo'); ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 18, 10)], + [error(CompileTimeErrorCode.undefinedClass, 18, 10)], ); } @@ -305,12 +285,8 @@ class A { var v = const A('foo'); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 52, 5), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 52, - 5, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 52, 5), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 52, 5), ], ); } @@ -324,12 +300,8 @@ class A { var v = const A('foo'); ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 46, 5), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 46, - 5, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 46, 5), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 46, 5), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_with_field_initialized_by_non_const_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_with_field_initialized_by_non_const_test.dart index 5921634a5cb..3168e00c41f 100644 --- a/pkg/analyzer/test/src/diagnostics/const_constructor_with_field_initialized_by_non_const_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_constructor_with_field_initialized_by_non_const_test.dart @@ -44,10 +44,9 @@ int f() { } ''', [ - error(CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, 26, 3), + error(CompileTimeErrorCode.constEvalMethodInvocation, 26, 3), error( - CompileTimeErrorCode - .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, + CompileTimeErrorCode.constConstructorWithFieldInitializedByNonConst, 33, 5, ), @@ -66,8 +65,7 @@ class A { ''', [ error( - CompileTimeErrorCode - .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, + CompileTimeErrorCode.constConstructorWithFieldInitializedByNonConst, 27, 5, ), @@ -116,10 +114,9 @@ enum E { int f() => 0; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, 30, 3), + error(CompileTimeErrorCode.constEvalMethodInvocation, 30, 3), error( - CompileTimeErrorCode - .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, + CompileTimeErrorCode.constConstructorWithFieldInitializedByNonConst, 37, 5, ), diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_with_mixin_with_field_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_with_mixin_with_field_test.dart index da182885e09..0c4b0a98b4e 100644 --- a/pkg/analyzer/test/src/diagnostics/const_constructor_with_mixin_with_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_constructor_with_mixin_with_field_test.dart @@ -28,13 +28,7 @@ class B with A { const B(this.a); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD, - 77, - 1, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithMixinWithField, 77, 1)], ); } @@ -63,13 +57,7 @@ class B extends Object with A { const B(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD, - 68, - 1, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithMixinWithField, 68, 1)], ); } @@ -108,13 +96,7 @@ class B extends Object with A { const B(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD, - 62, - 1, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithMixinWithField, 62, 1)], ); } @@ -130,13 +112,7 @@ class B extends Object with A { const B(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELDS, - 71, - 1, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithMixinWithFields, 71, 1)], ); } @@ -173,13 +149,7 @@ class X extends Object with M { const X(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD, - 62, - 1, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithMixinWithField, 62, 1)], ); } @@ -194,13 +164,7 @@ class X extends Object with M { const X(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN_WITH_FIELD, - 68, - 1, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithMixinWithField, 68, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_with_non_const_super_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_with_non_const_super_test.dart index ce317e86cc9..778f1101619 100644 --- a/pkg/analyzer/test/src/diagnostics/const_constructor_with_non_const_super_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_constructor_with_non_const_super_test.dart @@ -25,13 +25,7 @@ class B extends A { const B(): super(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, - 52, - 7, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithNonConstSuper, 52, 7)], ); } @@ -45,13 +39,7 @@ class B extends A { const B(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, - 47, - 1, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithNonConstSuper, 47, 1)], ); } @@ -82,13 +70,7 @@ class B extends A { const B.bar() : super._(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, - 111, - 9, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithNonConstSuper, 111, 9)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_with_non_final_field_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_with_non_final_field_test.dart index e48b8e15982..0801c2c084b 100644 --- a/pkg/analyzer/test/src/diagnostics/const_constructor_with_non_final_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_constructor_with_non_final_field_test.dart @@ -53,13 +53,7 @@ class A { const A.a(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, - 31, - 3, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithNonFinalField, 31, 3)], ); } @@ -71,13 +65,7 @@ class A { const A(); } ''', - [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, - 31, - 1, - ), - ], + [error(CompileTimeErrorCode.constConstructorWithNonFinalField, 31, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/const_deferred_class_test.dart index b295688f38c..dd0bb5df447 100644 --- a/pkg/analyzer/test/src/diagnostics/const_deferred_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_deferred_class_test.dart @@ -28,7 +28,7 @@ import 'lib1.dart' deferred as a; main() { const a.A.b(); }''', - [error(CompileTimeErrorCode.CONST_DEFERRED_CLASS, 65, 5)], + [error(CompileTimeErrorCode.constDeferredClass, 65, 5)], ); } @@ -48,7 +48,7 @@ main() { const a.B(); } ''', - [error(CompileTimeErrorCode.CONST_DEFERRED_CLASS, 65, 3)], + [error(CompileTimeErrorCode.constDeferredClass, 65, 3)], ); } @@ -67,7 +67,7 @@ main() { const a.A(); } ''', - [error(CompileTimeErrorCode.CONST_DEFERRED_CLASS, 65, 3)], + [error(CompileTimeErrorCode.constDeferredClass, 65, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_extension_method_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_extension_method_test.dart index ebeeaa84d9d..b3849576e37 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_extension_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_extension_method_test.dart @@ -25,7 +25,7 @@ extension on Object { const Object v1 = 0; const v2 = v1 + v1; ''', - [error(CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, 94, 7)], + [error(CompileTimeErrorCode.constEvalExtensionMethod, 94, 7)], ); } @@ -39,7 +39,7 @@ extension on Object { const Object v1 = 1; const v2 = -v1; ''', - [error(CompileTimeErrorCode.CONST_EVAL_EXTENSION_METHOD, 82, 3)], + [error(CompileTimeErrorCode.constEvalExtensionMethod, 82, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_for_element_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_for_element_test.dart index e9f96012825..d25ead44feb 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_for_element_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_for_element_test.dart @@ -22,11 +22,11 @@ const x = [for (int i = 0; i < 3; i++) i]; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 31, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 11, 29), + error(CompileTimeErrorCode.constEvalForElement, 11, 29), ], ); } @@ -39,11 +39,11 @@ const x = [for(final i in set) i]; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 30, 23, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 31, 21), + error(CompileTimeErrorCode.constEvalForElement, 31, 21), ], ); } @@ -55,11 +55,11 @@ const x = {for (final i in const []) i: null}; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 35, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 11, 33), + error(CompileTimeErrorCode.constEvalForElement, 11, 33), ], ); } @@ -71,11 +71,11 @@ const x = {if (true) for (final i in const []) i: null}; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 45, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 21, 33), + error(CompileTimeErrorCode.constEvalForElement, 21, 33), ], ); } @@ -88,11 +88,11 @@ const x = {for (final i in set) i}; ''', [ error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 30, 24, ), - error(CompileTimeErrorCode.CONST_EVAL_FOR_ELEMENT, 31, 22), + error(CompileTimeErrorCode.constEvalForElement, 31, 22), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_method_invocation_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_method_invocation_test.dart index 8e5ea80095b..2b9eb070308 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_method_invocation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_method_invocation_test.dart @@ -23,7 +23,7 @@ int f() { } const a = f(); ''', - [error(CompileTimeErrorCode.CONST_EVAL_METHOD_INVOCATION, 34, 3)], + [error(CompileTimeErrorCode.constEvalMethodInvocation, 34, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_primitive_equality_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_primitive_equality_test.dart index 7b0cb21d758..87ccabcd884 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_primitive_equality_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_primitive_equality_test.dart @@ -86,7 +86,7 @@ class A { const a = A(); const b = a == 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, 87, 6)], + [error(CompileTimeErrorCode.constEvalPrimitiveEquality, 87, 6)], ); } @@ -101,7 +101,7 @@ class A { const a = A(); const b = a == 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, 76, 6)], + [error(CompileTimeErrorCode.constEvalPrimitiveEquality, 76, 6)], ); } @@ -166,7 +166,7 @@ class A { const a = A(); const b = a != 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, 87, 6)], + [error(CompileTimeErrorCode.constEvalPrimitiveEquality, 87, 6)], ); } @@ -181,7 +181,7 @@ class A { const a = A(); const b = a != 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_PRIMITIVE_EQUALITY, 76, 6)], + [error(CompileTimeErrorCode.constEvalPrimitiveEquality, 76, 6)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_property_access_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_property_access_test.dart index 3e57bfde21b..d9e18e544c3 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_property_access_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_property_access_test.dart @@ -30,7 +30,7 @@ const a = const A(); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, + CompileTimeErrorCode.constEvalPropertyAccess, 29, 9, contextMessages: [ @@ -58,7 +58,7 @@ const int? c = d.length;'''); r''' const dynamic d = null; const int? c = d.length;''', - [error(CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, 39, 8)], + [error(CompileTimeErrorCode.constEvalPropertyAccess, 39, 8)], ); } @@ -75,7 +75,7 @@ class RequiresNonEmptyList { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, + CompileTimeErrorCode.constEvalPropertyAccess, 16, 31, contextMessages: [ @@ -102,7 +102,7 @@ class C { const x = const C().t; ''', - [error(CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, 59, 11)], + [error(CompileTimeErrorCode.constEvalPropertyAccess, 59, 11)], ); } @@ -111,7 +111,7 @@ const x = const C().t; r''' const int? s = null; const bool? c = s?.isEven;''', - [error(CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, 37, 9)], + [error(CompileTimeErrorCode.constEvalPropertyAccess, 37, 9)], ); } @@ -126,7 +126,7 @@ const int? c = d?.length;'''); r''' const List? l = []; const int? c = l?.length;''', - [error(CompileTimeErrorCode.CONST_EVAL_PROPERTY_ACCESS, 35, 9)], + [error(CompileTimeErrorCode.constEvalPropertyAccess, 35, 9)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart index 03876219520..098c8fb03dd 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart @@ -30,9 +30,9 @@ const int y = 1; var v = const C(); ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 27, 1), + error(CompileTimeErrorCode.invalidAssignment, 27, 1), error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 70, 17, contextMessages: [ @@ -60,7 +60,7 @@ var v = const A('foo'); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 57, 14, contextMessages: [ @@ -80,7 +80,7 @@ var v = const A('foo'); test_notGeneric_int_null() async { var errors = [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 57, 13, contextMessages: [ @@ -115,7 +115,7 @@ const a = const C(null); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 60, 13, contextMessages: [ @@ -151,7 +151,7 @@ main() { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 92, 19, contextMessages: [ @@ -165,7 +165,7 @@ main() { ], ), error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 115, 18, contextMessages: [ @@ -198,7 +198,7 @@ main() { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 104, 21, contextMessages: [ @@ -212,7 +212,7 @@ main() { ], ), error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 129, 18, contextMessages: [ @@ -239,7 +239,7 @@ var v = const A(3, 2); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 61, 13, contextMessages: [ @@ -272,7 +272,7 @@ main() { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 124, 10, contextMessages: [ @@ -306,7 +306,7 @@ const a = const A(0); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 84, 10, contextMessages: [ @@ -332,11 +332,11 @@ class A { const a = const A(0); ''', [ - error(CompileTimeErrorCode.INVALID_CONSTANT, 45, 8), - error(CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION, 45, 8), - error(WarningCode.DEAD_CODE, 54, 3), + error(CompileTimeErrorCode.invalidConstant, 45, 8), + error(CompileTimeErrorCode.constConstructorThrowsException, 45, 8), + error(WarningCode.deadCode, 54, 3), error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 70, 10, contextMessages: [ @@ -359,7 +359,7 @@ const a = const A(0); const dynamic D = null; const C = D - 5; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 34, 5)], + [error(CompileTimeErrorCode.constEvalThrowsException, 34, 5)], ); await assertErrorsInCode( @@ -367,7 +367,7 @@ const C = D - 5; const dynamic D = null; const C = 5 - D; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 34, 5)], + [error(CompileTimeErrorCode.constEvalThrowsException, 34, 5)], ); } @@ -377,7 +377,7 @@ const C = 5 - D; const dynamic D = null; const C = D + 5; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 34, 5)], + [error(CompileTimeErrorCode.constEvalThrowsException, 34, 5)], ); await assertErrorsInCode( @@ -385,7 +385,7 @@ const C = D + 5; const dynamic D = null; const C = 5 + D; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 34, 5)], + [error(CompileTimeErrorCode.constEvalThrowsException, 34, 5)], ); } @@ -463,11 +463,11 @@ main() { var c = const C(); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 37, 1)], + [error(WarningCode.unusedLocalVariable, 37, 1)], ); var otherFileResult = await resolveFile(other); assertErrorsInList(otherFileResult.diagnostics, [ - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE, 97, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullTrue, 97, 7), ]); } @@ -482,7 +482,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 11, 3, contextMessages: [ @@ -511,7 +511,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 36, 4, contextMessages: [ @@ -540,7 +540,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 35, 4, contextMessages: [ @@ -582,11 +582,11 @@ var x = const C(); ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, + CompileTimeErrorCode.fieldInitializedInInitializerAndDeclaration, 39, 1, ), - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 56, 9), + error(CompileTimeErrorCode.constEvalThrowsException, 56, 9), ], ); } @@ -607,11 +607,11 @@ var x = const C(2); ''', [ error( - CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, + CompileTimeErrorCode.finalInitializedInDeclarationAndConstructor, 40, 1, ), - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 54, 10), + error(CompileTimeErrorCode.constEvalThrowsException, 54, 10), ], ); } @@ -636,10 +636,10 @@ var b1 = const bool.fromEnvironment(1); var b2 = const bool.fromEnvironment('x', defaultValue: 1); ''', [ - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 9, 29), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 36, 1), - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 49, 48), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 95, 1), + error(CompileTimeErrorCode.constEvalThrowsException, 9, 29), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 36, 1), + error(CompileTimeErrorCode.constEvalThrowsException, 49, 48), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 95, 1), ], ); } @@ -653,8 +653,8 @@ var b2 = const bool.fromEnvironment('x', defaultValue: 1); var b = const bool.fromEnvironment('x', defaultValue: 1); ''', [ - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 8, 48), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 54, 1), + error(CompileTimeErrorCode.constEvalThrowsException, 8, 48), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 54, 1), ], ); } @@ -696,7 +696,7 @@ var v = const A.a1(0); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 74, 13, contextMessages: [ @@ -727,7 +727,7 @@ const f = const D('0.0'); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, + CompileTimeErrorCode.constEvalThrowsException, 106, 14, contextMessages: [ @@ -757,8 +757,8 @@ const f = const D('0.0'); var s2 = const Symbol(3); ''', [ - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 9, 15), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 22, 1), + error(CompileTimeErrorCode.constEvalThrowsException, 9, 15), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 22, 1), ], ); } @@ -781,7 +781,7 @@ var s = const Symbol('_'); const dynamic D = null; const C = ~D; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 34, 2)], + [error(CompileTimeErrorCode.constEvalThrowsException, 34, 2)], ); } @@ -791,7 +791,7 @@ const C = ~D; const dynamic D = null; const C = -D; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 34, 2)], + [error(CompileTimeErrorCode.constEvalThrowsException, 34, 2)], ); } @@ -801,7 +801,7 @@ const C = -D; const dynamic D = null; const C = !D; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 34, 2)], + [error(CompileTimeErrorCode.constEvalThrowsException, 34, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_throws_idbze_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_throws_idbze_test.dart index b1eb9b9dc5f..c0cc59ca393 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_throws_idbze_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_throws_idbze_test.dart @@ -20,7 +20,7 @@ class ConstEvalThrowsIdbzeTest extends PubPackageResolutionTest { ''' const C = 1 ~/ 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_THROWS_IDBZE, 10, 6)], + [error(CompileTimeErrorCode.constEvalThrowsIdbze, 10, 6)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_int_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_int_test.dart index 82dba71d2cf..15006bd7cf6 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_int_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_int_test.dart @@ -30,8 +30,8 @@ const int a = 0; const b = $expr; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_INT, 27, 6), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 31, 2), + error(CompileTimeErrorCode.constEvalTypeBoolInt, 27, 6), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 31, 2), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_num_string_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_num_string_test.dart index 3b4320188e2..0afc005a249 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_num_string_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_num_string_test.dart @@ -34,7 +34,7 @@ class A { const a = A(); const b = a == 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, 67, 6)], + [error(CompileTimeErrorCode.constEvalTypeBoolNumString, 67, 6)], ); } @@ -57,7 +57,7 @@ class A { const a = A(); const b = a != 0; ''', - [error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, 67, 6)], + [error(CompileTimeErrorCode.constEvalTypeBoolNumString, 67, 6)], ); } @@ -66,7 +66,7 @@ const b = a != 0; r''' const x = '${const [2]}'; ''', - [error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING, 11, 12)], + [error(CompileTimeErrorCode.constEvalTypeBoolNumString, 11, 12)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_test.dart index 8080ad9b26d..0c3cb45119a 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_type_bool_test.dart @@ -21,8 +21,8 @@ class ConstEvalTypeBoolTest extends PubPackageResolutionTest { const c = true && ''; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, 10, 10), - error(CompileTimeErrorCode.NON_BOOL_OPERAND, 18, 2), + error(CompileTimeErrorCode.constEvalTypeBool, 10, 10), + error(CompileTimeErrorCode.nonBoolOperand, 18, 2), ], ); } @@ -33,8 +33,8 @@ const c = true && ''; const c = (true || 0); ''', [ - error(WarningCode.DEAD_CODE, 16, 4), - error(CompileTimeErrorCode.NON_BOOL_OPERAND, 19, 1), + error(WarningCode.deadCode, 16, 4), + error(CompileTimeErrorCode.nonBoolOperand, 19, 1), ], ); } @@ -45,8 +45,8 @@ const c = (true || 0); const c = false || ''; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, 10, 11), - error(CompileTimeErrorCode.NON_BOOL_OPERAND, 19, 2), + error(CompileTimeErrorCode.constEvalTypeBool, 10, 11), + error(CompileTimeErrorCode.nonBoolOperand, 19, 2), ], ); } @@ -59,8 +59,8 @@ const c = false || ''; const int i = (1 ? 'alpha' : 'beta').length; ''', [ - error(CompileTimeErrorCode.NON_BOOL_CONDITION, 15, 1), - error(CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL, 15, 1), + error(CompileTimeErrorCode.nonBoolCondition, 15, 1), + error(CompileTimeErrorCode.constEvalTypeBool, 15, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_type_num_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_type_num_test.dart index 2938b3b1812..b2a8a96150b 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_type_num_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_type_num_test.dart @@ -35,8 +35,8 @@ const num a = 0; const b = $expr; ''', [ - error(CompileTimeErrorCode.CONST_EVAL_TYPE_NUM, 27, 6), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 31, 2), + error(CompileTimeErrorCode.constEvalTypeNum, 27, 6), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 31, 2), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_type_string_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_type_string_test.dart index 78e318e9101..cb88ad5ba0c 100644 --- a/pkg/analyzer/test/src/diagnostics/const_eval_type_string_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_eval_type_string_test.dart @@ -28,7 +28,7 @@ const y = B(x); ''', [ error( - CompileTimeErrorCode.CONST_EVAL_TYPE_STRING, + CompileTimeErrorCode.constEvalTypeString, 70, 4, contextMessages: [ @@ -41,8 +41,8 @@ const y = B(x); ), ], ), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 72, 1), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 72, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 72, 1), + error(CompileTimeErrorCode.constWithNonConstantArgument, 72, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_field_initializer_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/const_field_initializer_not_assignable_test.dart index 7450daa1171..0edbe534686 100644 --- a/pkg/analyzer/test/src/diagnostics/const_field_initializer_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_field_initializer_not_assignable_test.dart @@ -34,16 +34,8 @@ enum E { } ''', [ - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, - 11, - 1, - ), - error( - CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, - 47, - 2, - ), + error(CompileTimeErrorCode.constConstructorFieldTypeMismatch, 11, 1), + error(CompileTimeErrorCode.constFieldInitializerNotAssignable, 47, 2), ], ); } @@ -56,13 +48,7 @@ class A { const A() : x = ''; } ''', - [ - error( - CompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, - 43, - 2, - ), - ], + [error(CompileTimeErrorCode.constFieldInitializerNotAssignable, 43, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_from_deferred_library_test.dart index 594daa7318c..0c67cf3ee56 100644 --- a/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_from_deferred_library_test.dart @@ -32,7 +32,7 @@ const B = a.V; [ error( CompileTimeErrorCode - .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, + .constInitializedWithNonConstantValueFromDeferredLibrary, 60, 1, ), @@ -54,7 +54,7 @@ const B = a.V + 1; [ error( CompileTimeErrorCode - .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, + .constInitializedWithNonConstantValueFromDeferredLibrary, 60, 1, ), @@ -72,10 +72,10 @@ extension E on int { const g = self.E.f; ''', [ - error(CompileTimeErrorCode.DEFERRED_IMPORT_OF_EXTENSION, 7, 2), + error(CompileTimeErrorCode.deferredImportOfExtension, 7, 2), error( CompileTimeErrorCode - .CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, + .constInitializedWithNonConstantValueFromDeferredLibrary, 97, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_test.dart b/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_test.dart index bb3cdd1d95f..b9ea671c2fd 100644 --- a/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_test.dart @@ -24,12 +24,8 @@ f(p) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 19, - 1, - ), + error(WarningCode.unusedLocalVariable, 15, 1), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 19, 1), ], ); } @@ -43,7 +39,7 @@ class Foo { foo([int x = field]) {} } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 46, 5)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 46, 5)], ); } @@ -52,13 +48,7 @@ class Foo { ''' const a = () {}; ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 10, - 5, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 10, 5)], ); } @@ -82,13 +72,7 @@ class A { } const a = new A(); ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 35, - 7, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 35, 7)], ); } @@ -113,13 +97,7 @@ class A { final a = const A(); const c = a.m; ''', - [ - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 72, - 1, - ), - ], + [error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 72, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_instance_field_test.dart b/pkg/analyzer/test/src/diagnostics/const_instance_field_test.dart index 5a1f46006a4..147531992ac 100644 --- a/pkg/analyzer/test/src/diagnostics/const_instance_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_instance_field_test.dart @@ -22,7 +22,7 @@ class C { const int f = 0; } ''', - [error(CompileTimeErrorCode.CONST_INSTANCE_FIELD, 12, 5)], + [error(CompileTimeErrorCode.constInstanceField, 12, 5)], ); } @@ -33,7 +33,7 @@ mixin C { const int f = 0; } ''', - [error(CompileTimeErrorCode.CONST_INSTANCE_FIELD, 12, 5)], + [error(CompileTimeErrorCode.constInstanceField, 12, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_map_key_not_primitive_equality_test.dart b/pkg/analyzer/test/src/diagnostics/const_map_key_not_primitive_equality_test.dart index aa8078f1a2e..9244268bdbf 100644 --- a/pkg/analyzer/test/src/diagnostics/const_map_key_not_primitive_equality_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_map_key_not_primitive_equality_test.dart @@ -40,7 +40,7 @@ main() { const {const A() : 0}; } ''', - [error(CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, 75, 9)], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 75, 9)], ); } @@ -51,13 +51,7 @@ main() { const {double.infinity: 0}; } ''', - [ - error( - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, - 18, - 15, - ), - ], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 18, 15)], ); } @@ -80,13 +74,7 @@ main() { const {B.a : 0}; } ''', - [ - error( - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, - 118, - 3, - ), - ], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 118, 3)], ); } @@ -106,13 +94,7 @@ main() { const {const A(): 42}; } ''', - [ - error( - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, - 121, - 9, - ), - ], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 121, 9)], ); } @@ -133,13 +115,7 @@ main() { const B({A(): 0}); } ''', - [ - error( - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, - 110, - 3, - ), - ], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 110, 3)], ); } @@ -155,13 +131,7 @@ const x = { (a: 0, b: const A()): 0, }; ''', - [ - error( - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, - 71, - 20, - ), - ], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 71, 20)], ); } @@ -177,13 +147,7 @@ const x = { (0, const A()): 0, }; ''', - [ - error( - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, - 71, - 14, - ), - ], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 71, 14)], ); } @@ -203,13 +167,7 @@ main() { const {const B() : 0}; } ''', - [ - error( - CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, - 111, - 9, - ), - ], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 111, 9)], ); } @@ -223,7 +181,7 @@ class A { int get hashCode => 0; } ''', - [error(CompileTimeErrorCode.CONST_MAP_KEY_NOT_PRIMITIVE_EQUALITY, 11, 3)], + [error(CompileTimeErrorCode.constMapKeyNotPrimitiveEquality, 11, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_not_initialized_test.dart b/pkg/analyzer/test/src/diagnostics/const_not_initialized_test.dart index adf1f24ee76..c9cc04ae3c0 100644 --- a/pkg/analyzer/test/src/diagnostics/const_not_initialized_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_not_initialized_test.dart @@ -22,7 +22,7 @@ class A { static const F; } ''', - [error(CompileTimeErrorCode.CONST_NOT_INITIALIZED, 25, 1)], + [error(CompileTimeErrorCode.constNotInitialized, 25, 1)], ); } @@ -34,7 +34,7 @@ enum E { static const F; } ''', - [error(CompileTimeErrorCode.CONST_NOT_INITIALIZED, 29, 1)], + [error(CompileTimeErrorCode.constNotInitialized, 29, 1)], ); } @@ -45,7 +45,7 @@ extension E on String { static const F; } ''', - [error(CompileTimeErrorCode.CONST_NOT_INITIALIZED, 39, 1)], + [error(CompileTimeErrorCode.constNotInitialized, 39, 1)], ); } @@ -57,8 +57,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), - error(CompileTimeErrorCode.CONST_NOT_INITIALIZED, 18, 1), + error(WarningCode.unusedLocalVariable, 18, 1), + error(CompileTimeErrorCode.constNotInitialized, 18, 1), ], ); } @@ -68,7 +68,7 @@ f() { ''' const F; ''', - [error(CompileTimeErrorCode.CONST_NOT_INITIALIZED, 6, 1)], + [error(CompileTimeErrorCode.constNotInitialized, 6, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_set_element_not_primitive_equality_test.dart b/pkg/analyzer/test/src/diagnostics/const_set_element_not_primitive_equality_test.dart index b7877e26138..33d6e126a8f 100644 --- a/pkg/analyzer/test/src/diagnostics/const_set_element_not_primitive_equality_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_set_element_not_primitive_equality_test.dart @@ -27,13 +27,7 @@ main() { const {A.a}; } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 104, - 3, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 104, 3)], ); } @@ -48,13 +42,7 @@ main() { const {const A()}; } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 74, - 9, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 74, 9)], ); } @@ -75,13 +63,7 @@ main() { const {B.a}; } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 116, - 3, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 116, 3)], ); } @@ -101,13 +83,7 @@ main() { print(m); } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 128, - 9, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 128, 9)], ); } @@ -128,13 +104,7 @@ main() { const B({A()}); } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 110, - 3, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 110, 3)], ); } @@ -150,13 +120,7 @@ const x = { (a: 0, b: const A()), }; ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 71, - 20, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 71, 20)], ); } @@ -172,13 +136,7 @@ const x = { (0, const A()), }; ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 71, - 14, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 71, 14)], ); } @@ -194,13 +152,7 @@ main() { const [...{A()}]; } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 79, - 3, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 79, 3)], ); } @@ -216,13 +168,7 @@ main() { const {...[A()]}; } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 75, - 8, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 75, 8)], ); } @@ -238,13 +184,7 @@ main() { const {...{A()}}; } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 79, - 3, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 79, 3)], ); } @@ -262,13 +202,7 @@ main() { const {const B()}; } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 109, - 9, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 109, 9)], ); } @@ -282,13 +216,7 @@ class A { int get hashCode => 0; } ''', - [ - error( - CompileTimeErrorCode.CONST_SET_ELEMENT_NOT_PRIMITIVE_EQUALITY, - 11, - 3, - ), - ], + [error(CompileTimeErrorCode.constSetElementNotPrimitiveEquality, 11, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_spread_expected_list_or_set_test.dart b/pkg/analyzer/test/src/diagnostics/const_spread_expected_list_or_set_test.dart index ba4fc826796..2463f25dca3 100644 --- a/pkg/analyzer/test/src/diagnostics/const_spread_expected_list_or_set_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_spread_expected_list_or_set_test.dart @@ -24,7 +24,7 @@ mixin ConstSpreadExpectedListOrSetTestCases on PubPackageResolutionTest { const dynamic a = 5; var b = const [...a]; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, 44, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedListOrSet, 44, 1)], ); } @@ -34,7 +34,7 @@ var b = const [...a]; const dynamic a = 5; const x = [...a]; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, 40, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedListOrSet, 40, 1)], ); } @@ -51,7 +51,7 @@ var b = const [...a]; const dynamic a = {0: 1}; var b = const [...a]; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, 59, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedListOrSet, 59, 1)], ); } @@ -61,7 +61,7 @@ var b = const [...a]; const dynamic a = null; var b = const [...a]; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, 47, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedListOrSet, 47, 1)], ); } @@ -85,7 +85,7 @@ var b = const [...a]; const dynamic a = 5; var b = const {...a}; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, 44, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedListOrSet, 44, 1)], ); } @@ -102,7 +102,7 @@ var b = const {...a}; const dynamic a = {1: 2}; var b = const {...a}; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, 59, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedListOrSet, 59, 1)], ); } @@ -112,7 +112,7 @@ var b = const {...a}; const dynamic a = null; var b = const {...a}; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_LIST_OR_SET, 47, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedListOrSet, 47, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_spread_expected_map_test.dart b/pkg/analyzer/test/src/diagnostics/const_spread_expected_map_test.dart index 4572d768979..777a69d928b 100644 --- a/pkg/analyzer/test/src/diagnostics/const_spread_expected_map_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_spread_expected_map_test.dart @@ -24,7 +24,7 @@ mixin ConstSpreadExpectedMapTestCases on PubPackageResolutionTest { const dynamic a = 5; var b = const {...a}; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, 49, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedMap, 49, 1)], ); } @@ -34,7 +34,7 @@ var b = const {...a}; const dynamic a = [5]; var b = const {...a}; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, 56, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedMap, 56, 1)], ); } @@ -51,7 +51,7 @@ var b = {...a}; const dynamic a = null; var b = const {...a}; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, 52, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedMap, 52, 1)], ); } @@ -68,7 +68,7 @@ var b = {...?a}; const dynamic a = {5}; var b = const {...a}; ''', - [error(CompileTimeErrorCode.CONST_SPREAD_EXPECTED_MAP, 56, 1)], + [error(CompileTimeErrorCode.constSpreadExpectedMap, 56, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_type_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/const_type_parameter_test.dart index 83f5f051c15..35ef0562322 100644 --- a/pkg/analyzer/test/src/diagnostics/const_type_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_type_parameter_test.dart @@ -22,7 +22,7 @@ void f(x) { if (x case T) {} } ''', - [error(CompileTimeErrorCode.CONST_TYPE_PARAMETER, 28, 1)], + [error(CompileTimeErrorCode.constTypeParameter, 28, 1)], ); } @@ -33,7 +33,7 @@ void f(Object? x) { if (x case const (T)) {} } ''', - [error(CompileTimeErrorCode.CONST_TYPE_PARAMETER, 43, 1)], + [error(CompileTimeErrorCode.constTypeParameter, 43, 1)], ); } @@ -44,7 +44,7 @@ void f(Object? x) { if (x case const (List)) {} } ''', - [error(CompileTimeErrorCode.CONST_TYPE_PARAMETER, 43, 7)], + [error(CompileTimeErrorCode.constTypeParameter, 43, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_with_non_const_test.dart b/pkg/analyzer/test/src/diagnostics/const_with_non_const_test.dart index f2a7e5187f8..e4093ac00a3 100644 --- a/pkg/analyzer/test/src/diagnostics/const_with_non_const_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_with_non_const_test.dart @@ -27,7 +27,7 @@ main() { const A(B()); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 57, 3)], + [error(CompileTimeErrorCode.constWithNonConst, 57, 3)], ); } @@ -54,7 +54,7 @@ class A { class B = A with M; var b = const B(); ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 78, 5)], + [error(CompileTimeErrorCode.constWithNonConst, 78, 5)], ); } @@ -95,7 +95,7 @@ void f() { const A(0); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 57, 5)], + [error(CompileTimeErrorCode.constWithNonConst, 57, 5)], ); var node = findNode.singleInstanceCreationExpression; @@ -131,7 +131,7 @@ void f() { const A(0); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONST, 38, 5)], + [error(CompileTimeErrorCode.constWithNonConst, 38, 5)], ); var node = findNode.singleInstanceCreationExpression; diff --git a/pkg/analyzer/test/src/diagnostics/const_with_non_constant_argument_test.dart b/pkg/analyzer/test/src/diagnostics/const_with_non_constant_argument_test.dart index e9c2bd2f15b..6eaf121d025 100644 --- a/pkg/analyzer/test/src/diagnostics/const_with_non_constant_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_with_non_constant_argument_test.dart @@ -26,7 +26,7 @@ var v = 42; main() { } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 45, 1)], + [error(CompileTimeErrorCode.constWithNonConstantArgument, 45, 1)], ); } @@ -45,8 +45,8 @@ class Foo { } ''', [ - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 94, 3), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 94, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 94, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 94, 3), ], ); } @@ -61,7 +61,7 @@ enum E { const E(_); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 26, 1)], + [error(CompileTimeErrorCode.constWithNonConstantArgument, 26, 1)], ); } @@ -82,7 +82,7 @@ class A { } f(p) { return const A(p); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 48, 1)], + [error(CompileTimeErrorCode.constWithNonConstantArgument, 48, 1)], ); } @@ -98,7 +98,7 @@ void main() { const C(() {}); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 83, 5)], + [error(CompileTimeErrorCode.constWithNonConstantArgument, 83, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_with_non_type_test.dart b/pkg/analyzer/test/src/diagnostics/const_with_non_type_test.dart index 2c5e204633a..d39188f311a 100644 --- a/pkg/analyzer/test/src/diagnostics/const_with_non_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_with_non_type_test.dart @@ -24,7 +24,7 @@ void f() { const lib.A(); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_TYPE, 50, 1)], + [error(CompileTimeErrorCode.constWithNonType, 50, 1)], ); } @@ -36,7 +36,7 @@ f() { return const A(); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_TYPE, 32, 1)], + [error(CompileTimeErrorCode.constWithNonType, 32, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/const_with_type_parameters_test.dart b/pkg/analyzer/test/src/diagnostics/const_with_type_parameters_test.dart index c7442f16c29..e85fc8af52b 100644 --- a/pkg/analyzer/test/src/diagnostics/const_with_type_parameters_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_with_type_parameters_test.dart @@ -26,7 +26,7 @@ void g() { const [f as void Function(T, [int])]; } ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 38, 31)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 38, 31)], ); } @@ -39,7 +39,7 @@ class A { ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersConstructorTearoff, 34, 1, ), @@ -57,7 +57,7 @@ class A { ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersConstructorTearoff, 52, 1, ), @@ -75,7 +75,7 @@ class A { [ // `A Function()` cannot be assigned to `A Function()`, but // there should not be any other error reported here. - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 44, 5), + error(CompileTimeErrorCode.invalidAssignment, 44, 5), ], ); } @@ -90,9 +90,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1), + error(WarningCode.unusedLocalVariable, 36, 1), error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersConstructorTearoff, 42, 1, ), @@ -110,7 +110,7 @@ class A { ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersConstructorTearoff, 40, 1, ), @@ -128,9 +128,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1), + error(WarningCode.unusedLocalVariable, 36, 1), error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_CONSTRUCTOR_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersConstructorTearoff, 47, 1, ), @@ -147,7 +147,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, 60, 1)], + [error(CompileTimeErrorCode.constWithTypeParameters, 60, 1)], ); } @@ -177,7 +177,7 @@ class C { ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 83, 1, ), @@ -194,7 +194,7 @@ void bar([void Function(T) p = f]) {} ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 56, 1, ), @@ -213,7 +213,7 @@ class C { ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 68, 1, ), @@ -230,7 +230,7 @@ void bar([void Function(List) p = f]) {} ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 62, 1, ), @@ -247,7 +247,7 @@ void bar([void Function(T Function()) p = f]) {} ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 67, 1, ), @@ -265,7 +265,7 @@ class A { ''', [ error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 65, 1, ), @@ -284,9 +284,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1), + error(WarningCode.unusedLocalVariable, 54, 1), error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 60, 1, ), @@ -305,13 +305,12 @@ class A { ''', [ error( - CompileTimeErrorCode - .CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, + CompileTimeErrorCode.constConstructorWithFieldInitializedByNonConst, 33, 5, ), error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 58, 1, ), @@ -331,7 +330,7 @@ extension on A { [ // An instance field is illegal, but we should not also report an // additional error for the type variable. - error(CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, 63, 1), + error(CompileTimeErrorCode.extensionDeclaresInstanceField, 63, 1), ], ); } @@ -356,9 +355,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1), + error(WarningCode.unusedLocalVariable, 54, 1), error( - CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS_FUNCTION_TEAROFF, + CompileTimeErrorCode.constWithTypeParametersFunctionTearoff, 65, 1, ), @@ -390,7 +389,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, 51, 1)], + [error(CompileTimeErrorCode.constWithTypeParameters, 51, 1)], ); } @@ -404,7 +403,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, 56, 1)], + [error(CompileTimeErrorCode.constWithTypeParameters, 56, 1)], ); } @@ -418,7 +417,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, 51, 1)], + [error(CompileTimeErrorCode.constWithTypeParameters, 51, 1)], ); } @@ -432,7 +431,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, 65, 1)], + [error(CompileTimeErrorCode.constWithTypeParameters, 65, 1)], ); } @@ -490,7 +489,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, 75, 1)], + [error(CompileTimeErrorCode.constWithTypeParameters, 75, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/const_with_undefined_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/const_with_undefined_constructor_test.dart index c03cdfcdbe8..28c7c7b4cf3 100644 --- a/pkg/analyzer/test/src/diagnostics/const_with_undefined_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/const_with_undefined_constructor_test.dart @@ -27,7 +27,7 @@ f() { ''', [ error( - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, + CompileTimeErrorCode.constWithUndefinedConstructor, 48, 17, messageContains: ["class 'A'", "constructor 'noSuchConstructor'"], @@ -46,7 +46,7 @@ f() { ''', [ error( - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, + CompileTimeErrorCode.constWithUndefinedConstructor, 56, 17, messageContains: [ @@ -69,13 +69,7 @@ f() { return const B(); } ''', - [ - error( - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, - 66, - 1, - ), - ], + [error(CompileTimeErrorCode.constWithUndefinedConstructorDefault, 66, 1)], ); } @@ -91,7 +85,7 @@ f() { ''', [ error( - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, + CompileTimeErrorCode.constWithUndefinedConstructorDefault, 51, 1, messageContains: ["'A'"], @@ -115,7 +109,7 @@ f() { ''', [ error( - CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, + CompileTimeErrorCode.constWithUndefinedConstructorDefault, 49, 6, messageContains: ["'lib1.A'"], @@ -135,7 +129,7 @@ enum E { v } ''', - [error(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, 21, 1)], + [error(CompileTimeErrorCode.constWithUndefinedConstructor, 21, 1)], ); } @@ -152,7 +146,7 @@ enum E { void foo() {} } ''', - [error(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, 21, 3)], + [error(CompileTimeErrorCode.constWithUndefinedConstructor, 21, 3)], ); } @@ -167,7 +161,7 @@ enum E { v } ''', - [error(CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, 21, 3)], + [error(CompileTimeErrorCode.constWithUndefinedConstructor, 21, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/constant_pattern_never_matches_value_type_test.dart b/pkg/analyzer/test/src/diagnostics/constant_pattern_never_matches_value_type_test.dart index 4f2720cf0ab..3eb3d976e2d 100644 --- a/pkg/analyzer/test/src/diagnostics/constant_pattern_never_matches_value_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/constant_pattern_never_matches_value_type_test.dart @@ -31,7 +31,7 @@ void f(int x) { if (x case (true)) {} } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 4)], + [error(WarningCode.constantPatternNeverMatchesValueType, 30, 4)], ); } @@ -42,7 +42,7 @@ void f(List x) { if (x case (true)) {} } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 37, 4)], + [error(WarningCode.constantPatternNeverMatchesValueType, 37, 4)], ); } @@ -69,7 +69,7 @@ void f(T x) { if (x case (true)) {} } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 43, 4)], + [error(WarningCode.constantPatternNeverMatchesValueType, 43, 4)], ); } @@ -80,7 +80,7 @@ void f(List x) { if (x case [true]) {} } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 49, 4)], + [error(WarningCode.constantPatternNeverMatchesValueType, 49, 4)], ); } @@ -103,7 +103,7 @@ void f(T x) { } } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 51, 4)], + [error(WarningCode.constantPatternNeverMatchesValueType, 51, 4)], ); } @@ -184,7 +184,7 @@ class B extends A { const B(); } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 9)], + [error(WarningCode.constantPatternNeverMatchesValueType, 27, 9)], ); } @@ -219,7 +219,7 @@ class B extends A { const B(); } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 14)], + [error(WarningCode.constantPatternNeverMatchesValueType, 27, 14)], ); } @@ -258,7 +258,7 @@ class A { const A(); } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 32, 14)], + [error(WarningCode.constantPatternNeverMatchesValueType, 32, 14)], ); } @@ -293,7 +293,7 @@ void f(bool x) { if (x case (0)) {} } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 31, 1)], + [error(WarningCode.constantPatternNeverMatchesValueType, 31, 1)], ); } @@ -316,7 +316,7 @@ void f(E x) { if (x case (0)) {} } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 58, 1)], + [error(WarningCode.constantPatternNeverMatchesValueType, 58, 1)], ); } @@ -339,7 +339,7 @@ void f(void Function() x) { class A {} ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 42, 1)], + [error(WarningCode.constantPatternNeverMatchesValueType, 42, 1)], ); } @@ -376,7 +376,7 @@ void f(A x) { class A {} ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 28, 1)], + [error(WarningCode.constantPatternNeverMatchesValueType, 28, 1)], ); } @@ -387,7 +387,7 @@ void f(String x) { if (x case (0)) {} } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 33, 1)], + [error(WarningCode.constantPatternNeverMatchesValueType, 33, 1)], ); } @@ -399,8 +399,8 @@ void f(void Function() x) { } ''', [ - error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 42, 4), - error(WarningCode.DEAD_CODE, 49, 2), + error(WarningCode.constantPatternNeverMatchesValueType, 42, 4), + error(WarningCode.deadCode, 49, 2), ], ); } @@ -421,8 +421,8 @@ void f(int x) { } ''', [ - error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 4), - error(WarningCode.DEAD_CODE, 37, 2), + error(WarningCode.constantPatternNeverMatchesValueType, 30, 4), + error(WarningCode.deadCode, 37, 2), ], ); } @@ -443,8 +443,8 @@ void f(T x) { } ''', [ - error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 45, 4), - error(WarningCode.DEAD_CODE, 51, 2), + error(WarningCode.constantPatternNeverMatchesValueType, 45, 4), + error(WarningCode.deadCode, 51, 2), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/constant_pattern_with_non_constant_expression_test.dart b/pkg/analyzer/test/src/diagnostics/constant_pattern_with_non_constant_expression_test.dart index c5ff0fa69ee..27e7387b420 100644 --- a/pkg/analyzer/test/src/diagnostics/constant_pattern_with_non_constant_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/constant_pattern_with_non_constant_expression_test.dart @@ -78,7 +78,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, 60, 3, ), @@ -297,7 +297,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, 47, 1, ), @@ -335,7 +335,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, 38, 1, ), @@ -415,7 +415,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, 47, 1, ), @@ -465,7 +465,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, 50, 1, ), @@ -537,7 +537,7 @@ void f(var e, int a) { ''', [ error( - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, 58, 1, ), @@ -577,7 +577,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.CONSTANT_PATTERN_WITH_NON_CONSTANT_EXPRESSION, + CompileTimeErrorCode.constantPatternWithNonConstantExpression, 39, 1, ), @@ -603,7 +603,7 @@ void f(Object? x) { if (x case foo) {} } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 33, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 33, 3)], ); var node = findNode.singleGuardedPattern; diff --git a/pkg/analyzer/test/src/diagnostics/continue_label_invalid_test.dart b/pkg/analyzer/test/src/diagnostics/continue_label_invalid_test.dart index 887021c8c49..b5988f2ed28 100644 --- a/pkg/analyzer/test/src/diagnostics/continue_label_invalid_test.dart +++ b/pkg/analyzer/test/src/diagnostics/continue_label_invalid_test.dart @@ -28,8 +28,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(CompileTimeErrorCode.CONTINUE_LABEL_INVALID, 50, 11), + error(WarningCode.unusedLocalVariable, 33, 1), + error(CompileTimeErrorCode.continueLabelInvalid, 50, 11), ], ); } @@ -44,7 +44,7 @@ void f(int x) { } } ''', - [error(CompileTimeErrorCode.CONTINUE_LABEL_INVALID, 52, 11)], + [error(CompileTimeErrorCode.continueLabelInvalid, 52, 11)], ); } @@ -59,7 +59,7 @@ void f(int x) { } } ''', - [error(CompileTimeErrorCode.CONTINUE_LABEL_INVALID, 68, 11)], + [error(CompileTimeErrorCode.continueLabelInvalid, 68, 11)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/could_not_infer_test.dart b/pkg/analyzer/test/src/diagnostics/could_not_infer_test.dart index bafce0983a1..68e33a66eb8 100644 --- a/pkg/analyzer/test/src/diagnostics/could_not_infer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/could_not_infer_test.dart @@ -37,26 +37,26 @@ main() { [ error( CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + .notInitializedNonNullableInstanceFieldConstructor, 94, 1, ), error( CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + .notInitializedNonNullableInstanceFieldConstructor, 94, 1, ), - error(CompileTimeErrorCode.COULD_NOT_INFER, 154, 3), - error(CompileTimeErrorCode.COULD_NOT_INFER, 154, 3), + error(CompileTimeErrorCode.couldNotInfer, 154, 3), + error(CompileTimeErrorCode.couldNotInfer, 154, 3), error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 154, 1, contextMessages: [message(testFile, 154, 1)], ), error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 154, 1, contextMessages: [message(testFile, 154, 1)], @@ -84,9 +84,9 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 98, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 120, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 126, 3), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 98, 4), + error(WarningCode.unusedLocalVariable, 120, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 126, 3), ], ); } @@ -107,31 +107,27 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 93, 1), + error(WarningCode.unusedLocalVariable, 93, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 101, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 117, 1), + error(WarningCode.unusedLocalVariable, 117, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 125, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 142, 1), + error(WarningCode.unusedLocalVariable, 142, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 150, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 163, 1), + error(WarningCode.unusedLocalVariable, 163, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 171, 1, ), @@ -145,7 +141,7 @@ main() { T f(T t) => null; main() { f((S s) => s); } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 15, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 15, 4)], ); } @@ -158,7 +154,7 @@ void f(X x) { foo(x); } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 40, 1)], + [error(CompileTimeErrorCode.undefinedClass, 40, 1)], ); } @@ -193,7 +189,7 @@ void f() { foo(); } ''', - [error(CompileTimeErrorCode.COULD_NOT_INFER, 85, 3)], + [error(CompileTimeErrorCode.couldNotInfer, 85, 3)], ); } @@ -209,7 +205,7 @@ main() { [f]; } ''', - [error(CompileTimeErrorCode.COULD_NOT_INFER, 42, 3)], + [error(CompileTimeErrorCode.couldNotInfer, 42, 3)], ); } @@ -232,7 +228,7 @@ void main() { g(f); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 95, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 95, 1)], ); } @@ -248,7 +244,7 @@ void main() { g(a.f); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 78, 3)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 78, 3)], ); } @@ -261,7 +257,7 @@ void main() { g(f); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 95, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 95, 1)], ); } @@ -278,7 +274,7 @@ void main() { g(C().m); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 124, 5)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 124, 5)], ); } @@ -322,8 +318,8 @@ void main() { } ''', [ - error(CompileTimeErrorCode.COULD_NOT_INFER, 92, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 92, 1), + error(CompileTimeErrorCode.couldNotInfer, 92, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 92, 1), ], ); } @@ -339,7 +335,7 @@ main() { new Foo().method(42); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 104, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 104, 2)], ); } @@ -361,9 +357,9 @@ void f() { } ''', [ - error(CompileTimeErrorCode.COULD_NOT_INFER, 152, 1), - error(CompileTimeErrorCode.COULD_NOT_INFER, 169, 5), - error(CompileTimeErrorCode.COULD_NOT_INFER, 190, 5), + error(CompileTimeErrorCode.couldNotInfer, 152, 1), + error(CompileTimeErrorCode.couldNotInfer, 169, 5), + error(CompileTimeErrorCode.couldNotInfer, 190, 5), ], ); } @@ -376,7 +372,7 @@ class C { } main() { new C().f((S s) => s); } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 27, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 27, 4)], ); } @@ -390,7 +386,7 @@ class C

{ var c = C([]); ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 84, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 84, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/creation_of_struct_or_union_test.dart b/pkg/analyzer/test/src/diagnostics/creation_of_struct_or_union_test.dart index 53a47351c56..0b66cf4fc66 100644 --- a/pkg/analyzer/test/src/diagnostics/creation_of_struct_or_union_test.dart +++ b/pkg/analyzer/test/src/diagnostics/creation_of_struct_or_union_test.dart @@ -29,7 +29,7 @@ void f() { A(); } ''', - [error(FfiCode.CREATION_OF_STRUCT_OR_UNION, 96, 1)], + [error(FfiCode.creationOfStructOrUnion, 96, 1)], ); } @@ -47,7 +47,7 @@ void f() { A(); } ''', - [error(FfiCode.CREATION_OF_STRUCT_OR_UNION, 95, 1)], + [error(FfiCode.creationOfStructOrUnion, 95, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/dead_code_test.dart b/pkg/analyzer/test/src/diagnostics/dead_code_test.dart index 2d57c1e5b29..601d6903a53 100644 --- a/pkg/analyzer/test/src/diagnostics/dead_code_test.dart +++ b/pkg/analyzer/test/src/diagnostics/dead_code_test.dart @@ -24,7 +24,7 @@ Never doNotReturn() => throw 0; test() => doNotReturn() as int; ''', - [error(WarningCode.DEAD_CODE, 60, 4)], + [error(WarningCode.deadCode, 60, 4)], ); } @@ -35,7 +35,7 @@ void f(({int x, int y}) p) { true ? p.x : p.y; } ''', - [error(WarningCode.DEAD_CODE, 44, 3)], + [error(WarningCode.deadCode, 44, 3)], ); } @@ -46,7 +46,7 @@ void f(({bool b, }) r) { if (true || r.b) {} } ''', - [error(WarningCode.DEAD_CODE, 36, 6)], + [error(WarningCode.deadCode, 36, 6)], ); } @@ -57,7 +57,7 @@ void f(int x) { if (x case int() || 0) {} } ''', - [error(WarningCode.DEAD_CODE, 35, 4)], + [error(WarningCode.deadCode, 35, 4)], ); } @@ -68,7 +68,7 @@ void f(int x) { if (x case (int() || 0) && 1) {} } ''', - [error(WarningCode.DEAD_CODE, 36, 4)], + [error(WarningCode.deadCode, 36, 4)], ); } @@ -79,7 +79,7 @@ void f(Object? x) { if (x case [int() || 0, 1]) {} } ''', - [error(WarningCode.DEAD_CODE, 45, 4)], + [error(WarningCode.deadCode, 45, 4)], ); } @@ -92,7 +92,7 @@ Object f(int x) { }; } ''', - [error(WarningCode.DEAD_CODE, 50, 4)], + [error(WarningCode.deadCode, 50, 4)], ); } @@ -108,11 +108,11 @@ Object f(int x) { } ''', [ - error(WarningCode.DEAD_CODE, 50, 4), - error(WarningCode.DEAD_CODE, 65, 10), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 71, 2), - error(WarningCode.DEAD_CODE, 81, 6), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 83, 2), + error(WarningCode.deadCode, 50, 4), + error(WarningCode.deadCode, 65, 10), + error(WarningCode.unreachableSwitchCase, 71, 2), + error(WarningCode.deadCode, 81, 6), + error(WarningCode.unreachableSwitchCase, 83, 2), ], ); } @@ -127,7 +127,7 @@ void f(int x) { } } ''', - [error(WarningCode.DEAD_CODE, 46, 4)], + [error(WarningCode.deadCode, 46, 4)], ); } @@ -144,10 +144,10 @@ void f(int x) { } ''', [ - error(WarningCode.DEAD_CODE, 46, 4), - error(WarningCode.DEAD_CODE, 56, 4), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 56, 4), - error(WarningCode.DEAD_CODE, 68, 7), + error(WarningCode.deadCode, 46, 4), + error(WarningCode.deadCode, 56, 4), + error(WarningCode.unreachableSwitchCase, 56, 4), + error(WarningCode.deadCode, 68, 7), ], ); } @@ -165,11 +165,11 @@ void f(int x) { } ''', [ - error(WarningCode.DEAD_CODE, 46, 5), - error(WarningCode.DEAD_CODE, 57, 4), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 57, 4), - error(WarningCode.DEAD_CODE, 78, 4), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 78, 4), + error(WarningCode.deadCode, 46, 5), + error(WarningCode.deadCode, 57, 4), + error(WarningCode.unreachableSwitchCase, 57, 4), + error(WarningCode.deadCode, 78, 4), + error(WarningCode.unreachableSwitchCase, 78, 4), ], ); } @@ -180,8 +180,8 @@ void f(int x) { f() => [for (var (i) = throw 0; true; 1) 0]; ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), - error(WarningCode.DEAD_CODE, 32, 7), + error(WarningCode.unusedLocalVariable, 18, 1), + error(WarningCode.deadCode, 32, 7), ], ); } @@ -194,8 +194,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 23, 1), - error(WarningCode.DEAD_CODE, 37, 7), + error(WarningCode.unusedLocalVariable, 23, 1), + error(WarningCode.deadCode, 37, 7), ], ); } @@ -207,7 +207,7 @@ void f(int a) { [if (false) (a) = 0]; } ''', - [error(WarningCode.DEAD_CODE, 30, 7)], + [error(WarningCode.deadCode, 30, 7)], ); } @@ -219,8 +219,8 @@ Never doNotReturn() => throw 0; test() => doNotReturn() is int; ''', [ - error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 43, 20), - error(WarningCode.DEAD_CODE, 60, 4), + error(WarningCode.unnecessaryTypeCheckTrue, 43, 20), + error(WarningCode.deadCode, 60, 4), ], ); } @@ -232,7 +232,7 @@ void f() { _(){} } ''', - [error(WarningCode.DEAD_CODE, 13, 5)], + [error(WarningCode.deadCode, 13, 5)], ); } @@ -248,7 +248,7 @@ void f() { ''', [ // No dead code. - error(WarningCode.UNUSED_ELEMENT, 57, 1), + error(WarningCode.unusedElement, 57, 1), ], ); } @@ -263,7 +263,7 @@ void f(Null n, int i) { ''', [ // Dead range: `i]` - error(WarningCode.DEAD_CODE, 29, 2), + error(WarningCode.deadCode, 29, 2), ], ); } @@ -278,7 +278,7 @@ void f(Null n, int i, int j) { ''', [ // Dead range: `i] = j` - error(WarningCode.DEAD_CODE, 36, 6), + error(WarningCode.deadCode, 36, 6), ], ); } @@ -293,7 +293,7 @@ void f(Null n, int i) { ''', [ // Dead range: `foo(i)` - error(WarningCode.DEAD_CODE, 29, 6), + error(WarningCode.deadCode, 29, 6), ], ); } @@ -308,7 +308,7 @@ void f(Null n) { ''', [ // Dead range: `p` - error(WarningCode.DEAD_CODE, 22, 1), + error(WarningCode.deadCode, 22, 1), ], ); } @@ -323,7 +323,7 @@ void f(Null n, int i) { ''', [ // Dead range: `p = i` - error(WarningCode.DEAD_CODE, 29, 5), + error(WarningCode.deadCode, 29, 5), ], ); } @@ -339,7 +339,7 @@ void f(Object x) { if (x case A(foo: _)) {} } ''', - [error(WarningCode.DEAD_CODE, 84, 2)], + [error(WarningCode.deadCode, 84, 2)], ); } @@ -350,7 +350,7 @@ Never get doNotReturn => throw 0; test() => doNotReturn.hashCode; ''', - [error(WarningCode.DEAD_CODE, 57, 9)], + [error(WarningCode.deadCode, 57, 9)], ); } @@ -361,7 +361,7 @@ Never doNotReturn() => throw 0; test() => doNotReturn().hashCode; ''', - [error(WarningCode.DEAD_CODE, 57, 9)], + [error(WarningCode.deadCode, 57, 9)], ); } } @@ -442,7 +442,7 @@ void f() { assert (true); } ''', - [error(WarningCode.DEAD_CODE, 23, 14)], + [error(WarningCode.deadCode, 23, 14)], ); } @@ -457,7 +457,7 @@ void f(Object waldo) { assert(waldo != null, "Where's Waldo?"); } ''', - [error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE, 38, 7)], + [error(WarningCode.unnecessaryNullComparisonNeverNullTrue, 38, 7)], ); } @@ -469,7 +469,7 @@ void f() { i?.truncate(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 28, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 28, 2)], ); } @@ -483,7 +483,7 @@ class C { static final x = [1, 2, f(), 4]; } ''', - [error(WarningCode.DEAD_CODE, 66, 2)], + [error(WarningCode.deadCode, 66, 2)], ); } @@ -497,7 +497,7 @@ class A { } } ''', - [error(WarningCode.DEAD_CODE, 39, 12)], + [error(WarningCode.deadCode, 39, 12)], ); } @@ -527,7 +527,7 @@ class A { A() : x = [7, throw 8, 9]; } ''', - [error(WarningCode.DEAD_CODE, 50, 3)], + [error(WarningCode.deadCode, 50, 3)], ); } @@ -542,7 +542,7 @@ class A { y = 7; } ''', - [error(WarningCode.DEAD_CODE, 63, 5)], + [error(WarningCode.deadCode, 63, 5)], ); } @@ -566,7 +566,7 @@ f() { true ? 1 : 2; } ''', - [error(WarningCode.DEAD_CODE, 19, 1)], + [error(WarningCode.deadCode, 19, 1)], ); } @@ -587,7 +587,7 @@ f() { true ? true : false && false; } ''', - [error(WarningCode.DEAD_CODE, 22, 14)], + [error(WarningCode.deadCode, 22, 14)], ); } @@ -598,7 +598,7 @@ f() { false ? 1 : 2; } ''', - [error(WarningCode.DEAD_CODE, 16, 1)], + [error(WarningCode.deadCode, 16, 1)], ); } @@ -619,7 +619,7 @@ f() { false ? false && false : true; } ''', - [error(WarningCode.DEAD_CODE, 16, 14)], + [error(WarningCode.deadCode, 16, 14)], ); } @@ -630,7 +630,7 @@ f() { if(true) {} else {} } ''', - [error(WarningCode.DEAD_CODE, 25, 2)], + [error(WarningCode.deadCode, 25, 2)], ); } @@ -651,7 +651,7 @@ f() { if(true) {} else {if (false) {}} } ''', - [error(WarningCode.DEAD_CODE, 25, 15)], + [error(WarningCode.deadCode, 25, 15)], ); } @@ -662,7 +662,7 @@ f() { if(false) {} } ''', - [error(WarningCode.DEAD_CODE, 18, 2)], + [error(WarningCode.deadCode, 18, 2)], ); } @@ -721,7 +721,7 @@ f() { if(false) {if(false) {}} } ''', - [error(WarningCode.DEAD_CODE, 18, 14)], + [error(WarningCode.deadCode, 18, 14)], ); } @@ -734,7 +734,7 @@ f() { ]; } ''', - [error(WarningCode.DEAD_CODE, 25, 1)], + [error(WarningCode.deadCode, 25, 1)], ); } @@ -748,7 +748,7 @@ f() { ]; } ''', - [error(WarningCode.DEAD_CODE, 35, 1)], + [error(WarningCode.deadCode, 35, 1)], ); } @@ -759,7 +759,7 @@ f() { while(false) {} } ''', - [error(WarningCode.DEAD_CODE, 21, 2)], + [error(WarningCode.deadCode, 21, 2)], ); } @@ -780,7 +780,7 @@ f() { while(false) {if(false) {}} } ''', - [error(WarningCode.DEAD_CODE, 21, 14)], + [error(WarningCode.deadCode, 21, 14)], ); } @@ -792,7 +792,7 @@ f() { try {} catch (e) {} catch (e) {} } ''', - [error(WarningCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, 39, 12)], + [error(WarningCode.deadCodeCatchFollowingCatch, 39, 12)], ); } @@ -805,7 +805,7 @@ f() { try {} catch (e) {} catch (e) {if(false) {}} } ''', - [error(WarningCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, 39, 24)], + [error(WarningCode.deadCodeCatchFollowingCatch, 39, 24)], ); } @@ -817,8 +817,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_CATCH_CLAUSE, 32, 1), - error(WarningCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, 38, 12), + error(WarningCode.unusedCatchClause, 32, 1), + error(WarningCode.deadCodeCatchFollowingCatch, 38, 12), ], ); } @@ -832,8 +832,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_CATCH_CLAUSE, 32, 1), - error(WarningCode.DEAD_CODE_CATCH_FOLLOWING_CATCH, 38, 24), + error(WarningCode.unusedCatchClause, 32, 1), + error(WarningCode.deadCodeCatchFollowingCatch, 38, 24), ], ); } @@ -848,9 +848,9 @@ f() { } ''', [ - error(WarningCode.UNUSED_CATCH_CLAUSE, 59, 1), - error(WarningCode.DEAD_CODE_ON_CATCH_SUBTYPE, 65, 17), - error(WarningCode.UNUSED_CATCH_CLAUSE, 77, 1), + error(WarningCode.unusedCatchClause, 59, 1), + error(WarningCode.deadCodeOnCatchSubtype, 65, 17), + error(WarningCode.unusedCatchClause, 77, 1), ], ); } @@ -866,9 +866,9 @@ f() { } ''', [ - error(WarningCode.UNUSED_CATCH_CLAUSE, 59, 1), - error(WarningCode.DEAD_CODE_ON_CATCH_SUBTYPE, 65, 29), - error(WarningCode.UNUSED_CATCH_CLAUSE, 77, 1), + error(WarningCode.unusedCatchClause, 59, 1), + error(WarningCode.deadCodeOnCatchSubtype, 65, 29), + error(WarningCode.unusedCatchClause, 77, 1), ], ); } @@ -883,8 +883,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_CATCH_CLAUSE, 59, 1), - error(WarningCode.UNUSED_CATCH_CLAUSE, 77, 1), + error(WarningCode.unusedCatchClause, 59, 1), + error(WarningCode.unusedCatchClause, 77, 1), ], ); } @@ -897,7 +897,7 @@ f() { print(b); } ''', - [error(WarningCode.DEAD_CODE, 23, 8)], + [error(WarningCode.deadCode, 23, 8)], ); } @@ -919,7 +919,7 @@ f() { print(b); } ''', - [error(WarningCode.DEAD_CODE, 23, 19)], + [error(WarningCode.deadCode, 23, 19)], ); } @@ -931,7 +931,7 @@ f() { print(b); } ''', - [error(WarningCode.DEAD_CODE, 22, 7)], + [error(WarningCode.deadCode, 22, 7)], ); } @@ -943,7 +943,7 @@ f() { bool b = DEBUG || true; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 38, 1)], + [error(WarningCode.unusedLocalVariable, 38, 1)], ); } @@ -955,7 +955,7 @@ f() { print(b); } ''', - [error(WarningCode.DEAD_CODE, 22, 19)], + [error(WarningCode.deadCode, 22, 19)], ); } @@ -976,7 +976,7 @@ void f(bool c) { } while (c); } ''', - [error(WarningCode.DEAD_CODE, 52, 12)], + [error(WarningCode.deadCode, 52, 12)], ); } @@ -993,7 +993,7 @@ void f(bool c) { print(''); } ''', - [error(WarningCode.DEAD_CODE, 69, 12)], + [error(WarningCode.deadCode, 69, 12)], ); } @@ -1011,7 +1011,7 @@ void f(bool c) { print(''); } ''', - [error(WarningCode.DEAD_CODE, 85, 12)], + [error(WarningCode.deadCode, 85, 12)], ); } @@ -1029,8 +1029,8 @@ void f(bool c) { } ''', [ - error(WarningCode.DEAD_CODE, 73, 12), - error(WarningCode.DEAD_CODE, 88, 10), + error(WarningCode.deadCode, 73, 12), + error(WarningCode.deadCode, 88, 10), ], ); } @@ -1053,8 +1053,8 @@ void f(bool c) { } ''', [ - error(WarningCode.DEAD_CODE, 104, 12), - error(WarningCode.DEAD_CODE, 121, 38), + error(WarningCode.deadCode, 104, 12), + error(WarningCode.deadCode, 121, 38), ], ); } @@ -1075,8 +1075,8 @@ void f(bool c) { } ''', [ - error(WarningCode.DEAD_CODE, 98, 12), - error(WarningCode.DEAD_CODE, 115, 14), + error(WarningCode.deadCode, 98, 12), + error(WarningCode.deadCode, 115, 14), ], ); } @@ -1093,8 +1093,8 @@ void f(bool c) { } ''', [ - error(WarningCode.DEAD_CODE, 52, 12), - error(WarningCode.DEAD_CODE, 67, 11), + error(WarningCode.deadCode, 52, 12), + error(WarningCode.deadCode, 67, 11), ], ); } @@ -1109,10 +1109,7 @@ void f() { } } ''', - [ - error(WarningCode.DEAD_CODE, 21, 1), - error(WarningCode.DEAD_CODE, 42, 2), - ], + [error(WarningCode.deadCode, 21, 1), error(WarningCode.deadCode, 42, 2)], ); } @@ -1125,7 +1122,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 21, 4)], + [error(WarningCode.deadCode, 21, 4)], ); } @@ -1134,10 +1131,7 @@ void f() { r''' f() => [for (; throw 0; 1) 0]; ''', - [ - error(WarningCode.DEAD_CODE, 24, 1), - error(WarningCode.DEAD_CODE, 27, 3), - ], + [error(WarningCode.deadCode, 24, 1), error(WarningCode.deadCode, 27, 3)], ); } @@ -1146,7 +1140,7 @@ f() => [for (; throw 0; 1) 0]; r''' f(bool Function(Object?, Object?) g) => [for (; g(throw 0, 1); 2) 0]; ''', - [error(WarningCode.DEAD_CODE, 59, 10)], + [error(WarningCode.deadCode, 59, 10)], ); } @@ -1156,8 +1150,8 @@ f(bool Function(Object?, Object?) g) => [for (; g(throw 0, 1); 2) 0]; f() => [for (var i = throw 0; true; 1) 0]; ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(WarningCode.DEAD_CODE, 30, 7), + error(WarningCode.unusedLocalVariable, 17, 1), + error(WarningCode.deadCode, 30, 7), ], ); } @@ -1167,7 +1161,7 @@ f() => [for (var i = throw 0; true; 1) 0]; r''' f() => [for (throw 0; true; 1) 0]; ''', - [error(WarningCode.DEAD_CODE, 22, 7)], + [error(WarningCode.deadCode, 22, 7)], ); } @@ -1176,7 +1170,7 @@ f() => [for (throw 0; true; 1) 0]; r''' f() => [for (var i = 0;; i = i + 1) throw '']; ''', - [error(WarningCode.DEAD_CODE, 25, 9)], + [error(WarningCode.deadCode, 25, 9)], ); } @@ -1185,7 +1179,7 @@ f() => [for (var i = 0;; i = i + 1) throw '']; r''' f() => [for (var i = 0;; i + 1) throw '']; ''', - [error(WarningCode.DEAD_CODE, 25, 5)], + [error(WarningCode.deadCode, 25, 5)], ); } @@ -1194,7 +1188,7 @@ f() => [for (var i = 0;; i + 1) throw '']; r''' f() => [for (var i = 0;; i..sign) throw '']; ''', - [error(WarningCode.DEAD_CODE, 25, 7)], + [error(WarningCode.deadCode, 25, 7)], ); } @@ -1203,7 +1197,7 @@ f() => [for (var i = 0;; i..sign) throw '']; r''' f() => [for (var i = 0;; i > 1 ? i : i) throw '']; ''', - [error(WarningCode.DEAD_CODE, 25, 13)], + [error(WarningCode.deadCode, 25, 13)], ); } @@ -1212,7 +1206,7 @@ f() => [for (var i = 0;; i > 1 ? i : i) throw '']; r''' f(List values) => [for (;; values[0]) throw '']; ''', - [error(WarningCode.DEAD_CODE, 32, 9)], + [error(WarningCode.deadCode, 32, 9)], ); } @@ -1222,7 +1216,7 @@ f(List values) => [for (;; values[0]) throw '']; class C {} f() => [for (;; C()) throw '']; ''', - [error(WarningCode.DEAD_CODE, 27, 3)], + [error(WarningCode.deadCode, 27, 3)], ); } @@ -1231,7 +1225,7 @@ f() => [for (;; C()) throw '']; r''' f() => [for (var i = 0;; i.toString()) throw '']; ''', - [error(WarningCode.DEAD_CODE, 25, 12)], + [error(WarningCode.deadCode, 25, 12)], ); } @@ -1240,7 +1234,7 @@ f() => [for (var i = 0;; i.toString()) throw '']; r''' f() => [for (var i = 0;; i++) throw '']; ''', - [error(WarningCode.DEAD_CODE, 25, 3)], + [error(WarningCode.deadCode, 25, 3)], ); } @@ -1251,7 +1245,7 @@ import 'dart:math' as m; f() => [for (;; m.Point) throw '']; ''', - [error(WarningCode.DEAD_CODE, 42, 7)], + [error(WarningCode.deadCode, 42, 7)], ); } @@ -1260,7 +1254,7 @@ f() => [for (;; m.Point) throw '']; r''' f() => [for (var i = 0;; ++i) throw '']; ''', - [error(WarningCode.DEAD_CODE, 25, 3)], + [error(WarningCode.deadCode, 25, 3)], ); } @@ -1269,7 +1263,7 @@ f() => [for (var i = 0;; ++i) throw '']; r''' f() => [for (var i = 0;; (i).sign) throw '']; ''', - [error(WarningCode.DEAD_CODE, 25, 8)], + [error(WarningCode.deadCode, 25, 8)], ); } @@ -1278,7 +1272,7 @@ f() => [for (var i = 0;; (i).sign) throw '']; r''' f() => [for (;; 0, throw 1, 2) 0]; ''', - [error(WarningCode.DEAD_CODE, 28, 1)], + [error(WarningCode.deadCode, 28, 1)], ); } @@ -1289,10 +1283,7 @@ void f() { for (; throw 0; 1) {} } ''', - [ - error(WarningCode.DEAD_CODE, 29, 1), - error(WarningCode.DEAD_CODE, 32, 2), - ], + [error(WarningCode.deadCode, 29, 1), error(WarningCode.deadCode, 32, 2)], ); } @@ -1303,7 +1294,7 @@ void f(bool Function(Object?, Object?) g) { for (; g(throw 0, 1); 2) {} } ''', - [error(WarningCode.DEAD_CODE, 64, 9)], + [error(WarningCode.deadCode, 64, 9)], ); } @@ -1315,8 +1306,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1), - error(WarningCode.DEAD_CODE, 35, 7), + error(WarningCode.unusedLocalVariable, 22, 1), + error(WarningCode.deadCode, 35, 7), ], ); } @@ -1328,7 +1319,7 @@ void f() { for (throw 0; true; 1) {} } ''', - [error(WarningCode.DEAD_CODE, 27, 7)], + [error(WarningCode.deadCode, 27, 7)], ); } @@ -1341,7 +1332,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 30, 9)], + [error(WarningCode.deadCode, 30, 9)], ); } @@ -1354,7 +1345,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 30, 5)], + [error(WarningCode.deadCode, 30, 5)], ); } @@ -1367,7 +1358,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 30, 7)], + [error(WarningCode.deadCode, 30, 7)], ); } @@ -1380,7 +1371,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 30, 13)], + [error(WarningCode.deadCode, 30, 13)], ); } @@ -1393,7 +1384,7 @@ void f(List values) { } } ''', - [error(WarningCode.DEAD_CODE, 37, 9)], + [error(WarningCode.deadCode, 37, 9)], ); } @@ -1407,7 +1398,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 32, 3)], + [error(WarningCode.deadCode, 32, 3)], ); } @@ -1420,7 +1411,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 30, 12)], + [error(WarningCode.deadCode, 30, 12)], ); } @@ -1433,7 +1424,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 30, 3)], + [error(WarningCode.deadCode, 30, 3)], ); } @@ -1448,7 +1439,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 47, 7)], + [error(WarningCode.deadCode, 47, 7)], ); } @@ -1461,7 +1452,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 30, 3)], + [error(WarningCode.deadCode, 30, 3)], ); } @@ -1474,7 +1465,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 30, 8)], + [error(WarningCode.deadCode, 30, 8)], ); } @@ -1485,7 +1476,7 @@ void f() { for (;; 0, throw 1, 2) {} } ''', - [error(WarningCode.DEAD_CODE, 33, 1)], + [error(WarningCode.deadCode, 33, 1)], ); } @@ -1501,7 +1492,7 @@ main() { 2; } ''', - [error(WarningCode.DEAD_CODE, 61, 2)], + [error(WarningCode.deadCode, 61, 2)], ); } @@ -1516,7 +1507,7 @@ void f(bool a) { 2; } ''', - [error(WarningCode.DEAD_CODE, 44, 2)], + [error(WarningCode.deadCode, 44, 2)], ); } @@ -1525,10 +1516,7 @@ void f(bool a) { r''' f() => [for (;; 1) ...[throw '', 2]]; ''', - [ - error(WarningCode.DEAD_CODE, 16, 1), - error(WarningCode.DEAD_CODE, 33, 4), - ], + [error(WarningCode.deadCode, 16, 1), error(WarningCode.deadCode, 33, 4)], ); } @@ -1537,7 +1525,7 @@ f() => [for (;; 1) ...[throw '', 2]]; r''' f() => [for (;; 1, 2) ...[throw '']]; ''', - [error(WarningCode.DEAD_CODE, 16, 4)], + [error(WarningCode.deadCode, 16, 4)], ); } @@ -1553,10 +1541,7 @@ void f() { } } ''', - [ - error(WarningCode.DEAD_CODE, 21, 1), - error(WarningCode.DEAD_CODE, 52, 8), - ], + [error(WarningCode.deadCode, 21, 1), error(WarningCode.deadCode, 52, 8)], ); } @@ -1571,7 +1556,7 @@ void f() { } } ''', - [error(WarningCode.DEAD_CODE, 21, 4)], + [error(WarningCode.deadCode, 21, 4)], ); } @@ -1590,7 +1575,7 @@ main() { 3; } ''', - [error(WarningCode.DEAD_CODE, 57, 2)], + [error(WarningCode.deadCode, 57, 2)], ); } @@ -1607,7 +1592,7 @@ main() { 3; } ''', - [error(WarningCode.DEAD_CODE, 56, 2)], + [error(WarningCode.deadCode, 56, 2)], ); } @@ -1625,7 +1610,7 @@ main() { 4; } ''', - [error(WarningCode.DEAD_CODE, 61, 11)], + [error(WarningCode.deadCode, 61, 11)], ); } @@ -1637,7 +1622,7 @@ void f() { for (;;) {} } ''', - [error(WarningCode.DEAD_CODE, 23, 11)], + [error(WarningCode.deadCode, 23, 11)], ); } @@ -1653,7 +1638,7 @@ void f() { 3; } ''', - [error(WarningCode.DEAD_CODE, 24, 12)], + [error(WarningCode.deadCode, 24, 12)], ); } @@ -1669,7 +1654,7 @@ void f() { 3; } ''', - [error(WarningCode.DEAD_CODE, 41, 12)], + [error(WarningCode.deadCode, 41, 12)], ); } @@ -1685,8 +1670,8 @@ void g(A a) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 54, 3), - error(WarningCode.DEAD_CODE, 57, 16), + error(WarningCode.receiverOfTypeNever, 54, 3), + error(WarningCode.deadCode, 57, 16), ], ); } @@ -1700,8 +1685,8 @@ void g(Never f) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 3), - error(WarningCode.DEAD_CODE, 23, 16), + error(WarningCode.receiverOfTypeNever, 20, 3), + error(WarningCode.deadCode, 23, 16), ], ); } @@ -1715,8 +1700,8 @@ void g(Never f) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 21, 16), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 21, 16), ], ); } @@ -1728,7 +1713,7 @@ f() { late var _ = 0; } ''', - [error(WarningCode.DEAD_CODE_LATE_WILDCARD_VARIABLE_INITIALIZER, 21, 1)], + [error(WarningCode.deadCodeLateWildcardVariableInitializer, 21, 1)], ); } @@ -1770,7 +1755,7 @@ main() { 1; } ''', - [error(WarningCode.DEAD_CODE, 45, 2)], + [error(WarningCode.deadCode, 45, 2)], ); } @@ -1784,7 +1769,7 @@ main() { 2; } ''', - [error(WarningCode.DEAD_CODE, 45, 2)], + [error(WarningCode.deadCode, 45, 2)], ); } @@ -1806,7 +1791,7 @@ f() { print(2); } ''', - [error(WarningCode.DEAD_CODE, 129, 9)], + [error(WarningCode.deadCode, 129, 9)], ); } @@ -1822,7 +1807,7 @@ f(v) { } } ''', - [error(WarningCode.DEAD_CODE, 65, 9)], + [error(WarningCode.deadCode, 65, 9)], ); } @@ -1837,7 +1822,7 @@ f() { } } ''', - [error(WarningCode.DEAD_CODE, 56, 9)], + [error(WarningCode.deadCode, 56, 9)], ); } @@ -1851,7 +1836,7 @@ f() { } } ''', - [error(WarningCode.DEAD_CODE, 33, 9)], + [error(WarningCode.deadCode, 33, 9)], ); } @@ -1866,7 +1851,7 @@ f(v) { } } ''', - [error(WarningCode.DEAD_CODE, 52, 9)], + [error(WarningCode.deadCode, 52, 9)], ); } @@ -1880,7 +1865,7 @@ f(v) { } } ''', - [error(WarningCode.DEAD_CODE, 35, 9)], + [error(WarningCode.deadCode, 35, 9)], ); } @@ -1895,7 +1880,7 @@ f() { } } ''', - [error(WarningCode.DEAD_CODE, 59, 9)], + [error(WarningCode.deadCode, 59, 9)], ); } @@ -1909,7 +1894,7 @@ f() { } } ''', - [error(WarningCode.DEAD_CODE, 36, 9)], + [error(WarningCode.deadCode, 36, 9)], ); } @@ -1923,7 +1908,7 @@ f(v) { } } ''', - [error(WarningCode.DEAD_CODE, 38, 9)], + [error(WarningCode.deadCode, 38, 9)], ); } @@ -1939,7 +1924,7 @@ f() { print(1); } ''', - [error(WarningCode.DEAD_CODE, 62, 9)], + [error(WarningCode.deadCode, 62, 9)], ); } @@ -1966,7 +1951,7 @@ f() { } } ''', - [error(WarningCode.DEAD_CODE, 61, 9)], + [error(WarningCode.deadCode, 61, 9)], ); } @@ -1979,7 +1964,7 @@ f() { print(2); } ''', - [error(WarningCode.DEAD_CODE, 30, 9)], + [error(WarningCode.deadCode, 30, 9)], ); } @@ -1995,7 +1980,7 @@ f() { g(); } ''', - [error(WarningCode.DEAD_CODE, 49, 9)], + [error(WarningCode.deadCode, 49, 9)], ); } @@ -2010,7 +1995,7 @@ f() { }; } ''', - [error(WarningCode.DEAD_CODE, 43, 9)], + [error(WarningCode.deadCode, 43, 9)], ); } @@ -2025,7 +2010,7 @@ f(bool b) { } } ''', - [error(WarningCode.DEAD_CODE, 52, 9)], + [error(WarningCode.deadCode, 52, 9)], ); } @@ -2040,7 +2025,7 @@ class A { } } ''', - [error(WarningCode.DEAD_CODE, 48, 9)], + [error(WarningCode.deadCode, 48, 9)], ); } @@ -2053,7 +2038,7 @@ f() { if(false) {} } ''', - [error(WarningCode.DEAD_CODE, 30, 12)], + [error(WarningCode.deadCode, 30, 12)], ); } @@ -2068,7 +2053,7 @@ f() { print(3); } ''', - [error(WarningCode.DEAD_CODE, 30, 31)], + [error(WarningCode.deadCode, 30, 31)], ); } @@ -2081,7 +2066,7 @@ f() { print(2); } ''', - [error(WarningCode.DEAD_CODE, 41, 9)], + [error(WarningCode.deadCode, 41, 9)], ); } @@ -2098,7 +2083,7 @@ void f(int a) { } } ''', - [error(WarningCode.DEAD_CODE, 96, 6)], + [error(WarningCode.deadCode, 96, 6)], ); } @@ -2117,7 +2102,7 @@ void f(int a) { } } ''', - [error(WarningCode.DEAD_CODE, 140, 9)], + [error(WarningCode.deadCode, 140, 9)], ); } @@ -2138,7 +2123,7 @@ void f(int a) { } } ''', - [error(WarningCode.DEAD_CODE, 142, 8)], + [error(WarningCode.deadCode, 142, 8)], ); } @@ -2155,7 +2140,7 @@ void f(int a) { } } ''', - [error(WarningCode.DEAD_CODE, 96, 7)], + [error(WarningCode.deadCode, 96, 7)], ); } @@ -2172,7 +2157,7 @@ void f(int a) { } } ''', - [error(WarningCode.DEAD_CODE, 96, 8)], + [error(WarningCode.deadCode, 96, 8)], ); } @@ -2189,7 +2174,7 @@ int f(Foo foo) { return -1; } ''', - [error(WarningCode.DEAD_CODE, 111, 10)], + [error(WarningCode.deadCode, 111, 10)], ); } @@ -2201,7 +2186,7 @@ Never f() { throw ''; } var x = [1, 2, f(), 4]; ''', - [error(WarningCode.DEAD_CODE, 45, 2)], + [error(WarningCode.deadCode, 45, 2)], ); } @@ -2220,8 +2205,8 @@ main() { Never foo() => throw 'exception'; ''', [ - error(WarningCode.DEAD_CODE, 32, 14), - error(WarningCode.DEAD_CODE, 87, 14), + error(WarningCode.deadCode, 32, 14), + error(WarningCode.deadCode, 87, 14), ], ); } @@ -2234,7 +2219,7 @@ void f() { l?..[0]..length; } ''', - [error(WarningCode.DEAD_CODE, 30, 14)], + [error(WarningCode.deadCode, 30, 14)], ); } @@ -2246,7 +2231,7 @@ void f() { i?..toInt()..isEven; } ''', - [error(WarningCode.DEAD_CODE, 24, 18)], + [error(WarningCode.deadCode, 24, 18)], ); } @@ -2258,7 +2243,7 @@ void f() { i?..sign..isEven; } ''', - [error(WarningCode.DEAD_CODE, 24, 15)], + [error(WarningCode.deadCode, 24, 15)], ); } @@ -2270,7 +2255,7 @@ void f() { l?[0]; } ''', - [error(WarningCode.DEAD_CODE, 30, 4)], + [error(WarningCode.deadCode, 30, 4)], ); } @@ -2282,7 +2267,7 @@ void f() { l?[0][0]; } ''', - [error(WarningCode.DEAD_CODE, 36, 7)], + [error(WarningCode.deadCode, 36, 7)], ); } @@ -2294,7 +2279,7 @@ void f() { i?.truncate(); } ''', - [error(WarningCode.DEAD_CODE, 24, 12)], + [error(WarningCode.deadCode, 24, 12)], ); } @@ -2306,7 +2291,7 @@ void f() { i?.truncate().truncate(); } ''', - [error(WarningCode.DEAD_CODE, 24, 23)], + [error(WarningCode.deadCode, 24, 23)], ); } @@ -2318,7 +2303,7 @@ void f() { i?.truncate().sign; } ''', - [error(WarningCode.DEAD_CODE, 24, 17)], + [error(WarningCode.deadCode, 24, 17)], ); } @@ -2330,7 +2315,7 @@ void f() { (i)?.sign; } ''', - [error(WarningCode.DEAD_CODE, 26, 6)], + [error(WarningCode.deadCode, 26, 6)], ); } @@ -2342,7 +2327,7 @@ void f() { (i)?.sign.sign; } ''', - [error(WarningCode.DEAD_CODE, 26, 11)], + [error(WarningCode.deadCode, 26, 11)], ); } @@ -2354,7 +2339,7 @@ Iterable f() sync* { yield 1; } ''', - [error(WarningCode.DEAD_CODE, 38, 8)], + [error(WarningCode.deadCode, 38, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/dead_null_aware_expression_test.dart b/pkg/analyzer/test/src/diagnostics/dead_null_aware_expression_test.dart index 43d71b88df4..38d49f05ca8 100644 --- a/pkg/analyzer/test/src/diagnostics/dead_null_aware_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/dead_null_aware_expression_test.dart @@ -36,8 +36,8 @@ f(int x) { } ''', [ - error(WarningCode.DEAD_CODE, 19, 2), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 19, 1), + error(WarningCode.deadCode, 19, 2), + error(StaticWarningCode.deadNullAwareExpression, 19, 1), ], ); } @@ -58,8 +58,8 @@ f(int x) { } ''', [ - error(WarningCode.DEAD_CODE, 15, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 18, 1), + error(WarningCode.deadCode, 15, 4), + error(StaticWarningCode.deadNullAwareExpression, 18, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/default_value_in_function_type_test.dart b/pkg/analyzer/test/src/diagnostics/default_value_in_function_type_test.dart index b364303673d..9d4465a029e 100644 --- a/pkg/analyzer/test/src/diagnostics/default_value_in_function_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/default_value_in_function_type_test.dart @@ -21,7 +21,7 @@ class DefaultValueInFunctionTypeTest extends PubPackageResolutionTest { ''' typedef F = int Function({Map m = const {}}); ''', - [error(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 48, 1)], + [error(ParserErrorCode.defaultValueInFunctionType, 48, 1)], ); } @@ -33,8 +33,8 @@ typedef F = int Function({Map m = const {}}); typedef F = int Function({Object m = const {1, 2: 3}}); ''', [ - error(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 35, 1), - error(CompileTimeErrorCode.AMBIGUOUS_SET_OR_MAP_LITERAL_BOTH, 37, 15), + error(ParserErrorCode.defaultValueInFunctionType, 35, 1), + error(CompileTimeErrorCode.ambiguousSetOrMapLiteralBoth, 37, 15), ], ); } @@ -44,7 +44,7 @@ typedef F = int Function({Object m = const {1, 2: 3}}); ''' typedef F = int Function([Map m = const {}]); ''', - [error(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 48, 1)], + [error(ParserErrorCode.defaultValueInFunctionType, 48, 1)], ); } @@ -53,7 +53,7 @@ typedef F = int Function([Map m = const {}]); ''' typedef F([x = 0]); ''', - [error(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 13, 1)], + [error(ParserErrorCode.defaultValueInFunctionType, 13, 1)], ); } @@ -62,7 +62,7 @@ typedef F([x = 0]); ''' typedef F([x = 0]); ''', - [error(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 13, 1)], + [error(ParserErrorCode.defaultValueInFunctionType, 13, 1)], ); } @@ -75,7 +75,7 @@ void f() { A(); } ''', - [error(ParserErrorCode.DEFAULT_VALUE_IN_FUNCTION_TYPE, 51, 1)], + [error(ParserErrorCode.defaultValueInFunctionType, 51, 1)], ); // The expression is resolved, even if it is invalid. assertType(findNode.integerLiteral('42'), 'int'); diff --git a/pkg/analyzer/test/src/diagnostics/default_value_in_redirecting_factory_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/default_value_in_redirecting_factory_constructor_test.dart index 95d12695ab2..6824bfe81d1 100644 --- a/pkg/analyzer/test/src/diagnostics/default_value_in_redirecting_factory_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/default_value_in_redirecting_factory_constructor_test.dart @@ -29,7 +29,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR, + CompileTimeErrorCode.defaultValueInRedirectingFactoryConstructor, 27, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/default_value_on_required_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/default_value_on_required_parameter_test.dart index 0ad70a927f9..bbe8c6ed768 100644 --- a/pkg/analyzer/test/src/diagnostics/default_value_on_required_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/default_value_on_required_parameter_test.dart @@ -32,7 +32,7 @@ void log({String? message}) {} ''' void log({required String? message = 'no message'}) {} ''', - [error(CompileTimeErrorCode.DEFAULT_VALUE_ON_REQUIRED_PARAMETER, 27, 7)], + [error(CompileTimeErrorCode.defaultValueOnRequiredParameter, 27, 7)], ); } @@ -49,7 +49,7 @@ abstract class C { void foo({required int? a = 0}); } ''', - [error(CompileTimeErrorCode.DEFAULT_VALUE_ON_REQUIRED_PARAMETER, 45, 1)], + [error(CompileTimeErrorCode.defaultValueOnRequiredParameter, 45, 1)], ); } @@ -60,7 +60,7 @@ class C { void foo({required int? a = 0}) {} } ''', - [error(CompileTimeErrorCode.DEFAULT_VALUE_ON_REQUIRED_PARAMETER, 36, 1)], + [error(CompileTimeErrorCode.defaultValueOnRequiredParameter, 36, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/deferred_import_of_extension_test.dart b/pkg/analyzer/test/src/diagnostics/deferred_import_of_extension_test.dart index 55bd94cf756..fdc2d800e2e 100644 --- a/pkg/analyzer/test/src/diagnostics/deferred_import_of_extension_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deferred_import_of_extension_test.dart @@ -28,7 +28,7 @@ void f() { foo.C(); } ''', - [error(CompileTimeErrorCode.DEFERRED_IMPORT_OF_EXTENSION, 7, 10)], + [error(CompileTimeErrorCode.deferredImportOfExtension, 7, 10)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/definitely_unassigned_late_local_variable_test.dart b/pkg/analyzer/test/src/diagnostics/definitely_unassigned_late_local_variable_test.dart index eda64b56f43..c9b3c363098 100644 --- a/pkg/analyzer/test/src/diagnostics/definitely_unassigned_late_local_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/definitely_unassigned_late_local_variable_test.dart @@ -17,7 +17,7 @@ main() { class DefinitelyUnassignedLateLocalVariableTest extends PubPackageResolutionTest { CompileTimeErrorCode get _errorCode { - return CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE; + return CompileTimeErrorCode.definitelyUnassignedLateLocalVariable; } test_definitelyAssigned_after_compoundAssignment() async { @@ -104,10 +104,7 @@ void f() { v += 1; } ''', - [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1), - error(_errorCode, 27, 1), - ], + [error(WarningCode.unusedLocalVariable, 22, 1), error(_errorCode, 27, 1)], ); } @@ -119,7 +116,7 @@ void f() { v = 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1)], + [error(WarningCode.unusedLocalVariable, 22, 1)], ); } @@ -143,10 +140,7 @@ void f() { ++v; } ''', - [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1), - error(_errorCode, 29, 1), - ], + [error(WarningCode.unusedLocalVariable, 22, 1), error(_errorCode, 29, 1)], ); } @@ -170,10 +164,7 @@ void f() { v++; } ''', - [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1), - error(_errorCode, 27, 1), - ], + [error(WarningCode.unusedLocalVariable, 22, 1), error(_errorCode, 27, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_colon_for_default_value_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_colon_for_default_value_test.dart index 58111cbfba0..9ea549f4b63 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_colon_for_default_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_colon_for_default_value_test.dart @@ -36,7 +36,7 @@ class B extends A { B({super.a : ''}); } ''', - [error(HintCode.DEPRECATED_COLON_FOR_DEFAULT_VALUE, 74, 1)], + [error(HintCode.deprecatedColonForDefaultValue, 74, 1)], ); } @@ -45,7 +45,7 @@ class B extends A { ''' void f({int x : 0}) {} ''', - [error(HintCode.DEPRECATED_COLON_FOR_DEFAULT_VALUE, 14, 1)], + [error(HintCode.deprecatedColonForDefaultValue, 14, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_export_use_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_export_use_test.dart index 2182f06b0c3..08282f59b6f 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_export_use_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_export_use_test.dart @@ -35,7 +35,7 @@ void f() { A; } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 31, 1)], + [error(WarningCode.deprecatedExportUse, 31, 1)], ); } @@ -59,7 +59,7 @@ void f() { prefix.A; } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 48, 1)], + [error(WarningCode.deprecatedExportUse, 48, 1)], ); } @@ -81,7 +81,7 @@ import 'b.dart'; void f(A a) {} ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 25, 1)], + [error(WarningCode.deprecatedExportUse, 25, 1)], ); } @@ -103,7 +103,7 @@ import 'b.dart' as prefix; void f(prefix.A a) {} ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 42, 1)], + [error(WarningCode.deprecatedExportUse, 42, 1)], ); } @@ -125,7 +125,7 @@ import 'b.dart' show A; void f(A a) {} ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 32, 1)], + [error(WarningCode.deprecatedExportUse, 32, 1)], ); } @@ -149,7 +149,7 @@ void f() { foo(); } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 31, 3)], + [error(WarningCode.deprecatedExportUse, 31, 3)], ); } @@ -173,7 +173,7 @@ void f() { prefix.foo(); } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 48, 3)], + [error(WarningCode.deprecatedExportUse, 48, 3)], ); } @@ -200,7 +200,7 @@ void f() { foo; } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 31, 3)], + [error(WarningCode.deprecatedExportUse, 31, 3)], ); } @@ -227,7 +227,7 @@ void f() { prefix.foo; } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 48, 3)], + [error(WarningCode.deprecatedExportUse, 48, 3)], ); } @@ -261,7 +261,7 @@ void f() { foo(); } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 31, 3)], + [error(WarningCode.deprecatedExportUse, 31, 3)], ); } @@ -288,7 +288,7 @@ void f() { foo = 0; } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 31, 3)], + [error(WarningCode.deprecatedExportUse, 31, 3)], ); } @@ -315,7 +315,7 @@ void f() { prefix.foo = 0; } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 48, 3)], + [error(WarningCode.deprecatedExportUse, 48, 3)], ); } @@ -339,7 +339,7 @@ void f() { foo; } ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 31, 3)], + [error(WarningCode.deprecatedExportUse, 31, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_extend_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_extend_test.dart index 2b252d7b522..9b9c8f4cd76 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_extend_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_extend_test.dart @@ -26,7 +26,7 @@ class Foo {} import 'foo.dart'; class Bar extends Foo {} ''', - [error(WarningCode.DEPRECATED_EXTEND, 37, 3)], + [error(WarningCode.deprecatedExtend, 37, 3)], ); } @@ -68,7 +68,7 @@ mixin M {} import 'foo.dart'; class Bar extends Foo {} ''', - [error(WarningCode.DEPRECATED_EXTEND, 37, 3)], + [error(WarningCode.deprecatedExtend, 37, 3)], ); } @@ -84,7 +84,7 @@ import 'foo.dart'; mixin M {} class Bar = Foo with M; ''', - [error(WarningCode.DEPRECATED_EXTEND, 42, 3)], + [error(WarningCode.deprecatedExtend, 42, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_extends_function_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_extends_function_test.dart index 4fc5659a360..c966bd01921 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_extends_function_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_extends_function_test.dart @@ -20,13 +20,7 @@ class DeprecatedExtendsFunctionTest extends PubPackageResolutionTest { ''' class A extends Function {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 16, - 8, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 16, 8)], ); } @@ -36,7 +30,7 @@ class A extends Function {} // @dart = 2.19 class A extends Function {} ''', - [error(WarningCode.DEPRECATED_EXTENDS_FUNCTION, 32, 8)], + [error(WarningCode.deprecatedExtendsFunction, 32, 8)], ); } @@ -47,7 +41,7 @@ class A extends Function {} typedef F = Function; class A extends F {} ''', - [error(WarningCode.DEPRECATED_EXTENDS_FUNCTION, 54, 1)], + [error(WarningCode.deprecatedExtendsFunction, 54, 1)], ); } @@ -58,7 +52,7 @@ class A extends F {} class Function {} class A extends Function {} ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 22, 8)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 22, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_implement_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_implement_test.dart index 0d4430d0b65..c98bccd870e 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_implement_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_implement_test.dart @@ -26,7 +26,7 @@ class Foo {} import 'foo.dart'; class Bar implements Foo {} ''', - [error(WarningCode.DEPRECATED_IMPLEMENT, 40, 3)], + [error(WarningCode.deprecatedImplement, 40, 3)], ); } @@ -68,7 +68,7 @@ mixin M {} import 'foo.dart'; class Bar implements Foo {} ''', - [error(WarningCode.DEPRECATED_IMPLEMENT, 40, 3)], + [error(WarningCode.deprecatedImplement, 40, 3)], ); } @@ -84,7 +84,7 @@ import 'foo.dart'; mixin M {} class Bar = Object with M implements Foo; ''', - [error(WarningCode.DEPRECATED_IMPLEMENT, 67, 3)], + [error(WarningCode.deprecatedImplement, 67, 3)], ); } @@ -99,7 +99,7 @@ class Foo {} import 'foo.dart'; enum Bar implements Foo { one; } ''', - [error(WarningCode.DEPRECATED_IMPLEMENT, 39, 3)], + [error(WarningCode.deprecatedImplement, 39, 3)], ); } @@ -122,7 +122,7 @@ class Foo {} import 'foo.dart'; mixin Bar implements Foo {} ''', - [error(WarningCode.DEPRECATED_IMPLEMENT, 40, 3)], + [error(WarningCode.deprecatedImplement, 40, 3)], ); } @@ -137,7 +137,7 @@ class Foo {} import 'foo.dart'; mixin Bar on Foo {} ''', - [error(WarningCode.DEPRECATED_IMPLEMENT, 32, 3)], + [error(WarningCode.deprecatedImplement, 32, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_implements_function_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_implements_function_test.dart index 4fca77421e9..ee36aab6793 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_implements_function_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_implements_function_test.dart @@ -22,7 +22,7 @@ class A implements Function {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 19, 8, ), @@ -37,13 +37,13 @@ class A implements Function, Function {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 19, 8, ), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 29, 8), + error(CompileTimeErrorCode.implementsRepeated, 29, 8), error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 29, 8, ), @@ -58,8 +58,8 @@ class A implements Function, Function {} class A implements Function, Function {} ''', [ - error(WarningCode.DEPRECATED_IMPLEMENTS_FUNCTION, 35, 8), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 45, 8), + error(WarningCode.deprecatedImplementsFunction, 35, 8), + error(CompileTimeErrorCode.implementsRepeated, 45, 8), ], ); } @@ -70,7 +70,7 @@ class A implements Function, Function {} // @dart = 2.19 class A implements Function {} ''', - [error(WarningCode.DEPRECATED_IMPLEMENTS_FUNCTION, 35, 8)], + [error(WarningCode.deprecatedImplementsFunction, 35, 8)], ); } @@ -81,7 +81,7 @@ class A implements Function {} typedef F = Function; class A implements F {} ''', - [error(WarningCode.DEPRECATED_IMPLEMENTS_FUNCTION, 57, 1)], + [error(WarningCode.deprecatedImplementsFunction, 57, 1)], ); } @@ -91,7 +91,7 @@ class A implements F {} class Function {} class A implements Function {} ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 6, 8)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 6, 8)], ); } @@ -102,7 +102,7 @@ class A implements Function {} mixin M {} class A = Object with M implements Function; ''', - [error(WarningCode.DEPRECATED_IMPLEMENTS_FUNCTION, 62, 8)], + [error(WarningCode.deprecatedImplementsFunction, 62, 8)], ); } @@ -114,7 +114,7 @@ mixin M {} typedef F = Function; class A = Object with M implements F; ''', - [error(WarningCode.DEPRECATED_IMPLEMENTS_FUNCTION, 84, 1)], + [error(WarningCode.deprecatedImplementsFunction, 84, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart index da93122bab3..9005b42426c 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart @@ -35,7 +35,7 @@ import 'package:foo.bar/a.dart'; void f(A a) {} ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 41, 1)], + [error(HintCode.deprecatedMemberUse, 41, 1)], ); } @@ -53,7 +53,7 @@ import 'package:aaa/a.dart'; void f(A a) {} ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 37, 1)], + [error(HintCode.deprecatedMemberUse, 37, 1)], ); } } @@ -110,7 +110,7 @@ import 'package:aaa/a.dart'; void f(A a) {} ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 37, 1)], + [error(HintCode.deprecatedMemberUse, 37, 1)], ); } @@ -165,7 +165,7 @@ import 'package:aaa/a.dart'; void f(A a) {} ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 37, 1)], + [error(HintCode.deprecatedMemberUse, 37, 1)], ); } @@ -189,7 +189,7 @@ import 'package:aaa/a.dart'; void f(A a) {} ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 37, 1)], + [error(HintCode.deprecatedMemberUse, 37, 1)], ); } } @@ -249,7 +249,7 @@ void f() { x += 2; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -266,7 +266,7 @@ void f() { x += 2; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -297,7 +297,7 @@ void f() { x = 0; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -314,7 +314,7 @@ void f() { x = 0; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -331,7 +331,7 @@ void f(A a) { a(); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 45, 3)], + [error(HintCode.deprecatedMemberUse, 45, 3)], ); } @@ -344,7 +344,7 @@ class A {} code: r''' void f(A a) {} ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 36, 1)], + [error(HintCode.deprecatedMemberUse, 36, 1)], ); } @@ -389,7 +389,7 @@ f(A a, A b) { a += b; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 45, 6)], + [error(HintCode.deprecatedMemberUse, 45, 6)], ); } @@ -408,7 +408,7 @@ int g(Object s) => _ => 7, }; ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 69, 3)], + [error(HintCode.deprecatedMemberUse, 69, 3)], ); } @@ -427,7 +427,7 @@ int g(Object s) => _ => 7, }; ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 74, 3)], + [error(HintCode.deprecatedMemberUse, 74, 3)], ); } @@ -449,9 +449,9 @@ void f() { } ''', [ - error(HintCode.DEPRECATED_MEMBER_USE, 43, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1), - error(HintCode.DEPRECATED_MEMBER_USE, 50, 3), + error(HintCode.deprecatedMemberUse, 43, 1), + error(WarningCode.unusedLocalVariable, 45, 1), + error(HintCode.deprecatedMemberUse, 50, 3), ], ); } @@ -473,8 +473,8 @@ void f() { } ''', [ - error(HintCode.DEPRECATED_MEMBER_USE, 43, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1), + error(HintCode.deprecatedMemberUse, 43, 1), + error(WarningCode.unusedLocalVariable, 45, 1), ], ); } @@ -496,8 +496,8 @@ void f() { } ''', [ - error(HintCode.DEPRECATED_MEMBER_USE, 43, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1), + error(HintCode.deprecatedMemberUse, 43, 1), + error(WarningCode.unusedLocalVariable, 45, 1), ], ); } @@ -516,9 +516,9 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 1), + error(WarningCode.unusedLocalVariable, 39, 1), error( - HintCode.DEPRECATED_MEMBER_USE, + HintCode.deprecatedMemberUse, 44, 5, messageContains: ["'A.named' is deprecated and shouldn't be used."], @@ -544,8 +544,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1), - error(HintCode.DEPRECATED_MEMBER_USE, 50, 3), + error(WarningCode.unusedLocalVariable, 45, 1), + error(HintCode.deprecatedMemberUse, 50, 3), ], ); } @@ -560,7 +560,7 @@ library a; ''' export 'package:aaa/a.dart'; ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 0, 28)], + [error(HintCode.deprecatedMemberUse, 0, 28)], ); } @@ -574,7 +574,7 @@ library a; ''' export 'lib2.dart'; ''', - [error(HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE, 0, 19)], + [error(HintCode.deprecatedMemberUseFromSamePackage, 0, 19)], ); } @@ -591,7 +591,7 @@ void f() { E(0).foo; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -611,7 +611,7 @@ void f(A a) { a.foo; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 48, 3)], + [error(HintCode.deprecatedMemberUse, 48, 3)], ); } @@ -631,7 +631,7 @@ void f(A a) { a.foo = 0; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 48, 3)], + [error(HintCode.deprecatedMemberUse, 48, 3)], ); } @@ -680,7 +680,7 @@ import 'package:aaa/a.dart'; ''', [ error( - HintCode.DEPRECATED_MEMBER_USE, + HintCode.deprecatedMemberUse, 24, 28, messageContains: ['package:aaa/a.dart'], @@ -707,9 +707,9 @@ class C { const z = C(x: ''); ''', [ - error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, 53, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 82, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 82, 1), + error(CompileTimeErrorCode.finalNotInitializedConstructor1, 53, 1), + error(ParserErrorCode.missingIdentifier, 82, 1), + error(ParserErrorCode.expectedToken, 82, 1), ], ); } @@ -982,7 +982,7 @@ void f(A a) { return a[1]; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 52, 4)], + [error(HintCode.deprecatedMemberUse, 52, 4)], ); } @@ -1001,7 +1001,7 @@ enum E { } } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 68, 1)], + [error(HintCode.deprecatedMemberUse, 68, 1)], ); } @@ -1018,7 +1018,7 @@ extension E on int { } } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 67, 1)], + [error(HintCode.deprecatedMemberUse, 67, 1)], ); } @@ -1039,7 +1039,7 @@ void f() { A(); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 43, 1)], + [error(HintCode.deprecatedMemberUse, 43, 1)], ); } @@ -1059,7 +1059,7 @@ void f() { A(); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 43, 1)], + [error(HintCode.deprecatedMemberUse, 43, 1)], ); } @@ -1082,7 +1082,7 @@ void f() { [ // https://github.com/dart-lang/linter/issues/4752 // Highlights `A`. - error(HintCode.DEPRECATED_MEMBER_USE, 43, 1), + error(HintCode.deprecatedMemberUse, 43, 1), ], ); } @@ -1102,7 +1102,7 @@ f() { ''', [ error( - HintCode.DEPRECATED_MEMBER_USE, + HintCode.deprecatedMemberUse, 48, 7, messageContains: ["'A.named' is deprecated and shouldn't be used."], @@ -1127,7 +1127,7 @@ void f() { A(); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 43, 1)], + [error(HintCode.deprecatedMemberUse, 43, 1)], ); } @@ -1144,7 +1144,7 @@ f() { return new A(1); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 48, 1)], + [error(HintCode.deprecatedMemberUse, 48, 1)], ); } @@ -1164,7 +1164,7 @@ void f(A a) { a.foo(); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 48, 3)], + [error(HintCode.deprecatedMemberUse, 48, 3)], ); } @@ -1177,7 +1177,7 @@ int f() => 0; code: r''' var x = f(); ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 37, 1)], + [error(HintCode.deprecatedMemberUse, 37, 1)], ); } @@ -1192,7 +1192,7 @@ var x = f(); ''', [ error( - HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE, + HintCode.deprecatedMemberUseWithMessage, 37, 1, text: "'f' is deprecated and shouldn't be used. 0.9.", @@ -1212,7 +1212,7 @@ var x = f(); ''', [ error( - HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE, + HintCode.deprecatedMemberUseWithMessage, 37, 1, text: "'f' is deprecated and shouldn't be used. 0.9.", @@ -1232,7 +1232,7 @@ var x = f(); ''', [ error( - HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE, + HintCode.deprecatedMemberUseWithMessage, 37, 1, text: "'f' is deprecated and shouldn't be used. Really!", @@ -1252,7 +1252,7 @@ var x = f(); ''', [ error( - HintCode.DEPRECATED_MEMBER_USE, + HintCode.deprecatedMemberUse, 37, 1, text: "'f' is deprecated and shouldn't be used.", @@ -1272,7 +1272,7 @@ var x = f(); ''', [ error( - HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE, + HintCode.deprecatedMemberUseWithMessage, 37, 1, text: "'f' is deprecated and shouldn't be used. Are you sure?", @@ -1297,7 +1297,7 @@ void f(A a) { a.foo(); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE, 39, 3)], + [error(HintCode.deprecatedMemberUseFromSamePackage, 39, 3)], ); } @@ -1333,7 +1333,7 @@ void f(A a) { ''', [ error( - HintCode.DEPRECATED_MEMBER_USE_WITH_MESSAGE, + HintCode.deprecatedMemberUseWithMessage, 48, 3, text: "'foo' is deprecated and shouldn't be used. 0.9.", @@ -1368,12 +1368,12 @@ var z = C(x: ''); ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 21, 5, ), - error(ParserErrorCode.MISSING_IDENTIFIER, 26, 1), - error(CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, 42, 1), + error(ParserErrorCode.missingIdentifier, 26, 1), + error(CompileTimeErrorCode.undefinedNamedParameter, 42, 1), ], ); } @@ -1391,7 +1391,7 @@ f(A a, A b) { return a + b; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 52, 5)], + [error(HintCode.deprecatedMemberUse, 52, 5)], ); } @@ -1403,7 +1403,7 @@ void f({@deprecated int x = 0}) {} code: r''' void g() => f(x: 1); ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 43, 1)], + [error(HintCode.deprecatedMemberUse, 43, 1)], ); } @@ -1451,7 +1451,7 @@ class C { C({B this.a = instance}); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 57, 1)], + [error(HintCode.deprecatedMemberUse, 57, 1)], ); } @@ -1510,7 +1510,7 @@ void f() { foo(a: 0); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 47, 1)], + [error(HintCode.deprecatedMemberUse, 47, 1)], ); } @@ -1529,7 +1529,7 @@ void f(A a) { a.foo(a: 0); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 52, 1)], + [error(HintCode.deprecatedMemberUse, 52, 1)], ); } @@ -1545,7 +1545,7 @@ void f(A a) { a.foo(0); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 51, 1)], + [error(HintCode.deprecatedMemberUse, 51, 1)], ); } @@ -1609,7 +1609,7 @@ void f() { x++; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -1641,7 +1641,7 @@ void f() { x++; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -1658,7 +1658,7 @@ void f() { A.foo; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 44, 3)], + [error(HintCode.deprecatedMemberUse, 44, 3)], ); } @@ -1675,7 +1675,7 @@ void f() { A.foo; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -1692,7 +1692,7 @@ void f() { ++x; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 44, 1)], + [error(HintCode.deprecatedMemberUse, 44, 1)], ); } @@ -1709,7 +1709,7 @@ void f() { ++x; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 44, 1)], + [error(HintCode.deprecatedMemberUse, 44, 1)], ); } @@ -1728,7 +1728,7 @@ class B extends A { } } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 74, 3)], + [error(HintCode.deprecatedMemberUse, 74, 3)], ); } @@ -1740,7 +1740,7 @@ class A { A.named() : this(a: 0); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE, 61, 1)], + [error(HintCode.deprecatedMemberUseFromSamePackage, 61, 1)], ); } @@ -1760,7 +1760,7 @@ void f(A a) { a.foo = 0; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 48, 3)], + [error(HintCode.deprecatedMemberUse, 48, 3)], ); } @@ -1774,7 +1774,7 @@ class A {} // ignore: unused_import import '$externalLibUri' show A; ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 58, 1)], + [error(HintCode.deprecatedMemberUse, 58, 1)], ); } @@ -1793,7 +1793,7 @@ class B extends A { ''', [ error( - HintCode.DEPRECATED_MEMBER_USE, + HintCode.deprecatedMemberUse, 57, 13, text: "'A.named' is deprecated and shouldn't be used.", @@ -1817,7 +1817,7 @@ class B extends A { ''', [ error( - HintCode.DEPRECATED_MEMBER_USE, + HintCode.deprecatedMemberUse, 57, 7, text: "'A' is deprecated and shouldn't be used.", @@ -1837,7 +1837,7 @@ void f() { print(x); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 48, 1)], + [error(HintCode.deprecatedMemberUse, 48, 1)], ); } @@ -1852,7 +1852,7 @@ void f(int a) { a = x; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 51, 1)], + [error(HintCode.deprecatedMemberUse, 51, 1)], ); } @@ -1867,7 +1867,7 @@ void f() { x + 1; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -1883,7 +1883,7 @@ class A { A() : f = x; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 66, 1)], + [error(HintCode.deprecatedMemberUse, 66, 1)], ); } @@ -1896,7 +1896,7 @@ int x = 1; code: r''' int f() => x; ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 40, 1)], + [error(HintCode.deprecatedMemberUse, 40, 1)], ); } @@ -1911,7 +1911,7 @@ void f() { x; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 42, 1)], + [error(HintCode.deprecatedMemberUse, 42, 1)], ); } @@ -1926,7 +1926,7 @@ void f() { [for (;x;) 0]; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 49, 1)], + [error(HintCode.deprecatedMemberUse, 49, 1)], ); } @@ -1941,7 +1941,7 @@ void f() { for (;x;) {} } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 48, 1)], + [error(HintCode.deprecatedMemberUse, 48, 1)], ); } @@ -1956,7 +1956,7 @@ void f() { [if (x) 0]; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 47, 1)], + [error(HintCode.deprecatedMemberUse, 47, 1)], ); } @@ -1971,7 +1971,7 @@ void f() { if (x) {} } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 46, 1)], + [error(HintCode.deprecatedMemberUse, 46, 1)], ); } @@ -1986,7 +1986,7 @@ void f() { [x]; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 43, 1)], + [error(HintCode.deprecatedMemberUse, 43, 1)], ); } @@ -2002,8 +2002,8 @@ void f() { } ''', [ - error(HintCode.DEPRECATED_MEMBER_USE, 47, 1), - error(HintCode.DEPRECATED_MEMBER_USE, 50, 1), + error(HintCode.deprecatedMemberUse, 47, 1), + error(HintCode.deprecatedMemberUse, 50, 1), ], ); } @@ -2020,7 +2020,7 @@ void f() { g(a: x); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 70, 1)], + [error(HintCode.deprecatedMemberUse, 70, 1)], ); } @@ -2035,7 +2035,7 @@ int f() { return x; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 48, 1)], + [error(HintCode.deprecatedMemberUse, 48, 1)], ); } @@ -2050,7 +2050,7 @@ void f() { ({x}); } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 44, 1)], + [error(HintCode.deprecatedMemberUse, 44, 1)], ); } @@ -2065,7 +2065,7 @@ void f() { [...x]; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 46, 1)], + [error(HintCode.deprecatedMemberUse, 46, 1)], ); } @@ -2083,7 +2083,7 @@ void f(int a) { } } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 69, 1)], + [error(HintCode.deprecatedMemberUse, 69, 1)], ); } @@ -2103,7 +2103,7 @@ void f(int a) { } } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 85, 1)], + [error(HintCode.deprecatedMemberUse, 85, 1)], ); } @@ -2118,7 +2118,7 @@ void f() { switch (x) {} } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 50, 1)], + [error(HintCode.deprecatedMemberUse, 50, 1)], ); } @@ -2135,7 +2135,7 @@ void f() { switch (x) {} } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 66, 1)], + [error(HintCode.deprecatedMemberUse, 66, 1)], ); } @@ -2150,7 +2150,7 @@ void f() { -x; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 43, 1)], + [error(HintCode.deprecatedMemberUse, 43, 1)], ); } @@ -2166,7 +2166,7 @@ void f() { var v = x; } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 85, 1)], + [error(HintCode.deprecatedMemberUse, 85, 1)], ); } @@ -2181,7 +2181,7 @@ void f() { while (x) {} } ''', - [error(HintCode.DEPRECATED_MEMBER_USE, 49, 1)], + [error(HintCode.deprecatedMemberUse, 49, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_mixin_function_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_mixin_function_test.dart index 29f3b40f847..b37b87bc1ba 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_mixin_function_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_mixin_function_test.dart @@ -20,7 +20,7 @@ class DeprecatedMixinFunctionTest extends PubPackageResolutionTest { ''' class A extends Object with Function {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 28, 8)], + [error(CompileTimeErrorCode.classUsedAsMixin, 28, 8)], ); } @@ -30,7 +30,7 @@ class A extends Object with Function {} // @dart = 2.19 class A extends Object with Function {} ''', - [error(WarningCode.DEPRECATED_MIXIN_FUNCTION, 44, 8)], + [error(WarningCode.deprecatedMixinFunction, 44, 8)], ); } @@ -41,7 +41,7 @@ class A extends Object with Function {} typedef F = Function; class A extends Object with F {} ''', - [error(WarningCode.DEPRECATED_MIXIN_FUNCTION, 66, 1)], + [error(WarningCode.deprecatedMixinFunction, 66, 1)], ); } @@ -51,7 +51,7 @@ class A extends Object with F {} mixin Function {} class A extends Object with Function {} ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 6, 8)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 6, 8)], ); } @@ -62,7 +62,7 @@ class A extends Object with Function {} mixin Function {} class A extends Object with Function {} ''', - [error(CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 22, 8)], + [error(CompileTimeErrorCode.builtInIdentifierAsTypeName, 22, 8)], ); } @@ -72,7 +72,7 @@ class A extends Object with Function {} // @dart = 2.19 class A = Object with Function; ''', - [error(WarningCode.DEPRECATED_MIXIN_FUNCTION, 38, 8)], + [error(WarningCode.deprecatedMixinFunction, 38, 8)], ); } @@ -83,7 +83,7 @@ class A = Object with Function; typedef F = Function; class A = Object with F; ''', - [error(WarningCode.DEPRECATED_MIXIN_FUNCTION, 60, 1)], + [error(WarningCode.deprecatedMixinFunction, 60, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_subclass_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_subclass_test.dart index b00a5593de3..057e12a9389 100644 --- a/pkg/analyzer/test/src/diagnostics/deprecated_subclass_test.dart +++ b/pkg/analyzer/test/src/diagnostics/deprecated_subclass_test.dart @@ -26,7 +26,7 @@ class Foo {} import 'foo.dart'; enum Bar implements Foo { one; } ''', - [error(WarningCode.DEPRECATED_SUBCLASS, 39, 3)], + [error(WarningCode.deprecatedSubclass, 39, 3)], ); } @@ -41,7 +41,7 @@ class Foo {} import 'foo.dart'; class Bar extends Foo {} ''', - [error(WarningCode.DEPRECATED_SUBCLASS, 37, 3)], + [error(WarningCode.deprecatedSubclass, 37, 3)], ); } @@ -56,7 +56,7 @@ class Foo {} import 'foo.dart'; class Bar implements Foo {} ''', - [error(WarningCode.DEPRECATED_SUBCLASS, 40, 3)], + [error(WarningCode.deprecatedSubclass, 40, 3)], ); } @@ -71,7 +71,7 @@ mixin Foo {} import 'foo.dart'; class Bar implements Foo {} ''', - [error(WarningCode.DEPRECATED_SUBCLASS, 40, 3)], + [error(WarningCode.deprecatedSubclass, 40, 3)], ); } @@ -96,7 +96,7 @@ class Foo {} import 'foo.dart'; class Bar extends Object with Foo {} ''', - [error(WarningCode.DEPRECATED_SUBCLASS, 65, 3)], + [error(WarningCode.deprecatedSubclass, 65, 3)], ); } @@ -111,7 +111,7 @@ class Foo {} import 'foo.dart'; mixin Bar implements Foo {} ''', - [error(WarningCode.DEPRECATED_SUBCLASS, 40, 3)], + [error(WarningCode.deprecatedSubclass, 40, 3)], ); } @@ -126,7 +126,7 @@ class Foo {} import 'foo.dart'; mixin Bar on Foo {} ''', - [error(WarningCode.DEPRECATED_SUBCLASS, 32, 3)], + [error(WarningCode.deprecatedSubclass, 32, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/doc_directive_argument_wrong_format_test.dart b/pkg/analyzer/test/src/diagnostics/doc_directive_argument_wrong_format_test.dart index 0bd598ffbb3..6304a8a7954 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_directive_argument_wrong_format_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_directive_argument_wrong_format_test.dart @@ -21,7 +21,7 @@ class DocDirectiveArgumentWrongFormatTest extends PubPackageResolutionTest { /// {@animation 600 nan http://google.com} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT, 20, 3)], + [error(WarningCode.docDirectiveArgumentWrongFormat, 20, 3)], ); } @@ -38,7 +38,7 @@ class C {} /// {@animation nan 400 http://google.com} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT, 16, 3)], + [error(WarningCode.docDirectiveArgumentWrongFormat, 16, 3)], ); } @@ -48,7 +48,7 @@ class C {} /// {@youtube 600 nan https://www.youtube.com/watch?v=123} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT, 18, 3)], + [error(WarningCode.docDirectiveArgumentWrongFormat, 18, 3)], ); } @@ -58,7 +58,7 @@ class C {} /// {@youtube 600 400 http://google.com} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT, 22, 17)], + [error(WarningCode.docDirectiveArgumentWrongFormat, 22, 17)], ); } @@ -68,7 +68,7 @@ class C {} /// {@youtube nan 400 https://www.youtube.com/watch?v=123} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_ARGUMENT_WRONG_FORMAT, 14, 3)], + [error(WarningCode.docDirectiveArgumentWrongFormat, 14, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/doc_directive_has_extra_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/doc_directive_has_extra_arguments_test.dart index b0d79df4464..3393f8c4a59 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_directive_has_extra_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_directive_has_extra_arguments_test.dart @@ -21,7 +21,7 @@ class DocDirectiveHasExtraArgumentsTest extends PubPackageResolutionTest { /// {@animation 600 400 http://google.com foo} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS, 42, 3)], + [error(WarningCode.docDirectiveHasExtraArguments, 42, 3)], ); } @@ -45,7 +45,7 @@ class C {} /// {@macro one two} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS, 16, 3)], + [error(WarningCode.docDirectiveHasExtraArguments, 16, 3)], ); } @@ -55,7 +55,7 @@ class C {} /// {@youtube 600 400 https://www.youtube.com/watch?v=123 foo} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS, 58, 3)], + [error(WarningCode.docDirectiveHasExtraArguments, 58, 3)], ); } @@ -65,7 +65,7 @@ class C {} /// {@youtube 600 400 https://www.youtube.com/watch?v=123 foo } class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_HAS_EXTRA_ARGUMENTS, 58, 3)], + [error(WarningCode.docDirectiveHasExtraArguments, 58, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/doc_directive_has_unexpected_named_argument_test.dart b/pkg/analyzer/test/src/diagnostics/doc_directive_has_unexpected_named_argument_test.dart index 2942c47eab3..21a27f38226 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_directive_has_unexpected_named_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_directive_has_unexpected_named_argument_test.dart @@ -22,7 +22,7 @@ class DocDirectiveHasUnexpectedNamedArgumentTest /// {@animation 600 400 http://google.com foo=bar} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_HAS_UNEXPECTED_NAMED_ARGUMENT, 42, 7)], + [error(WarningCode.docDirectiveHasUnexpectedNamedArgument, 42, 7)], ); } @@ -32,7 +32,7 @@ class C {} /// {@macro name foo=bar} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_HAS_UNEXPECTED_NAMED_ARGUMENT, 17, 7)], + [error(WarningCode.docDirectiveHasUnexpectedNamedArgument, 17, 7)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/doc_directive_missing_one_argument_test.dart b/pkg/analyzer/test/src/diagnostics/doc_directive_missing_one_argument_test.dart index 6810848a9a0..c080feac384 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_directive_missing_one_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_directive_missing_one_argument_test.dart @@ -35,7 +35,7 @@ class C {} /// {@canonicalFor} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_MISSING_ONE_ARGUMENT, 4, 16)], + [error(WarningCode.docDirectiveMissingOneArgument, 4, 16)], ); } @@ -52,7 +52,7 @@ class C {} /// {@macro} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_MISSING_ONE_ARGUMENT, 4, 9)], + [error(WarningCode.docDirectiveMissingOneArgument, 4, 9)], ); } @@ -69,7 +69,7 @@ class C {} /// {@youtube 600 400} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_MISSING_ONE_ARGUMENT, 4, 19)], + [error(WarningCode.docDirectiveMissingOneArgument, 4, 19)], ); } @@ -80,8 +80,8 @@ class C {} class C {} ''', [ - error(WarningCode.DOC_DIRECTIVE_MISSING_ONE_ARGUMENT, 4, 18), - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE, 21, 1), + error(WarningCode.docDirectiveMissingOneArgument, 4, 18), + error(WarningCode.docDirectiveMissingClosingBrace, 21, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/doc_directive_missing_three_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/doc_directive_missing_three_arguments_test.dart index 2d42065aa37..3f127b84cee 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_directive_missing_three_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_directive_missing_three_arguments_test.dart @@ -28,7 +28,7 @@ class C {} /// {@animation} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_MISSING_THREE_ARGUMENTS, 4, 13)], + [error(WarningCode.docDirectiveMissingThreeArguments, 4, 13)], ); } @@ -45,7 +45,7 @@ class C {} /// {@youtube} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_MISSING_THREE_ARGUMENTS, 4, 11)], + [error(WarningCode.docDirectiveMissingThreeArguments, 4, 11)], ); } @@ -55,7 +55,7 @@ class C {} /// {@youtube class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_MISSING_THREE_ARGUMENTS, 4, 10)], + [error(WarningCode.docDirectiveMissingThreeArguments, 4, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/doc_directive_missing_two_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/doc_directive_missing_two_arguments_test.dart index 69191f6a475..5f501eb45af 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_directive_missing_two_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_directive_missing_two_arguments_test.dart @@ -35,7 +35,7 @@ class C {} /// {@animation 600} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_MISSING_TWO_ARGUMENTS, 4, 17)], + [error(WarningCode.docDirectiveMissingTwoArguments, 4, 17)], ); } @@ -52,7 +52,7 @@ class C {} /// {@youtube 600} class C {} ''', - [error(WarningCode.DOC_DIRECTIVE_MISSING_TWO_ARGUMENTS, 4, 15)], + [error(WarningCode.docDirectiveMissingTwoArguments, 4, 15)], ); } @@ -63,8 +63,8 @@ class C {} class C {} ''', [ - error(WarningCode.DOC_DIRECTIVE_MISSING_TWO_ARGUMENTS, 4, 14), - error(WarningCode.DOC_DIRECTIVE_MISSING_CLOSING_BRACE, 17, 1), + error(WarningCode.docDirectiveMissingTwoArguments, 4, 14), + error(WarningCode.docDirectiveMissingClosingBrace, 17, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/doc_import_cannot_be_deferred_test.dart b/pkg/analyzer/test/src/diagnostics/doc_import_cannot_be_deferred_test.dart index 217642e9413..24ff25d80e8 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_import_cannot_be_deferred_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_import_cannot_be_deferred_test.dart @@ -22,8 +22,8 @@ class DocImportCannotBeDeferredTest extends PubPackageResolutionTest { class C {} ''', [ - error(WarningCode.DOC_IMPORT_CANNOT_BE_DEFERRED, 27, 8), - error(WarningCode.DOC_IMPORT_CANNOT_HAVE_PREFIX, 39, 4), + error(WarningCode.docImportCannotBeDeferred, 27, 8), + error(WarningCode.docImportCannotHavePrefix, 39, 4), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_combinators_test.dart b/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_combinators_test.dart index 36c981a8b3f..cd7ffaf4e29 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_combinators_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_combinators_test.dart @@ -21,7 +21,7 @@ class DocImportCannotHaveCombinatorsTest extends PubPackageResolutionTest { /// @docImport 'dart:math' show max; class C {} ''', - [error(WarningCode.DOC_IMPORT_CANNOT_HAVE_COMBINATORS, 27, 8)], + [error(WarningCode.docImportCannotHaveCombinators, 27, 8)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_configurations_test.dart b/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_configurations_test.dart index a26ae56c1a1..45a1933d8a2 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_configurations_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_configurations_test.dart @@ -21,7 +21,7 @@ class DocImportCannotHaveConfigurationsTest extends PubPackageResolutionTest { /// @docImport 'dart:math' if (dart.library.html) 'dart:html'; class C {} ''', - [error(WarningCode.DOC_IMPORT_CANNOT_HAVE_CONFIGURATIONS, 27, 34)], + [error(WarningCode.docImportCannotHaveConfigurations, 27, 34)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_prefix_test.dart b/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_prefix_test.dart index dff27e23f9e..5bcf48f5e86 100644 --- a/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_prefix_test.dart +++ b/pkg/analyzer/test/src/diagnostics/doc_import_cannot_have_prefix_test.dart @@ -21,7 +21,7 @@ class DocImportCannotHavePrefixTest extends PubPackageResolutionTest { /// @docImport 'dart:math' as math; class C {} ''', - [error(WarningCode.DOC_IMPORT_CANNOT_HAVE_PREFIX, 30, 4)], + [error(WarningCode.docImportCannotHavePrefix, 30, 4)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_constructor_default_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_constructor_default_test.dart index 2759978316b..d78edf38485 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_constructor_default_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_constructor_default_test.dart @@ -63,7 +63,7 @@ augment class A { await resolveFile2(a); assertErrorsInResult([ - error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 42, 1), + error(CompileTimeErrorCode.duplicateConstructorDefault, 42, 1), ]); } @@ -75,7 +75,7 @@ class C { C(); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 19, 1)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 19, 1)], ); } @@ -87,7 +87,7 @@ class C { C.new(); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 19, 5)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 19, 5)], ); } @@ -99,7 +99,7 @@ class C { C(); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 23, 1)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 23, 1)], ); } @@ -111,7 +111,7 @@ class C { C.new(); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 23, 5)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 23, 5)], ); } @@ -124,7 +124,7 @@ enum E { const E(); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 35, 1)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 35, 1)], ); } @@ -138,8 +138,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 35, 5), - error(WarningCode.UNUSED_ELEMENT, 37, 3), + error(CompileTimeErrorCode.duplicateConstructorDefault, 35, 5), + error(WarningCode.unusedElement, 37, 3), ], ); } @@ -153,7 +153,7 @@ enum E { const E(); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 39, 1)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 39, 1)], ); } @@ -167,8 +167,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 39, 5), - error(WarningCode.UNUSED_ELEMENT, 41, 3), + error(CompileTimeErrorCode.duplicateConstructorDefault, 39, 5), + error(WarningCode.unusedElement, 41, 3), ], ); } @@ -180,7 +180,7 @@ extension type A(int it) { A(this.it); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 29, 1)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 29, 1)], ); } @@ -191,7 +191,7 @@ extension type A(int it) { A.new(this.it); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 29, 5)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 29, 5)], ); } @@ -202,7 +202,7 @@ extension type A.new(int it) { A(this.it); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 33, 1)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 33, 1)], ); } @@ -213,7 +213,7 @@ extension type A.new(int it) { A.new(this.it); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 33, 5)], + [error(CompileTimeErrorCode.duplicateConstructorDefault, 33, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_constructor_name_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_constructor_name_test.dart index 2b0dbfad586..90ecd539a59 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_constructor_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_constructor_name_test.dart @@ -23,7 +23,7 @@ class C { C.foo(); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, 23, 5)], + [error(CompileTimeErrorCode.duplicateConstructorName, 23, 5)], ); } @@ -101,7 +101,7 @@ augment class A { await resolveFile2(a); assertErrorsInResult([ - error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, 42, 7), + error(CompileTimeErrorCode.duplicateConstructorName, 42, 7), ]); } @@ -115,8 +115,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, 45, 5), - error(WarningCode.UNUSED_ELEMENT, 47, 3), + error(CompileTimeErrorCode.duplicateConstructorName, 45, 5), + error(WarningCode.unusedElement, 47, 3), ], ); } @@ -129,7 +129,7 @@ extension type A(int it) { A.foo(this.it); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, 47, 5)], + [error(CompileTimeErrorCode.duplicateConstructorName, 47, 5)], ); } @@ -140,7 +140,7 @@ extension type A.foo(int it) { A.foo(this.it); } ''', - [error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, 33, 5)], + [error(CompileTimeErrorCode.duplicateConstructorName, 33, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_definition_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_definition_test.dart index c26a510c8f7..126b815f0ca 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_definition_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_definition_test.dart @@ -33,7 +33,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 31, 3, contextMessages: [message(testFile, 16, 3)], @@ -78,13 +78,13 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 31, 3, contextMessages: [message(testFile, 16, 3)], ), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 46, 3, contextMessages: [message(testFile, 16, 3)], @@ -117,7 +117,7 @@ class A { await resolveFile2(a); assertErrorsInResult([ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 46, 3, contextMessages: [message(testFile, 32, 3)], @@ -135,7 +135,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 35, 3, contextMessages: [message(testFile, 16, 3)], @@ -154,7 +154,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 32, 3, contextMessages: [message(testFile, 16, 3)], @@ -173,7 +173,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 41, 3, contextMessages: [message(testFile, 22, 3)], @@ -210,7 +210,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 38, 3, contextMessages: [message(testFile, 27, 3)], @@ -229,7 +229,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 40, 3, contextMessages: [message(testFile, 20, 3)], @@ -265,7 +265,7 @@ augment class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 61, 3, contextMessages: [message(testFile, 20, 3)], @@ -285,7 +285,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 43, 1, contextMessages: [message(testFile, 21, 1)], @@ -304,7 +304,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 37, 3, contextMessages: [message(testFile, 20, 3)], @@ -333,7 +333,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 71, 1, contextMessages: [message(testFile, 21, 1)], @@ -353,7 +353,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 71, 1, contextMessages: [message(testFile, 43, 1)], @@ -372,7 +372,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 36, 3, contextMessages: [message(testFile, 17, 3)], @@ -391,7 +391,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 33, 3, contextMessages: [message(testFile, 17, 3)], @@ -427,7 +427,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 54, 3, contextMessages: [message(testFile, 17, 3)], @@ -446,7 +446,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 32, 3, contextMessages: [message(testFile, 17, 3)], @@ -469,7 +469,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 53, 3, contextMessages: [message(testFile, 17, 3)], @@ -505,7 +505,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 76, 1, contextMessages: [message(testFile, 25, 1)], @@ -534,7 +534,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 71, 1, contextMessages: [message(testFile, 49, 1)], @@ -554,7 +554,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 71, 1, contextMessages: [message(testFile, 21, 1)], @@ -573,7 +573,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 33, 3, contextMessages: [message(testFile, 16, 3)], @@ -596,7 +596,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 54, 3, contextMessages: [message(testFile, 16, 3)], @@ -615,7 +615,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 42, 3, contextMessages: [message(testFile, 21, 3)], @@ -648,7 +648,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 49, 1, contextMessages: [message(testFile, 21, 1)], @@ -671,7 +671,7 @@ augment class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 63, 3, contextMessages: [message(testFile, 21, 3)], @@ -690,7 +690,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 45, 3, contextMessages: [message(testFile, 23, 3)], @@ -709,7 +709,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 49, 3, contextMessages: [message(testFile, 23, 3)], @@ -728,7 +728,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 46, 3, contextMessages: [message(testFile, 23, 3)], @@ -747,7 +747,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 55, 3, contextMessages: [message(testFile, 29, 3)], @@ -784,7 +784,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 52, 3, contextMessages: [message(testFile, 34, 3)], @@ -803,7 +803,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 54, 3, contextMessages: [message(testFile, 27, 3)], @@ -839,7 +839,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 75, 3, contextMessages: [message(testFile, 27, 3)], @@ -858,7 +858,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 51, 3, contextMessages: [message(testFile, 27, 3)], @@ -886,7 +886,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 50, 3, contextMessages: [message(testFile, 24, 3)], @@ -905,7 +905,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 47, 3, contextMessages: [message(testFile, 24, 3)], @@ -941,7 +941,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 68, 3, contextMessages: [message(testFile, 24, 3)], @@ -960,7 +960,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 46, 3, contextMessages: [message(testFile, 24, 3)], @@ -988,7 +988,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 47, 3, contextMessages: [message(testFile, 23, 3)], @@ -1007,7 +1007,7 @@ class C { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 56, 3, contextMessages: [message(testFile, 28, 3)], @@ -1043,7 +1043,7 @@ augment class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 77, 3, contextMessages: [message(testFile, 28, 3)], @@ -1064,7 +1064,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 16, 3, contextMessages: [message(testFile, 11, 3)], @@ -1084,7 +1084,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 47, 3, contextMessages: [message(testFile, 26, 3)], @@ -1104,7 +1104,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 45, 3, contextMessages: [message(testFile, 26, 3)], @@ -1124,7 +1124,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 42, 3, contextMessages: [message(testFile, 26, 3)], @@ -1144,7 +1144,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 45, 3, contextMessages: [message(testFile, 26, 3)], @@ -1174,7 +1174,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 44, 3, contextMessages: [message(testFile, 24, 3)], @@ -1212,7 +1212,7 @@ augment enum E {; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 65, 3, contextMessages: [message(testFile, 24, 3)], @@ -1232,7 +1232,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 41, 3, contextMessages: [message(testFile, 24, 3)], @@ -1262,7 +1262,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 40, 3, contextMessages: [message(testFile, 21, 3)], @@ -1282,7 +1282,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 37, 3, contextMessages: [message(testFile, 21, 3)], @@ -1320,7 +1320,7 @@ augment enum E {; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 58, 3, contextMessages: [message(testFile, 21, 3)], @@ -1340,7 +1340,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 36, 3, contextMessages: [message(testFile, 21, 3)], @@ -1370,7 +1370,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 37, 3, contextMessages: [message(testFile, 20, 3)], @@ -1390,7 +1390,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 46, 3, contextMessages: [message(testFile, 25, 3)], @@ -1428,7 +1428,7 @@ augment enum E {; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 67, 3, contextMessages: [message(testFile, 25, 3)], @@ -1447,7 +1447,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 29, 3, contextMessages: [message(testFile, 11, 3)], @@ -1466,7 +1466,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 33, 3, contextMessages: [message(testFile, 11, 3)], @@ -1485,7 +1485,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 30, 3, contextMessages: [message(testFile, 11, 3)], @@ -1514,7 +1514,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 49, 3, contextMessages: [message(testFile, 27, 3)], @@ -1534,7 +1534,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 53, 3, contextMessages: [message(testFile, 27, 3)], @@ -1554,7 +1554,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 50, 3, contextMessages: [message(testFile, 27, 3)], @@ -1574,7 +1574,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 59, 3, contextMessages: [message(testFile, 33, 3)], @@ -1604,7 +1604,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 58, 3, contextMessages: [message(testFile, 31, 3)], @@ -1642,7 +1642,7 @@ augment enum E {; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 79, 3, contextMessages: [message(testFile, 31, 3)], @@ -1662,7 +1662,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 55, 3, contextMessages: [message(testFile, 31, 3)], @@ -1692,7 +1692,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 54, 3, contextMessages: [message(testFile, 28, 3)], @@ -1712,7 +1712,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 51, 3, contextMessages: [message(testFile, 28, 3)], @@ -1750,7 +1750,7 @@ augment enum E {; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 72, 3, contextMessages: [message(testFile, 28, 3)], @@ -1770,7 +1770,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 50, 3, contextMessages: [message(testFile, 28, 3)], @@ -1800,7 +1800,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 51, 3, contextMessages: [message(testFile, 27, 3)], @@ -1820,7 +1820,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 60, 3, contextMessages: [message(testFile, 32, 3)], @@ -1858,7 +1858,7 @@ augment enum E {; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 81, 3, contextMessages: [message(testFile, 32, 3)], @@ -1913,7 +1913,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 60, 3, contextMessages: [message(testFile, 40, 3)], @@ -1949,7 +1949,7 @@ augment extension E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 76, 3, contextMessages: [message(testFile, 31, 3)], @@ -1969,7 +1969,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 57, 3, contextMessages: [message(testFile, 40, 3)], @@ -1999,7 +1999,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 56, 3, contextMessages: [message(testFile, 37, 3)], @@ -2019,7 +2019,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 53, 3, contextMessages: [message(testFile, 37, 3)], @@ -2055,7 +2055,7 @@ augment extension E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 69, 3, contextMessages: [message(testFile, 28, 3)], @@ -2075,7 +2075,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 52, 3, contextMessages: [message(testFile, 37, 3)], @@ -2105,7 +2105,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 53, 3, contextMessages: [message(testFile, 36, 3)], @@ -2125,7 +2125,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 62, 3, contextMessages: [message(testFile, 41, 3)], @@ -2161,7 +2161,7 @@ augment extension E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 78, 3, contextMessages: [message(testFile, 32, 3)], @@ -2181,7 +2181,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 65, 3, contextMessages: [message(testFile, 43, 3)], @@ -2201,7 +2201,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 69, 3, contextMessages: [message(testFile, 43, 3)], @@ -2221,7 +2221,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 66, 3, contextMessages: [message(testFile, 43, 3)], @@ -2241,7 +2241,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 75, 3, contextMessages: [message(testFile, 49, 3)], @@ -2271,7 +2271,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 74, 3, contextMessages: [message(testFile, 47, 3)], @@ -2307,7 +2307,7 @@ augment extension E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 90, 3, contextMessages: [message(testFile, 38, 3)], @@ -2327,7 +2327,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 71, 3, contextMessages: [message(testFile, 47, 3)], @@ -2357,7 +2357,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 70, 3, contextMessages: [message(testFile, 44, 3)], @@ -2377,7 +2377,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 67, 3, contextMessages: [message(testFile, 44, 3)], @@ -2413,7 +2413,7 @@ augment extension E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 83, 3, contextMessages: [message(testFile, 35, 3)], @@ -2433,7 +2433,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 66, 3, contextMessages: [message(testFile, 44, 3)], @@ -2462,7 +2462,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 67, 3, contextMessages: [message(testFile, 43, 3)], @@ -2482,7 +2482,7 @@ extension E on A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 76, 3, contextMessages: [message(testFile, 48, 3)], @@ -2518,7 +2518,7 @@ augment extension E { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 92, 3, contextMessages: [message(testFile, 39, 3)], @@ -2536,7 +2536,7 @@ extension E on A {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 41, 1, contextMessages: [message(testFile, 21, 1)], @@ -2558,7 +2558,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 57, 3, contextMessages: [message(testFile, 37, 3)], @@ -2577,7 +2577,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 54, 3, contextMessages: [message(testFile, 37, 3)], @@ -2605,7 +2605,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 53, 3, contextMessages: [message(testFile, 34, 3)], @@ -2624,7 +2624,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 50, 3, contextMessages: [message(testFile, 34, 3)], @@ -2643,7 +2643,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 49, 3, contextMessages: [message(testFile, 34, 3)], @@ -2661,7 +2661,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 37, 2, contextMessages: [message(testFile, 21, 2)], @@ -2679,7 +2679,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 34, 2, contextMessages: [message(testFile, 21, 2)], @@ -2715,7 +2715,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 50, 3, contextMessages: [message(testFile, 33, 3)], @@ -2734,7 +2734,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 59, 3, contextMessages: [message(testFile, 38, 3)], @@ -2753,7 +2753,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 62, 3, contextMessages: [message(testFile, 40, 3)], @@ -2772,7 +2772,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 66, 3, contextMessages: [message(testFile, 40, 3)], @@ -2791,7 +2791,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 63, 3, contextMessages: [message(testFile, 40, 3)], @@ -2810,7 +2810,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 72, 3, contextMessages: [message(testFile, 46, 3)], @@ -2838,7 +2838,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 71, 3, contextMessages: [message(testFile, 44, 3)], @@ -2857,7 +2857,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 68, 3, contextMessages: [message(testFile, 44, 3)], @@ -2885,7 +2885,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 67, 3, contextMessages: [message(testFile, 41, 3)], @@ -2904,7 +2904,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 64, 3, contextMessages: [message(testFile, 41, 3)], @@ -2923,7 +2923,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 63, 3, contextMessages: [message(testFile, 41, 3)], @@ -2951,7 +2951,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 64, 3, contextMessages: [message(testFile, 40, 3)], @@ -2970,7 +2970,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 73, 3, contextMessages: [message(testFile, 45, 3)], @@ -2987,7 +2987,7 @@ extension type E(int it) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 43, 1, contextMessages: [message(testFile, 15, 1)], @@ -3009,7 +3009,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 31, 3, contextMessages: [message(testFile, 16, 3)], @@ -3028,7 +3028,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 35, 3, contextMessages: [message(testFile, 16, 3)], @@ -3047,7 +3047,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 32, 3, contextMessages: [message(testFile, 16, 3)], @@ -3066,7 +3066,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 41, 3, contextMessages: [message(testFile, 22, 3)], @@ -3094,7 +3094,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 40, 3, contextMessages: [message(testFile, 20, 3)], @@ -3113,7 +3113,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 37, 3, contextMessages: [message(testFile, 20, 3)], @@ -3141,7 +3141,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 36, 3, contextMessages: [message(testFile, 17, 3)], @@ -3160,7 +3160,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 33, 3, contextMessages: [message(testFile, 17, 3)], @@ -3218,7 +3218,7 @@ mixin A { await resolveFile2(a); assertErrorsInResult([ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 47, 3, contextMessages: [message(testFile, 33, 3)], @@ -3236,7 +3236,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 32, 3, contextMessages: [message(testFile, 17, 3)], @@ -3264,7 +3264,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 33, 3, contextMessages: [message(testFile, 16, 3)], @@ -3283,7 +3283,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 42, 3, contextMessages: [message(testFile, 21, 3)], @@ -3302,7 +3302,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 45, 3, contextMessages: [message(testFile, 23, 3)], @@ -3321,7 +3321,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 49, 3, contextMessages: [message(testFile, 23, 3)], @@ -3340,7 +3340,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 46, 3, contextMessages: [message(testFile, 23, 3)], @@ -3359,7 +3359,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 55, 3, contextMessages: [message(testFile, 29, 3)], @@ -3387,7 +3387,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 54, 3, contextMessages: [message(testFile, 27, 3)], @@ -3406,7 +3406,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 51, 3, contextMessages: [message(testFile, 27, 3)], @@ -3434,7 +3434,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 50, 3, contextMessages: [message(testFile, 24, 3)], @@ -3453,7 +3453,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 47, 3, contextMessages: [message(testFile, 24, 3)], @@ -3472,7 +3472,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 46, 3, contextMessages: [message(testFile, 24, 3)], @@ -3500,7 +3500,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 47, 3, contextMessages: [message(testFile, 23, 3)], @@ -3519,7 +3519,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 56, 3, contextMessages: [message(testFile, 28, 3)], @@ -3541,9 +3541,9 @@ void f() { } ''', [ - error(WarningCode.DEAD_CODE, 13, 11), - error(WarningCode.DEAD_CODE, 27, 19), - error(WarningCode.DEAD_CODE, 49, 24), + error(WarningCode.deadCode, 13, 11), + error(WarningCode.deadCode, 27, 19), + error(WarningCode.deadCode, 49, 24), ], ); } @@ -3561,21 +3561,21 @@ void f() { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 62, 1), + error(WarningCode.unusedElement, 62, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 75, 1, contextMessages: [message(testFile, 62, 1)], ), - error(WarningCode.UNUSED_ELEMENT, 75, 1), + error(WarningCode.unusedElement, 75, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 100, 1, contextMessages: [message(testFile, 62, 1)], ), - error(WarningCode.UNUSED_ELEMENT, 100, 1), + error(WarningCode.unusedElement, 100, 1), ], ); } @@ -3589,10 +3589,10 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 30, 1), + error(WarningCode.unusedLocalVariable, 17, 1), + error(WarningCode.unusedLocalVariable, 30, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 30, 1, contextMessages: [message(testFile, 17, 1)], @@ -3623,7 +3623,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 74, 1, contextMessages: [message(testFile, 61, 1)], @@ -3641,14 +3641,14 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), + error(WarningCode.unusedLocalVariable, 17, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 31, 1, contextMessages: [message(testFile, 17, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 31, 1), + error(WarningCode.unusedLocalVariable, 31, 1), ], ); } @@ -3683,14 +3683,14 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), + error(WarningCode.unusedLocalVariable, 18, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 32, 1, contextMessages: [message(testFile, 18, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1), + error(WarningCode.unusedLocalVariable, 32, 1), ], ); } @@ -3704,14 +3704,14 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), + error(WarningCode.unusedLocalVariable, 18, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 33, 1, contextMessages: [message(testFile, 18, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), + error(WarningCode.unusedLocalVariable, 33, 1), ], ); } @@ -3723,9 +3723,9 @@ main() { try {} catch (e, e) {} }''', [ - error(WarningCode.UNUSED_CATCH_STACK, 28, 1), + error(WarningCode.unusedCatchStack, 28, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 28, 1, contextMessages: [message(testFile, 25, 1)], @@ -3752,7 +3752,7 @@ f() { }''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 69, 1, contextMessages: [message(testFile, 66, 1)], @@ -3771,7 +3771,7 @@ Map _globalMap = { 'b' : () {} }; ''', - [error(WarningCode.UNUSED_ELEMENT, 4, 10)], + [error(WarningCode.unusedElement, 4, 10)], ); } @@ -3784,12 +3784,12 @@ f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 24, 1, contextMessages: [message(testFile, 17, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 24, 1), + error(WarningCode.unusedLocalVariable, 24, 1), ], ); } @@ -3814,7 +3814,7 @@ f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 68, 1, contextMessages: [message(testFile, 61, 1)], @@ -3839,7 +3839,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 36, 1, contextMessages: [message(testFile, 29, 1)], @@ -3856,7 +3856,7 @@ class A { A(this._, int _); } ''', - [error(WarningCode.UNUSED_FIELD, 17, 1)], + [error(WarningCode.unusedField, 17, 1)], ); } @@ -3872,9 +3872,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 61, 1), + error(WarningCode.unusedField, 61, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 80, 1, contextMessages: [message(testFile, 73, 1)], @@ -3893,7 +3893,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 36, 1, contextMessages: [message(testFile, 28, 1)], @@ -3910,7 +3910,7 @@ class A { A(int _, this._); } ''', - [error(WarningCode.UNUSED_FIELD, 17, 1)], + [error(WarningCode.unusedField, 17, 1)], ); } @@ -3926,9 +3926,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 61, 1), + error(WarningCode.unusedField, 61, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 80, 1, contextMessages: [message(testFile, 72, 1)], @@ -3949,10 +3949,9 @@ class B extends A { } ''', [ - error(WarningCode.UNUSED_FIELD, 17, 1), + error(WarningCode.unusedField, 17, 1), error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedPositional, 74, 1, ), @@ -3975,16 +3974,15 @@ class B extends A { } ''', [ - error(WarningCode.UNUSED_FIELD, 61, 1), + error(WarningCode.unusedField, 61, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 118, 1, contextMessages: [message(testFile, 109, 1)], ), error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedPositional, 118, 1, ), @@ -4006,7 +4004,7 @@ class C extends A { C(this._, super._, [super._]); } ''', - [error(WarningCode.UNUSED_FIELD, 90, 1)], + [error(WarningCode.unusedField, 90, 1)], ); } @@ -4017,7 +4015,7 @@ typedef void F(int a, double a); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 29, 1, contextMessages: [message(testFile, 19, 1)], @@ -4042,7 +4040,7 @@ typedef void F(int _, double _); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 73, 1, contextMessages: [message(testFile, 63, 1)], @@ -4058,7 +4056,7 @@ typedef F = void Function(int a, double a); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 40, 1, contextMessages: [message(testFile, 30, 1)], @@ -4083,7 +4081,7 @@ typedef F = void Function(int _, double _); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 84, 1, contextMessages: [message(testFile, 74, 1)], @@ -4101,9 +4099,9 @@ main() { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 11, 1), + error(WarningCode.unusedElement, 11, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 27, 1, contextMessages: [message(testFile, 17, 1)], @@ -4119,7 +4117,7 @@ f() { g(int _, double _) {}; } ''', - [error(WarningCode.UNUSED_ELEMENT, 8, 1)], + [error(WarningCode.unusedElement, 8, 1)], ); } @@ -4134,9 +4132,9 @@ f() { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 52, 1), + error(WarningCode.unusedElement, 52, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 68, 1, contextMessages: [message(testFile, 58, 1)], @@ -4155,7 +4153,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 28, 1, contextMessages: [message(testFile, 18, 1)], @@ -4186,7 +4184,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 72, 1, contextMessages: [message(testFile, 62, 1)], @@ -4202,7 +4200,7 @@ f(int a, double a) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 16, 1, contextMessages: [message(testFile, 6, 1)], @@ -4217,8 +4215,8 @@ f(int a, double a) {} f(,[]) {} ''', [ - error(ParserErrorCode.MISSING_IDENTIFIER, 2, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 4, 1), + error(ParserErrorCode.missingIdentifier, 2, 1), + error(ParserErrorCode.missingIdentifier, 4, 1), ], ); } @@ -4239,7 +4237,7 @@ f(int _, double _) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 60, 1, contextMessages: [message(testFile, 50, 1)], @@ -4261,14 +4259,14 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 64, 1), + error(WarningCode.unusedLocalVariable, 64, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 77, 1, contextMessages: [message(testFile, 64, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 77, 1), + error(WarningCode.unusedLocalVariable, 77, 1), ], ); } @@ -4285,14 +4283,14 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 49, 1), + error(WarningCode.unusedLocalVariable, 49, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 62, 1, contextMessages: [message(testFile, 49, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1), + error(WarningCode.unusedLocalVariable, 62, 1), ], ); } @@ -4313,7 +4311,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 106, 1, contextMessages: [message(testFile, 93, 1)], @@ -4346,14 +4344,14 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 48, 1), + error(WarningCode.unusedLocalVariable, 48, 1), error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 61, 1, contextMessages: [message(testFile, 48, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 61, 1), + error(WarningCode.unusedLocalVariable, 61, 1), ], ); } @@ -4386,7 +4384,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 105, 1, contextMessages: [message(testFile, 92, 1)], @@ -4403,7 +4401,7 @@ var f = 2; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 15, 1, contextMessages: [message(testFile, 4, 1)], @@ -4420,7 +4418,7 @@ int get f => 7; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 19, 1, contextMessages: [message(testFile, 4, 1)], @@ -4437,7 +4435,7 @@ set f(int value) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 15, 1, contextMessages: [message(testFile, 4, 1)], @@ -4475,7 +4473,7 @@ set f(int value) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 18, 1, contextMessages: [message(testFile, 11, 1)], @@ -4492,7 +4490,7 @@ set f(int value) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 24, 1, contextMessages: [message(testFile, 4, 1)], @@ -4514,7 +4512,7 @@ set f(int value) {} await assertErrorsInFile2(a, [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 25, 1, contextMessages: [message(testFile, 19, 1)], @@ -4529,7 +4527,7 @@ class A {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 11, 1, contextMessages: [message(testFile, 8, 1)], @@ -4554,7 +4552,7 @@ class A<_, _> {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 55, 1, contextMessages: [message(testFile, 52, 1)], @@ -4570,7 +4568,7 @@ typedef void F(); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 18, 1, contextMessages: [message(testFile, 15, 1)], @@ -4595,7 +4593,7 @@ typedef void F<_, _>(); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 62, 1, contextMessages: [message(testFile, 59, 1)], @@ -4611,7 +4609,7 @@ typedef F = void Function(); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 29, 1, contextMessages: [message(testFile, 26, 1)], @@ -4636,7 +4634,7 @@ typedef F = void Function<_, _>(); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 73, 1, contextMessages: [message(testFile, 70, 1)], @@ -4652,7 +4650,7 @@ typedef F = void Function(); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 13, 1, contextMessages: [message(testFile, 10, 1)], @@ -4677,7 +4675,7 @@ typedef F<_, _> = void Function(); ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 57, 1, contextMessages: [message(testFile, 54, 1)], @@ -4693,7 +4691,7 @@ typedef F = Map; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 13, 1, contextMessages: [message(testFile, 10, 1)], @@ -4718,7 +4716,7 @@ typedef F<_, _> = Map; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 57, 1, contextMessages: [message(testFile, 54, 1)], @@ -4736,7 +4734,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 22, 1, contextMessages: [message(testFile, 19, 1)], @@ -4765,7 +4763,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 66, 1, contextMessages: [message(testFile, 63, 1)], @@ -4781,7 +4779,7 @@ void f() {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 10, 1, contextMessages: [message(testFile, 7, 1)], @@ -4806,7 +4804,7 @@ void f<_, _>() {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 54, 1, contextMessages: [message(testFile, 51, 1)], @@ -4827,7 +4825,7 @@ class A {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 28, 1, contextMessages: [message(testFile, 6, 1)], @@ -4877,7 +4875,7 @@ class A {} ..addAll(aResult.diagnostics) ..assertErrors([ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 27, 1, contextMessages: [message(lib, 22, 1)], @@ -4915,7 +4913,7 @@ class A {} ..addAll(bResult.diagnostics) ..assertErrors([ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 27, 1, contextMessages: [message(a, 27, 1)], @@ -4932,7 +4930,7 @@ extension A on int {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 54, 1, contextMessages: [message(testFile, 10, 1)], @@ -4961,7 +4959,7 @@ extension A on int {} ..addAll(aResult.diagnostics) ..assertErrors([ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 31, 1, contextMessages: [message(lib, 26, 1)], @@ -4978,7 +4976,7 @@ extension type A(int it) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 71, 1, contextMessages: [message(testFile, 15, 1)], @@ -5007,7 +5005,7 @@ extension type A(int it) {} ..addAll(aResult.diagnostics) ..assertErrors([ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 36, 1, contextMessages: [message(lib, 31, 1)], @@ -5024,7 +5022,7 @@ mixin A {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 28, 1, contextMessages: [message(testFile, 6, 1)], @@ -5074,7 +5072,7 @@ mixin A {} ..addAll(aResult.diagnostics) ..assertErrors([ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 27, 1, contextMessages: [message(lib, 22, 1)], @@ -5090,7 +5088,7 @@ typedef A = List; ''', [ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 31, 1, contextMessages: [message(testFile, 8, 1)], @@ -5140,7 +5138,7 @@ int foo = 0; await resolveFile2(a); assertErrorsInResult([ error( - CompileTimeErrorCode.DUPLICATE_DEFINITION, + CompileTimeErrorCode.duplicateDefinition, 26, 3, contextMessages: [message(testFile, 20, 3)], diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_field_formal_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_field_formal_parameter_test.dart index bb623959cf1..07f8de44ab7 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_field_formal_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_field_formal_parameter_test.dart @@ -25,7 +25,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 41, 1, contextMessages: [message(testFile, 29, 1)], @@ -43,15 +43,15 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 16, 1), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 29, 1), + error(WarningCode.unusedField, 16, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 29, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 41, 1, contextMessages: [message(testFile, 29, 1)], ), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 41, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 41, 1), ], ); } @@ -68,15 +68,15 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 60, 1), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 73, 1), + error(WarningCode.unusedField, 60, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 73, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 85, 1, contextMessages: [message(testFile, 73, 1)], ), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 85, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 85, 1), ], ); } @@ -91,7 +91,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 41, 1, contextMessages: [message(testFile, 29, 1)], @@ -110,7 +110,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 43, 1, contextMessages: [message(testFile, 31, 1)], @@ -128,9 +128,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 18, 1), + error(WarningCode.unusedField, 18, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 43, 1, contextMessages: [message(testFile, 31, 1)], @@ -151,9 +151,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 62, 1), + error(WarningCode.unusedField, 62, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 87, 1, contextMessages: [message(testFile, 75, 1)], @@ -171,9 +171,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 16, 1), + error(WarningCode.unusedField, 16, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 41, 1, contextMessages: [message(testFile, 29, 1)], @@ -194,9 +194,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 60, 1), + error(WarningCode.unusedField, 60, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 85, 1, contextMessages: [message(testFile, 73, 1)], @@ -215,7 +215,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 55, 1, contextMessages: [message(testFile, 38, 1)], @@ -233,15 +233,15 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 16, 1), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 38, 1), + error(WarningCode.unusedField, 16, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 38, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 55, 1, contextMessages: [message(testFile, 38, 1)], ), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 55, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 55, 1), ], ); } @@ -258,15 +258,15 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 60, 1), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 82, 1), + error(WarningCode.unusedField, 60, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 82, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 99, 1, contextMessages: [message(testFile, 82, 1)], ), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 99, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 99, 1), ], ); } @@ -281,7 +281,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 36, 1, contextMessages: [message(testFile, 28, 1)], @@ -300,7 +300,7 @@ class A { ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 38, 1, contextMessages: [message(testFile, 30, 1)], @@ -318,9 +318,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 18, 1), + error(WarningCode.unusedField, 18, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 38, 1, contextMessages: [message(testFile, 30, 1)], @@ -341,9 +341,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 62, 1), + error(WarningCode.unusedField, 62, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 82, 1, contextMessages: [message(testFile, 74, 1)], @@ -364,9 +364,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 61, 1), + error(WarningCode.unusedField, 61, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 81, 1, contextMessages: [message(testFile, 73, 1)], @@ -385,9 +385,9 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 17, 1), + error(WarningCode.unusedField, 17, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_FORMAL_PARAMETER, + CompileTimeErrorCode.duplicateFieldFormalParameter, 37, 1, contextMessages: [message(testFile, 29, 1)], diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_field_name_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_field_name_test.dart index c05cec59564..1e046b487b6 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_field_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_field_name_test.dart @@ -23,7 +23,7 @@ var r = (a: 1, a: 2); ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_NAME, + CompileTimeErrorCode.duplicateFieldName, 15, 1, contextMessages: [message(testFile, 9, 1)], @@ -49,7 +49,7 @@ void f(({int a, int a}) r) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_NAME, + CompileTimeErrorCode.duplicateFieldName, 20, 1, contextMessages: [message(testFile, 13, 1)], @@ -65,7 +65,7 @@ void f((int a, int a) r) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_NAME, + CompileTimeErrorCode.duplicateFieldName, 19, 1, contextMessages: [message(testFile, 12, 1)], @@ -81,7 +81,7 @@ void f((int a, {int a}) r) {} ''', [ error( - CompileTimeErrorCode.DUPLICATE_FIELD_NAME, + CompileTimeErrorCode.duplicateFieldName, 20, 1, contextMessages: [message(testFile, 12, 1)], @@ -97,14 +97,14 @@ void f(({int _, int _}) r) {} ''', [ // Only positional wildcard fields can be duplicated. - error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 13, 1), + error(CompileTimeErrorCode.invalidFieldNamePrivate, 13, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_NAME, + CompileTimeErrorCode.duplicateFieldName, 20, 1, contextMessages: [message(testFile, 13, 1)], ), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 20, 1), + error(CompileTimeErrorCode.invalidFieldNamePrivate, 20, 1), ], ); } @@ -124,14 +124,14 @@ void f((int _, int _) r) {} void f((int _, int _) r) {} ''', [ - error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 56, 1), + error(CompileTimeErrorCode.invalidFieldNamePrivate, 56, 1), error( - CompileTimeErrorCode.DUPLICATE_FIELD_NAME, + CompileTimeErrorCode.duplicateFieldName, 63, 1, contextMessages: [message(testFile, 56, 1)], ), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 63, 1), + error(CompileTimeErrorCode.invalidFieldNamePrivate, 63, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_hidden_name_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_hidden_name_test.dart index f50383ebe87..a2697ed3f76 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_hidden_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_hidden_name_test.dart @@ -24,7 +24,7 @@ class B {} ''' export 'lib1.dart' hide A, B, A; ''', - [error(WarningCode.DUPLICATE_HIDDEN_NAME, 30, 1)], + [error(WarningCode.duplicateHiddenName, 30, 1)], ); } @@ -41,7 +41,7 @@ export 'dart:math' hide pi, Random, pi; await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.DUPLICATE_HIDDEN_NAME, 54, 2), + error(WarningCode.duplicateHiddenName, 54, 2), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_ignore_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_ignore_test.dart index 88b5d13ccbd..925d59cf6ec 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_ignore_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_ignore_test.dart @@ -35,7 +35,7 @@ void f() { var x = 0; } ''', - [error(WarningCode.DUPLICATE_IGNORE, 43, 21)], + [error(WarningCode.duplicateIgnore, 43, 21)], ); } @@ -47,7 +47,7 @@ void f() { var x = 0; } ''', - [error(WarningCode.DUPLICATE_IGNORE, 47, 21)], + [error(WarningCode.duplicateIgnore, 47, 21)], ); } @@ -60,7 +60,7 @@ void f() { var x = 0; } ''', - [error(WarningCode.DUPLICATE_IGNORE, 66, 21)], + [error(WarningCode.duplicateIgnore, 66, 21)], ); } @@ -70,7 +70,7 @@ void f() { // ignore_for_file: type=lint, TYPE=LINT void f(arg1(int)) {} // AVOID_TYPES_AS_PARAMETER_NAMES ''', - [error(WarningCode.DUPLICATE_IGNORE, 31, 9)], + [error(WarningCode.duplicateIgnore, 31, 9)], ); } @@ -81,7 +81,7 @@ void f() {} // ignore: type=lint, TYPE=LINT void g(arg1(int)) {} // AVOID_TYPES_AS_PARAMETER_NAMES ''', - [error(WarningCode.DUPLICATE_IGNORE, 34, 9)], + [error(WarningCode.duplicateIgnore, 34, 9)], ); } @@ -93,7 +93,7 @@ void f() {} // ignore: type=lint void g(arg1(int)) {} // AVOID_TYPES_AS_PARAMETER_NAMES ''', - [error(WarningCode.DUPLICATE_IGNORE, 53, 9)], + [error(WarningCode.duplicateIgnore, 53, 9)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_import_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_import_test.dart index a2836bb232f..a31e35d4258 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_import_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_import_test.dart @@ -26,7 +26,7 @@ class B {} export 'lib1.dart'; export 'lib1.dart'; ''', - [error(WarningCode.DUPLICATE_EXPORT, 27, 11)], + [error(WarningCode.duplicateExport, 27, 11)], ); } @@ -51,7 +51,7 @@ class B {} export 'lib1.dart' show A; export 'lib1.dart' show A; ''', - [error(WarningCode.DUPLICATE_EXPORT, 34, 11)], + [error(WarningCode.duplicateExport, 34, 11)], ); } @@ -68,7 +68,7 @@ export 'dart:math'; await assertErrorsInFile2(a, []); - await assertErrorsInFile2(b, [error(WarningCode.DUPLICATE_EXPORT, 45, 11)]); + await assertErrorsInFile2(b, [error(WarningCode.duplicateExport, 45, 11)]); } } @@ -86,7 +86,7 @@ import 'package:test/a.dart'; final a = A(); ''', - [error(WarningCode.DUPLICATE_IMPORT, 37, 21)], + [error(WarningCode.duplicateImport, 37, 21)], ); } @@ -102,7 +102,7 @@ import 'package:test/a.dart'; final a = A(); ''', - [error(WarningCode.DUPLICATE_IMPORT, 24, 21)], + [error(WarningCode.duplicateImport, 24, 21)], ); } @@ -118,7 +118,7 @@ import 'a.dart'; final a = A(); ''', - [error(WarningCode.DUPLICATE_IMPORT, 24, 8)], + [error(WarningCode.duplicateImport, 24, 8)], ); } @@ -138,9 +138,9 @@ M.A a = M.A(); await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.MULTIPLE_COMBINATORS, 35, 13), - error(WarningCode.DUPLICATE_IMPORT, 57, 11), - error(WarningCode.MULTIPLE_COMBINATORS, 74, 13), + error(WarningCode.multipleCombinators, 35, 13), + error(WarningCode.duplicateImport, 57, 11), + error(WarningCode.multipleCombinators, 74, 13), ]); } @@ -212,8 +212,8 @@ A a = A(); await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.DUPLICATE_IMPORT, 38, 11), - error(WarningCode.DUPLICATE_IMPORT, 58, 11), + error(WarningCode.duplicateImport, 38, 11), + error(WarningCode.duplicateImport, 58, 11), ]); } @@ -231,6 +231,6 @@ void f(Random _) {} await assertErrorsInFile2(a, []); - await assertErrorsInFile2(b, [error(WarningCode.DUPLICATE_IMPORT, 45, 11)]); + await assertErrorsInFile2(b, [error(WarningCode.duplicateImport, 45, 11)]); } } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_named_argument_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_named_argument_test.dart index 0fa3950adc5..95391a8e2c6 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_named_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_named_argument_test.dart @@ -25,7 +25,7 @@ main() { C(a: 1, a: 2); } ''', - [error(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, 54, 1)], + [error(CompileTimeErrorCode.duplicateNamedArgument, 54, 1)], ); } @@ -40,7 +40,7 @@ main() { D(a: 1, a: 2); } ''', - [error(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, 69, 1)], + [error(CompileTimeErrorCode.duplicateNamedArgument, 69, 1)], ); } @@ -55,7 +55,7 @@ class B extends A { B({required super.a}) : super(a: 0); } ''', - [error(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, 88, 1)], + [error(CompileTimeErrorCode.duplicateNamedArgument, 88, 1)], ); } @@ -67,7 +67,7 @@ enum E { const E({required int a}); } ''', - [error(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, 19, 1)], + [error(CompileTimeErrorCode.duplicateNamedArgument, 19, 1)], ); } @@ -79,7 +79,7 @@ main() { f(a: 1, a: 2); } ''', - [error(CompileTimeErrorCode.DUPLICATE_NAMED_ARGUMENT, 32, 1)], + [error(CompileTimeErrorCode.duplicateNamedArgument, 32, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_part_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_part_test.dart index 786db50ba2e..5c82622ff25 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_part_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_part_test.dart @@ -25,7 +25,7 @@ part of 'test.dart'; part 'part.dart'; part 'foo/../part.dart'; ''', - [error(CompileTimeErrorCode.DUPLICATE_PART, 23, 18)], + [error(CompileTimeErrorCode.duplicatePart, 23, 18)], ); } @@ -39,7 +39,7 @@ part of 'test.dart'; part 'part.dart'; part 'part.dart'; ''', - [error(CompileTimeErrorCode.DUPLICATE_PART, 23, 11)], + [error(CompileTimeErrorCode.duplicatePart, 23, 11)], ); } @@ -71,7 +71,7 @@ part 'b.dart'; await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.DUPLICATE_PART, 23, 8), + error(CompileTimeErrorCode.duplicatePart, 23, 8), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_pattern_assignment_variable_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_pattern_assignment_variable_test.dart index 6a6028dd40d..817bc33934a 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_pattern_assignment_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_pattern_assignment_variable_test.dart @@ -26,7 +26,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE, + CompileTimeErrorCode.duplicatePatternAssignmentVariable, 38, 1, contextMessages: [message(testFile, 23, 1)], @@ -46,7 +46,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE, + CompileTimeErrorCode.duplicatePatternAssignmentVariable, 26, 1, contextMessages: [message(testFile, 23, 1)], @@ -66,13 +66,13 @@ void f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE, + CompileTimeErrorCode.duplicatePatternAssignmentVariable, 26, 1, contextMessages: [message(testFile, 23, 1)], ), error( - CompileTimeErrorCode.DUPLICATE_PATTERN_ASSIGNMENT_VARIABLE, + CompileTimeErrorCode.duplicatePatternAssignmentVariable, 29, 1, contextMessages: [message(testFile, 23, 1)], diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_pattern_field_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_pattern_field_test.dart index 67c79e3b155..67ba0be31c2 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_pattern_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_pattern_field_test.dart @@ -27,7 +27,7 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_PATTERN_FIELD, + CompileTimeErrorCode.duplicatePatternField, 57, 4, contextMessages: [message(testFile, 48, 4)], @@ -48,7 +48,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_PATTERN_FIELD, + CompileTimeErrorCode.duplicatePatternField, 45, 3, contextMessages: [message(testFile, 37, 3)], @@ -69,12 +69,12 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_PATTERN_FIELD, + CompileTimeErrorCode.duplicatePatternField, 45, 1, contextMessages: [message(testFile, 37, 3)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 50, 3), + error(WarningCode.unusedLocalVariable, 50, 3), ], ); } @@ -90,9 +90,9 @@ void f(x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 42, 3), + error(WarningCode.unusedLocalVariable, 42, 3), error( - CompileTimeErrorCode.DUPLICATE_PATTERN_FIELD, + CompileTimeErrorCode.duplicatePatternField, 47, 3, contextMessages: [message(testFile, 37, 1)], @@ -113,7 +113,7 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_PATTERN_FIELD, + CompileTimeErrorCode.duplicatePatternField, 53, 3, contextMessages: [message(testFile, 45, 3)], @@ -134,7 +134,7 @@ void f(({int foo}) x) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_PATTERN_FIELD, + CompileTimeErrorCode.duplicatePatternField, 57, 3, contextMessages: [message(testFile, 49, 3)], diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_rest_element_in_pattern_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_rest_element_in_pattern_test.dart index 57b81236eb0..efbf2071dd8 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_rest_element_in_pattern_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_rest_element_in_pattern_test.dart @@ -24,7 +24,7 @@ void f(List x) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_REST_ELEMENT_IN_PATTERN, + CompileTimeErrorCode.duplicateRestElementInPattern, 41, 3, contextMessages: [message(testFile, 36, 3)], diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_shown_name_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_shown_name_test.dart index b76152318f5..0882b4de83d 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_shown_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_shown_name_test.dart @@ -24,7 +24,7 @@ class B {} ''' export 'lib1.dart' show A, B, A; ''', - [error(WarningCode.DUPLICATE_SHOWN_NAME, 30, 1)], + [error(WarningCode.duplicateShownName, 30, 1)], ); } @@ -41,7 +41,7 @@ export 'dart:math' show pi, Random, pi; await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.DUPLICATE_SHOWN_NAME, 54, 2), + error(WarningCode.duplicateShownName, 54, 2), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_variable_pattern_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_variable_pattern_test.dart index fb879934f32..2fcc77efaa2 100644 --- a/pkg/analyzer/test/src/diagnostics/duplicate_variable_pattern_test.dart +++ b/pkg/analyzer/test/src/diagnostics/duplicate_variable_pattern_test.dart @@ -26,7 +26,7 @@ void f(int x) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_VARIABLE_PATTERN, + CompileTimeErrorCode.duplicateVariablePattern, 42, 1, contextMessages: [message(testFile, 33, 1)], @@ -88,7 +88,7 @@ void f(int x) { ''', [ error( - CompileTimeErrorCode.DUPLICATE_VARIABLE_PATTERN, + CompileTimeErrorCode.duplicateVariablePattern, 53, 1, contextMessages: [message(testFile, 44, 1)], @@ -138,7 +138,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DUPLICATE_VARIABLE_PATTERN, + CompileTimeErrorCode.duplicateVariablePattern, 21, 1, contextMessages: [message(testFile, 18, 1)], diff --git a/pkg/analyzer/test/src/diagnostics/enum_constant_invokes_factory_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/enum_constant_invokes_factory_constructor_test.dart index 023bf2fdf24..999d0eb4d69 100644 --- a/pkg/analyzer/test/src/diagnostics/enum_constant_invokes_factory_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/enum_constant_invokes_factory_constructor_test.dart @@ -33,7 +33,7 @@ extension type const ET(E it) implements E { ''', [ error( - CompileTimeErrorCode.ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR, + CompileTimeErrorCode.enumConstantInvokesFactoryConstructor, 20, 5, ), @@ -58,7 +58,7 @@ extension type const ET(E it) implements E { ''', [ error( - CompileTimeErrorCode.ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR, + CompileTimeErrorCode.enumConstantInvokesFactoryConstructor, 27, 2, ), @@ -83,7 +83,7 @@ extension type const ET(E it) implements E { ''', [ error( - CompileTimeErrorCode.ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR, + CompileTimeErrorCode.enumConstantInvokesFactoryConstructor, 27, 2, ), diff --git a/pkg/analyzer/test/src/diagnostics/enum_constant_same_name_as_enclosing_test.dart b/pkg/analyzer/test/src/diagnostics/enum_constant_same_name_as_enclosing_test.dart index c6db82eba47..cc074eb23f8 100644 --- a/pkg/analyzer/test/src/diagnostics/enum_constant_same_name_as_enclosing_test.dart +++ b/pkg/analyzer/test/src/diagnostics/enum_constant_same_name_as_enclosing_test.dart @@ -22,7 +22,7 @@ enum E { E } ''', - [error(CompileTimeErrorCode.ENUM_CONSTANT_SAME_NAME_AS_ENCLOSING, 11, 1)], + [error(CompileTimeErrorCode.enumConstantSameNameAsEnclosing, 11, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/enum_instantiated_to_bounds_is_not_well_bounded_test.dart b/pkg/analyzer/test/src/diagnostics/enum_instantiated_to_bounds_is_not_well_bounded_test.dart index b3787a381c5..1feee8a79b7 100644 --- a/pkg/analyzer/test/src/diagnostics/enum_instantiated_to_bounds_is_not_well_bounded_test.dart +++ b/pkg/analyzer/test/src/diagnostics/enum_instantiated_to_bounds_is_not_well_bounded_test.dart @@ -27,7 +27,7 @@ enum E, U> { ''', [ error( - CompileTimeErrorCode.ENUM_INSTANTIATED_TO_BOUNDS_IS_NOT_WELL_BOUNDED, + CompileTimeErrorCode.enumInstantiatedToBoundsIsNotWellBounded, 36, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/enum_mixin_with_instance_variable_test.dart b/pkg/analyzer/test/src/diagnostics/enum_mixin_with_instance_variable_test.dart index 272d62a6007..4117b5d609c 100644 --- a/pkg/analyzer/test/src/diagnostics/enum_mixin_with_instance_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/enum_mixin_with_instance_variable_test.dart @@ -26,7 +26,7 @@ enum E with M { v } ''', - [error(CompileTimeErrorCode.ENUM_MIXIN_WITH_INSTANCE_VARIABLE, 40, 1)], + [error(CompileTimeErrorCode.enumMixinWithInstanceVariable, 40, 1)], ); } @@ -41,7 +41,7 @@ enum E with M { v } ''', - [error(CompileTimeErrorCode.ENUM_MIXIN_WITH_INSTANCE_VARIABLE, 42, 1)], + [error(CompileTimeErrorCode.enumMixinWithInstanceVariable, 42, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/enum_with_abstract_member_test.dart b/pkg/analyzer/test/src/diagnostics/enum_with_abstract_member_test.dart index 8acd49ec62e..6d73cfa6a88 100644 --- a/pkg/analyzer/test/src/diagnostics/enum_with_abstract_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/enum_with_abstract_member_test.dart @@ -23,7 +23,7 @@ enum E { int get foo; } ''', - [error(CompileTimeErrorCode.ENUM_WITH_ABSTRACT_MEMBER, 16, 12)], + [error(CompileTimeErrorCode.enumWithAbstractMember, 16, 12)], ); } @@ -35,7 +35,7 @@ enum E { void foo(); } ''', - [error(CompileTimeErrorCode.ENUM_WITH_ABSTRACT_MEMBER, 16, 11)], + [error(CompileTimeErrorCode.enumWithAbstractMember, 16, 11)], ); } @@ -47,7 +47,7 @@ enum E { set foo(int _); } ''', - [error(CompileTimeErrorCode.ENUM_WITH_ABSTRACT_MEMBER, 16, 15)], + [error(CompileTimeErrorCode.enumWithAbstractMember, 16, 15)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/enum_with_name_values_test.dart b/pkg/analyzer/test/src/diagnostics/enum_with_name_values_test.dart index b635c83e073..22d9628a14e 100644 --- a/pkg/analyzer/test/src/diagnostics/enum_with_name_values_test.dart +++ b/pkg/analyzer/test/src/diagnostics/enum_with_name_values_test.dart @@ -22,7 +22,7 @@ enum values { v } ''', - [error(CompileTimeErrorCode.ENUM_WITH_NAME_VALUES, 5, 6)], + [error(CompileTimeErrorCode.enumWithNameValues, 5, 6)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/enum_without_constants_test.dart b/pkg/analyzer/test/src/diagnostics/enum_without_constants_test.dart index 670beb2e615..876d4e31756 100644 --- a/pkg/analyzer/test/src/diagnostics/enum_without_constants_test.dart +++ b/pkg/analyzer/test/src/diagnostics/enum_without_constants_test.dart @@ -35,7 +35,7 @@ enum E {} ''' enum E {} ''', - [error(CompileTimeErrorCode.ENUM_WITHOUT_CONSTANTS, 5, 1)], + [error(CompileTimeErrorCode.enumWithoutConstants, 5, 1)], ); } @@ -52,7 +52,7 @@ augment enum E {} '''); await assertErrorsInFile2(a, [ - error(CompileTimeErrorCode.ENUM_WITHOUT_CONSTANTS, 20, 1), + error(CompileTimeErrorCode.enumWithoutConstants, 20, 1), ]); await assertErrorsInFile2(b, []); diff --git a/pkg/analyzer/test/src/diagnostics/equal_elements_in_const_set_test.dart b/pkg/analyzer/test/src/diagnostics/equal_elements_in_const_set_test.dart index 4005229ac7a..0a339b1577b 100644 --- a/pkg/analyzer/test/src/diagnostics/equal_elements_in_const_set_test.dart +++ b/pkg/analyzer/test/src/diagnostics/equal_elements_in_const_set_test.dart @@ -25,7 +25,7 @@ var c = const {1, 2, 1}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 21, 1, contextMessages: [message(testFile, 15, 1)], @@ -42,7 +42,7 @@ extension type E(int it) {} ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 16, 1, contextMessages: [message(testFile, 11, 3)], @@ -58,7 +58,7 @@ var c = const {1, if (1 < 0) 2 else 1}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 36, 1, contextMessages: [message(testFile, 15, 1)], @@ -98,7 +98,7 @@ var c = const {1, if (0 < 1) 1}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 29, 1, contextMessages: [message(testFile, 15, 1)], @@ -118,7 +118,7 @@ var c = const {const A(), const A()}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 60, 14, contextMessages: [message(testFile, 44, 14)], @@ -145,7 +145,7 @@ const x = {[0], [0]}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 16, 3, contextMessages: [message(testFile, 11, 3)], @@ -167,7 +167,7 @@ const x = {(0, 1), (0, 1)}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 19, 6, contextMessages: [message(testFile, 11, 6)], @@ -195,7 +195,7 @@ var c = const {1, ...{1}}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 21, 3, contextMessages: [message(testFile, 15, 1)], @@ -210,7 +210,7 @@ var c = const {1, ...{1}}; ''' var c = {1, 2, 1}; ''', - [error(WarningCode.EQUAL_ELEMENTS_IN_SET, 15, 1)], + [error(WarningCode.equalElementsInSet, 15, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/equal_elements_in_set_test.dart b/pkg/analyzer/test/src/diagnostics/equal_elements_in_set_test.dart index fb706574352..c457ef56354 100644 --- a/pkg/analyzer/test/src/diagnostics/equal_elements_in_set_test.dart +++ b/pkg/analyzer/test/src/diagnostics/equal_elements_in_set_test.dart @@ -22,7 +22,7 @@ const a = 1; const b = 1; var s = {a, b}; ''', - [error(WarningCode.EQUAL_ELEMENTS_IN_SET, 38, 1)], + [error(WarningCode.equalElementsInSet, 38, 1)], ); } @@ -32,7 +32,7 @@ var s = {a, b}; const one = 1; var s = {1, one}; ''', - [error(WarningCode.EQUAL_ELEMENTS_IN_SET, 27, 3)], + [error(WarningCode.equalElementsInSet, 27, 3)], ); } @@ -41,7 +41,7 @@ var s = {1, one}; ''' var s = {1, 1}; ''', - [error(WarningCode.EQUAL_ELEMENTS_IN_SET, 12, 1)], + [error(WarningCode.equalElementsInSet, 12, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/equal_keys_in_const_map_test.dart b/pkg/analyzer/test/src/diagnostics/equal_keys_in_const_map_test.dart index 214bd298fdf..8beeeecb1b7 100644 --- a/pkg/analyzer/test/src/diagnostics/equal_keys_in_const_map_test.dart +++ b/pkg/analyzer/test/src/diagnostics/equal_keys_in_const_map_test.dart @@ -25,7 +25,7 @@ var c = const {1: null, 2: null, 1: null}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 33, 1, contextMessages: [message(testFile, 15, 1)], @@ -42,7 +42,7 @@ extension type E(int it) {} ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 19, 1, contextMessages: [message(testFile, 11, 3)], @@ -58,7 +58,7 @@ var c = const {1: null, if (1 < 0) 2: null else 1: null}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 48, 1, contextMessages: [message(testFile, 15, 1)], @@ -98,7 +98,7 @@ var c = const {1: null, if (0 < 1) 1: null}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 35, 1, contextMessages: [message(testFile, 15, 1)], @@ -118,7 +118,7 @@ var c = const {const A(): null, const A(): null}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 66, 14, contextMessages: [message(testFile, 44, 14)], @@ -145,7 +145,7 @@ const x = {[0]: null, [0]: null}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 22, 3, contextMessages: [message(testFile, 11, 3)], @@ -167,7 +167,7 @@ const x = {(0, 1): null, (0, 1): null}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 25, 6, contextMessages: [message(testFile, 11, 6)], @@ -195,7 +195,7 @@ var c = const {1: null, ...{1: null}}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 27, 9, contextMessages: [message(testFile, 15, 1)], @@ -210,7 +210,7 @@ var c = const {1: null, ...{1: null}}; ''' var c = {1: null, 2: null, 1: null}; ''', - [error(WarningCode.EQUAL_KEYS_IN_MAP, 27, 1)], + [error(WarningCode.equalKeysInMap, 27, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/equal_keys_in_map_pattern_test.dart b/pkg/analyzer/test/src/diagnostics/equal_keys_in_map_pattern_test.dart index dcf257f0e49..63038e74d66 100644 --- a/pkg/analyzer/test/src/diagnostics/equal_keys_in_map_pattern_test.dart +++ b/pkg/analyzer/test/src/diagnostics/equal_keys_in_map_pattern_test.dart @@ -24,7 +24,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + CompileTimeErrorCode.equalKeysInMapPattern, 35, 4, contextMessages: [message(testFile, 26, 4)], @@ -42,7 +42,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + CompileTimeErrorCode.equalKeysInMapPattern, 32, 1, contextMessages: [message(testFile, 26, 1)], @@ -63,7 +63,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + CompileTimeErrorCode.equalKeysInMapPattern, 59, 1, contextMessages: [message(testFile, 53, 1)], @@ -81,7 +81,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + CompileTimeErrorCode.equalKeysInMapPattern, 34, 3, contextMessages: [message(testFile, 26, 3)], @@ -100,7 +100,7 @@ extension type E(int it) {} ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + CompileTimeErrorCode.equalKeysInMapPattern, 34, 1, contextMessages: [message(testFile, 26, 3)], @@ -182,7 +182,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + CompileTimeErrorCode.equalKeysInMapPattern, 33, 2, contextMessages: [message(testFile, 26, 2)], @@ -200,7 +200,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + CompileTimeErrorCode.equalKeysInMapPattern, 37, 6, contextMessages: [message(testFile, 26, 6)], @@ -226,7 +226,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_MAP_PATTERN, + CompileTimeErrorCode.equalKeysInMapPattern, 35, 4, contextMessages: [message(testFile, 26, 4)], diff --git a/pkg/analyzer/test/src/diagnostics/equal_keys_in_map_test.dart b/pkg/analyzer/test/src/diagnostics/equal_keys_in_map_test.dart index 14a8ed76c4b..7d4bc89c542 100644 --- a/pkg/analyzer/test/src/diagnostics/equal_keys_in_map_test.dart +++ b/pkg/analyzer/test/src/diagnostics/equal_keys_in_map_test.dart @@ -22,7 +22,7 @@ const a = 1; const b = 1; var s = {a: 2, b: 3}; ''', - [error(WarningCode.EQUAL_KEYS_IN_MAP, 41, 1)], + [error(WarningCode.equalKeysInMap, 41, 1)], ); } @@ -32,7 +32,7 @@ var s = {a: 2, b: 3}; const one = 1; var s = {1: 2, one: 3}; ''', - [error(WarningCode.EQUAL_KEYS_IN_MAP, 30, 3)], + [error(WarningCode.equalKeysInMap, 30, 3)], ); } @@ -41,7 +41,7 @@ var s = {1: 2, one: 3}; ''' var s = {1: 2, 1: 3}; ''', - [error(WarningCode.EQUAL_KEYS_IN_MAP, 15, 1)], + [error(WarningCode.equalKeysInMap, 15, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/expected_one_list_pattern_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/expected_one_list_pattern_type_arguments_test.dart index c77ffde43f8..77be0c52786 100644 --- a/pkg/analyzer/test/src/diagnostics/expected_one_list_pattern_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expected_one_list_pattern_type_arguments_test.dart @@ -30,13 +30,7 @@ void f(x) { if (x case [0]) {} } ''', - [ - error( - CompileTimeErrorCode.EXPECTED_ONE_LIST_PATTERN_TYPE_ARGUMENTS, - 25, - 10, - ), - ], + [error(CompileTimeErrorCode.expectedOneListPatternTypeArguments, 25, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/expected_one_list_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/expected_one_list_type_arguments_test.dart index e6a12b06272..edcbb1d65a2 100644 --- a/pkg/analyzer/test/src/diagnostics/expected_one_list_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expected_one_list_type_arguments_test.dart @@ -29,7 +29,7 @@ main() { main() { []; }''', - [error(CompileTimeErrorCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, 11, 10)], + [error(CompileTimeErrorCode.expectedOneListTypeArguments, 11, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/expected_one_set_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/expected_one_set_type_arguments_test.dart index 3d2d1fcfd4c..cb56bb212a1 100644 --- a/pkg/analyzer/test/src/diagnostics/expected_one_set_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expected_one_set_type_arguments_test.dart @@ -21,7 +21,7 @@ class ExpectedOneSetTypeArgumentsTest extends PubPackageResolutionTest { main() { {2, 3}; }''', - [error(CompileTimeErrorCode.EXPECTED_ONE_SET_TYPE_ARGUMENTS, 11, 15)], + [error(CompileTimeErrorCode.expectedOneSetTypeArguments, 11, 15)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/expected_two_map_pattern_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/expected_two_map_pattern_type_arguments_test.dart index 31fb9eebc6b..0693931b083 100644 --- a/pkg/analyzer/test/src/diagnostics/expected_two_map_pattern_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expected_two_map_pattern_type_arguments_test.dart @@ -30,13 +30,7 @@ void f(x) { if (x case {0: _}) {} } ''', - [ - error( - CompileTimeErrorCode.EXPECTED_TWO_MAP_PATTERN_TYPE_ARGUMENTS, - 25, - 5, - ), - ], + [error(CompileTimeErrorCode.expectedTwoMapPatternTypeArguments, 25, 5)], ); } @@ -55,13 +49,7 @@ void f(x) { if (x case {0: _}) {} } ''', - [ - error( - CompileTimeErrorCode.EXPECTED_TWO_MAP_PATTERN_TYPE_ARGUMENTS, - 25, - 19, - ), - ], + [error(CompileTimeErrorCode.expectedTwoMapPatternTypeArguments, 25, 19)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/expected_two_map_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/expected_two_map_type_arguments_test.dart index 84acb993202..d5d84774718 100644 --- a/pkg/analyzer/test/src/diagnostics/expected_two_map_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expected_two_map_type_arguments_test.dart @@ -23,7 +23,7 @@ class ExpectedTwoMapTypeArgumentsTest extends PubPackageResolutionTest { main() { {}; }''', - [error(CompileTimeErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, 11, 15)], + [error(CompileTimeErrorCode.expectedTwoMapTypeArguments, 11, 15)], ); } @@ -33,7 +33,7 @@ main() { main() { {1: 2}; }''', - [error(CompileTimeErrorCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, 11, 15)], + [error(CompileTimeErrorCode.expectedTwoMapTypeArguments, 11, 15)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/experiment_not_enabled_test.dart b/pkg/analyzer/test/src/diagnostics/experiment_not_enabled_test.dart index 938191f3a1b..f794ffbab60 100644 --- a/pkg/analyzer/test/src/diagnostics/experiment_not_enabled_test.dart +++ b/pkg/analyzer/test/src/diagnostics/experiment_not_enabled_test.dart @@ -29,8 +29,8 @@ main() { } ''', [ - error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 86, 5), - error(CompileTimeErrorCode.UNDEFINED_METHOD, 96, 3), + error(ParserErrorCode.experimentNotEnabled, 86, 5), + error(CompileTimeErrorCode.undefinedMethod, 96, 3), ], ); } @@ -44,7 +44,7 @@ void main() { print(c); } ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 42, 1)], + [error(ParserErrorCode.experimentNotEnabled, 42, 1)], ); } @@ -54,7 +54,7 @@ void main() { // @dart = 2.12 typedef A = int; ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 26, 1)], + [error(ParserErrorCode.experimentNotEnabled, 26, 1)], ); } @@ -64,7 +64,7 @@ typedef A = int; // @dart = 2.12 typedef A = int?; ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 26, 1)], + [error(ParserErrorCode.experimentNotEnabled, 26, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/export_internal_library_test.dart b/pkg/analyzer/test/src/diagnostics/export_internal_library_test.dart index ee31f0f190e..f4fc158f1d6 100644 --- a/pkg/analyzer/test/src/diagnostics/export_internal_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/export_internal_library_test.dart @@ -22,7 +22,7 @@ export 'dart:_internal'; ''', [ error( - CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY, + CompileTimeErrorCode.exportInternalLibrary, 0, 24, messageContains: ["library 'dart:_internal' "], diff --git a/pkg/analyzer/test/src/diagnostics/export_of_non_library_test.dart b/pkg/analyzer/test/src/diagnostics/export_of_non_library_test.dart index c5b7b4b4d01..2fbdbf6206a 100644 --- a/pkg/analyzer/test/src/diagnostics/export_of_non_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/export_of_non_library_test.dart @@ -26,7 +26,7 @@ export 'lib1.dart'; ''', [ error( - CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY, + CompileTimeErrorCode.exportOfNonLibrary, 18, 11, messageContains: ["library 'lib1.dart' "], diff --git a/pkg/analyzer/test/src/diagnostics/expression_in_map_test.dart b/pkg/analyzer/test/src/diagnostics/expression_in_map_test.dart index a4347e5afe5..11213ee889f 100644 --- a/pkg/analyzer/test/src/diagnostics/expression_in_map_test.dart +++ b/pkg/analyzer/test/src/diagnostics/expression_in_map_test.dart @@ -20,7 +20,7 @@ class ExpressionInMapTest extends PubPackageResolutionTest { ''' var m = {'a', 'b' : 2}; ''', - [error(CompileTimeErrorCode.EXPRESSION_IN_MAP, 22, 3)], + [error(CompileTimeErrorCode.expressionInMap, 22, 3)], ); } @@ -29,7 +29,7 @@ var m = {'a', 'b' : 2}; ''' const m = {'a', 'b' : 2}; ''', - [error(CompileTimeErrorCode.EXPRESSION_IN_MAP, 24, 3)], + [error(CompileTimeErrorCode.expressionInMap, 24, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extends_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/extends_deferred_class_test.dart index de8676aa02e..4bc12985a67 100644 --- a/pkg/analyzer/test/src/diagnostics/extends_deferred_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extends_deferred_class_test.dart @@ -27,7 +27,7 @@ import 'lib1.dart' deferred as a; mixin M {} class C = a.A with M; ''', - [error(CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS, 69, 3)], + [error(CompileTimeErrorCode.extendsDeferredClass, 69, 3)], ); } @@ -42,7 +42,7 @@ library root; import 'lib1.dart' deferred as a; class B extends a.A {} ''', - [error(CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS, 64, 3)], + [error(CompileTimeErrorCode.extendsDeferredClass, 64, 3)], ); } @@ -58,7 +58,7 @@ library root; import 'lib1.dart' deferred as a; class B extends a.B {} ''', - [error(CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS, 64, 3)], + [error(CompileTimeErrorCode.extendsDeferredClass, 64, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extends_disallowed_class_test.dart b/pkg/analyzer/test/src/diagnostics/extends_disallowed_class_test.dart index af1eaf42d74..090db10e419 100644 --- a/pkg/analyzer/test/src/diagnostics/extends_disallowed_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extends_disallowed_class_test.dart @@ -20,7 +20,7 @@ class ExtendsDisallowedClassTest extends PubPackageResolutionTest { ''' class A extends bool {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 16, 4)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 16, 4)], ); } @@ -29,7 +29,7 @@ class A extends bool {} ''' class A extends double {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 16, 6)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 16, 6)], ); } @@ -39,7 +39,7 @@ class A extends double {} import 'dart:async'; class A extends FutureOr {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 37, 8)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 37, 8)], ); } @@ -49,7 +49,7 @@ class A extends FutureOr {} import 'dart:async'; class A extends FutureOr {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 37, 13)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 37, 13)], ); } @@ -60,7 +60,7 @@ import 'dart:async'; typedef F = FutureOr; class A extends F {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 65, 1)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 65, 1)], ); } @@ -70,7 +70,7 @@ class A extends F {} import 'dart:async'; class A extends FutureOr {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 40, 11)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 40, 11)], ); } @@ -79,7 +79,7 @@ class A extends FutureOr {} ''' class A extends int {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 16, 3)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 16, 3)], ); } @@ -88,7 +88,7 @@ class A extends int {} ''' class A extends Null {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 16, 4)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 16, 4)], ); } @@ -97,7 +97,7 @@ class A extends Null {} ''' class A extends num {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 16, 3)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 16, 3)], ); } @@ -106,7 +106,7 @@ class A extends num {} ''' class A extends Record {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 16, 6)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 16, 6)], ); } @@ -115,7 +115,7 @@ class A extends Record {} ''' class A extends String {} ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 16, 6)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 16, 6)], ); } @@ -133,7 +133,7 @@ augment class A extends String {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 42, 6), + error(CompileTimeErrorCode.extendsDisallowedClass, 42, 6), ]); } @@ -143,7 +143,7 @@ augment class A extends String {} class M {} class C = bool with M; ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 21, 4)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 21, 4)], ); } @@ -153,7 +153,7 @@ class C = bool with M; class M {} class C = double with M; ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 21, 6)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 21, 6)], ); } @@ -164,7 +164,7 @@ import 'dart:async'; class M {} class C = FutureOr with M; ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 42, 8)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 42, 8)], ); } @@ -174,7 +174,7 @@ class C = FutureOr with M; class M {} class C = int with M; ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 21, 3)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 21, 3)], ); } @@ -184,7 +184,7 @@ class C = int with M; class M {} class C = Null with M; ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 21, 4)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 21, 4)], ); } @@ -194,7 +194,7 @@ class C = Null with M; class M {} class C = num with M; ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 21, 3)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 21, 3)], ); } @@ -204,7 +204,7 @@ class C = num with M; class M {} class C = String with M; ''', - [error(CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, 21, 6)], + [error(CompileTimeErrorCode.extendsDisallowedClass, 21, 6)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extends_non_class_test.dart b/pkg/analyzer/test/src/diagnostics/extends_non_class_test.dart index 199512eae53..575e244438a 100644 --- a/pkg/analyzer/test/src/diagnostics/extends_non_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extends_non_class_test.dart @@ -20,7 +20,7 @@ class ExtendsNonClassTest extends PubPackageResolutionTest { r''' class A extends dynamic {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 16, 7)], + [error(CompileTimeErrorCode.extendsNonClass, 16, 7)], ); var node = findNode.singleExtendsClause; @@ -40,7 +40,7 @@ ExtendsClause enum E { ONE } class A extends E {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 31, 1)], + [error(CompileTimeErrorCode.extendsNonClass, 31, 1)], ); var node = findNode.singleExtendsClause; @@ -60,7 +60,7 @@ ExtendsClause extension type A(int it) {} class B extends A {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 44, 1)], + [error(CompileTimeErrorCode.extendsNonClass, 44, 1)], ); var node = findNode.singleExtendsClause; @@ -80,7 +80,7 @@ ExtendsClause mixin M {} class A extends M {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 27, 1)], + [error(CompileTimeErrorCode.extendsNonClass, 27, 1)], ); var node = findNode.singleExtendsClause; @@ -100,7 +100,7 @@ ExtendsClause int v = 0; class A extends v {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 27, 1)], + [error(CompileTimeErrorCode.extendsNonClass, 27, 1)], ); var node = findNode.singleExtendsClause; @@ -120,7 +120,7 @@ ExtendsClause int v = 0; class A extends v {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 27, 1)], + [error(CompileTimeErrorCode.extendsNonClass, 27, 1)], ); var node = findNode.singleExtendsClause; @@ -147,7 +147,7 @@ ExtendsClause ''' class A extends Never {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 16, 5)], + [error(CompileTimeErrorCode.extendsNonClass, 16, 5)], ); var node = findNode.singleExtendsClause; @@ -166,7 +166,7 @@ ExtendsClause r''' class C extends A {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 16, 1)], + [error(CompileTimeErrorCode.extendsNonClass, 16, 1)], ); var node = findNode.singleExtendsClause; @@ -187,7 +187,7 @@ import 'a.dart' as p; class C extends p.A {} ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 8)], ); var node = findNode.singleExtendsClause; @@ -242,7 +242,7 @@ part of 'a.dart'; import 'x.dart' as p; class C extends p.A {} ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 25, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 25, 8)], ); var node = findNode.singleExtendsClause; @@ -267,7 +267,7 @@ import 'a.dart' show A; class C extends A {} ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 8)], ); } @@ -294,7 +294,7 @@ part of 'a.dart'; import 'x.dart' show A; class C extends A {} ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 25, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 25, 8)], ); } @@ -333,7 +333,7 @@ import 'x.dart' show A; part of 'a.dart'; class C extends A {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 34, 1)], + [error(CompileTimeErrorCode.extendsNonClass, 34, 1)], ); } @@ -345,8 +345,8 @@ import 'a.dart' show B; class C extends A {} ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8), - error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 41, 1), + error(CompileTimeErrorCode.uriDoesNotExist, 7, 8), + error(CompileTimeErrorCode.extendsNonClass, 41, 1), ], ); } @@ -362,7 +362,7 @@ part 'a.g.dart'; class C extends _$A {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 34, 3)], + [error(CompileTimeErrorCode.extendsNonClass, 34, 3)], ); } @@ -373,7 +373,7 @@ part 'a.g.dart'; class C extends _$A {} ''', - [error(CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, 5, 10)], + [error(CompileTimeErrorCode.uriHasNotBeenGenerated, 5, 10)], ); } @@ -385,8 +385,8 @@ part 'a.g.dart'; class C extends A {} ''', [ - error(CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, 5, 10), - error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 34, 1), + error(CompileTimeErrorCode.uriHasNotBeenGenerated, 5, 10), + error(CompileTimeErrorCode.extendsNonClass, 34, 1), ], ); } @@ -399,8 +399,8 @@ part 'a.dart'; class C extends _$A {} ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 8), - error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 32, 3), + error(CompileTimeErrorCode.uriDoesNotExist, 5, 8), + error(CompileTimeErrorCode.extendsNonClass, 32, 3), ], ); } @@ -413,8 +413,8 @@ part 'a.dart'; class C extends A {} ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 8), - error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 32, 1), + error(CompileTimeErrorCode.uriDoesNotExist, 5, 8), + error(CompileTimeErrorCode.extendsNonClass, 32, 1), ], ); } @@ -426,7 +426,7 @@ import 'dart:math' as p; class C extends p.A {} ''', - [error(CompileTimeErrorCode.EXTENDS_NON_CLASS, 42, 3)], + [error(CompileTimeErrorCode.extendsNonClass, 42, 3)], ); var node = findNode.singleExtendsClause; diff --git a/pkg/analyzer/test/src/diagnostics/extends_type_alias_expands_to_type_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/extends_type_alias_expands_to_type_parameter_test.dart index 6c0c77ec53c..ceb78694351 100644 --- a/pkg/analyzer/test/src/diagnostics/extends_type_alias_expands_to_type_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extends_type_alias_expands_to_type_parameter_test.dart @@ -33,7 +33,7 @@ class B extends T {} ''', [ error( - CompileTimeErrorCode.EXTENDS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.extendsTypeAliasExpandsToTypeParameter, 55, 1, ), @@ -50,7 +50,7 @@ class B extends T {} ''', [ error( - CompileTimeErrorCode.EXTENDS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.extendsTypeAliasExpandsToTypeParameter, 55, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_as_expression_test.dart b/pkg/analyzer/test/src/diagnostics/extension_as_expression_test.dart index 8906c8bcc6a..881b0c98561 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_as_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_as_expression_test.dart @@ -24,7 +24,7 @@ extension E on int {} import 'a.dart' as p; var v = p.E; ''', - [error(CompileTimeErrorCode.EXTENSION_AS_EXPRESSION, 30, 3)], + [error(CompileTimeErrorCode.extensionAsExpression, 30, 3)], ); assertTypeDynamic(findNode.simple('E;')); assertTypeDynamic(findNode.prefixed('p.E;')); @@ -36,7 +36,7 @@ var v = p.E; extension E on int {} var v = E; ''', - [error(CompileTimeErrorCode.EXTENSION_AS_EXPRESSION, 30, 1)], + [error(CompileTimeErrorCode.extensionAsExpression, 30, 1)], ); assertTypeDynamic(findNode.simple('E;')); } diff --git a/pkg/analyzer/test/src/diagnostics/extension_conflicting_static_and_instance_test.dart b/pkg/analyzer/test/src/diagnostics/extension_conflicting_static_and_instance_test.dart index 4fa1999935f..cda70a6099b 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_conflicting_static_and_instance_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_conflicting_static_and_instance_test.dart @@ -17,7 +17,7 @@ main() { class ExtensionConflictingStaticAndInstanceTest extends PubPackageResolutionTest { CompileTimeErrorCode get _errorCode => - CompileTimeErrorCode.EXTENSION_CONFLICTING_STATIC_AND_INSTANCE; + CompileTimeErrorCode.extensionConflictingStaticAndInstance; test_extendedType_staticField() async { await assertNoErrorsInCode(''' diff --git a/pkg/analyzer/test/src/diagnostics/extension_declares_abstract_method_test.dart b/pkg/analyzer/test/src/diagnostics/extension_declares_abstract_method_test.dart index b4280df5706..8d28b7bde05 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_declares_abstract_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_declares_abstract_method_test.dart @@ -22,7 +22,7 @@ extension E on String { bool get isPalindrome; } ''', - [error(ParserErrorCode.EXTENSION_DECLARES_ABSTRACT_MEMBER, 35, 12)], + [error(ParserErrorCode.extensionDeclaresAbstractMember, 35, 12)], ); } @@ -33,7 +33,7 @@ extension E on String { String reversed(); } ''', - [error(ParserErrorCode.EXTENSION_DECLARES_ABSTRACT_MEMBER, 33, 8)], + [error(ParserErrorCode.extensionDeclaresAbstractMember, 33, 8)], ); } @@ -50,7 +50,7 @@ extension E on String { String operator -(String otherString); } ''', - [error(ParserErrorCode.EXTENSION_DECLARES_ABSTRACT_MEMBER, 42, 1)], + [error(ParserErrorCode.extensionDeclaresAbstractMember, 42, 1)], ); } @@ -61,7 +61,7 @@ extension E on String { set length(int newLength); } ''', - [error(ParserErrorCode.EXTENSION_DECLARES_ABSTRACT_MEMBER, 30, 6)], + [error(ParserErrorCode.extensionDeclaresAbstractMember, 30, 6)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extension_declares_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/extension_declares_constructor_test.dart index 5ffd67c643c..10e31659d30 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_declares_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_declares_constructor_test.dart @@ -22,7 +22,7 @@ extension E on String { E.named() : super(); } ''', - [error(ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR, 26, 1)], + [error(ParserErrorCode.extensionDeclaresConstructor, 26, 1)], ); } @@ -39,7 +39,7 @@ extension E on String { E() : super(); } ''', - [error(ParserErrorCode.EXTENSION_DECLARES_CONSTRUCTOR, 26, 1)], + [error(ParserErrorCode.extensionDeclaresConstructor, 26, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extension_declares_field_test.dart b/pkg/analyzer/test/src/diagnostics/extension_declares_field_test.dart index 290c29baa3d..b50cb7c0645 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_declares_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_declares_field_test.dart @@ -23,9 +23,9 @@ extension E on String { } ''', [ - error(CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, 34, 3), - error(CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, 39, 3), - error(CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, 44, 5), + error(CompileTimeErrorCode.extensionDeclaresInstanceField, 34, 3), + error(CompileTimeErrorCode.extensionDeclaresInstanceField, 39, 3), + error(CompileTimeErrorCode.extensionDeclaresInstanceField, 44, 5), ], ); } @@ -43,7 +43,7 @@ extension E on String { String? s; } ''', - [error(CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, 34, 1)], + [error(CompileTimeErrorCode.extensionDeclaresInstanceField, 34, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/extension_declares_member_of_object_test.dart b/pkg/analyzer/test/src/diagnostics/extension_declares_member_of_object_test.dart index deb3e85491d..357b048732e 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_declares_member_of_object_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_declares_member_of_object_test.dart @@ -22,7 +22,7 @@ extension E on String { void hashCode() {} } ''', - [error(CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, 31, 8)], + [error(CompileTimeErrorCode.extensionDeclaresMemberOfObject, 31, 8)], ); } @@ -38,19 +38,11 @@ extension E on String { } ''', [ - error(CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, 39, 2), - error(CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, 72, 8), - error(CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, 96, 8), - error( - CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, - 128, - 11, - ), - error( - CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, - 159, - 12, - ), + error(CompileTimeErrorCode.extensionDeclaresMemberOfObject, 39, 2), + error(CompileTimeErrorCode.extensionDeclaresMemberOfObject, 72, 8), + error(CompileTimeErrorCode.extensionDeclaresMemberOfObject, 96, 8), + error(CompileTimeErrorCode.extensionDeclaresMemberOfObject, 128, 11), + error(CompileTimeErrorCode.extensionDeclaresMemberOfObject, 159, 12), ], ); } @@ -62,7 +54,7 @@ extension E on String { static void hashCode() {} } ''', - [error(CompileTimeErrorCode.EXTENSION_DECLARES_MEMBER_OF_OBJECT, 38, 8)], + [error(CompileTimeErrorCode.extensionDeclaresMemberOfObject, 38, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extension_override_access_to_static_member_test.dart b/pkg/analyzer/test/src/diagnostics/extension_override_access_to_static_member_test.dart index 761df6fcb5f..727ec3a3935 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_override_access_to_static_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_override_access_to_static_member_test.dart @@ -29,7 +29,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, 65, 2, ), @@ -73,7 +73,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, 79, 5, ), @@ -94,7 +94,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, 116, 5, ), @@ -114,7 +114,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, 77, 5, ), @@ -160,7 +160,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.extensionOverrideAccessToStaticMember, 83, 5, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_override_argument_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/extension_override_argument_not_assignable_test.dart index 8929543d9d7..425b4a9aa16 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_override_argument_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_override_argument_not_assignable_test.dart @@ -28,7 +28,7 @@ f() { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE, + CompileTimeErrorCode.extensionOverrideArgumentNotAssignable, 50, 4, ), @@ -74,7 +74,7 @@ void f(A a) { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE, + CompileTimeErrorCode.extensionOverrideArgumentNotAssignable, 85, 1, ), @@ -96,7 +96,7 @@ void f(B b) { ''', [ error( - CompileTimeErrorCode.EXTENSION_OVERRIDE_ARGUMENT_NOT_ASSIGNABLE, + CompileTimeErrorCode.extensionOverrideArgumentNotAssignable, 75, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_override_with_cascade_test.dart b/pkg/analyzer/test/src/diagnostics/extension_override_with_cascade_test.dart index ef5b0241ea3..c9cfa847a52 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_override_with_cascade_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_override_with_cascade_test.dart @@ -25,7 +25,7 @@ f() { E(3)..g..g; } ''', - [error(CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE, 49, 1)], + [error(CompileTimeErrorCode.extensionOverrideWithCascade, 49, 1)], ); assertTypeDynamic(findNode.extensionOverride('E(')); } @@ -40,7 +40,7 @@ f() { E(3)..m()..m(); } ''', - [error(CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE, 45, 1)], + [error(CompileTimeErrorCode.extensionOverrideWithCascade, 45, 1)], ); assertTypeDynamic(findNode.extensionOverride('E(')); } @@ -55,7 +55,7 @@ f() { E(3)..s = 1..s = 2; } ''', - [error(CompileTimeErrorCode.EXTENSION_OVERRIDE_WITH_CASCADE, 49, 1)], + [error(CompileTimeErrorCode.extensionOverrideWithCascade, 49, 1)], ); assertTypeDynamic(findNode.extensionOverride('E(')); } diff --git a/pkg/analyzer/test/src/diagnostics/extension_override_without_access_test.dart b/pkg/analyzer/test/src/diagnostics/extension_override_without_access_test.dart index 80343f412ae..fadf9bddf99 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_override_without_access_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_override_without_access_test.dart @@ -52,7 +52,7 @@ f(C c) { E(c); } ''', - [error(CompileTimeErrorCode.EXTENSION_OVERRIDE_WITHOUT_ACCESS, 57, 4)], + [error(CompileTimeErrorCode.extensionOverrideWithoutAccess, 57, 4)], ); assertTypeDynamic(findNode.extensionOverride('E(c)')); } diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_constructor_with_super_formal_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_constructor_with_super_formal_parameter_test.dart index 841a49a634b..972b17c5160 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_constructor_with_super_formal_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_constructor_with_super_formal_parameter_test.dart @@ -25,8 +25,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode - .EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_FORMAL_PARAMETER, + CompileTimeErrorCode.extensionTypeConstructorWithSuperFormalParameter, 47, 5, ), @@ -70,8 +69,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode - .EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_FORMAL_PARAMETER, + CompileTimeErrorCode.extensionTypeConstructorWithSuperFormalParameter, 46, 5, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_constructor_with_super_invocation_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_constructor_with_super_invocation_test.dart index 88066677545..c6718329683 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_constructor_with_super_invocation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_constructor_with_super_invocation_test.dart @@ -25,7 +25,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION, + CompileTimeErrorCode.extensionTypeConstructorWithSuperInvocation, 49, 5, ), @@ -56,9 +56,9 @@ extension type const E._(int it) { } ''', [ - error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, 43, 1), + error(CompileTimeErrorCode.finalNotInitializedConstructor1, 43, 1), error( - CompileTimeErrorCode.EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION, + CompileTimeErrorCode.extensionTypeConstructorWithSuperInvocation, 55, 5, ), @@ -75,7 +75,7 @@ extension type E(int it) { ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_CONSTRUCTOR_WITH_SUPER_INVOCATION, + CompileTimeErrorCode.extensionTypeConstructorWithSuperInvocation, 49, 5, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_declares_instance_field_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_declares_instance_field_test.dart index 6f42cac826f..bd73549d503 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_declares_instance_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_declares_instance_field_test.dart @@ -22,13 +22,7 @@ extension type E(int it) { final int foo = 0; } ''', - [ - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 39, - 3, - ), - ], + [error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 39, 3)], ); } @@ -64,21 +58,9 @@ extension type E(int it) { } ''', [ - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 37, - 3, - ), - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 42, - 3, - ), - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 47, - 5, - ), + error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 37, 3), + error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 42, 3), + error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 47, 5), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_declares_member_of_object_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_declares_member_of_object_test.dart index 49cb44b6dc1..454989b7638 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_declares_member_of_object_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_declares_member_of_object_test.dart @@ -22,13 +22,7 @@ extension type E(int it) { int get hashCode => 0; } ''', - [ - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, - 37, - 8, - ), - ], + [error(CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, 37, 8)], ); } @@ -44,28 +38,16 @@ extension type E(int it) { } ''', [ + error(CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, 42, 2), + error(CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, 75, 8), + error(CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, 99, 8), error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, - 42, - 2, - ), - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, - 75, - 8, - ), - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, - 99, - 8, - ), - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, + CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, 131, 11, ), error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, + CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, 162, 12, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_implements_disallowed_type_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_implements_disallowed_type_test.dart index b784e4dae76..c1e2e54c600 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_implements_disallowed_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_implements_disallowed_type_test.dart @@ -24,7 +24,7 @@ typedef X = dynamic; ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, 36, 1, ), @@ -40,7 +40,7 @@ typedef X = void Function(); ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, 36, 1, ), @@ -62,7 +62,7 @@ extension type A(int it) implements Function {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, 36, 8, ), @@ -77,7 +77,7 @@ extension type A(int it) implements FutureOr {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, 36, 13, ), @@ -91,7 +91,7 @@ extension type A(int it) implements FutureOr {} extension type A(int it) implements X {} typedef X = num?; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 36, 1)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 36, 1)], ); } @@ -109,7 +109,7 @@ typedef X = (int, String); ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, 36, 1, ), @@ -124,7 +124,7 @@ extension type A(int it) implements T {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, 39, 1, ), @@ -140,7 +140,7 @@ typedef X = void; ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_DISALLOWED_TYPE, + CompileTimeErrorCode.extensionTypeImplementsDisallowedType, 36, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_implements_itself_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_implements_itself_test.dart index 518a1afc748..9d939e47f9c 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_implements_itself_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_implements_itself_test.dart @@ -22,8 +22,8 @@ extension type A(int it) implements B {} extension type B(int it) implements A {} ''', [ - error(CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_ITSELF, 15, 1), - error(CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_ITSELF, 56, 1), + error(CompileTimeErrorCode.extensionTypeImplementsItself, 15, 1), + error(CompileTimeErrorCode.extensionTypeImplementsItself, 56, 1), ], ); } @@ -33,7 +33,7 @@ extension type B(int it) implements A {} ''' extension type A(int it) implements A {} ''', - [error(CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_ITSELF, 15, 1)], + [error(CompileTimeErrorCode.extensionTypeImplementsItself, 15, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_implements_not_supertype_of_erasure_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_implements_not_supertype_of_erasure_test.dart index 7e918fec8c5..6441e36bd9e 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_implements_not_supertype_of_erasure_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_implements_not_supertype_of_erasure_test.dart @@ -21,13 +21,7 @@ class ExtensionTypeImplementsNotSupertypeTest extends PubPackageResolutionTest { extension type A(int it) {} extension type B(A it) implements num {} ''', - [ - error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_NOT_SUPERTYPE, - 62, - 3, - ), - ], + [error(CompileTimeErrorCode.extensionTypeImplementsNotSupertype, 62, 3)], ); } @@ -36,13 +30,7 @@ extension type B(A it) implements num {} ''' extension type A(int it) implements String {} ''', - [ - error( - CompileTimeErrorCode.EXTENSION_TYPE_IMPLEMENTS_NOT_SUPERTYPE, - 36, - 6, - ), - ], + [error(CompileTimeErrorCode.extensionTypeImplementsNotSupertype, 36, 6)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_implements_representation_not_supertype_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_implements_representation_not_supertype_test.dart index ff2b3c36123..c2124cf2674 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_implements_representation_not_supertype_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_implements_representation_not_supertype_test.dart @@ -27,7 +27,7 @@ extension type B(int it) implements A {} [ error( CompileTimeErrorCode - .EXTENSION_TYPE_IMPLEMENTS_REPRESENTATION_NOT_SUPERTYPE, + .extensionTypeImplementsRepresentationNotSupertype, 67, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_inherited_member_conflict_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_inherited_member_conflict_test.dart index 1c396acf4e5..e4e745fb032 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_inherited_member_conflict_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_inherited_member_conflict_test.dart @@ -37,7 +37,7 @@ extension type B(int it) implements A1, A2 {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT, + CompileTimeErrorCode.extensionTypeInheritedMemberConflict, 109, 1, contextMessages: [message(testFile, 35, 3), message(testFile, 82, 3)], @@ -57,7 +57,7 @@ extension type C(String foo) implements A, B {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT, + CompileTimeErrorCode.extensionTypeInheritedMemberConflict, 81, 1, contextMessages: [message(testFile, 24, 3), message(testFile, 57, 3)], @@ -115,7 +115,7 @@ extension type C(A it) implements A, B {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT, + CompileTimeErrorCode.extensionTypeInheritedMemberConflict, 88, 1, contextMessages: [message(testFile, 17, 3), message(testFile, 61, 3)], @@ -163,7 +163,7 @@ extension type D(C it) implements A, B {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_INHERITED_MEMBER_CONFLICT, + CompileTimeErrorCode.extensionTypeInheritedMemberConflict, 139, 1, contextMessages: [message(testFile, 17, 3), message(testFile, 51, 3)], diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_representation_depends_on_itself_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_representation_depends_on_itself_test.dart index 68e952a0a02..76a061dca44 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_representation_depends_on_itself_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_representation_depends_on_itself_test.dart @@ -25,12 +25,12 @@ extension type B(A it) {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF, + CompileTimeErrorCode.extensionTypeRepresentationDependsOnItself, 15, 1, ), error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF, + CompileTimeErrorCode.extensionTypeRepresentationDependsOnItself, 42, 1, ), @@ -47,12 +47,12 @@ extension type B(List it) {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF, + CompileTimeErrorCode.extensionTypeRepresentationDependsOnItself, 15, 1, ), error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF, + CompileTimeErrorCode.extensionTypeRepresentationDependsOnItself, 48, 1, ), @@ -67,7 +67,7 @@ extension type A(A it) {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF, + CompileTimeErrorCode.extensionTypeRepresentationDependsOnItself, 15, 1, ), @@ -82,7 +82,7 @@ extension type A(List it) {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_DEPENDS_ON_ITSELF, + CompileTimeErrorCode.extensionTypeRepresentationDependsOnItself, 15, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_representation_type_bottom_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_representation_type_bottom_test.dart index 85f1fa2e9f0..4fc9ad71651 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_representation_type_bottom_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_representation_type_bottom_test.dart @@ -23,7 +23,7 @@ extension type A(Never it) {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_TYPE_BOTTOM, + CompileTimeErrorCode.extensionTypeRepresentationTypeBottom, 17, 5, ), @@ -44,7 +44,7 @@ extension type A(T it) {} ''', [ error( - CompileTimeErrorCode.EXTENSION_TYPE_REPRESENTATION_TYPE_BOTTOM, + CompileTimeErrorCode.extensionTypeRepresentationTypeBottom, 34, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/extension_type_with_abstract_member_test.dart b/pkg/analyzer/test/src/diagnostics/extension_type_with_abstract_member_test.dart index c1800412372..6ec51e5502b 100644 --- a/pkg/analyzer/test/src/diagnostics/extension_type_with_abstract_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extension_type_with_abstract_member_test.dart @@ -23,7 +23,7 @@ extension type A(int it) { int get foo; } ''', - [error(CompileTimeErrorCode.EXTENSION_TYPE_WITH_ABSTRACT_MEMBER, 29, 12)], + [error(CompileTimeErrorCode.extensionTypeWithAbstractMember, 29, 12)], ); } @@ -42,7 +42,7 @@ extension type A(int it) { static int get foo; } ''', - [error(ParserErrorCode.MISSING_FUNCTION_BODY, 47, 1)], + [error(ParserErrorCode.missingFunctionBody, 47, 1)], ); } @@ -53,7 +53,7 @@ extension type A(int it) { void foo(); } ''', - [error(CompileTimeErrorCode.EXTENSION_TYPE_WITH_ABSTRACT_MEMBER, 29, 11)], + [error(CompileTimeErrorCode.extensionTypeWithAbstractMember, 29, 11)], ); } @@ -72,7 +72,7 @@ extension type A(int it) { static void foo(); } ''', - [error(ParserErrorCode.MISSING_FUNCTION_BODY, 46, 1)], + [error(ParserErrorCode.missingFunctionBody, 46, 1)], ); } @@ -83,7 +83,7 @@ extension type A(int it) { set foo(int _); } ''', - [error(CompileTimeErrorCode.EXTENSION_TYPE_WITH_ABSTRACT_MEMBER, 29, 15)], + [error(CompileTimeErrorCode.extensionTypeWithAbstractMember, 29, 15)], ); } @@ -102,7 +102,7 @@ extension type A(int it) { static set foo(int _); } ''', - [error(ParserErrorCode.MISSING_FUNCTION_BODY, 50, 1)], + [error(ParserErrorCode.missingFunctionBody, 50, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/external_field_constructor_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/external_field_constructor_initializer_test.dart index a44971d5992..97124560cf2 100644 --- a/pkg/analyzer/test/src/diagnostics/external_field_constructor_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/external_field_constructor_initializer_test.dart @@ -23,13 +23,7 @@ class A { A() : x = 0; } ''', - [ - error( - CompileTimeErrorCode.EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER, - 36, - 1, - ), - ], + [error(CompileTimeErrorCode.externalFieldConstructorInitializer, 36, 1)], ); } @@ -41,13 +35,7 @@ class A { A() : x = 0; } ''', - [ - error( - CompileTimeErrorCode.EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER, - 42, - 1, - ), - ], + [error(CompileTimeErrorCode.externalFieldConstructorInitializer, 42, 1)], ); } @@ -59,13 +47,7 @@ class A { A(this.x); } ''', - [ - error( - CompileTimeErrorCode.EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER, - 43, - 1, - ), - ], + [error(CompileTimeErrorCode.externalFieldConstructorInitializer, 43, 1)], ); } @@ -86,13 +68,7 @@ class A { A(this.x); } ''', - [ - error( - CompileTimeErrorCode.EXTERNAL_FIELD_CONSTRUCTOR_INITIALIZER, - 37, - 1, - ), - ], + [error(CompileTimeErrorCode.externalFieldConstructorInitializer, 37, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/external_field_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/external_field_initializer_test.dart index d074c3b5d70..8fea48bbfb2 100644 --- a/pkg/analyzer/test/src/diagnostics/external_field_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/external_field_initializer_test.dart @@ -22,7 +22,7 @@ class A { external final int x = 0; } ''', - [error(CompileTimeErrorCode.EXTERNAL_FIELD_INITIALIZER, 31, 1)], + [error(CompileTimeErrorCode.externalFieldInitializer, 31, 1)], ); } @@ -41,7 +41,7 @@ class A { external int x = 0; } ''', - [error(CompileTimeErrorCode.EXTERNAL_FIELD_INITIALIZER, 25, 1)], + [error(CompileTimeErrorCode.externalFieldInitializer, 25, 1)], ); } @@ -60,7 +60,7 @@ class A { external static final int x = 0; } ''', - [error(CompileTimeErrorCode.EXTERNAL_FIELD_INITIALIZER, 38, 1)], + [error(CompileTimeErrorCode.externalFieldInitializer, 38, 1)], ); } @@ -79,7 +79,7 @@ class A { external static int x = 0; } ''', - [error(CompileTimeErrorCode.EXTERNAL_FIELD_INITIALIZER, 32, 1)], + [error(CompileTimeErrorCode.externalFieldInitializer, 32, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/external_variable_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/external_variable_initializer_test.dart index 63b1d843358..de80bd6ef9d 100644 --- a/pkg/analyzer/test/src/diagnostics/external_variable_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/external_variable_initializer_test.dart @@ -20,7 +20,7 @@ class ExternalVariableInitializerTest extends PubPackageResolutionTest { ''' external final int x = 0; ''', - [error(CompileTimeErrorCode.EXTERNAL_VARIABLE_INITIALIZER, 19, 1)], + [error(CompileTimeErrorCode.externalVariableInitializer, 19, 1)], ); } @@ -35,7 +35,7 @@ external final int x; ''' external int x = 0; ''', - [error(CompileTimeErrorCode.EXTERNAL_VARIABLE_INITIALIZER, 13, 1)], + [error(CompileTimeErrorCode.externalVariableInitializer, 13, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/extra_annotation_on_struct_field_test.dart b/pkg/analyzer/test/src/diagnostics/extra_annotation_on_struct_field_test.dart index 9950424a591..9653cd5a617 100644 --- a/pkg/analyzer/test/src/diagnostics/extra_annotation_on_struct_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extra_annotation_on_struct_field_test.dart @@ -35,7 +35,7 @@ final class C extends Struct { external int x; } ''', - [error(FfiCode.EXTRA_ANNOTATION_ON_STRUCT_FIELD, 63, 8)], + [error(FfiCode.extraAnnotationOnStructField, 63, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extra_positional_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/extra_positional_arguments_test.dart index ea306c65fe9..c9436d9f906 100644 --- a/pkg/analyzer/test/src/diagnostics/extra_positional_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extra_positional_arguments_test.dart @@ -27,13 +27,7 @@ main() { const A(0); } ''', - [ - error( - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - 55, - 1, - ), - ], + [error(CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, 55, 1)], ); } @@ -47,13 +41,7 @@ class B extends A { const B() : super(0); } ''', - [ - error( - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - 76, - 1, - ), - ], + [error(CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, 76, 1)], ); } @@ -68,13 +56,7 @@ main() { const B(0); } ''', - [ - error( - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - 70, - 1, - ), - ], + [error(CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, 70, 1)], ); } @@ -89,13 +71,7 @@ main() { g(f()); } ''', - [ - error( - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - 56, - 3, - ), - ], + [error(CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, 56, 3)], ); assertType( findNode.methodInvocation('f()').typeArgumentTypes!.single, @@ -110,13 +86,7 @@ main() { (int x, {int y = 0}) {} (0, 1); } ''', - [ - error( - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - 39, - 1, - ), - ], + [error(CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, 39, 1)], ); } @@ -129,12 +99,8 @@ enum E { } ''', [ - error( - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - 13, - 1, - ), - error(WarningCode.UNUSED_ELEMENT_PARAMETER, 33, 1), + error(CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, 13, 1), + error(WarningCode.unusedElementParameter, 33, 1), ], ); } @@ -147,7 +113,7 @@ extension type const A(int it) {} @A(0, 1) void f() {} ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 41, 1)], + [error(CompileTimeErrorCode.extraPositionalArguments, 41, 1)], ); } @@ -159,13 +125,7 @@ main() { f(0, 1, '2'); } ''', - [ - error( - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - 26, - 1, - ), - ], + [error(CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, 26, 1)], ); } @@ -179,12 +139,8 @@ main() { } ''', [ - error( - CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED, - 71, - 1, - ), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 71, 1), + error(CompileTimeErrorCode.extraPositionalArgumentsCouldBeNamed, 71, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 71, 1), ], ); } @@ -202,7 +158,7 @@ main() { const A(0); } ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 44, 1)], + [error(CompileTimeErrorCode.extraPositionalArguments, 44, 1)], ); } @@ -216,7 +172,7 @@ class B extends A { const B() : super(0); } ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 65, 1)], + [error(CompileTimeErrorCode.extraPositionalArguments, 65, 1)], ); } @@ -227,7 +183,7 @@ enum E { v(0) } ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 13, 1)], + [error(CompileTimeErrorCode.extraPositionalArguments, 13, 1)], ); } @@ -238,7 +194,7 @@ main() { (int x) {} (0, 1); } ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 26, 1)], + [error(CompileTimeErrorCode.extraPositionalArguments, 26, 1)], ); } @@ -250,7 +206,7 @@ main() { f(0, 1, '2'); } ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 20, 1)], + [error(CompileTimeErrorCode.extraPositionalArguments, 20, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extra_size_annotation_carray_test.dart b/pkg/analyzer/test/src/diagnostics/extra_size_annotation_carray_test.dart index a6c9a75e68f..9742763f36d 100644 --- a/pkg/analyzer/test/src/diagnostics/extra_size_annotation_carray_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extra_size_annotation_carray_test.dart @@ -50,7 +50,7 @@ final class C extends Struct { external Array a0; } ''', - [error(FfiCode.EXTRA_SIZE_ANNOTATION_CARRAY, 65, 9)], + [error(FfiCode.extraSizeAnnotationCarray, 65, 9)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/extraneous_modifier_test.dart b/pkg/analyzer/test/src/diagnostics/extraneous_modifier_test.dart index d2c9228bb46..3bb88c4b8d8 100644 --- a/pkg/analyzer/test/src/diagnostics/extraneous_modifier_test.dart +++ b/pkg/analyzer/test/src/diagnostics/extraneous_modifier_test.dart @@ -22,7 +22,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER, 14, 5), + error(ParserErrorCode.extraneousModifier, 14, 5), ]); var node = parseResult.findNode.simpleFormalParameter('a);'); @@ -56,7 +56,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.EXTRANEOUS_MODIFIER, 14, 3), + error(ParserErrorCode.extraneousModifier, 14, 3), ]); var node = parseResult.findNode.superFormalParameter('super.a'); diff --git a/pkg/analyzer/test/src/diagnostics/ffi_address_of_cast_test.dart b/pkg/analyzer/test/src/diagnostics/ffi_address_of_cast_test.dart index 1596bbf05c7..37629d582fb 100644 --- a/pkg/analyzer/test/src/diagnostics/ffi_address_of_cast_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ffi_address_of_cast_test.dart @@ -35,7 +35,7 @@ final class MyStruct extends Struct { external Array arr; } ''', - [error(FfiCode.ADDRESS_POSITION, 200, 7)], + [error(FfiCode.addressPosition, 200, 7)], ); } @@ -59,7 +59,7 @@ final class MyStruct extends Struct { external Array arr; } ''', - [error(FfiCode.ADDRESS_POSITION, 202, 7)], + [error(FfiCode.addressPosition, 202, 7)], ); } @@ -99,7 +99,7 @@ main() { myNonLeafNative(buffer.address.cast()); } ''', - [error(FfiCode.ADDRESS_POSITION, 204, 7)], + [error(FfiCode.addressPosition, 204, 7)], ); } @@ -138,7 +138,7 @@ final class MyUnion extends Union { external Array arr; } ''', - [error(FfiCode.ADDRESS_POSITION, 196, 7)], + [error(FfiCode.addressPosition, 196, 7)], ); } @@ -161,7 +161,7 @@ final class MyUnion extends Union { external Array arr; } ''', - [error(FfiCode.ADDRESS_POSITION, 198, 7)], + [error(FfiCode.addressPosition, 198, 7)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/ffi_array_test.dart b/pkg/analyzer/test/src/diagnostics/ffi_array_test.dart index 19854009a4b..80660b014b0 100644 --- a/pkg/analyzer/test/src/diagnostics/ffi_array_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ffi_array_test.dart @@ -25,7 +25,7 @@ final class MyStruct extends Struct { external Array arr; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 67, 2)], + [error(FfiCode.nonPositiveArrayDimension, 67, 2)], ); } @@ -50,7 +50,7 @@ final class MyStruct extends Struct { external Array arr; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 67, 1)], + [error(FfiCode.nonPositiveArrayDimension, 67, 1)], ); } @@ -64,7 +64,7 @@ final class MyStruct extends Struct { external Array> arr; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 74, 2)], + [error(FfiCode.nonPositiveArrayDimension, 74, 2)], ); } @@ -89,7 +89,7 @@ final class MyStruct extends Struct { external Array> arr; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 74, 1)], + [error(FfiCode.nonPositiveArrayDimension, 74, 1)], ); } @@ -103,7 +103,7 @@ final class MyStruct extends Struct { external Array> arr; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 76, 2)], + [error(FfiCode.nonPositiveArrayDimension, 76, 2)], ); } @@ -139,7 +139,7 @@ final class MyStruct extends Struct { external Array> arr; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 76, 1)], + [error(FfiCode.nonPositiveArrayDimension, 76, 1)], ); } @@ -153,7 +153,7 @@ final class MyStruct extends Struct { external Array>> arr; } ''', - [error(FfiCode.NEGATIVE_VARIABLE_DIMENSION, 100, 2)], + [error(FfiCode.negativeVariableDimension, 100, 2)], ); } @@ -200,7 +200,7 @@ final class MyStruct extends Struct { external Array arr; } ''', - [error(FfiCode.NEGATIVE_VARIABLE_DIMENSION, 97, 2)], + [error(FfiCode.negativeVariableDimension, 97, 2)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/ffi_async_callback_test.dart b/pkg/analyzer/test/src/diagnostics/ffi_async_callback_test.dart index 8768414e7ea..1e1df4994a9 100644 --- a/pkg/analyzer/test/src/diagnostics/ffi_async_callback_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ffi_async_callback_test.dart @@ -26,7 +26,7 @@ void g() { NativeCallable.isolateLocal(f, exceptionalReturn: e); } ''', - [error(FfiCode.ARGUMENT_MUST_BE_A_CONSTANT, 143, 1)], + [error(FfiCode.argumentMustBeAConstant, 143, 1)], ); } @@ -39,7 +39,7 @@ void g() { NativeCallable.isolateLocal(f, exceptionalReturn: '?'); } ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 128, 3)], + [error(FfiCode.mustBeASubtype, 128, 3)], ); } @@ -64,7 +64,7 @@ void g() { NativeCallable.isolateLocal(f, exceptionalReturn: 4); } ''', - [error(FfiCode.INVALID_EXCEPTION_VALUE, 109, 20)], + [error(FfiCode.invalidExceptionValue, 109, 20)], ); } @@ -77,7 +77,7 @@ void g() { NativeCallable.isolateLocal(f); } ''', - [error(FfiCode.MISSING_EXCEPTION_VALUE, 55, 53)], + [error(FfiCode.missingExceptionValue, 55, 53)], ); } @@ -90,7 +90,7 @@ void g() { NativeCallable.isolateLocal(f, exceptionalReturn: 4); } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 55, 46)], + [error(FfiCode.mustBeANativeFunctionType, 55, 46)], ); } @@ -103,7 +103,7 @@ void g() { NativeCallable.isolateLocal(f, exceptionalReturn: 4); } ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 107, 1)], + [error(FfiCode.mustBeASubtype, 107, 1)], ); } @@ -116,7 +116,7 @@ void g() { NativeCallable.isolateLocal(f, exceptionalReturn: 4); } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 55, 27)], + [error(FfiCode.mustBeANativeFunctionType, 55, 27)], ); } @@ -171,7 +171,7 @@ void g() { NativeCallable.listener(f); } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 56, 43)], + [error(FfiCode.mustBeANativeFunctionType, 56, 43)], ); } @@ -184,7 +184,7 @@ void g() { NativeCallable.listener(f); } ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 103, 1)], + [error(FfiCode.mustBeASubtype, 103, 1)], ); } @@ -197,7 +197,7 @@ void g() { NativeCallable.listener(f); } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 55, 23)], + [error(FfiCode.mustBeANativeFunctionType, 55, 23)], ); } @@ -210,7 +210,7 @@ void g() { NativeCallable.listener(f); } ''', - [error(FfiCode.MUST_RETURN_VOID, 102, 1)], + [error(FfiCode.mustReturnVoid, 102, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/ffi_leaf_call_must_not_use_handle_test.dart b/pkg/analyzer/test/src/diagnostics/ffi_leaf_call_must_not_use_handle_test.dart index 9ba63b74bfd..28a7ccce394 100644 --- a/pkg/analyzer/test/src/diagnostics/ffi_leaf_call_must_not_use_handle_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ffi_leaf_call_must_not_use_handle_test.dart @@ -27,7 +27,7 @@ doThings() { f(); } ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 224, 10)], + [error(FfiCode.leafCallMustNotReturnHandle, 224, 10)], ); } @@ -44,7 +44,7 @@ doThings() { f(MyClass()); } ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_TAKE_HANDLE, 241, 10)], + [error(FfiCode.leafCallMustNotTakeHandle, 241, 10)], ); } @@ -60,7 +60,7 @@ base class A extends NativeFieldWrapperClass1 { external Object get foo; } ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 200, 3)], + [error(FfiCode.leafCallMustNotReturnHandle, 200, 3)], ); } @@ -75,7 +75,7 @@ doThings() { l.lookupFunction("timesFour", isLeaf:true); } ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 195, 19)], + [error(FfiCode.leafCallMustNotReturnHandle, 195, 19)], ); } @@ -91,7 +91,7 @@ doThings() { l.lookupFunction("timesFour", isLeaf:true); } ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_TAKE_HANDLE, 216, 17)], + [error(FfiCode.leafCallMustNotTakeHandle, 216, 17)], ); } @@ -103,7 +103,7 @@ import 'dart:ffi'; @Native(symbol: 'foo', isLeaf:true) external Object get foo; ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 95, 3)], + [error(FfiCode.leafCallMustNotReturnHandle, 95, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/ffi_native_test.dart b/pkg/analyzer/test/src/diagnostics/ffi_native_test.dart index a0c7d9bc222..61303da9a43 100644 --- a/pkg/analyzer/test/src/diagnostics/ffi_native_test.dart +++ b/pkg/analyzer/test/src/diagnostics/ffi_native_test.dart @@ -27,7 +27,7 @@ import 'dart:ffi'; void main() => print(Native.addressOf(() => 3)); ''', - [error(FfiCode.ARGUMENT_MUST_BE_NATIVE, 58, 7)], + [error(FfiCode.argumentMustBeNative, 58, 7)], ); } @@ -41,7 +41,7 @@ external Pointer global; void main() => print(Native.addressOf>(global)); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 85, 41)], + [error(FfiCode.mustBeASubtype, 85, 41)], ); } @@ -57,7 +57,7 @@ void main() { print(Native.addressOf>(foo)); } ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 91, 54)], + [error(FfiCode.mustBeASubtype, 91, 54)], ); } @@ -73,7 +73,7 @@ void main() { print(Native.addressOf(foo)); } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 91, 21)], + [error(FfiCode.mustBeANativeFunctionType, 91, 21)], ); } @@ -89,7 +89,7 @@ void main() { print(Native.addressOf(foo)); } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 74, 21)], + [error(FfiCode.mustBeANativeFunctionType, 74, 21)], ); } @@ -103,7 +103,7 @@ external Pointer global; void main() => print(Native.addressOf(global)); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 85, 24)], + [error(FfiCode.mustBeASubtype, 85, 24)], ); } @@ -121,7 +121,7 @@ void entry(bool condition) { print(Native.addressOf(condition ? foo : bar)); } ''', - [error(FfiCode.ARGUMENT_MUST_BE_NATIVE, 171, 21)], + [error(FfiCode.argumentMustBeNative, 171, 21)], ); } @@ -135,7 +135,7 @@ external void foo(); void main() => print(Native.addressOf(foo)); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 90, 37)], + [error(FfiCode.mustBeASubtype, 90, 37)], ); } @@ -149,7 +149,7 @@ external void foo(); void main() => print(Native.addressOf(foo)); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 73, 37)], + [error(FfiCode.mustBeASubtype, 73, 37)], ); } @@ -160,7 +160,7 @@ import 'dart:ffi'; void main() => print(Native.addressOf('malloc')); ''', - [error(FfiCode.ARGUMENT_MUST_BE_NATIVE, 58, 8)], + [error(FfiCode.argumentMustBeNative, 58, 8)], ); } @@ -197,7 +197,7 @@ library; import 'dart:ffi'; ''', - [error(FfiCode.FFI_NATIVE_INVALID_DUPLICATE_DEFAULT_ASSET, 22, 12)], + [error(FfiCode.ffiNativeInvalidDuplicateDefaultAsset, 22, 12)], ); } @@ -212,7 +212,7 @@ import 'dart:ffi'; const defaults = DefaultAsset('foo'); ''', - [error(FfiCode.FFI_NATIVE_INVALID_DUPLICATE_DEFAULT_ASSET, 22, 8)], + [error(FfiCode.ffiNativeInvalidDuplicateDefaultAsset, 22, 8)], ); } @@ -269,7 +269,7 @@ import 'dart:ffi'; @Native external int foo(); ''', - [error(CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, 20, 7)], + [error(CompileTimeErrorCode.noAnnotationConstructorArguments, 20, 7)], ); } @@ -281,7 +281,7 @@ import 'dart:ffi'; @Native() external int foo(); ''', - [error(FfiCode.NATIVE_FUNCTION_MISSING_TYPE, 43, 3)], + [error(FfiCode.nativeFunctionMissingType, 43, 3)], ); } @@ -312,7 +312,7 @@ class K { ''', [ error( - FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER, + FfiCode.ffiNativeUnexpectedNumberOfParametersWithReceiver, 102, 12, ), @@ -327,7 +327,7 @@ import 'dart:ffi'; @Native(symbol: 'DoesntMatter', isLeaf:true) external Object doesntMatter(); ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 99, 12)], + [error(FfiCode.leafCallMustNotReturnHandle, 99, 12)], ); } @@ -338,7 +338,7 @@ import 'dart:ffi'; @Native(symbol: 'DoesntMatter', isLeaf:true) external void doesntMatter(Object o); ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_TAKE_HANDLE, 101, 12)], + [error(FfiCode.leafCallMustNotTakeHandle, 101, 12)], ); } @@ -349,7 +349,7 @@ import 'dart:ffi'; @Native(symbol: 'doesntmatter') external int nonFfiParameter(int v); ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 86, 15)], + [error(FfiCode.mustBeANativeFunctionType, 86, 15)], ); } @@ -360,7 +360,7 @@ import 'dart:ffi'; @Native(symbol: 'doesntmatter') external double nonFfiReturnType(int v); ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 92, 16)], + [error(FfiCode.mustBeANativeFunctionType, 92, 16)], ); } @@ -379,7 +379,7 @@ import 'dart:ffi'; @Native(symbol: 'DoesntMatter') external void doesntMatter(double x, double y); ''', - [error(FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS, 88, 12)], + [error(FfiCode.ffiNativeUnexpectedNumberOfParameters, 88, 12)], ); } @@ -390,7 +390,7 @@ import 'dart:ffi'; @Native(symbol: 'DoesntMatter') external void doesntMatter(double x); ''', - [error(FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS, 96, 12)], + [error(FfiCode.ffiNativeUnexpectedNumberOfParameters, 96, 12)], ); } @@ -401,7 +401,7 @@ import 'dart:ffi'; @Native(symbol: 'doesntmatter') external void voidReturn(int width, int height, Object outImage); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 106, 10)], + [error(FfiCode.mustBeASubtype, 106, 10)], ); } @@ -412,7 +412,7 @@ import 'dart:ffi'; @Native(symbol: 'doesntmatter') external int wrongFfiParameter(int v); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 89, 17)], + [error(FfiCode.mustBeASubtype, 89, 17)], ); } @@ -423,7 +423,7 @@ import 'dart:ffi'; @Native(symbol: 'doesntmatter') external double wrongFfiReturnType(int v); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 92, 18)], + [error(FfiCode.mustBeASubtype, 92, 18)], ); } } @@ -460,7 +460,7 @@ import 'dart:ffi'; @Array(0) external Array field; ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 37, 1)], + [error(FfiCode.nonPositiveArrayDimension, 37, 1)], ); } @@ -473,7 +473,7 @@ import 'dart:ffi'; @Array(10, 20) external Array field; ''', - [error(FfiCode.SIZE_ANNOTATION_DIMENSIONS, 30, 14)], + [error(FfiCode.sizeAnnotationDimensions, 30, 14)], ); } @@ -485,7 +485,7 @@ import 'dart:ffi'; @Native() external Array field; ''', - [error(FfiCode.MISSING_SIZE_ANNOTATION_CARRAY, 53, 5)], + [error(FfiCode.missingSizeAnnotationCarray, 53, 5)], ); } @@ -527,7 +527,7 @@ import 'dart:ffi'; @Native() external int field; ''', - [error(FfiCode.NATIVE_FIELD_INVALID_TYPE, 67, 5)], + [error(FfiCode.nativeFieldInvalidType, 67, 5)], ); } @@ -541,7 +541,7 @@ class Foo { external int field; } ''', - [error(FfiCode.NATIVE_FIELD_NOT_STATIC, 67, 5)], + [error(FfiCode.nativeFieldNotStatic, 67, 5)], ); } @@ -554,12 +554,8 @@ import 'dart:ffi'; int field; ''', [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 42, - 5, - ), - error(FfiCode.FFI_NATIVE_MUST_BE_EXTERNAL, 42, 5), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 42, 5), + error(FfiCode.ffiNativeMustBeExternal, 42, 5), ], ); } @@ -572,7 +568,7 @@ import 'dart:ffi'; @Native>() external int Function() field; ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 89, 5)], + [error(FfiCode.mustBeASubtype, 89, 5)], ); } @@ -584,7 +580,7 @@ import 'dart:ffi'; @Native() external int field; ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 51, 5)], + [error(FfiCode.mustBeASubtype, 51, 5)], ); } @@ -599,7 +595,7 @@ external int invalid; @Native() external Pointer valid; ''', - [error(FfiCode.NATIVE_FIELD_MISSING_TYPE, 43, 7)], + [error(FfiCode.nativeFieldMissingType, 43, 7)], ); } @@ -611,7 +607,7 @@ import 'dart:ffi'; @Native>() external void Function() field; ''', - [error(FfiCode.NATIVE_FIELD_INVALID_TYPE, 88, 5)], + [error(FfiCode.nativeFieldInvalidType, 88, 5)], ); } @@ -623,7 +619,7 @@ import 'dart:ffi'; @Native() external Object field; ''', - [error(FfiCode.NATIVE_FIELD_INVALID_TYPE, 54, 5)], + [error(FfiCode.nativeFieldInvalidType, 54, 5)], ); } } @@ -638,7 +634,7 @@ import 'dart:ffi'; @Native() external int foo(); ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 51, 3)], + [error(FfiCode.mustBeANativeFunctionType, 51, 3)], ); } @@ -650,7 +646,7 @@ import 'dart:ffi'; @Native() external int foo(); ''', - [error(FfiCode.NATIVE_FUNCTION_MISSING_TYPE, 43, 3)], + [error(FfiCode.nativeFunctionMissingType, 43, 3)], ); } @@ -664,7 +660,7 @@ const a = Native(); @a external int foo(); ''', - [error(FfiCode.NATIVE_FUNCTION_MISSING_TYPE, 57, 3)], + [error(FfiCode.nativeFunctionMissingType, 57, 3)], ); } @@ -692,7 +688,7 @@ import 'dart:ffi'; @Native external int foo(); ''', - [error(CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, 20, 7)], + [error(CompileTimeErrorCode.noAnnotationConstructorArguments, 20, 7)], ); } @@ -948,7 +944,7 @@ import 'dart:ffi'; @Native(isLeaf: true) external int foo(int v); ''', - [error(FfiCode.FFI_NATIVE_INVALID_MULTIPLE_ANNOTATIONS, 53, 6)], + [error(FfiCode.ffiNativeInvalidMultipleAnnotations, 53, 6)], ); } @@ -963,7 +959,7 @@ const duplicate = Native(isLeaf: true); @duplicate external int foo(int v); ''', - [error(FfiCode.FFI_NATIVE_INVALID_MULTIPLE_ANNOTATIONS, 118, 9)], + [error(FfiCode.ffiNativeInvalidMultipleAnnotations, 118, 9)], ); } @@ -989,7 +985,7 @@ class K { ''', [ error( - FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS_WITH_RECEIVER, + FfiCode.ffiNativeUnexpectedNumberOfParametersWithReceiver, 80, 12, ), @@ -1004,7 +1000,7 @@ import 'dart:ffi'; @Native(isLeaf:true) external Object doesntMatter(); ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 75, 12)], + [error(FfiCode.leafCallMustNotReturnHandle, 75, 12)], ); } @@ -1017,7 +1013,7 @@ const annotation = Native(isLeaf:true); @annotation external Object doesntMatter(); ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_RETURN_HANDLE, 107, 12)], + [error(FfiCode.leafCallMustNotReturnHandle, 107, 12)], ); } @@ -1028,7 +1024,7 @@ import 'dart:ffi'; @Native(symbol: 'DoesntMatter', isLeaf:true) external void doesntMatter(Object o); ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_TAKE_HANDLE, 101, 12)], + [error(FfiCode.leafCallMustNotTakeHandle, 101, 12)], ); } @@ -1041,7 +1037,7 @@ const annotation = Native(symbol: 'DoesntMatter', isLeaf: @annotation external void doesntMatter(Object o); ''', - [error(FfiCode.LEAF_CALL_MUST_NOT_TAKE_HANDLE, 133, 12)], + [error(FfiCode.leafCallMustNotTakeHandle, 133, 12)], ); } @@ -1052,7 +1048,7 @@ import 'dart:ffi'; @Native() external int nonFfiParameter(int v); ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 64, 15)], + [error(FfiCode.mustBeANativeFunctionType, 64, 15)], ); } @@ -1063,7 +1059,7 @@ import 'dart:ffi'; @Native() external double nonFfiReturnType(int v); ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 70, 16)], + [error(FfiCode.mustBeANativeFunctionType, 70, 16)], ); } @@ -1082,7 +1078,7 @@ import 'dart:ffi'; @Native() external void doesntMatter(double x, double y); ''', - [error(FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS, 66, 12)], + [error(FfiCode.ffiNativeUnexpectedNumberOfParameters, 66, 12)], ); } @@ -1093,7 +1089,7 @@ import 'dart:ffi'; @Native() external void doesntMatter(double x); ''', - [error(FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS, 74, 12)], + [error(FfiCode.ffiNativeUnexpectedNumberOfParameters, 74, 12)], ); } @@ -1112,7 +1108,7 @@ import 'dart:ffi'; @Native)>() external int doesntMatter(int x, int y); ''', - [error(FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS, 90, 12)], + [error(FfiCode.ffiNativeUnexpectedNumberOfParameters, 90, 12)], ); } @@ -1123,7 +1119,7 @@ import 'dart:ffi'; @Native)>() external int doesntMatter(int x, int y, double z, int superfluous); ''', - [error(FfiCode.FFI_NATIVE_UNEXPECTED_NUMBER_OF_PARAMETERS, 90, 12)], + [error(FfiCode.ffiNativeUnexpectedNumberOfParameters, 90, 12)], ); } @@ -1134,7 +1130,7 @@ import 'dart:ffi'; @Native() external void voidReturn(int width, int height, Object outImage); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 84, 10)], + [error(FfiCode.mustBeASubtype, 84, 10)], ); } @@ -1145,7 +1141,7 @@ import 'dart:ffi'; @Native() external int wrongFfiParameter(int v); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 67, 17)], + [error(FfiCode.mustBeASubtype, 67, 17)], ); } @@ -1156,7 +1152,7 @@ import 'dart:ffi'; @Native() external double wrongFfiReturnType(int v); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 70, 18)], + [error(FfiCode.mustBeASubtype, 70, 18)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/field_initialized_by_multiple_initializers_test.dart b/pkg/analyzer/test/src/diagnostics/field_initialized_by_multiple_initializers_test.dart index 1cf45e808d1..6e20089a885 100644 --- a/pkg/analyzer/test/src/diagnostics/field_initialized_by_multiple_initializers_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_initialized_by_multiple_initializers_test.dart @@ -17,7 +17,7 @@ main() { class FinalInitializedByMultipleInitializersTest extends PubPackageResolutionTest { static const _errorCode = - CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS; + CompileTimeErrorCode.fieldInitializedByMultipleInitializers; @SkippedTest() // TODO(scheglov): implement augmentation test_class_augmentation2_bothInitialize() async { @@ -203,7 +203,7 @@ enum E { } ''', [ - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 11, 1), + error(CompileTimeErrorCode.constEvalThrowsException, 11, 1), error(_errorCode, 50, 1), ], ); diff --git a/pkg/analyzer/test/src/diagnostics/field_initialized_in_initializer_and_declaration_test.dart b/pkg/analyzer/test/src/diagnostics/field_initialized_in_initializer_and_declaration_test.dart index b5ebb2f28f7..96e61dbf0de 100644 --- a/pkg/analyzer/test/src/diagnostics/field_initialized_in_initializer_and_declaration_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_initialized_in_initializer_and_declaration_test.dart @@ -41,7 +41,7 @@ augment class A { await resolveFile2(a); assertErrorsInResult([ error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, + CompileTimeErrorCode.fieldInitializedInInitializerAndDeclaration, 56, 1, ), @@ -58,7 +58,7 @@ class A { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, + CompileTimeErrorCode.fieldInitializedInInitializerAndDeclaration, 37, 1, ), @@ -76,9 +76,9 @@ enum E { } ''', [ - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 11, 1), + error(CompileTimeErrorCode.constEvalThrowsException, 11, 1), error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, + CompileTimeErrorCode.fieldInitializedInInitializerAndDeclaration, 47, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/field_initialized_in_parameter_and_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/field_initialized_in_parameter_and_initializer_test.dart index 4b86d4ce08a..b2b143ac578 100644 --- a/pkg/analyzer/test/src/diagnostics/field_initialized_in_parameter_and_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_initialized_in_parameter_and_initializer_test.dart @@ -41,7 +41,7 @@ augment class A { await resolveFile2(a); assertErrorsInResult([ error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, + CompileTimeErrorCode.fieldInitializedInParameterAndInitializer, 62, 1, ), @@ -58,7 +58,7 @@ class A { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, + CompileTimeErrorCode.fieldInitializedInParameterAndInitializer, 33, 1, ), @@ -76,9 +76,9 @@ enum E { } ''', [ - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 11, 4), + error(CompileTimeErrorCode.constEvalThrowsException, 11, 4), error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, + CompileTimeErrorCode.fieldInitializedInParameterAndInitializer, 52, 1, ), @@ -95,7 +95,7 @@ extension type A(int it) { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, + CompileTimeErrorCode.fieldInitializedInParameterAndInitializer, 48, 2, ), diff --git a/pkg/analyzer/test/src/diagnostics/field_initializer_factory_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/field_initializer_factory_constructor_test.dart index 0528e3e80e4..7fc9b02c22d 100644 --- a/pkg/analyzer/test/src/diagnostics/field_initializer_factory_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_initializer_factory_constructor_test.dart @@ -24,13 +24,7 @@ class A { factory A(this.x) => throw 0; } ''', - [ - error( - CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, - 35, - 6, - ), - ], + [error(CompileTimeErrorCode.fieldInitializerFactoryConstructor, 35, 6)], ); } @@ -45,12 +39,8 @@ class A { [ // TODO(srawlins): Only report one error. Theoretically change Fasta to // report "Field initializer in factory constructor" as a parse error. - error( - CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, - 43, - 12, - ), - error(ParserErrorCode.MISSING_FUNCTION_BODY, 56, 1), + error(CompileTimeErrorCode.fieldInitializerFactoryConstructor, 43, 12), + error(ParserErrorCode.missingFunctionBody, 56, 1), ], ); } @@ -69,13 +59,7 @@ void f() { E._(0); } ''', - [ - error( - CompileTimeErrorCode.FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, - 60, - 6, - ), - ], + [error(CompileTimeErrorCode.fieldInitializerFactoryConstructor, 60, 6)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/field_initializer_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/field_initializer_not_assignable_test.dart index 0bf3880c6cd..91d636eaa88 100644 --- a/pkg/analyzer/test/src/diagnostics/field_initializer_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_initializer_not_assignable_test.dart @@ -48,7 +48,7 @@ class A { A() : x = ''; } ''', - [error(CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, 31, 2)], + [error(CompileTimeErrorCode.fieldInitializerNotAssignable, 31, 2)], ); } } @@ -65,7 +65,7 @@ class A { A(dynamic a) : i = a; } ''', - [error(CompileTimeErrorCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, 40, 1)], + [error(CompileTimeErrorCode.fieldInitializerNotAssignable, 40, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/field_initializer_outside_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/field_initializer_outside_constructor_test.dart index 66fd7f9b2e6..82177f8dab6 100644 --- a/pkg/analyzer/test/src/diagnostics/field_initializer_outside_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_initializer_outside_constructor_test.dart @@ -23,13 +23,7 @@ class A { dynamic field = ({this.field}) {}; } ''', - [ - error( - CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - 30, - 10, - ), - ], + [error(CompileTimeErrorCode.fieldInitializerOutsideConstructor, 30, 10)], ); } @@ -41,13 +35,7 @@ class A { m([this.x = 0]) {} } ''', - [ - error( - CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - 28, - 6, - ), - ], + [error(CompileTimeErrorCode.fieldInitializerOutsideConstructor, 28, 6)], ); } @@ -61,12 +49,8 @@ class A { } ''', [ - error( - CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - 35, - 12, - ), - error(ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, 39, 4), + error(CompileTimeErrorCode.fieldInitializerOutsideConstructor, 35, 12), + error(ParserErrorCode.fieldInitializerOutsideConstructor, 39, 4), ], ); } @@ -79,13 +63,7 @@ class A { A(int p(this.x)); } ''', - [ - error( - CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - 30, - 6, - ), - ], + [error(CompileTimeErrorCode.fieldInitializerOutsideConstructor, 30, 6)], ); } @@ -99,12 +77,8 @@ class A { } ''', [ - error(ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, 24, 4), - error( - CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, - 24, - 6, - ), + error(ParserErrorCode.fieldInitializerOutsideConstructor, 24, 4), + error(CompileTimeErrorCode.fieldInitializerOutsideConstructor, 24, 6), ], ); } @@ -114,7 +88,7 @@ class A { r''' f(this.x(y)) {} ''', - [error(CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, 2, 9)], + [error(CompileTimeErrorCode.fieldInitializerOutsideConstructor, 2, 9)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/field_initializer_redirecting_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/field_initializer_redirecting_constructor_test.dart index 77b9d30419f..5d6c155105f 100644 --- a/pkg/analyzer/test/src/diagnostics/field_initializer_redirecting_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_initializer_redirecting_constructor_test.dart @@ -27,7 +27,7 @@ class A { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, 60, 6, ), @@ -46,7 +46,7 @@ class A { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, 46, 6, ), @@ -65,7 +65,7 @@ class A { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, 42, 6, ), @@ -85,7 +85,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, 84, 6, ), @@ -105,7 +105,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, 70, 6, ), @@ -125,7 +125,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, + CompileTimeErrorCode.fieldInitializerRedirectingConstructor, 69, 6, ), diff --git a/pkg/analyzer/test/src/diagnostics/field_initializing_formal_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/field_initializing_formal_not_assignable_test.dart index e41bc1638c7..94b1f139de9 100644 --- a/pkg/analyzer/test/src/diagnostics/field_initializing_formal_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_initializing_formal_not_assignable_test.dart @@ -26,7 +26,7 @@ class A { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, + CompileTimeErrorCode.fieldInitializingFormalNotAssignable, 23, 14, ), @@ -44,7 +44,7 @@ class A { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, + CompileTimeErrorCode.fieldInitializingFormalNotAssignable, 23, 13, ), @@ -63,7 +63,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, + CompileTimeErrorCode.fieldInitializingFormalNotAssignable, 42, 14, ), @@ -81,13 +81,9 @@ enum E { } ''', [ + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 13, 2), error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 13, - 2, - ), - error( - CompileTimeErrorCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, + CompileTimeErrorCode.fieldInitializingFormalNotAssignable, 43, 13, ), diff --git a/pkg/analyzer/test/src/diagnostics/field_must_be_external_in_struct_test.dart b/pkg/analyzer/test/src/diagnostics/field_must_be_external_in_struct_test.dart index be65b21a4dc..e5de471f22a 100644 --- a/pkg/analyzer/test/src/diagnostics/field_must_be_external_in_struct_test.dart +++ b/pkg/analyzer/test/src/diagnostics/field_must_be_external_in_struct_test.dart @@ -25,7 +25,7 @@ final class A extends Struct { int a; } ''', - [error(FfiCode.FIELD_MUST_BE_EXTERNAL_IN_STRUCT, 68, 1)], + [error(FfiCode.fieldMustBeExternalInStruct, 68, 1)], ); } @@ -39,7 +39,7 @@ final class A extends Union { int a; } ''', - [error(FfiCode.FIELD_MUST_BE_EXTERNAL_IN_STRUCT, 67, 1)], + [error(FfiCode.fieldMustBeExternalInStruct, 67, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/final_class_extended_outside_of_library_test.dart b/pkg/analyzer/test/src/diagnostics/final_class_extended_outside_of_library_test.dart index 6df3c810669..5316964d9d1 100644 --- a/pkg/analyzer/test/src/diagnostics/final_class_extended_outside_of_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/final_class_extended_outside_of_library_test.dart @@ -32,13 +32,7 @@ final class Foo {} import 'foo.dart'; final class Bar extends Foo {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 43, - 3, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 43, 3)], ); } @@ -77,13 +71,7 @@ typedef FooTypedef = Foo; import 'foo.dart'; final class Bar extends FooTypedef {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 43, - 10, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 43, 10)], ); } @@ -98,13 +86,7 @@ import 'foo.dart'; typedef FooTypedef = Foo; final class Bar extends FooTypedef {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 69, - 10, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 69, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/final_class_implemented_outside_of_library_test.dart b/pkg/analyzer/test/src/diagnostics/final_class_implemented_outside_of_library_test.dart index a5188fa8242..d5d4d27d08d 100644 --- a/pkg/analyzer/test/src/diagnostics/final_class_implemented_outside_of_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/final_class_implemented_outside_of_library_test.dart @@ -35,7 +35,7 @@ final class Bar implements Foo {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 46, 3, ), @@ -66,7 +66,7 @@ final class B implements A { ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 42, 1, ), @@ -87,7 +87,7 @@ final class Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 46, 10, ), @@ -108,7 +108,7 @@ final class Bar implements FooTypedef {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 72, 10, ), @@ -135,7 +135,7 @@ enum Bar implements Foo { bar } ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 39, 3, ), @@ -156,7 +156,7 @@ enum Bar implements FooTypedef { bar } ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 39, 10, ), @@ -177,7 +177,7 @@ enum Bar implements FooTypedef { bar } ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 65, 10, ), diff --git a/pkg/analyzer/test/src/diagnostics/final_class_used_as_mixin_constraint_outside_of_library_test.dart b/pkg/analyzer/test/src/diagnostics/final_class_used_as_mixin_constraint_outside_of_library_test.dart index 6837b7ee57e..a358b93d0e2 100644 --- a/pkg/analyzer/test/src/diagnostics/final_class_used_as_mixin_constraint_outside_of_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/final_class_used_as_mixin_constraint_outside_of_library_test.dart @@ -35,8 +35,7 @@ base mixin B on A {} ''', [ error( - CompileTimeErrorCode - .FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassUsedAsMixinConstraintOutsideOfLibrary, 33, 1, ), @@ -57,14 +56,12 @@ base mixin C on A, B {} ''', [ error( - CompileTimeErrorCode - .FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassUsedAsMixinConstraintOutsideOfLibrary, 33, 1, ), error( - CompileTimeErrorCode - .FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassUsedAsMixinConstraintOutsideOfLibrary, 36, 1, ), @@ -86,8 +83,7 @@ mixin B on A {} ''', [ error( - CompileTimeErrorCode - .FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassUsedAsMixinConstraintOutsideOfLibrary, 28, 1, ), @@ -108,8 +104,7 @@ base mixin B on ATypedef {} ''', [ error( - CompileTimeErrorCode - .FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassUsedAsMixinConstraintOutsideOfLibrary, 33, 8, ), @@ -130,8 +125,7 @@ base mixin B on ATypedef {} ''', [ error( - CompileTimeErrorCode - .FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassUsedAsMixinConstraintOutsideOfLibrary, 55, 8, ), diff --git a/pkg/analyzer/test/src/diagnostics/final_initialized_in_declaration_and_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/final_initialized_in_declaration_and_constructor_test.dart index 99e04c8bef8..4f35099bb29 100644 --- a/pkg/analyzer/test/src/diagnostics/final_initialized_in_declaration_and_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/final_initialized_in_declaration_and_constructor_test.dart @@ -38,7 +38,7 @@ augment class A { await resolveFile2(testFile); assertErrorsInResult([ error( - CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, + CompileTimeErrorCode.finalInitializedInDeclarationAndConstructor, 54, 1, ), @@ -58,7 +58,7 @@ class A { ''', [ error( - CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, + CompileTimeErrorCode.finalInitializedInDeclarationAndConstructor, 34, 1, ), @@ -76,9 +76,9 @@ enum E { } ''', [ - error(CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, 11, 4), + error(CompileTimeErrorCode.constEvalThrowsException, 11, 4), error( - CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, + CompileTimeErrorCode.finalInitializedInDeclarationAndConstructor, 47, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/final_not_initialized_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/final_not_initialized_constructor_test.dart index f2e7e544a32..07949c507e4 100644 --- a/pkg/analyzer/test/src/diagnostics/final_not_initialized_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/final_not_initialized_constructor_test.dart @@ -23,7 +23,7 @@ class A { A() {} } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, 27, 1)], + [error(CompileTimeErrorCode.finalNotInitializedConstructor1, 27, 1)], ); } @@ -36,7 +36,7 @@ class A { A() {} } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2, 42, 1)], + [error(CompileTimeErrorCode.finalNotInitializedConstructor2, 42, 1)], ); } @@ -50,13 +50,7 @@ class A { A() {} } ''', - [ - error( - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS, - 57, - 1, - ), - ], + [error(CompileTimeErrorCode.finalNotInitializedConstructor3Plus, 57, 1)], ); } @@ -148,7 +142,7 @@ augment class A { await resolveFile2(testFile); assertErrorsInResult([ error( - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, + CompileTimeErrorCode.finalNotInitializedConstructor1, 60, 1, messageContains: ['f2'], @@ -208,7 +202,7 @@ augment class A { await resolveFile2(a); assertErrorsInResult([ - error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, 42, 1), + error(CompileTimeErrorCode.finalNotInitializedConstructor1, 42, 1), ]); } @@ -221,7 +215,7 @@ class A { A._(); } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, 45, 1)], + [error(CompileTimeErrorCode.finalNotInitializedConstructor1, 45, 1)], ); } @@ -254,7 +248,7 @@ enum E { const E(); } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, 37, 1)], + [error(CompileTimeErrorCode.finalNotInitializedConstructor1, 37, 1)], ); } @@ -268,7 +262,7 @@ enum E { const E(); } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2, 52, 1)], + [error(CompileTimeErrorCode.finalNotInitializedConstructor2, 52, 1)], ); } @@ -283,13 +277,7 @@ enum E { const E(); } ''', - [ - error( - CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS, - 67, - 1, - ), - ], + [error(CompileTimeErrorCode.finalNotInitializedConstructor3Plus, 67, 1)], ); } @@ -303,7 +291,7 @@ enum E { const E._(); } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, 70, 1)], + [error(CompileTimeErrorCode.finalNotInitializedConstructor1, 70, 1)], ); } @@ -336,7 +324,7 @@ extension type A(int it) { A.named(); } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1, 29, 1)], + [error(CompileTimeErrorCode.finalNotInitializedConstructor1, 29, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/final_not_initialized_test.dart b/pkg/analyzer/test/src/diagnostics/final_not_initialized_test.dart index 43d10b051d3..3f4e8a96d97 100644 --- a/pkg/analyzer/test/src/diagnostics/final_not_initialized_test.dart +++ b/pkg/analyzer/test/src/diagnostics/final_not_initialized_test.dart @@ -89,7 +89,7 @@ abstract class A { final int x; } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 31, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 31, 1)], ); } @@ -147,7 +147,7 @@ class A { factory A() => throw 0; }''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 22, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 22, 1)], ); } @@ -188,7 +188,7 @@ enum E { final int x; } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 26, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 26, 1)], ); } @@ -198,7 +198,7 @@ enum E { extension E on String { static final F; }''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 39, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 39, 1)], ); } @@ -208,7 +208,7 @@ extension E on String { class A { final F; }''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 18, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 18, 1)], ); } @@ -218,7 +218,7 @@ class A { class A { static final F; }''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 25, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 25, 1)], ); } @@ -227,7 +227,7 @@ class A { ''' final F; ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 6, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 6, 1)], ); } @@ -237,7 +237,7 @@ final F; f() { final int x; }''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1)], + [error(WarningCode.unusedLocalVariable, 18, 1)], ); } @@ -248,7 +248,7 @@ f() { late final x = 1; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 1)], + [error(WarningCode.unusedLocalVariable, 19, 1)], ); } @@ -259,7 +259,7 @@ f() { late final x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 1)], + [error(WarningCode.unusedLocalVariable, 19, 1)], ); } @@ -270,7 +270,7 @@ mixin M { final int x; } ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 22, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 22, 1)], ); } @@ -293,7 +293,7 @@ external final int x; ''' final int x; ''', - [error(CompileTimeErrorCode.FINAL_NOT_INITIALIZED, 10, 1)], + [error(CompileTimeErrorCode.finalNotInitialized, 10, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_element_type_test.dart b/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_element_type_test.dart index ef0d9a2dd17..1b5fc17ede2 100644 --- a/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_element_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_element_type_test.dart @@ -34,7 +34,7 @@ f(Stream stream) async { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 55, 6)], + [error(CompileTimeErrorCode.forInOfInvalidElementType, 55, 6)], ); } @@ -48,7 +48,7 @@ f(Stream stream) async { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 60, 6)], + [error(CompileTimeErrorCode.forInOfInvalidElementType, 60, 6)], ); } @@ -63,7 +63,7 @@ class Foo> { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 86, 8)], + [error(CompileTimeErrorCode.forInOfInvalidElementType, 86, 8)], ); } @@ -133,7 +133,7 @@ f() { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 22, 10)], + [error(CompileTimeErrorCode.forInOfInvalidElementType, 22, 10)], ); } @@ -147,7 +147,7 @@ f() { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 27, 10)], + [error(CompileTimeErrorCode.forInOfInvalidElementType, 27, 10)], ); } @@ -192,7 +192,7 @@ void foo(Iterable iterable) { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 106, 8)], + [error(CompileTimeErrorCode.forInOfInvalidElementType, 106, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_type_test.dart index 1462763357d..44c0bc68fc0 100644 --- a/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/for_in_of_invalid_type_test.dart @@ -35,7 +35,7 @@ f(bool e) async { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 41, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 41, 1)], ); } @@ -48,7 +48,7 @@ f(Never e) async { } } ''', - [error(WarningCode.DEAD_CODE, 32, 26)], + [error(WarningCode.deadCode, 32, 26)], ); // TODO(scheglov): extract for-in resolution and implement // assertType(findNode.simple('id;'), 'Never'); @@ -63,7 +63,7 @@ f(Object e) async { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 43, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 43, 1)], ); } @@ -119,7 +119,7 @@ f(bool e) { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 29, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 29, 1)], ); } @@ -143,7 +143,7 @@ f(Never e) { } } ''', - [error(WarningCode.DEAD_CODE, 20, 26)], + [error(WarningCode.deadCode, 20, 26)], ); // TODO(scheglov): extract for-in resolution and implement // assertType(findNode.simple('id;'), 'Never'); @@ -158,7 +158,7 @@ f(Object e) async { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 37, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 37, 1)], ); } } @@ -175,7 +175,7 @@ f(dynamic e) { } } ''', - [error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 32, 1)], + [error(CompileTimeErrorCode.forInOfInvalidType, 32, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/for_in_with_const_variable_test.dart b/pkg/analyzer/test/src/diagnostics/for_in_with_const_variable_test.dart index c9f93f0656f..1f041f5c96d 100644 --- a/pkg/analyzer/test/src/diagnostics/for_in_with_const_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/for_in_with_const_variable_test.dart @@ -24,7 +24,7 @@ f() { } } ''', - [error(CompileTimeErrorCode.FOR_IN_WITH_CONST_VARIABLE, 13, 5)], + [error(CompileTimeErrorCode.forInWithConstVariable, 13, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/function_typed_parameter_var_test.dart b/pkg/analyzer/test/src/diagnostics/function_typed_parameter_var_test.dart index 8f970fcb972..7b7fd04d7c2 100644 --- a/pkg/analyzer/test/src/diagnostics/function_typed_parameter_var_test.dart +++ b/pkg/analyzer/test/src/diagnostics/function_typed_parameter_var_test.dart @@ -22,7 +22,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, 14, 3), + error(ParserErrorCode.functionTypedParameterVar, 14, 3), ]); var node = parseResult.findNode.superFormalParameter('super.a'); diff --git a/pkg/analyzer/test/src/diagnostics/generic_function_type_cannot_be_bound_test.dart b/pkg/analyzer/test/src/diagnostics/generic_function_type_cannot_be_bound_test.dart index 89a1fab5510..76b047d9b53 100644 --- a/pkg/analyzer/test/src/diagnostics/generic_function_type_cannot_be_bound_test.dart +++ b/pkg/analyzer/test/src/diagnostics/generic_function_type_cannot_be_bound_test.dart @@ -41,13 +41,7 @@ typedef F = S Function(S); import 'a.dart'; late T Function(T) fun; ''', - [ - error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND, - 57, - 1, - ), - ], + [error(CompileTimeErrorCode.genericFunctionTypeCannotBeBound, 57, 1)], ); } @@ -80,13 +74,7 @@ class GenericFunctionTypeCannotBeBoundWithoutGenericMetadataTest class C(S)> { } ''', - [ - error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND, - 32, - 16, - ), - ], + [error(CompileTimeErrorCode.genericFunctionTypeCannotBeBound, 32, 16)], ); } @@ -96,13 +84,7 @@ class C(S)> { // @dart=2.12 late T Function(S)>(T) fun; ''', - [ - error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND, - 40, - 16, - ), - ], + [error(CompileTimeErrorCode.genericFunctionTypeCannotBeBound, 40, 16)], ); } @@ -112,13 +94,7 @@ late T Function(S)>(T) fun; // @dart=2.12 typedef foo = T Function(S)>(T t); ''', - [ - error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND, - 49, - 16, - ), - ], + [error(CompileTimeErrorCode.genericFunctionTypeCannotBeBound, 49, 16)], ); } @@ -134,13 +110,7 @@ class C(S))> {} // @dart=2.12 typedef T foo(S)>(T t); ''', - [ - error( - CompileTimeErrorCode.GENERIC_FUNCTION_TYPE_CANNOT_BE_BOUND, - 38, - 16, - ), - ], + [error(CompileTimeErrorCode.genericFunctionTypeCannotBeBound, 38, 16)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/generic_struct_subclass_test.dart b/pkg/analyzer/test/src/diagnostics/generic_struct_subclass_test.dart index ee62c609e76..26f2c76a719 100644 --- a/pkg/analyzer/test/src/diagnostics/generic_struct_subclass_test.dart +++ b/pkg/analyzer/test/src/diagnostics/generic_struct_subclass_test.dart @@ -24,7 +24,7 @@ final class S extends Struct { } ''', [ - error(FfiCode.GENERIC_STRUCT_SUBCLASS, 31, 1, messageContains: ["'S'"]), + error(FfiCode.genericStructSubclass, 31, 1, messageContains: ["'S'"]), ], ); } @@ -38,7 +38,7 @@ final class S extends Union { } ''', [ - error(FfiCode.GENERIC_STRUCT_SUBCLASS, 31, 1, messageContains: ["'S'"]), + error(FfiCode.genericStructSubclass, 31, 1, messageContains: ["'S'"]), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/getter_not_subtype_setter_types_test.dart b/pkg/analyzer/test/src/diagnostics/getter_not_subtype_setter_types_test.dart index d3442e53930..22a89d4a679 100644 --- a/pkg/analyzer/test/src/diagnostics/getter_not_subtype_setter_types_test.dart +++ b/pkg/analyzer/test/src/diagnostics/getter_not_subtype_setter_types_test.dart @@ -92,7 +92,7 @@ import 'a.dart'; class B extends A { set _foo(String _) {} } -''', _filterGetterSetterTypeErrors([error(WarningCode.UNUSED_ELEMENT, 44, 4)])); +''', _filterGetterSetterTypeErrors([error(WarningCode.unusedElement, 44, 4)])); } test_class_instance_private_interfaces() async { @@ -143,7 +143,7 @@ import 'a.dart'; class B extends A { int get _foo => 0; } -''', _filterGetterSetterTypeErrors([error(WarningCode.UNUSED_ELEMENT, 48, 4)])); +''', _filterGetterSetterTypeErrors([error(WarningCode.unusedElement, 48, 4)])); } test_class_instance_sameClass() async { @@ -415,8 +415,7 @@ set foo(String v) {} ) { if (experiments.contains(Feature.getter_setter_error.enableString)) { return expectedErrors.whereNot((error) { - return error.code == - CompileTimeErrorCode.GETTER_NOT_SUBTYPE_SETTER_TYPES; + return error.code == CompileTimeErrorCode.getterNotSubtypeSetterTypes; }).toList(); } else { return expectedErrors; diff --git a/pkg/analyzer/test/src/diagnostics/if_element_condition_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/if_element_condition_from_deferred_library_test.dart index 2fecd0985b5..5a01745b8f0 100644 --- a/pkg/analyzer/test/src/diagnostics/if_element_condition_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/if_element_condition_from_deferred_library_test.dart @@ -30,7 +30,7 @@ f() { }''', [ error( - CompileTimeErrorCode.IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.ifElementConditionFromDeferredLibrary, 61, 1, ), @@ -69,7 +69,7 @@ f() { }''', [ error( - CompileTimeErrorCode.IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.ifElementConditionFromDeferredLibrary, 61, 1, ), @@ -108,7 +108,7 @@ f() { }''', [ error( - CompileTimeErrorCode.IF_ELEMENT_CONDITION_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.ifElementConditionFromDeferredLibrary, 61, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/illegal_async_generator_return_type_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_async_generator_return_type_test.dart index 8a1d9f1a3a5..8a81449aa34 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_async_generator_return_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_async_generator_return_type_test.dart @@ -20,7 +20,7 @@ class IllegalAsyncGeneratorReturnTypeTest extends PubPackageResolutionTest { ''' int f() async* {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 0, 3)], + [error(CompileTimeErrorCode.illegalAsyncGeneratorReturnType, 0, 3)], ); } @@ -36,7 +36,7 @@ Stream f() async* {} abstract class SubStream implements Stream {} SubStream f() async* {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 52, 14)], + [error(CompileTimeErrorCode.illegalAsyncGeneratorReturnType, 52, 14)], ); } @@ -45,7 +45,7 @@ SubStream f() async* {} ''' void f() async* {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 0, 4)], + [error(CompileTimeErrorCode.illegalAsyncGeneratorReturnType, 0, 4)], ); } @@ -56,7 +56,7 @@ class C { int f() async* {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 12, 3)], + [error(CompileTimeErrorCode.illegalAsyncGeneratorReturnType, 12, 3)], ); } @@ -68,7 +68,7 @@ class C { SubStream f() async* {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 64, 14)], + [error(CompileTimeErrorCode.illegalAsyncGeneratorReturnType, 64, 14)], ); } @@ -79,7 +79,7 @@ class C { void f() async* {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 12, 4)], + [error(CompileTimeErrorCode.illegalAsyncGeneratorReturnType, 12, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/illegal_async_return_type_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_async_return_type_test.dart index ba01dd01618..8b8de89feff 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_async_return_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_async_return_type_test.dart @@ -22,7 +22,7 @@ int f() async { return 1; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3)], + [error(CompileTimeErrorCode.illegalAsyncReturnType, 0, 3)], ); } @@ -39,7 +39,7 @@ int f() async { return 2; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3)], + [error(CompileTimeErrorCode.illegalAsyncReturnType, 0, 3)], ); } @@ -51,7 +51,7 @@ SubFuture f() async { return 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 52, 14)], + [error(CompileTimeErrorCode.illegalAsyncReturnType, 52, 14)], ); } @@ -64,7 +64,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 12, 3)], + [error(CompileTimeErrorCode.illegalAsyncReturnType, 12, 3)], ); } @@ -86,7 +86,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 64, 14)], + [error(CompileTimeErrorCode.illegalAsyncReturnType, 64, 14)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/illegal_concrete_enum_member_declaration_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_concrete_enum_member_declaration_test.dart index ea78368b4d8..a175f26d08d 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_concrete_enum_member_declaration_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_concrete_enum_member_declaration_test.dart @@ -25,13 +25,7 @@ abstract class A implements Enum { int hashCode = 0; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 41, - 8, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 41, 8)], ); } @@ -42,13 +36,7 @@ abstract class A implements Enum { int get hashCode => 0; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 45, - 8, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 45, 8)], ); } @@ -75,13 +63,7 @@ abstract class A implements Enum { int index = 0; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 41, - 5, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 41, 5)], ); } @@ -92,13 +74,7 @@ abstract class A implements Enum { int get index => 0; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 45, - 5, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 45, 5)], ); } @@ -125,13 +101,7 @@ abstract class A implements Enum { bool operator ==(Object other) => false; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 51, - 2, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 51, 2)], ); } } @@ -147,13 +117,7 @@ enum E { final int index = 0; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 26, - 5, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 26, 5)], ); } @@ -166,13 +130,7 @@ enum E { const E(); } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 26, - 5, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 26, 5)], ); } @@ -184,13 +142,7 @@ enum E { int get index => 0; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 24, - 5, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 24, 5)], ); } @@ -220,13 +172,7 @@ enum E { bool operator ==(Object other) => false; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 30, - 2, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 30, 2)], ); } } @@ -241,13 +187,7 @@ mixin M on Enum { int index = 0; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 24, - 5, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 24, 5)], ); } @@ -258,13 +198,7 @@ mixin M on Enum { int get index => 0; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 28, - 5, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 28, 5)], ); } @@ -291,13 +225,7 @@ mixin M on Enum { bool operator ==(Object other) => false; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 34, - 2, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 34, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/illegal_concrete_enum_member_inheritance_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_concrete_enum_member_inheritance_test.dart index 06d4374310b..c9e4a732389 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_concrete_enum_member_inheritance_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_concrete_enum_member_inheritance_test.dart @@ -27,13 +27,7 @@ class A { abstract class B extends A implements Enum {} ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - 48, - 1, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, 48, 1)], ); } @@ -56,13 +50,7 @@ mixin M { abstract class B with M implements Enum {} ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - 48, - 1, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, 48, 1)], ); } @@ -75,13 +63,7 @@ class A { abstract class B extends A implements Enum {} ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - 53, - 1, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, 53, 1)], ); } @@ -114,13 +96,7 @@ class A { abstract class B extends A implements Enum {} ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - 71, - 1, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, 71, 1)], ); } @@ -143,13 +119,7 @@ mixin M { abstract class B with M implements Enum {} ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - 71, - 1, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, 71, 1)], ); } } @@ -180,13 +150,7 @@ enum E with M { v; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - 43, - 1, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, 43, 1)], ); } @@ -225,13 +189,7 @@ enum E with M { v; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - 40, - 1, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, 40, 1)], ); } @@ -270,13 +228,7 @@ enum E with M { v; } ''', - [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_INHERITANCE, - 61, - 1, - ), - ], + [error(CompileTimeErrorCode.illegalConcreteEnumMemberInheritance, 61, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/illegal_enum_values_declaration_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_enum_values_declaration_test.dart index a9b7c1a726c..1855521c40f 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_enum_values_declaration_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_enum_values_declaration_test.dart @@ -22,7 +22,7 @@ abstract class A implements Enum { int values = 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, 41, 6)], + [error(CompileTimeErrorCode.illegalEnumValuesDeclaration, 41, 6)], ); } @@ -41,7 +41,7 @@ abstract class A implements Enum { int get values => 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, 45, 6)], + [error(CompileTimeErrorCode.illegalEnumValuesDeclaration, 45, 6)], ); } @@ -60,7 +60,7 @@ abstract class A implements Enum { void values() {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, 42, 6)], + [error(CompileTimeErrorCode.illegalEnumValuesDeclaration, 42, 6)], ); } @@ -79,7 +79,7 @@ abstract class A implements Enum { set values(int _) {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, 41, 6)], + [error(CompileTimeErrorCode.illegalEnumValuesDeclaration, 41, 6)], ); } @@ -98,7 +98,7 @@ mixin M on Enum { int values = 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, 24, 6)], + [error(CompileTimeErrorCode.illegalEnumValuesDeclaration, 24, 6)], ); } @@ -117,7 +117,7 @@ mixin M on Enum { int get values => 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, 28, 6)], + [error(CompileTimeErrorCode.illegalEnumValuesDeclaration, 28, 6)], ); } @@ -136,7 +136,7 @@ mixin M on Enum { void values() {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, 25, 6)], + [error(CompileTimeErrorCode.illegalEnumValuesDeclaration, 25, 6)], ); } @@ -155,7 +155,7 @@ mixin M on Enum { set values(int _) {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_DECLARATION, 24, 6)], + [error(CompileTimeErrorCode.illegalEnumValuesDeclaration, 24, 6)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/illegal_enum_values_inheritance_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_enum_values_inheritance_test.dart index 99a1c844979..7da914862f9 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_enum_values_inheritance_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_enum_values_inheritance_test.dart @@ -24,7 +24,7 @@ class A { abstract class B extends A implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 46, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 46, 1)], ); } @@ -37,7 +37,7 @@ class A { abstract class B implements A, Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 46, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 46, 1)], ); } @@ -50,7 +50,7 @@ mixin M { abstract class B with M implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 46, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 46, 1)], ); } @@ -63,7 +63,7 @@ class A { abstract class B extends A implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 51, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 51, 1)], ); } @@ -76,7 +76,7 @@ class A { abstract class B extends A implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 47, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 47, 1)], ); } @@ -89,7 +89,7 @@ class A { abstract class B extends A implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 51, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 51, 1)], ); } @@ -104,7 +104,7 @@ enum E implements A { v } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 41, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 41, 1)], ); } @@ -119,7 +119,7 @@ enum E implements A { v } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 39, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 39, 1)], ); } @@ -134,7 +134,7 @@ enum E with M { v } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 39, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 39, 1)], ); } @@ -149,7 +149,7 @@ enum E implements A { v } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 41, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 41, 1)], ); } @@ -164,7 +164,7 @@ enum E with M { v } ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 41, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 41, 1)], ); } @@ -177,7 +177,7 @@ class A { mixin M on A implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 37, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 37, 1)], ); } @@ -190,7 +190,7 @@ class A { mixin M on A implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 42, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 42, 1)], ); } @@ -203,7 +203,7 @@ class A { mixin M on A implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 40, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 40, 1)], ); } @@ -216,7 +216,7 @@ class A { mixin M on A implements Enum {} ''', - [error(CompileTimeErrorCode.ILLEGAL_ENUM_VALUES_INHERITANCE, 42, 1)], + [error(CompileTimeErrorCode.illegalEnumValuesInheritance, 42, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/illegal_language_version_override_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_language_version_override_test.dart index 7a71533e3fa..a38fc6c37c5 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_language_version_override_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_language_version_override_test.dart @@ -35,7 +35,7 @@ void f() {} // @dart = 2.9 int a = 0; ''', - [error(CompileTimeErrorCode.ILLEGAL_LANGUAGE_VERSION_OVERRIDE, 0, 14)], + [error(CompileTimeErrorCode.illegalLanguageVersionOverride, 0, 14)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/illegal_sync_generator_return_type_test.dart b/pkg/analyzer/test/src/diagnostics/illegal_sync_generator_return_type_test.dart index 8af13ec5599..9415c50dd6f 100644 --- a/pkg/analyzer/test/src/diagnostics/illegal_sync_generator_return_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/illegal_sync_generator_return_type_test.dart @@ -20,7 +20,7 @@ class IllegalSyncGeneratorReturnTypeTest extends PubPackageResolutionTest { ''' Iterable f() sync* => []; ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 25, 2)], + [error(CompileTimeErrorCode.returnInGenerator, 25, 2)], ); } @@ -35,7 +35,7 @@ Iterable f() sync* {} ''' int f() sync* {} ''', - [error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 0, 3)], + [error(CompileTimeErrorCode.illegalSyncGeneratorReturnType, 0, 3)], ); } @@ -45,7 +45,7 @@ int f() sync* {} abstract class SubIterator implements Iterator {} SubIterator f() sync* {} ''', - [error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 56, 16)], + [error(CompileTimeErrorCode.illegalSyncGeneratorReturnType, 56, 16)], ); } @@ -54,7 +54,7 @@ SubIterator f() sync* {} ''' void f() sync* {} ''', - [error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 0, 4)], + [error(CompileTimeErrorCode.illegalSyncGeneratorReturnType, 0, 4)], ); } @@ -65,7 +65,7 @@ class C { int f() sync* {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 12, 3)], + [error(CompileTimeErrorCode.illegalSyncGeneratorReturnType, 12, 3)], ); } @@ -77,7 +77,7 @@ class C { SubIterator f() sync* {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 68, 16)], + [error(CompileTimeErrorCode.illegalSyncGeneratorReturnType, 68, 16)], ); } @@ -88,7 +88,7 @@ class C { void f() sync* {} } ''', - [error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 12, 4)], + [error(CompileTimeErrorCode.illegalSyncGeneratorReturnType, 12, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/implements_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/implements_deferred_class_test.dart index e027486088c..c088d5755fc 100644 --- a/pkg/analyzer/test/src/diagnostics/implements_deferred_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/implements_deferred_class_test.dart @@ -26,7 +26,7 @@ library root; import 'lib1.dart' deferred as a; class B implements a.A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, 67, 3)], + [error(CompileTimeErrorCode.implementsDeferredClass, 67, 3)], ); var node = findNode.singleImplementsClause; @@ -57,7 +57,7 @@ library root; import 'lib1.dart' deferred as a; class C implements a.B {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, 67, 3)], + [error(CompileTimeErrorCode.implementsDeferredClass, 67, 3)], ); var node = findNode.singleImplementsClause; @@ -90,7 +90,7 @@ class B {} class M {} class C = B with M implements a.A; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, 100, 3)], + [error(CompileTimeErrorCode.implementsDeferredClass, 100, 3)], ); var node = findNode.singleImplementsClause; @@ -119,7 +119,7 @@ class A {} import 'a.dart' deferred as a; extension type B(a.A it) implements a.A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, 67, 3)], + [error(CompileTimeErrorCode.implementsDeferredClass, 67, 3)], ); var node = findNode.singleImplementsClause; @@ -148,7 +148,7 @@ extension type A(int it) {} import 'a.dart' deferred as a; extension type B(int it) implements a.A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, 67, 3)], + [error(CompileTimeErrorCode.implementsDeferredClass, 67, 3)], ); var node = findNode.singleImplementsClause; @@ -173,7 +173,7 @@ ImplementsClause import 'dart:math' deferred as math; mixin M implements math.Random {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS, 56, 11)], + [error(CompileTimeErrorCode.implementsDeferredClass, 56, 11)], ); var node = findNode.singleImplementsClause; diff --git a/pkg/analyzer/test/src/diagnostics/implements_disallowed_class_test.dart b/pkg/analyzer/test/src/diagnostics/implements_disallowed_class_test.dart index f732b7a20cd..0f57ebe8a3e 100644 --- a/pkg/analyzer/test/src/diagnostics/implements_disallowed_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/implements_disallowed_class_test.dart @@ -20,7 +20,7 @@ class ImplementsDisallowedClassTest extends PubPackageResolutionTest { ''' class A implements bool {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 19, 4)], ); } @@ -36,7 +36,7 @@ abstract class A implements Enum {} // @dart = 2.16 abstract class A implements Enum {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 44, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 44, 4)], ); } @@ -46,7 +46,7 @@ abstract class A implements Enum {} // @dart = 2.16 class A implements Enum {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 35, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 35, 4)], ); } @@ -55,7 +55,7 @@ class A implements Enum {} ''' class A implements double {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 6)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 19, 6)], ); } @@ -65,7 +65,7 @@ class A implements double {} import 'dart:async'; class A implements FutureOr {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 40, 8)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 40, 8)], ); } @@ -75,7 +75,7 @@ class A implements FutureOr {} import 'dart:async'; class A implements FutureOr {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 40, 13)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 40, 13)], ); } @@ -86,7 +86,7 @@ import 'dart:async'; typedef F = FutureOr; class A implements F {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 68, 1)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 68, 1)], ); } @@ -96,7 +96,7 @@ class A implements F {} import 'dart:async'; class A implements FutureOr {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 43, 11)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 43, 11)], ); } @@ -105,7 +105,7 @@ class A implements FutureOr {} ''' class A implements int {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 3)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 19, 3)], ); } @@ -114,7 +114,7 @@ class A implements int {} ''' class A implements Null {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 19, 4)], ); } @@ -123,7 +123,7 @@ class A implements Null {} ''' class A implements num {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 3)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 19, 3)], ); } @@ -132,7 +132,7 @@ class A implements num {} ''' class A implements Record {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 6)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 19, 6)], ); } @@ -141,7 +141,7 @@ class A implements Record {} ''' class A implements String {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 6)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 19, 6)], ); } @@ -159,7 +159,7 @@ augment class A implements String {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 45, 6), + error(CompileTimeErrorCode.implementsDisallowedClass, 45, 6), ]); } @@ -169,8 +169,8 @@ augment class A implements String {} class A implements String, num {} ''', [ - error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 6), - error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 27, 3), + error(CompileTimeErrorCode.implementsDisallowedClass, 19, 6), + error(CompileTimeErrorCode.implementsDisallowedClass, 27, 3), ], ); } @@ -182,7 +182,7 @@ class A {} class M {} class C = A with M implements bool; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 52, 4)], ); } @@ -200,7 +200,7 @@ abstract class A = Object with M implements Enum; mixin M {} abstract class A = Object with M implements Enum; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 71, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 71, 4)], ); } @@ -211,7 +211,7 @@ abstract class A = Object with M implements Enum; mixin M {} class A = Object with M implements Enum; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 62, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 62, 4)], ); } @@ -222,7 +222,7 @@ class A {} class M {} class C = A with M implements double; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 6)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 52, 6)], ); } @@ -234,7 +234,7 @@ class A {} class M {} class C = A with M implements FutureOr; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 73, 8)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 73, 8)], ); } @@ -245,7 +245,7 @@ class A {} class M {} class C = A with M implements int; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 3)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 52, 3)], ); } @@ -256,7 +256,7 @@ class A {} class M {} class C = A with M implements Null; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 52, 4)], ); } @@ -267,7 +267,7 @@ class A {} class M {} class C = A with M implements num; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 3)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 52, 3)], ); } @@ -278,7 +278,7 @@ class A {} class M {} class C = A with M implements String; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 6)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 52, 6)], ); } @@ -290,8 +290,8 @@ class M {} class C = A with M implements String, num; ''', [ - error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 52, 6), - error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 60, 3), + error(CompileTimeErrorCode.implementsDisallowedClass, 52, 6), + error(CompileTimeErrorCode.implementsDisallowedClass, 60, 3), ], ); } @@ -303,7 +303,7 @@ enum E implements int { v } ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 18, 3)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 18, 3)], ); } @@ -319,7 +319,7 @@ mixin M implements Enum {} // @dart = 2.16 mixin M implements Enum {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 35, 4)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 35, 4)], ); } @@ -328,7 +328,7 @@ mixin M implements Enum {} r''' mixin M implements int {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_DISALLOWED_CLASS, 19, 3)], + [error(CompileTimeErrorCode.implementsDisallowedClass, 19, 3)], ); var node = findNode.singleImplementsClause; diff --git a/pkg/analyzer/test/src/diagnostics/implements_non_class_test.dart b/pkg/analyzer/test/src/diagnostics/implements_non_class_test.dart index e086ccfdb3d..b72fb8f3cb4 100644 --- a/pkg/analyzer/test/src/diagnostics/implements_non_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/implements_non_class_test.dart @@ -20,7 +20,7 @@ class ImplementsNonClassTest extends PubPackageResolutionTest { ''' class A implements dynamic {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 19, 7)], + [error(CompileTimeErrorCode.implementsNonClass, 19, 7)], ); } @@ -30,7 +30,7 @@ class A implements dynamic {} enum E { ONE } class A implements E {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 34, 1)], + [error(CompileTimeErrorCode.implementsNonClass, 34, 1)], ); } @@ -40,7 +40,7 @@ class A implements E {} extension type A(int it) {} class B implements A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 47, 1)], + [error(CompileTimeErrorCode.implementsNonClass, 47, 1)], ); } @@ -50,7 +50,7 @@ class B implements A {} int A = 7; class B implements A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 30, 1)], + [error(CompileTimeErrorCode.implementsNonClass, 30, 1)], ); } @@ -62,7 +62,7 @@ mixin M {} int B = 7; class C = A with M implements B; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 63, 1)], + [error(CompileTimeErrorCode.implementsNonClass, 63, 1)], ); } @@ -74,7 +74,7 @@ enum E implements A { v } ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 29, 1)], + [error(CompileTimeErrorCode.implementsNonClass, 29, 1)], ); } @@ -83,7 +83,7 @@ enum E implements A { r''' mixin M implements dynamic {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 19, 7)], + [error(CompileTimeErrorCode.implementsNonClass, 19, 7)], ); } @@ -93,7 +93,7 @@ mixin M implements dynamic {} extension type A(int it) {} mixin M implements A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 47, 1)], + [error(CompileTimeErrorCode.implementsNonClass, 47, 1)], ); } @@ -102,7 +102,7 @@ mixin M implements A {} ''' class A implements Never {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_NON_CLASS, 19, 5)], + [error(CompileTimeErrorCode.implementsNonClass, 19, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/implements_repeated_test.dart b/pkg/analyzer/test/src/diagnostics/implements_repeated_test.dart index 2c2c07c8ecc..4e816808d77 100644 --- a/pkg/analyzer/test/src/diagnostics/implements_repeated_test.dart +++ b/pkg/analyzer/test/src/diagnostics/implements_repeated_test.dart @@ -21,7 +21,7 @@ class ImplementsRepeatedTest extends PubPackageResolutionTest { class A {} class B implements A, A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 33, 1)], + [error(CompileTimeErrorCode.implementsRepeated, 33, 1)], ); var node = findNode.singleImplementsClause; @@ -58,7 +58,7 @@ augment class B implements A {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 46, 1), + error(CompileTimeErrorCode.implementsRepeated, 46, 1), ]); } @@ -69,7 +69,7 @@ class A {} typedef B = A; class C implements A, B {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 48, 1)], + [error(CompileTimeErrorCode.implementsRepeated, 48, 1)], ); var node = findNode.singleImplementsClause; @@ -96,9 +96,9 @@ class A {} class C{} class B implements A, A, A, A {} ''', [ - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 43, 1), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 46, 1), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 49, 1), + error(CompileTimeErrorCode.implementsRepeated, 43, 1), + error(CompileTimeErrorCode.implementsRepeated, 46, 1), + error(CompileTimeErrorCode.implementsRepeated, 49, 1), ], ); } @@ -111,7 +111,7 @@ enum E implements A, A { v } ''', - [error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 32, 1)], + [error(CompileTimeErrorCode.implementsRepeated, 32, 1)], ); var node = findNode.singleImplementsClause; @@ -148,7 +148,7 @@ augment enum E implements A {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 45, 1), + error(CompileTimeErrorCode.implementsRepeated, 45, 1), ]); } @@ -161,7 +161,7 @@ enum E implements A, B { v } ''', - [error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 47, 1)], + [error(CompileTimeErrorCode.implementsRepeated, 47, 1)], ); var node = findNode.singleImplementsClause; @@ -190,9 +190,9 @@ enum E implements A, A, A, A { } ''', [ - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 42, 1), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 45, 1), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 48, 1), + error(CompileTimeErrorCode.implementsRepeated, 42, 1), + error(CompileTimeErrorCode.implementsRepeated, 45, 1), + error(CompileTimeErrorCode.implementsRepeated, 48, 1), ], ); } @@ -202,7 +202,7 @@ enum E implements A, A, A, A { r''' extension type A(int it) implements int, int {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 41, 3)], + [error(CompileTimeErrorCode.implementsRepeated, 41, 3)], ); var node = findNode.singleImplementsClause; @@ -238,7 +238,7 @@ augment extension type A(int it) implements int {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 63, 3), + error(CompileTimeErrorCode.implementsRepeated, 63, 3), ]); } @@ -248,7 +248,7 @@ augment extension type A(int it) implements int {} typedef A = int; extension type B(int it) implements int, A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 58, 1)], + [error(CompileTimeErrorCode.implementsRepeated, 58, 1)], ); var node = findNode.singleImplementsClause; @@ -274,9 +274,9 @@ ImplementsClause extension type A(int it) implements int, int, int, int {} ''', [ - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 41, 3), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 46, 3), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 51, 3), + error(CompileTimeErrorCode.implementsRepeated, 41, 3), + error(CompileTimeErrorCode.implementsRepeated, 46, 3), + error(CompileTimeErrorCode.implementsRepeated, 51, 3), ], ); } @@ -287,7 +287,7 @@ extension type A(int it) implements int, int, int, int {} class A {} mixin M implements A, A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 33, 1)], + [error(CompileTimeErrorCode.implementsRepeated, 33, 1)], ); } @@ -309,7 +309,7 @@ augment mixin M implements A {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 46, 1), + error(CompileTimeErrorCode.implementsRepeated, 46, 1), ]); } @@ -320,9 +320,9 @@ class A {} mixin M implements A, A, A, A {} ''', [ - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 33, 1), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 36, 1), - error(CompileTimeErrorCode.IMPLEMENTS_REPEATED, 39, 1), + error(CompileTimeErrorCode.implementsRepeated, 33, 1), + error(CompileTimeErrorCode.implementsRepeated, 36, 1), + error(CompileTimeErrorCode.implementsRepeated, 39, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/implements_super_class_test.dart b/pkg/analyzer/test/src/diagnostics/implements_super_class_test.dart index edfe515f6f7..9efd33c0e4a 100644 --- a/pkg/analyzer/test/src/diagnostics/implements_super_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/implements_super_class_test.dart @@ -21,7 +21,7 @@ class ImplementsSuperClassTest extends PubPackageResolutionTest { class A {} class B extends A implements A {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, 40, 1)], + [error(CompileTimeErrorCode.implementsSuperClass, 40, 1)], ); } @@ -30,7 +30,7 @@ class B extends A implements A {} ''' class A implements Object {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, 19, 6)], + [error(CompileTimeErrorCode.implementsSuperClass, 19, 6)], ); } @@ -41,7 +41,7 @@ class A {} typedef B = A; class C extends A implements B {} ''', - [error(CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, 55, 1)], + [error(CompileTimeErrorCode.implementsSuperClass, 55, 1)], ); } @@ -52,7 +52,7 @@ class A {} mixin M {} class B = A with M implements A; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, 52, 1)], + [error(CompileTimeErrorCode.implementsSuperClass, 52, 1)], ); } @@ -62,7 +62,7 @@ class B = A with M implements A; mixin M {} class A = Object with M implements Object; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, 46, 6)], + [error(CompileTimeErrorCode.implementsSuperClass, 46, 6)], ); } @@ -74,7 +74,7 @@ mixin M {} typedef B = A; class C = A with M implements B; ''', - [error(CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, 67, 1)], + [error(CompileTimeErrorCode.implementsSuperClass, 67, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/implements_type_alias_expands_to_type_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/implements_type_alias_expands_to_type_parameter_test.dart index e42024aa150..977409e3f19 100644 --- a/pkg/analyzer/test/src/diagnostics/implements_type_alias_expands_to_type_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/implements_type_alias_expands_to_type_parameter_test.dart @@ -33,7 +33,7 @@ class B implements T {} ''', [ error( - CompileTimeErrorCode.IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.implementsTypeAliasExpandsToTypeParameter, 58, 1, ), @@ -58,7 +58,7 @@ class B implements T {} ''', [ error( - CompileTimeErrorCode.IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.implementsTypeAliasExpandsToTypeParameter, 58, 1, ), @@ -91,7 +91,7 @@ mixin M implements T {} ''', [ error( - CompileTimeErrorCode.IMPLEMENTS_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.implementsTypeAliasExpandsToTypeParameter, 58, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/implicit_this_reference_in_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/implicit_this_reference_in_initializer_test.dart index 9ad423a0695..e688359aa26 100644 --- a/pkg/analyzer/test/src/diagnostics/implicit_this_reference_in_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/implicit_this_reference_in_initializer_test.dart @@ -82,13 +82,7 @@ class B extends A { B() : assert(f != 0); } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 66, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 66, 1)], ); } @@ -100,13 +94,7 @@ class A { int get f => 0; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 25, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 25, 1)], ); } @@ -119,13 +107,7 @@ class A { var f; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 31, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 31, 1)], ); } @@ -149,13 +131,7 @@ class A { final y = x; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 37, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 37, 1)], ); } @@ -167,13 +143,7 @@ class A { final y = x; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 39, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 39, 1)], ); } @@ -193,13 +163,7 @@ class A { void _foo() {} } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 87, - 4, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 87, 4)], ); } @@ -212,13 +176,7 @@ class A { f() {} } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 31, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 31, 1)], ); } @@ -230,13 +188,7 @@ class A { int m() => 0; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 27, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 27, 1)], ); } @@ -294,13 +246,7 @@ class A { var f; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 39, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 39, 1)], ); } @@ -345,13 +291,7 @@ class B extends A { var f; } ''', - [ - error( - CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, - 56, - 1, - ), - ], + [error(CompileTimeErrorCode.implicitThisReferenceInInitializer, 56, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/import_deferred_library_with_load_function_test.dart b/pkg/analyzer/test/src/diagnostics/import_deferred_library_with_load_function_test.dart index b3cdaa074d2..9a4d93c772f 100644 --- a/pkg/analyzer/test/src/diagnostics/import_deferred_library_with_load_function_test.dart +++ b/pkg/analyzer/test/src/diagnostics/import_deferred_library_with_load_function_test.dart @@ -29,7 +29,7 @@ void main() { p.f(); } ''', - [error(HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION, 0, 30)], + [error(HintCode.importDeferredLibraryWithLoadFunction, 0, 30)], ); } @@ -61,7 +61,7 @@ void main() { p.f(); } ''', - [error(HintCode.IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION, 0, 38)], + [error(HintCode.importDeferredLibraryWithLoadFunction, 0, 38)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/import_internal_library_test.dart b/pkg/analyzer/test/src/diagnostics/import_internal_library_test.dart index 0390a4d0e80..448d837d8c3 100644 --- a/pkg/analyzer/test/src/diagnostics/import_internal_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/import_internal_library_test.dart @@ -27,8 +27,8 @@ class ImportInternalLibraryTest extends PubPackageResolutionTest { import 'dart:_internal'; ''', [ - error(CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, 7, 16), - error(WarningCode.UNUSED_IMPORT, 7, 16), + error(CompileTimeErrorCode.importInternalLibrary, 7, 16), + error(WarningCode.unusedImport, 7, 16), ], ); } @@ -40,7 +40,7 @@ import 'dart:_wasm'; '''); await resolveFile2(file); assertErrorsInResolvedUnit(result, [ - error(WarningCode.UNUSED_IMPORT, 7, 12), + error(WarningCode.unusedImport, 7, 12), ]); } @@ -50,8 +50,8 @@ import 'dart:_wasm'; import 'dart:_wasm'; ''', [ - error(CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, 7, 12), - error(WarningCode.UNUSED_IMPORT, 7, 12), + error(CompileTimeErrorCode.importInternalLibrary, 7, 12), + error(WarningCode.unusedImport, 7, 12), ], ); } @@ -63,7 +63,7 @@ import 'dart:_wasm'; '''); await resolveFile2(file); assertErrorsInResolvedUnit(result, [ - error(WarningCode.UNUSED_IMPORT, 7, 12), + error(WarningCode.unusedImport, 7, 12), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/import_of_non_library_test.dart b/pkg/analyzer/test/src/diagnostics/import_of_non_library_test.dart index dce32046234..cd17fbbcd52 100644 --- a/pkg/analyzer/test/src/diagnostics/import_of_non_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/import_of_non_library_test.dart @@ -26,7 +26,7 @@ import 'lib1.dart' deferred as p; ''', [ error( - CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, + CompileTimeErrorCode.importOfNonLibrary, 20, 11, messageContains: ["library 'lib1.dart' "], @@ -46,7 +46,7 @@ import 'part.dart'; ''', [ error( - CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, + CompileTimeErrorCode.importOfNonLibrary, 20, 11, messageContains: ["library 'part.dart' "], diff --git a/pkg/analyzer/test/src/diagnostics/inconsistent_inheritance_getter_and_method_test.dart b/pkg/analyzer/test/src/diagnostics/inconsistent_inheritance_getter_and_method_test.dart index ae1a8daa0a1..548c17ac4e6 100644 --- a/pkg/analyzer/test/src/diagnostics/inconsistent_inheritance_getter_and_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inconsistent_inheritance_getter_and_method_test.dart @@ -29,7 +29,7 @@ abstract class C implements A, B {} ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 85, 1, ), @@ -54,7 +54,7 @@ abstract class C with M implements I { ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 97, 1, ), @@ -75,7 +75,7 @@ abstract class C implements A, B {} ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 85, 1, ), @@ -98,7 +98,7 @@ class C = S with M; ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 70, 1, ), @@ -125,12 +125,12 @@ class C = S with M1, M2; ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 105, 1, ), error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 105, 1, ), @@ -151,7 +151,7 @@ mixin M implements A, B {} ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 76, 1, ), @@ -172,7 +172,7 @@ mixin M implements A, B {} ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 76, 1, ), @@ -193,7 +193,7 @@ mixin M on A, B {} ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 76, 1, ), @@ -214,7 +214,7 @@ mixin M on A, B {} ''', [ error( - CompileTimeErrorCode.INCONSISTENT_INHERITANCE_GETTER_AND_METHOD, + CompileTimeErrorCode.inconsistentInheritanceGetterAndMethod, 76, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/inconsistent_inheritance_test.dart b/pkg/analyzer/test/src/diagnostics/inconsistent_inheritance_test.dart index f1137c4ac5d..01e252a940f 100644 --- a/pkg/analyzer/test/src/diagnostics/inconsistent_inheritance_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inconsistent_inheritance_test.dart @@ -45,7 +45,7 @@ augment abstract class C with A {} '''); await assertErrorsInFile2(a, [ - error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 122, 1), + error(CompileTimeErrorCode.inconsistentInheritance, 122, 1), ]); await assertErrorsInFile2(b, []); await assertErrorsInFile2(c, []); @@ -81,7 +81,7 @@ augment abstract class C implements B {} '''); await assertErrorsInFile2(a, [ - error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 122, 1), + error(CompileTimeErrorCode.inconsistentInheritance, 122, 1), ]); await assertErrorsInFile2(b, []); await assertErrorsInFile2(c, []); @@ -100,7 +100,7 @@ abstract class B1 { void m(D1 d1); } abstract class B2 { void m(D2 d2); } class C extends A implements B1, B2 {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 171, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 171, 1)], ); } @@ -115,7 +115,7 @@ abstract class B { } abstract class C implements A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 94, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 94, 1)], ); } @@ -130,7 +130,7 @@ abstract class B { } abstract class C extends B implements A {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 94, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 94, 1)], ); } @@ -146,7 +146,7 @@ abstract class B { abstract class B2 extends B {} abstract class C implements A, B2 {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 125, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 125, 1)], ); } @@ -162,7 +162,7 @@ abstract class B { abstract class B2 extends B {} abstract class C extends Object with A implements B2 {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 116, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 116, 1)], ); } @@ -178,7 +178,7 @@ abstract class B { abstract class B2 extends B {} abstract class C = Object with A implements B2; ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 116, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 116, 1)], ); } @@ -194,7 +194,7 @@ mixin B { abstract class B2 extends Object with B {} abstract class C implements A, B2 {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 128, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 128, 1)], ); } @@ -210,7 +210,7 @@ mixin B { abstract class B2 extends Object with B {} abstract class C extends Object with A implements B2 {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 119, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 119, 1)], ); } @@ -228,7 +228,7 @@ abstract class C { } abstract class D implements A, B, C {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 135, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 135, 1)], ); } @@ -243,7 +243,7 @@ abstract class B { } abstract class C implements A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 86, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 86, 1)], ); } @@ -258,7 +258,7 @@ abstract class B { } abstract class C implements A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 82, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 82, 1)], ); } @@ -275,7 +275,7 @@ abstract class B { enum E implements A, B {v} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 78, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 78, 1)], ); } @@ -297,7 +297,7 @@ augment enum E implements B { augment v; } ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 78, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 78, 1)], ); } @@ -312,7 +312,7 @@ abstract class B { } mixin M implements A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 85, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 85, 1)], ); } @@ -327,7 +327,7 @@ abstract class B { } mixin M implements A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 77, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 77, 1)], ); } @@ -342,7 +342,7 @@ abstract class B { } mixin M implements A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 73, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 73, 1)], ); } @@ -357,7 +357,7 @@ abstract class B { } mixin M on A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 85, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 85, 1)], ); } @@ -372,7 +372,7 @@ abstract class B { } mixin M on A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 77, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 77, 1)], ); } @@ -387,7 +387,7 @@ abstract class B { } mixin M on A, B {} ''', - [error(CompileTimeErrorCode.INCONSISTENT_INHERITANCE, 73, 1)], + [error(CompileTimeErrorCode.inconsistentInheritance, 73, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/inconsistent_language_version_override_test.dart b/pkg/analyzer/test/src/diagnostics/inconsistent_language_version_override_test.dart index 1195bc4d898..1e835cc147a 100644 --- a/pkg/analyzer/test/src/diagnostics/inconsistent_language_version_override_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inconsistent_language_version_override_test.dart @@ -17,7 +17,7 @@ main() { @reflectiveTest class InconsistentLanguageVersionOverrideTest extends PubPackageResolutionTest { CompileTimeErrorCode get _errorCode => - CompileTimeErrorCode.INCONSISTENT_LANGUAGE_VERSION_OVERRIDE; + CompileTimeErrorCode.inconsistentLanguageVersionOverride; test_both_different() async { await _checkLibraryAndPart( diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_collection_literal_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_collection_literal_test.dart index 50b0974c7c0..3a08d8deee3 100644 --- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_collection_literal_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_collection_literal_test.dart @@ -38,13 +38,13 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 20, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 61, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 76, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 102, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 121, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 151, 1), + error(WarningCode.unusedLocalVariable, 20, 1), + error(WarningCode.unusedLocalVariable, 35, 1), + error(WarningCode.unusedLocalVariable, 61, 1), + error(WarningCode.unusedLocalVariable, 76, 1), + error(WarningCode.unusedLocalVariable, 102, 1), + error(WarningCode.unusedLocalVariable, 121, 1), + error(WarningCode.unusedLocalVariable, 151, 1), ], ); } @@ -57,8 +57,8 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 20, 1), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 49, 2), + error(WarningCode.unusedLocalVariable, 20, 1), + error(WarningCode.inferenceFailureOnCollectionLiteral, 49, 2), ], ); } @@ -69,8 +69,8 @@ void main() { void f([list = const []]) => print(list); ''', [ - error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 8, 4), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 15, 8), + error(WarningCode.inferenceFailureOnUntypedParameter, 8, 4), + error(WarningCode.inferenceFailureOnCollectionLiteral, 15, 8), ], ); } @@ -81,8 +81,8 @@ void f([list = const []]) => print(list); void f([map = const {}]) => print(map); ''', [ - error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 8, 3), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 14, 8), + error(WarningCode.inferenceFailureOnUntypedParameter, 8, 3), + error(WarningCode.inferenceFailureOnCollectionLiteral, 14, 8), ], ); } @@ -104,12 +104,12 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 30, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 53, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 85, 1), - error(WarningCode.UNUSED_ELEMENT, 172, 1), - error(WarningCode.UNUSED_ELEMENT, 194, 1), - error(WarningCode.UNUSED_ELEMENT, 221, 1), + error(WarningCode.unusedLocalVariable, 30, 1), + error(WarningCode.unusedLocalVariable, 53, 1), + error(WarningCode.unusedLocalVariable, 85, 1), + error(WarningCode.unusedElement, 172, 1), + error(WarningCode.unusedElement, 194, 1), + error(WarningCode.unusedElement, 221, 1), ], ); } @@ -124,9 +124,9 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 20, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 43, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 66, 1), + error(WarningCode.unusedLocalVariable, 20, 1), + error(WarningCode.unusedLocalVariable, 43, 1), + error(WarningCode.unusedLocalVariable, 66, 1), ], ); } @@ -136,7 +136,7 @@ void main() { r''' dynamic f() => []; ''', - [error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 15, 2)], + [error(WarningCode.inferenceFailureOnCollectionLiteral, 15, 2)], ); } @@ -159,7 +159,7 @@ void f(List? a) { var x = a ?? []; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1)], + [error(WarningCode.unusedLocalVariable, 29, 1)], ); } @@ -171,8 +171,8 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 26, 2), + error(WarningCode.unusedLocalVariable, 22, 1), + error(WarningCode.inferenceFailureOnCollectionLiteral, 26, 2), ], ); } @@ -185,8 +185,8 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 26, 2), + error(WarningCode.unusedLocalVariable, 22, 1), + error(WarningCode.inferenceFailureOnCollectionLiteral, 26, 2), ], ); } @@ -199,8 +199,8 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 20, 1), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 24, 2), + error(WarningCode.unusedLocalVariable, 20, 1), + error(WarningCode.inferenceFailureOnCollectionLiteral, 24, 2), ], ); } @@ -213,8 +213,8 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 20, 1), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 24, 2), + error(WarningCode.unusedLocalVariable, 20, 1), + error(WarningCode.inferenceFailureOnCollectionLiteral, 24, 2), ], ); } @@ -227,9 +227,9 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 20, 1), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 25, 2), - error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 29, 2), + error(WarningCode.unusedLocalVariable, 20, 1), + error(WarningCode.inferenceFailureOnCollectionLiteral, 25, 2), + error(WarningCode.inferenceFailureOnCollectionLiteral, 29, 2), ], ); } @@ -239,7 +239,7 @@ void main() { r''' var x = []; ''', - [error(WarningCode.INFERENCE_FAILURE_ON_COLLECTION_LITERAL, 8, 2)], + [error(WarningCode.inferenceFailureOnCollectionLiteral, 8, 2)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_invocation_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_invocation_test.dart index 61290cca8ca..654f9759489 100644 --- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_invocation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_invocation_test.dart @@ -35,7 +35,7 @@ void f(void Function() m) { m(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, 33, 1)], + [error(WarningCode.inferenceFailureOnFunctionInvocation, 33, 1)], ); } @@ -102,7 +102,7 @@ void f(C c) { c.m(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, 55, 1)], + [error(WarningCode.inferenceFailureOnFunctionInvocation, 55, 1)], ); } @@ -143,7 +143,7 @@ void f() { C.m(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, 52, 1)], + [error(WarningCode.inferenceFailureOnFunctionInvocation, 52, 1)], ); } @@ -155,7 +155,7 @@ void g(Fn fn) { fn(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, 51, 2)], + [error(WarningCode.inferenceFailureOnFunctionInvocation, 51, 2)], ); } @@ -178,7 +178,7 @@ void f() { g(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, 30, 1)], + [error(WarningCode.inferenceFailureOnFunctionInvocation, 30, 1)], ); } @@ -190,7 +190,7 @@ void f() { m(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, 33, 1)], + [error(WarningCode.inferenceFailureOnFunctionInvocation, 33, 1)], ); } @@ -215,7 +215,7 @@ void g() { f(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, 29, 1)], + [error(WarningCode.inferenceFailureOnFunctionInvocation, 29, 1)], ); } @@ -230,7 +230,7 @@ void g() { a.f(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_INVOCATION, 37, 1)], + [error(WarningCode.inferenceFailureOnFunctionInvocation, 37, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_return_type_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_return_type_test.dart index a9352921b47..6b807cd6e4b 100644 --- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_return_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_return_type_test.dart @@ -34,7 +34,7 @@ class C { get f => 7; } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 16, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 16, 1)], ); } @@ -45,7 +45,7 @@ class C { f() => 7; } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 12, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 12, 1)], ); } @@ -96,7 +96,7 @@ class C { operator +(int x) => print(x); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 21, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 21, 1)], ); } @@ -115,7 +115,7 @@ class C { static f() => 7; } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 19, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 19, 1)], ); } @@ -136,7 +136,7 @@ extension E on List { } } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 24, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 24, 1)], ); } @@ -147,7 +147,7 @@ void f(callback()) { callback(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 7, 10)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 7, 10)], ); } @@ -158,7 +158,7 @@ void f(void callback(callback2())) { callback(() => print('hey')); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 21, 11)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 21, 11)], ); } @@ -177,7 +177,7 @@ Function(int) f = (int n) { print(n); }; ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 0, 13)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 0, 13)], ); } @@ -198,7 +198,7 @@ class C { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 27, 1)], + [error(WarningCode.unusedElement, 27, 1)], ); } @@ -209,7 +209,7 @@ mixin C { f() => 7; } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 12, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 12, 1)], ); } @@ -224,7 +224,7 @@ set f(int x) => print(x); r''' f() => 7; ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 0, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 0, 1)], ); } @@ -235,7 +235,7 @@ f() { return 7; } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 0, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 0, 1)], ); } @@ -246,7 +246,7 @@ f() { return 7; } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 0, 1)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 0, 1)], ); } @@ -261,7 +261,7 @@ dynamic f() => 7; r''' typedef Callback(int i); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 0, 24)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 0, 24)], ); } @@ -276,7 +276,7 @@ typedef void Callback(int i); r''' typedef Callback = Function(int i); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_FUNCTION_RETURN_TYPE, 0, 35)], + [error(WarningCode.inferenceFailureOnFunctionReturnType, 0, 35)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_generic_invocation_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_generic_invocation_test.dart index f92b3d15e75..7e3ba5467ca 100644 --- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_generic_invocation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_generic_invocation_test.dart @@ -50,7 +50,7 @@ void f(void Function()? m, void Function() n) { (m ?? n)(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_GENERIC_INVOCATION, 56, 8)], + [error(WarningCode.inferenceFailureOnGenericInvocation, 56, 8)], ); } @@ -69,7 +69,7 @@ void f() { (() {})(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_GENERIC_INVOCATION, 13, 10)], + [error(WarningCode.inferenceFailureOnGenericInvocation, 13, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_instance_creation_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_instance_creation_test.dart index e68d72ff9b6..2c76a990033 100644 --- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_instance_creation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_instance_creation_test.dart @@ -34,7 +34,7 @@ void f() { HashMap.from({1: 1, 2: 2, 3: 3}); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 39, 12)], + [error(WarningCode.inferenceFailureOnInstanceCreation, 39, 12)], ); expect(result.diagnostics[0].message, contains("'HashMap.from'")); } @@ -47,7 +47,7 @@ void f() { c.HashMap.from({1: 1, 2: 2, 3: 3}); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 44, 14)], + [error(WarningCode.inferenceFailureOnInstanceCreation, 44, 14)], ); expect(result.diagnostics[0].message, contains("'c.HashMap.from'")); } @@ -60,7 +60,7 @@ void f() { HashMap(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 39, 7)], + [error(WarningCode.inferenceFailureOnInstanceCreation, 39, 7)], ); expect(result.diagnostics[0].message, contains("'HashMap'")); } @@ -73,7 +73,7 @@ void f() { c.HashMap(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 44, 9)], + [error(WarningCode.inferenceFailureOnInstanceCreation, 44, 9)], ); expect(result.diagnostics[0].message, contains("'c.HashMap'")); } @@ -95,7 +95,7 @@ void f() { E(1); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 43, 1)], + [error(WarningCode.inferenceFailureOnInstanceCreation, 43, 1)], ); } @@ -109,7 +109,7 @@ class C { @C() void f() {} ''', - [error(WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 29, 4)], + [error(WarningCode.inferenceFailureOnInstanceCreation, 29, 4)], ); } @@ -177,7 +177,7 @@ void f() { HashMap(); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 39, 7)], + [error(WarningCode.inferenceFailureOnInstanceCreation, 39, 7)], ); } @@ -199,7 +199,7 @@ void f() { import 'dart:collection'; var m = HashMap(); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_INSTANCE_CREATION, 34, 7)], + [error(WarningCode.inferenceFailureOnInstanceCreation, 34, 7)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_uninitialized_variable_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_uninitialized_variable_test.dart index 47c1a09934d..0803cacaeff 100644 --- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_uninitialized_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_uninitialized_variable_test.dart @@ -34,7 +34,7 @@ class C { var a; } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE, 16, 1)], + [error(WarningCode.inferenceFailureOnUninitializedVariable, 16, 1)], ); } @@ -72,7 +72,7 @@ class C { C(this.a); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE, 18, 1)], + [error(WarningCode.inferenceFailureOnUninitializedVariable, 18, 1)], ); } @@ -84,8 +84,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(WarningCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE, 17, 1), + error(WarningCode.unusedLocalVariable, 17, 1), + error(WarningCode.inferenceFailureOnUninitializedVariable, 17, 1), ], ); } @@ -97,7 +97,7 @@ void f() { var a = 7; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); } @@ -112,10 +112,10 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 67, 1), + error(WarningCode.unusedLocalVariable, 17, 1), + error(WarningCode.unusedLocalVariable, 34, 1), + error(WarningCode.unusedLocalVariable, 46, 1), + error(WarningCode.unusedLocalVariable, 67, 1), ], ); } @@ -127,7 +127,7 @@ class C { static var a; } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE, 23, 1)], + [error(WarningCode.inferenceFailureOnUninitializedVariable, 23, 1)], ); } @@ -136,7 +136,7 @@ class C { r''' var a; ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNINITIALIZED_VARIABLE, 4, 1)], + [error(WarningCode.inferenceFailureOnUninitializedVariable, 4, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_untyped_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_untyped_parameter_test.dart index c8b3dfac069..7fcfcf2cc59 100644 --- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_untyped_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_untyped_parameter_test.dart @@ -46,7 +46,7 @@ void fn(String cb(int x)) => print(cb(7)); r''' void fn(String cb(var x)) => print(cb(7)); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 18, 5)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 18, 5)], ); } @@ -61,7 +61,7 @@ void fn({int a = 0}) => print(a); r''' void fn({var a}) => print(a); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 9, 5)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 9, 5)], ); } @@ -76,7 +76,7 @@ void fn({var a}) {} r''' void fn(a) => print(a); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 8, 1)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 8, 1)], ); } @@ -89,7 +89,7 @@ class C { } } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 14, 5)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 14, 5)], ); } @@ -122,7 +122,7 @@ class C { C(var a) : assert(a != null); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 14, 5)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 14, 5)], ); } @@ -150,8 +150,8 @@ void fn() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), - error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 23, 5), + error(WarningCode.unusedLocalVariable, 18, 1), + error(WarningCode.inferenceFailureOnUntypedParameter, 23, 5), ], ); } @@ -193,7 +193,7 @@ class C { void fn(var a) => print(a); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 20, 5)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 20, 5)], ); } @@ -204,7 +204,7 @@ abstract class C { void fn(var a); } ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 29, 5)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 29, 5)], ); } @@ -286,7 +286,7 @@ class D extends C { r''' typedef void cb(a); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 16, 1)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 16, 1)], ); } @@ -301,7 +301,7 @@ typedef cb = void Function(int a); r''' void fn(a) => print(a); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 8, 1)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 8, 1)], ); } @@ -322,7 +322,7 @@ void fn([int a = 7]) => print(a); r''' void fn(var a) => print(a); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 8, 5)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 8, 5)], ); } @@ -331,7 +331,7 @@ void fn(var a) => print(a); r''' void fn([var a = 7]) => print(a); ''', - [error(WarningCode.INFERENCE_FAILURE_ON_UNTYPED_PARAMETER, 9, 5)], + [error(WarningCode.inferenceFailureOnUntypedParameter, 9, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/initializer_for_non_existent_field_test.dart b/pkg/analyzer/test/src/diagnostics/initializer_for_non_existent_field_test.dart index e97345993bf..df99f38d68e 100644 --- a/pkg/analyzer/test/src/diagnostics/initializer_for_non_existent_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/initializer_for_non_existent_field_test.dart @@ -27,7 +27,7 @@ A a = const A(); ''', [ error( - CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializerForNonExistentField, 24, 9, messageContains: ["'x'"], @@ -46,7 +46,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializerForNonExistentField, 36, 5, messageContains: ["'x'"], @@ -62,7 +62,7 @@ class A { A() : x = 0 {} } ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, 18, 5)], + [error(CompileTimeErrorCode.initializerForNonExistentField, 18, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/initializer_for_static_field_test.dart b/pkg/analyzer/test/src/diagnostics/initializer_for_static_field_test.dart index c0bb488e312..46ab2667a79 100644 --- a/pkg/analyzer/test/src/diagnostics/initializer_for_static_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/initializer_for_static_field_test.dart @@ -23,7 +23,7 @@ class A { A([this.x = 0]) {} } ''', - [error(CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, 32, 6)], + [error(CompileTimeErrorCode.initializerForStaticField, 32, 6)], ); } @@ -37,7 +37,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, + CompileTimeErrorCode.initializerForStaticField, 38, 5, messageContains: ["'x'"], diff --git a/pkg/analyzer/test/src/diagnostics/initializing_formal_for_non_existent_field_test.dart b/pkg/analyzer/test/src/diagnostics/initializing_formal_for_non_existent_field_test.dart index eec090a39de..f1082a332b2 100644 --- a/pkg/analyzer/test/src/diagnostics/initializing_formal_for_non_existent_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/initializing_formal_for_non_existent_field_test.dart @@ -25,7 +25,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 14, 6, ), @@ -45,7 +45,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 49, 6, ), @@ -62,7 +62,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 15, 6, ), @@ -80,7 +80,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 32, 6, ), @@ -108,11 +108,11 @@ enum E { ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 25, 6, ), - error(WarningCode.UNUSED_ELEMENT_PARAMETER, 30, 1), + error(WarningCode.unusedElementParameter, 30, 1), ], ); } @@ -127,7 +127,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 27, 6, ), @@ -146,7 +146,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 27, 6, ), diff --git a/pkg/analyzer/test/src/diagnostics/instance_access_to_static_member_test.dart b/pkg/analyzer/test/src/diagnostics/instance_access_to_static_member_test.dart index 38a52a7c3f8..51efe86bb16 100644 --- a/pkg/analyzer/test/src/diagnostics/instance_access_to_static_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/instance_access_to_static_member_test.dart @@ -28,7 +28,7 @@ f(C c) { ''', [ error( - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, 47, 1, correctionContains: "class 'C'", @@ -73,7 +73,7 @@ test(int i) { ''', [ error( - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, 71, 1, correctionContains: "class 'C'", @@ -94,7 +94,7 @@ f(A a) { ''', [ error( - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, 41, 1, correctionContains: "class 'A'", @@ -113,7 +113,7 @@ f(int a) { a.m; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 57, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 57, 1)], ); } @@ -129,7 +129,7 @@ f(A a) { ''', [ error( - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, 41, 1, correctionContains: "mixin 'A'", @@ -150,7 +150,7 @@ f(A a) { ''', [ error( - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, 44, 1, correctionContains: "class 'A'", @@ -171,7 +171,7 @@ f(A a) { ''', [ error( - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, 44, 1, correctionContains: "mixin 'A'", @@ -193,7 +193,7 @@ f(A a) { ''', [ error( - CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, + CompileTimeErrorCode.instanceAccessToStaticMember, 47, 1, correctionContains: "mixin 'A'", @@ -231,7 +231,7 @@ f(A a) { a.f; } ''', - [error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 41, 1)], + [error(CompileTimeErrorCode.instanceAccessToStaticMember, 41, 1)], ); } @@ -245,7 +245,7 @@ f(A a) { a.f; } ''', - [error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 47, 1)], + [error(CompileTimeErrorCode.instanceAccessToStaticMember, 47, 1)], ); } @@ -259,7 +259,7 @@ f(A a) { a.f = 42; } ''', - [error(CompileTimeErrorCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, 46, 1)], + [error(CompileTimeErrorCode.instanceAccessToStaticMember, 46, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/instance_member_access_from_factory_test.dart b/pkg/analyzer/test/src/diagnostics/instance_member_access_from_factory_test.dart index 8759d9f297a..feec686baca 100644 --- a/pkg/analyzer/test/src/diagnostics/instance_member_access_from_factory_test.dart +++ b/pkg/analyzer/test/src/diagnostics/instance_member_access_from_factory_test.dart @@ -27,7 +27,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, 56, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromFactory, 56, 3)], ); } @@ -46,7 +46,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, 73, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromFactory, 73, 3)], ); } @@ -62,7 +62,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, 52, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromFactory, 52, 3)], ); } @@ -78,7 +78,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, 58, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromFactory, 58, 3)], ); } @@ -95,7 +95,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, 102, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromFactory, 102, 3)], ); } @@ -111,7 +111,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_FACTORY, 47, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromFactory, 47, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/instance_member_access_from_static_test.dart b/pkg/analyzer/test/src/diagnostics/instance_member_access_from_static_test.dart index 8af047f3942..5ed1216f0b9 100644 --- a/pkg/analyzer/test/src/diagnostics/instance_member_access_from_static_test.dart +++ b/pkg/analyzer/test/src/diagnostics/instance_member_access_from_static_test.dart @@ -28,7 +28,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 75, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 75, 3)], ); } @@ -43,7 +43,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 57, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 57, 3)], ); } @@ -60,7 +60,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 77, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 77, 3)], ); } @@ -75,7 +75,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 63, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 63, 3)], ); } @@ -91,7 +91,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 107, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 107, 3)], ); } @@ -106,7 +106,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 53, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 53, 3)], ); } @@ -121,7 +121,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 57, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 57, 3)], ); } @@ -138,7 +138,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 78, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 78, 3)], ); } @@ -155,7 +155,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 74, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 74, 3)], ); } @@ -172,7 +172,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 78, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 78, 3)], ); } @@ -187,7 +187,7 @@ extension E on int { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 68, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 68, 3)], ); } @@ -202,7 +202,7 @@ extension E on int { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 64, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 64, 3)], ); } @@ -217,7 +217,7 @@ extension E on int { } } ''', - [error(CompileTimeErrorCode.INSTANCE_MEMBER_ACCESS_FROM_STATIC, 68, 3)], + [error(CompileTimeErrorCode.instanceMemberAccessFromStatic, 68, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/instantiate_abstract_class_test.dart b/pkg/analyzer/test/src/diagnostics/instantiate_abstract_class_test.dart index 3a91e38b7be..016484e9fe6 100644 --- a/pkg/analyzer/test/src/diagnostics/instantiate_abstract_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/instantiate_abstract_class_test.dart @@ -25,8 +25,8 @@ void f() { var a = const A(); }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1), - error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 64, 6), + error(WarningCode.unusedLocalVariable, 54, 1), + error(CompileTimeErrorCode.instantiateAbstractClass, 64, 6), ], ); @@ -43,8 +43,8 @@ void f() { A a = const A(); }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 49, 1), - error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 59, 1), + error(WarningCode.unusedLocalVariable, 49, 1), + error(CompileTimeErrorCode.instantiateAbstractClass, 59, 1), ], ); } @@ -57,7 +57,7 @@ void f() { new A(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 40, 6)], + [error(CompileTimeErrorCode.instantiateAbstractClass, 40, 6)], ); assertType(findNode.instanceCreation('new A'), 'A'); @@ -72,7 +72,7 @@ void f() { new B(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 52, 1)], + [error(CompileTimeErrorCode.instantiateAbstractClass, 52, 1)], ); } @@ -84,7 +84,7 @@ void f() { new A(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 37, 1)], + [error(CompileTimeErrorCode.instantiateAbstractClass, 37, 1)], ); } @@ -96,7 +96,7 @@ void f() { A(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 36, 6)], + [error(CompileTimeErrorCode.instantiateAbstractClass, 36, 6)], ); assertType(findNode.instanceCreation('A'), 'A'); @@ -111,7 +111,7 @@ void f() { B(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 48, 1)], + [error(CompileTimeErrorCode.instantiateAbstractClass, 48, 1)], ); } @@ -123,7 +123,7 @@ void f() { A(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ABSTRACT_CLASS, 33, 1)], + [error(CompileTimeErrorCode.instantiateAbstractClass, 33, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/instantiate_enum_test.dart b/pkg/analyzer/test/src/diagnostics/instantiate_enum_test.dart index bf57934be00..71ee270ac29 100644 --- a/pkg/analyzer/test/src/diagnostics/instantiate_enum_test.dart +++ b/pkg/analyzer/test/src/diagnostics/instantiate_enum_test.dart @@ -24,7 +24,7 @@ E e(String name) { return const E(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ENUM, 49, 1)], + [error(CompileTimeErrorCode.instantiateEnum, 49, 1)], ); } @@ -36,7 +36,7 @@ E e(String name) { return new E(); } ''', - [error(CompileTimeErrorCode.INSTANTIATE_ENUM, 47, 1)], + [error(CompileTimeErrorCode.instantiateEnum, 47, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/instantiate_type_alias_expands_to_type_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/instantiate_type_alias_expands_to_type_parameter_test.dart index 28bf7182b1a..624ac2f1a74 100644 --- a/pkg/analyzer/test/src/diagnostics/instantiate_type_alias_expands_to_type_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/instantiate_type_alias_expands_to_type_parameter_test.dart @@ -17,7 +17,7 @@ main() { class InstantiateTypeAliasExpandsToTypeParameterTest extends PubPackageResolutionTest { CompileTimeErrorCode get _errorCode => - CompileTimeErrorCode.INSTANTIATE_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER; + CompileTimeErrorCode.instantiateTypeAliasExpandsToTypeParameter; test_const_generic_noArguments_unnamed_typeParameter() async { await assertErrorsInCode( diff --git a/pkg/analyzer/test/src/diagnostics/integer_literal_imprecise_as_double_test.dart b/pkg/analyzer/test/src/diagnostics/integer_literal_imprecise_as_double_test.dart index 85d3c5d527b..bb52a37973a 100644 --- a/pkg/analyzer/test/src/diagnostics/integer_literal_imprecise_as_double_test.dart +++ b/pkg/analyzer/test/src/diagnostics/integer_literal_imprecise_as_double_test.dart @@ -23,7 +23,7 @@ class IntegerLiteralImpreciseAsDoubleTest extends PubPackageResolutionTest { '000000000000000000000000000000000000000000000000000000;', [ error( - CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE, + CompileTimeErrorCode.integerLiteralImpreciseAsDouble, 11, 259, correctionContains: @@ -45,7 +45,7 @@ double x = 9223372036854775809; ''', [ error( - CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE, + CompileTimeErrorCode.integerLiteralImpreciseAsDouble, 11, 19, // We suggest a valid double instead. @@ -62,7 +62,7 @@ double x = 9_223_372_036_854_775_809; ''', [ error( - CompileTimeErrorCode.INTEGER_LITERAL_IMPRECISE_AS_DOUBLE, + CompileTimeErrorCode.integerLiteralImpreciseAsDouble, 11, 25, // We suggest a valid double instead. diff --git a/pkg/analyzer/test/src/diagnostics/integer_literal_out_of_range_test.dart b/pkg/analyzer/test/src/diagnostics/integer_literal_out_of_range_test.dart index b6592707446..ac1a81b6e67 100644 --- a/pkg/analyzer/test/src/diagnostics/integer_literal_out_of_range_test.dart +++ b/pkg/analyzer/test/src/diagnostics/integer_literal_out_of_range_test.dart @@ -22,7 +22,7 @@ int x = 0xFFFF_FFFF_FFFF_FFFF_FFFF; ''', [ error( - CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE, + CompileTimeErrorCode.integerLiteralOutOfRange, 8, 26, messageContains: [RegExp('0xFFFF_FFFF_FFFF_FFFF_FFFF')], @@ -36,7 +36,7 @@ int x = 0xFFFF_FFFF_FFFF_FFFF_FFFF; ''' int x = -9223372036854775809; ''', - [error(CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE, 9, 19)], + [error(CompileTimeErrorCode.integerLiteralOutOfRange, 9, 19)], ); } @@ -45,7 +45,7 @@ int x = -9223372036854775809; ''' int x = 9223372036854775808; ''', - [error(CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE, 8, 19)], + [error(CompileTimeErrorCode.integerLiteralOutOfRange, 8, 19)], ); } @@ -56,7 +56,7 @@ int x = 9_223_372_036_854_775_808; ''', [ error( - CompileTimeErrorCode.INTEGER_LITERAL_OUT_OF_RANGE, + CompileTimeErrorCode.integerLiteralOutOfRange, 8, 25, messageContains: [RegExp('9_223_372_036_854_775_808')], diff --git a/pkg/analyzer/test/src/diagnostics/interface_class_extended_outside_of_library_test.dart b/pkg/analyzer/test/src/diagnostics/interface_class_extended_outside_of_library_test.dart index 5f728b7b2e1..bc20e232e6e 100644 --- a/pkg/analyzer/test/src/diagnostics/interface_class_extended_outside_of_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/interface_class_extended_outside_of_library_test.dart @@ -35,7 +35,7 @@ class Bar extends Foo {} ''', [ error( - CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.interfaceClassExtendedOutsideOfLibrary, 37, 3, ), @@ -56,7 +56,7 @@ class Bar extends FooTypedef {} ''', [ error( - CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.interfaceClassExtendedOutsideOfLibrary, 37, 10, ), @@ -77,7 +77,7 @@ class Bar extends FooTypedef {} ''', [ error( - CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.interfaceClassExtendedOutsideOfLibrary, 63, 10, ), diff --git a/pkg/analyzer/test/src/diagnostics/invalid_annotation_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_annotation_from_deferred_library_test.dart index 9bb1f79375c..028e18219bd 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_annotation_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_annotation_from_deferred_library_test.dart @@ -27,13 +27,7 @@ library root; import 'lib1.dart' deferred as a; @a.C() main () {} ''', - [ - error( - CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, - 49, - 3, - ), - ], + [error(CompileTimeErrorCode.invalidAnnotationFromDeferredLibrary, 49, 3)], ); } @@ -51,7 +45,7 @@ class C { const C(int i); } [ error( CompileTimeErrorCode - .INVALID_ANNOTATION_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, + .invalidAnnotationConstantValueFromDeferredLibrary, 81, 1, ), @@ -71,13 +65,7 @@ library root; import 'lib1.dart' deferred as a; @a.v main () {} ''', - [ - error( - CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, - 49, - 3, - ), - ], + [error(CompileTimeErrorCode.invalidAnnotationFromDeferredLibrary, 49, 3)], ); } @@ -92,13 +80,7 @@ library root; import 'lib1.dart' deferred as a; @a.C.name() main () {} ''', - [ - error( - CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, - 49, - 3, - ), - ], + [error(CompileTimeErrorCode.invalidAnnotationFromDeferredLibrary, 49, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_annotation_target_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_annotation_target_test.dart index 58c40d4e322..34ff9135e70 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_annotation_target_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_annotation_target_test.dart @@ -78,7 +78,7 @@ class A { static int f = 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 16)], + [error(WarningCode.invalidAnnotationTarget, 46, 16)], ); } @@ -91,7 +91,7 @@ class A { static int get f => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 16)], + [error(WarningCode.invalidAnnotationTarget, 46, 16)], ); } @@ -104,7 +104,7 @@ class A { static void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 16)], + [error(WarningCode.invalidAnnotationTarget, 46, 16)], ); } @@ -117,7 +117,7 @@ class A { static void set f(int value) {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 16)], + [error(WarningCode.invalidAnnotationTarget, 46, 16)], ); } @@ -131,7 +131,7 @@ class C { C(); } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 47, 16)], + [error(WarningCode.invalidAnnotationTarget, 47, 16)], ); } @@ -146,7 +146,7 @@ enum E { void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 58, 16)], + [error(WarningCode.invalidAnnotationTarget, 58, 16)], ); } @@ -160,7 +160,7 @@ extension E on String { void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 61, 16)], + [error(WarningCode.invalidAnnotationTarget, 61, 16)], ); } @@ -183,7 +183,7 @@ import 'package:meta/meta.dart'; @mustBeOverridden void m() {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 35, 16)], + [error(WarningCode.invalidAnnotationTarget, 35, 16)], ); } } @@ -250,7 +250,7 @@ class A { static int f = 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 13)], + [error(WarningCode.invalidAnnotationTarget, 46, 13)], ); } @@ -263,7 +263,7 @@ class A { static int get f => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 13)], + [error(WarningCode.invalidAnnotationTarget, 46, 13)], ); } @@ -276,7 +276,7 @@ class A { static void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 13)], + [error(WarningCode.invalidAnnotationTarget, 46, 13)], ); } @@ -289,7 +289,7 @@ class A { static void set f(int value) {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 13)], + [error(WarningCode.invalidAnnotationTarget, 46, 13)], ); } @@ -303,7 +303,7 @@ class C { C(); } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 47, 13)], + [error(WarningCode.invalidAnnotationTarget, 47, 13)], ); } @@ -318,7 +318,7 @@ enum E { void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 58, 13)], + [error(WarningCode.invalidAnnotationTarget, 58, 13)], ); } @@ -332,7 +332,7 @@ extension E on String { void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 61, 13)], + [error(WarningCode.invalidAnnotationTarget, 61, 13)], ); } @@ -355,7 +355,7 @@ import 'package:meta/meta.dart'; @mustCallSuper void m() {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 35, 13)], + [error(WarningCode.invalidAnnotationTarget, 35, 13)], ); } } @@ -378,7 +378,7 @@ class C { void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 47, 9)], + [error(WarningCode.invalidAnnotationTarget, 47, 9)], ); } @@ -441,7 +441,7 @@ extension type E(C c) { static int get g => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 100, 9)], + [error(WarningCode.invalidAnnotationTarget, 100, 9)], ); } @@ -459,7 +459,7 @@ extension type E(C c) { static void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 95, 9)], + [error(WarningCode.invalidAnnotationTarget, 95, 9)], ); } @@ -477,7 +477,7 @@ extension type E(C c) { static set g(int i) {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 99, 9)], + [error(WarningCode.invalidAnnotationTarget, 99, 9)], ); } } @@ -535,7 +535,7 @@ class A { @A() mixin M {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 98, 1)], + [error(WarningCode.invalidAnnotationTarget, 98, 1)], ); } @@ -552,7 +552,7 @@ class A { @A() int x = 0; ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 98, 1)], + [error(WarningCode.invalidAnnotationTarget, 98, 1)], ); } @@ -571,7 +571,7 @@ const a = A(); @a int x = 0; ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 114, 1)], + [error(WarningCode.invalidAnnotationTarget, 114, 1)], ); } @@ -604,7 +604,7 @@ class C { @A() void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 112, 1)], + [error(WarningCode.invalidAnnotationTarget, 112, 1)], ); } @@ -621,7 +621,7 @@ class A { @A() class C {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 98, 1)], + [error(WarningCode.invalidAnnotationTarget, 98, 1)], ); } @@ -652,7 +652,7 @@ class A { @A() class C {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 97, 1)], + [error(WarningCode.invalidAnnotationTarget, 97, 1)], ); } @@ -699,7 +699,7 @@ class C { @A() int f = 7; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 110, 1)], + [error(WarningCode.invalidAnnotationTarget, 110, 1)], ); } @@ -716,7 +716,7 @@ class A { @A() class C {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 98, 1)], + [error(WarningCode.invalidAnnotationTarget, 98, 1)], ); } @@ -793,7 +793,7 @@ class C { int M(int x) => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 109, 1)], + [error(WarningCode.invalidAnnotationTarget, 109, 1)], ); } @@ -810,7 +810,7 @@ class A { @A() int get x => 0; ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 97, 1)], + [error(WarningCode.invalidAnnotationTarget, 97, 1)], ); } @@ -827,7 +827,7 @@ class A { @A() set x(_x) {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 97, 1)], + [error(WarningCode.invalidAnnotationTarget, 97, 1)], ); } @@ -862,7 +862,7 @@ class C { int m(int x) => x; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 107, 1)], + [error(WarningCode.invalidAnnotationTarget, 107, 1)], ); } @@ -881,7 +881,7 @@ class C { set x(int _x) {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 107, 1)], + [error(WarningCode.invalidAnnotationTarget, 107, 1)], ); } @@ -912,7 +912,7 @@ class A { @A() class C {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 96, 1)], + [error(WarningCode.invalidAnnotationTarget, 96, 1)], ); } @@ -957,7 +957,7 @@ class C { int get x => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 107, 1)], + [error(WarningCode.invalidAnnotationTarget, 107, 1)], ); } @@ -1008,7 +1008,7 @@ class C { set x(int _x) {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 107, 1)], + [error(WarningCode.invalidAnnotationTarget, 107, 1)], ); } @@ -1025,7 +1025,7 @@ class A { @A() int f(int x) => x; ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 95, 1)], + [error(WarningCode.invalidAnnotationTarget, 95, 1)], ); } @@ -1042,7 +1042,7 @@ class A { @A() class C {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 98, 1)], + [error(WarningCode.invalidAnnotationTarget, 98, 1)], ); } @@ -1073,7 +1073,7 @@ class A { @A() int x = 0; ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 117, 1)], + [error(WarningCode.invalidAnnotationTarget, 117, 1)], ); } @@ -1132,7 +1132,7 @@ class A { void f({@A() required int x}) {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 114, 1)], + [error(WarningCode.invalidAnnotationTarget, 114, 1)], ); } @@ -1148,7 +1148,7 @@ class A { void f(@A() int x) {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 113, 1)], + [error(WarningCode.invalidAnnotationTarget, 113, 1)], ); } @@ -1167,7 +1167,7 @@ class C { C(); } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 118, 1)], + [error(WarningCode.invalidAnnotationTarget, 118, 1)], ); } @@ -1219,7 +1219,7 @@ enum E { int x() => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 129, 1)], + [error(WarningCode.invalidAnnotationTarget, 129, 1)], ); } @@ -1238,7 +1238,7 @@ extension E on int { int x() => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 129, 1)], + [error(WarningCode.invalidAnnotationTarget, 129, 1)], ); } @@ -1305,7 +1305,7 @@ class C { static int x() => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 118, 1)], + [error(WarningCode.invalidAnnotationTarget, 118, 1)], ); } @@ -1322,7 +1322,7 @@ class A { @A() void f(int x) {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 98, 1)], + [error(WarningCode.invalidAnnotationTarget, 98, 1)], ); } @@ -1354,7 +1354,7 @@ class C { int get x => 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 107, 1)], + [error(WarningCode.invalidAnnotationTarget, 107, 1)], ); } @@ -1373,7 +1373,7 @@ class C { int m(int x) => x; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 107, 1)], + [error(WarningCode.invalidAnnotationTarget, 107, 1)], ); } @@ -1422,7 +1422,7 @@ class B { int f = 0; } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 117, 1)], + [error(WarningCode.invalidAnnotationTarget, 117, 1)], ); } @@ -1498,7 +1498,7 @@ class A { extension on C {} class C {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 93, 1)], + [error(WarningCode.invalidAnnotationTarget, 93, 1)], ); } @@ -1556,7 +1556,7 @@ class A { void f(@A() p) {} ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 109, 1)], + [error(WarningCode.invalidAnnotationTarget, 109, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_annotation_test.dart index 9a015e8679e..d0628486cdb 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_annotation_test.dart @@ -25,7 +25,7 @@ class A { @A void f() {} ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 32, 2)], + [error(CompileTimeErrorCode.invalidAnnotation, 32, 2)], ); } @@ -39,7 +39,7 @@ class A { @A.foo void f() {} ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 38, 6)], + [error(CompileTimeErrorCode.invalidAnnotation, 38, 6)], ); } @@ -53,7 +53,7 @@ class A { @A.foo() void f() {} ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 38, 8)], + [error(CompileTimeErrorCode.invalidAnnotation, 38, 8)], ); } @@ -65,7 +65,7 @@ get V => 0; main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 12, 2)], + [error(CompileTimeErrorCode.invalidAnnotation, 12, 2)], ); } @@ -81,7 +81,7 @@ import 'lib.dart' as p; main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 24, 4)], + [error(CompileTimeErrorCode.invalidAnnotation, 24, 4)], ); } @@ -97,7 +97,7 @@ import 'lib.dart' as p; main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 24, 4)], + [error(CompileTimeErrorCode.invalidAnnotation, 24, 4)], ); } @@ -113,7 +113,7 @@ import 'lib.dart' as p; main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 24, 4)], + [error(CompileTimeErrorCode.invalidAnnotation, 24, 4)], ); } @@ -136,7 +136,7 @@ void f() { var b; // ignore:unused_local_variable } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 28, 5)], + [error(CompileTimeErrorCode.invalidAnnotation, 28, 5)], ); } @@ -149,7 +149,7 @@ void f() { var b; // ignore:unused_local_variable } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 28, 2)], + [error(CompileTimeErrorCode.invalidAnnotation, 28, 2)], ); } @@ -169,7 +169,7 @@ import 'annotations.dart' as pref; main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 35, 19)], + [error(CompileTimeErrorCode.invalidAnnotation, 35, 19)], ); } @@ -187,7 +187,7 @@ const Property property = const Property(42); main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 116, 14)], + [error(CompileTimeErrorCode.invalidAnnotation, 116, 14)], ); } @@ -199,7 +199,7 @@ final V = 0; main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 13, 2)], + [error(CompileTimeErrorCode.invalidAnnotation, 13, 2)], ); } @@ -211,7 +211,7 @@ typedef V(); main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 13, 2)], + [error(CompileTimeErrorCode.invalidAnnotation, 13, 2)], ); } @@ -223,7 +223,7 @@ import 'dart:math' as p; @p.sin(0) class B {} ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 26, 9)], + [error(CompileTimeErrorCode.invalidAnnotation, 26, 9)], ); } @@ -235,7 +235,7 @@ import 'dart:math' as p; @p.sin.cos(0) class B {} ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 26, 13)], + [error(CompileTimeErrorCode.invalidAnnotation, 26, 13)], ); } @@ -249,7 +249,7 @@ class A { main() { } ''', - [error(CompileTimeErrorCode.INVALID_ANNOTATION, 28, 4)], + [error(CompileTimeErrorCode.invalidAnnotation, 28, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart index 65050cb41b3..ffeb6038b83 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_assignment_test.dart @@ -27,7 +27,7 @@ class C { String Function(String) f = C(); ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 76, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 76, 3)], ); } @@ -45,7 +45,7 @@ void Function(bool, String) f = C(7); // The type arguments of the instance of `C` should be accurate and be // taken into account when evaluating the assignment of the implicit call // reference. - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 86, 4), + error(CompileTimeErrorCode.invalidAssignment, 86, 4), ], ); } @@ -59,7 +59,7 @@ class C { void Function() f = C(); ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 56, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 56, 3)], ); } @@ -73,7 +73,7 @@ class C { int Function(int) f = C(); ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 72, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 72, 3)], ); } @@ -87,7 +87,7 @@ enum E implements J { } I x = E.v; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 56, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 56, 3)], ); } @@ -101,9 +101,9 @@ void f(A a) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 61, 1), + error(WarningCode.unusedLocalVariable, 61, 1), error( - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, 65, 1, messageContains: ['A', 'A'], @@ -122,9 +122,9 @@ void f(A a) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 1), + error(WarningCode.unusedLocalVariable, 56, 1), error( - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, 60, 1, messageContains: ['A', 'A'], @@ -143,9 +143,9 @@ void f(A a) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 55, 1), + error(WarningCode.unusedLocalVariable, 55, 1), error( - CompileTimeErrorCode.INVALID_ASSIGNMENT, + CompileTimeErrorCode.invalidAssignment, 59, 1, messageContains: ['A', 'A'], @@ -161,7 +161,7 @@ class C {} Function f = C(); ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 25, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 25, 3)], ); } @@ -172,7 +172,7 @@ class C {} String Function(String) f = C(); ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 40, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 40, 3)], ); } @@ -185,7 +185,7 @@ class C { void Function(String) f = C(); ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 61, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 61, 3)], ); } @@ -199,7 +199,7 @@ class D { U f = C(); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 72, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 72, 3)], ); } @@ -213,7 +213,7 @@ class D { U f = C(); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 82, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 82, 3)], ); } @@ -423,7 +423,7 @@ f() { g = () => 0; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -435,7 +435,7 @@ void f(int a) { String v = (a)..isEven; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 64, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 64, 1)], ); } @@ -454,8 +454,8 @@ void main() { } ''', [ - error(WarningCode.UNUSED_FIELD, 19, 6), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 116, 1), + error(WarningCode.unusedField, 19, 6), + error(WarningCode.unusedLocalVariable, 116, 1), ], ); } @@ -489,7 +489,7 @@ class C { C Function(String) g = C.new; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 49, 10)], + [error(CompileTimeErrorCode.invalidAssignment, 49, 10)], ); } @@ -499,7 +499,7 @@ C Function(String) g = C.new; f({String x = 0}) { } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 14, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 14, 1)], ); } @@ -514,7 +514,7 @@ f({String x = '0'}) { r''' f([String x = 0]) { }''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 14, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 14, 1)], ); } @@ -532,7 +532,7 @@ class C { String x = (() => 5)(); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 23, 11)], + [error(CompileTimeErrorCode.invalidAssignment, 23, 11)], ); } @@ -549,7 +549,7 @@ U Function(U) foo = f; T f(T a) => a; U Function(U, int) foo = f; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 46, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 46, 1)], ); } @@ -566,7 +566,7 @@ int Function(int) foo = f; T f(T a) => a; int Function(int, int) foo = f; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 47, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 47, 1)], ); } @@ -612,7 +612,7 @@ void f(T a) {} void Function(String) g = f; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 45, 6)], + [error(CompileTimeErrorCode.invalidAssignment, 45, 6)], ); } @@ -624,7 +624,7 @@ void f(int i) { d ??= i; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 37, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 37, 1)], ); } @@ -736,7 +736,7 @@ f(var y) { } } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 80, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 80, 1)], ); } @@ -749,7 +749,7 @@ f() { x = y; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -760,7 +760,7 @@ void f(Never x) { x = null; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 24, 4)], + [error(CompileTimeErrorCode.invalidAssignment, 24, 4)], ); } @@ -773,8 +773,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 21, 3), + error(WarningCode.unusedLocalVariable, 12, 1), + error(CompileTimeErrorCode.invalidAssignment, 21, 3), ], ); } @@ -789,7 +789,7 @@ f(var y) { } } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 44, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 44, 1)], ); } @@ -801,7 +801,7 @@ void f(int a) { String v = (a); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 64, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 64, 1)], ); } @@ -818,7 +818,7 @@ f(A a) { a++; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 65, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 65, 3)], ); } @@ -851,7 +851,7 @@ f(C c) { c.a++; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 91, 5)], + [error(CompileTimeErrorCode.invalidAssignment, 91, 5)], ); } @@ -884,7 +884,7 @@ f(A a) { ++a; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 65, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 65, 3)], ); } @@ -917,7 +917,7 @@ f(C c) { ++c.a; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 91, 5)], + [error(CompileTimeErrorCode.invalidAssignment, 91, 5)], ); } @@ -955,10 +955,10 @@ void f(X x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 127, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 140, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 153, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 167, 1), + error(WarningCode.unusedLocalVariable, 127, 1), + error(WarningCode.unusedLocalVariable, 140, 1), + error(WarningCode.unusedLocalVariable, 153, 2), + error(WarningCode.unusedLocalVariable, 167, 1), ], ); } @@ -971,7 +971,7 @@ void f() { print(r); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 28, 12)], + [error(CompileTimeErrorCode.invalidAssignment, 28, 12)], ); } @@ -982,7 +982,7 @@ void f((int a, int b) r) { r = (a: 1, b: 2); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 33, 12)], + [error(CompileTimeErrorCode.invalidAssignment, 33, 12)], ); } @@ -996,7 +996,7 @@ class C { (int, int)? r; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 22, 12)], + [error(CompileTimeErrorCode.invalidAssignment, 22, 12)], ); } @@ -1008,7 +1008,7 @@ class C { T t = int; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 21, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 21, 3)], ); } @@ -1022,7 +1022,7 @@ f() { A.x = '0'; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 46, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 46, 3)], ); } @@ -1038,7 +1038,7 @@ f(var y) { } } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 74, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 74, 1)], ); } @@ -1051,7 +1051,7 @@ void f() { x = null; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 37, 4)], + [error(CompileTimeErrorCode.invalidAssignment, 37, 4)], ); } @@ -1060,7 +1060,7 @@ void f() { ''' int x = 'string'; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 8, 8)], + [error(CompileTimeErrorCode.invalidAssignment, 8, 8)], ); } @@ -1075,7 +1075,7 @@ class B { } } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 58, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 58, 1)], ); } @@ -1094,7 +1094,7 @@ void f(X x) { } } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 131, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 131, 1)], ); } @@ -1105,7 +1105,7 @@ class A { int x = 'string'; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 20, 8)], + [error(CompileTimeErrorCode.invalidAssignment, 20, 8)], ); } @@ -1127,7 +1127,7 @@ main() { print(n); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 218, 7)], + [error(CompileTimeErrorCode.invalidAssignment, 218, 7)], ); } } @@ -1141,7 +1141,7 @@ class InvalidAssignmentWithStrictCastsTest extends PubPackageResolutionTest dynamic a; void Function(int i) f = a; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 36, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 36, 1)], ); } @@ -1151,7 +1151,7 @@ void Function(int i) f = a; dynamic a; int b = a; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 19, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 19, 1)], ); } @@ -1161,7 +1161,7 @@ int b = a; dynamic a; (int i, ) r = a; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 25, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 25, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_await_not_required_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_await_not_required_annotation_test.dart index 4ad1204b44d..0669b6dd895 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_await_not_required_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_await_not_required_annotation_test.dart @@ -30,7 +30,7 @@ class C { var x = 0; } ''', - [error(WarningCode.INVALID_AWAIT_NOT_REQUIRED_ANNOTATION, 69, 5)], + [error(WarningCode.invalidAwaitNotRequiredAnnotation, 69, 5)], ); } @@ -43,7 +43,7 @@ class C { int x = 0; } ''', - [error(WarningCode.INVALID_AWAIT_NOT_REQUIRED_ANNOTATION, 69, 5)], + [error(WarningCode.invalidAwaitNotRequiredAnnotation, 69, 5)], ); } @@ -54,7 +54,7 @@ import 'package:meta/meta.dart'; @awaitNotRequired void f() {} ''', - [error(WarningCode.INVALID_AWAIT_NOT_REQUIRED_ANNOTATION, 34, 16)], + [error(WarningCode.invalidAwaitNotRequiredAnnotation, 34, 16)], ); } @@ -67,7 +67,7 @@ class C { void f() {} } ''', - [error(WarningCode.INVALID_AWAIT_NOT_REQUIRED_ANNOTATION, 46, 16)], + [error(WarningCode.invalidAwaitNotRequiredAnnotation, 46, 16)], ); } @@ -84,7 +84,7 @@ class D extends C { f() {} } ''', - [error(WarningCode.INVALID_AWAIT_NOT_REQUIRED_ANNOTATION, 82, 16)], + [error(WarningCode.invalidAwaitNotRequiredAnnotation, 82, 16)], ); } @@ -95,7 +95,7 @@ import 'package:meta/meta.dart'; @awaitNotRequired int x = 0; ''', - [error(WarningCode.INVALID_AWAIT_NOT_REQUIRED_ANNOTATION, 55, 5)], + [error(WarningCode.invalidAwaitNotRequiredAnnotation, 55, 5)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_constant_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_constant_test.dart index cc8176371b4..69bab13106f 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_constant_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_constant_test.dart @@ -44,7 +44,7 @@ class A { const A(int _); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 87, 1)], + [error(CompileTimeErrorCode.invalidConstant, 87, 1)], ); } @@ -55,7 +55,7 @@ class A { const A(int i) : assert(i.isNegative); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 36, 12)], + [error(CompileTimeErrorCode.invalidConstant, 36, 12)], ); } @@ -66,7 +66,7 @@ class A { const A(int i) : assert(i < 0, 'isNegative = ${i.isNegative}'); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 59, 12)], + [error(CompileTimeErrorCode.invalidConstant, 59, 12)], ); } @@ -79,7 +79,7 @@ class A { const A() : a = C; } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 63, 1)], + [error(CompileTimeErrorCode.invalidConstant, 63, 1)], ); } @@ -105,7 +105,7 @@ class A { const A() : x = a.c; } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 91, 3)], + [error(CompileTimeErrorCode.invalidConstant, 91, 3)], ); } @@ -123,7 +123,7 @@ class A { const A() : x = a.c + 1; } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 91, 3)], + [error(CompileTimeErrorCode.invalidConstant, 91, 3)], ); } @@ -141,7 +141,7 @@ class A { const A() : this.named(a.c); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 103, 3)], + [error(CompileTimeErrorCode.invalidConstant, 103, 3)], ); } @@ -161,7 +161,7 @@ class B extends A { const B() : super(a.c); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 114, 3)], + [error(CompileTimeErrorCode.invalidConstant, 114, 3)], ); } @@ -178,9 +178,9 @@ class B { var b = const B(); ''', [ - error(CompileTimeErrorCode.INVALID_CONSTANT, 47, 7), + error(CompileTimeErrorCode.invalidConstant, 47, 7), error( - CompileTimeErrorCode.INVALID_CONSTANT, + CompileTimeErrorCode.invalidConstant, 77, 9, contextMessages: [ @@ -206,7 +206,7 @@ class A { const A() : this.named(C); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 71, 1)], + [error(CompileTimeErrorCode.invalidConstant, 71, 1)], ); } @@ -221,7 +221,7 @@ class B extends A { const B() : super(C); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 82, 1)], + [error(CompileTimeErrorCode.invalidConstant, 82, 1)], ); } @@ -238,7 +238,7 @@ void main() { const Foo(bar: data); } ''', - [error(CompileTimeErrorCode.INVALID_CONSTANT, 148, 4)], + [error(CompileTimeErrorCode.invalidConstant, 148, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_constructor_name_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_constructor_name_test.dart index b9355af35af..0a832dc95b6 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_constructor_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_constructor_name_test.dart @@ -24,7 +24,7 @@ class A { } class B {} ''', - [error(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 12, 1)], + [error(ParserErrorCode.invalidConstructorName, 12, 1)], ); } @@ -37,7 +37,7 @@ class B { B.foo(); } ''', - [error(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 23, 1)], + [error(ParserErrorCode.invalidConstructorName, 23, 1)], ); } @@ -51,7 +51,7 @@ class B { B(); } ''', - [error(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 24, 1)], + [error(ParserErrorCode.invalidConstructorName, 24, 1)], ); } @@ -62,7 +62,7 @@ class A { B() : super(); } ''', - [error(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 12, 1)], + [error(ParserErrorCode.invalidConstructorName, 12, 1)], ); } @@ -78,8 +78,8 @@ enum E { } ''', [ - error(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 40, 1), - error(WarningCode.UNUSED_ELEMENT, 59, 3), + error(ParserErrorCode.invalidConstructorName, 40, 1), + error(WarningCode.unusedElement, 59, 3), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_deprecated_extend_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_deprecated_extend_annotation_test.dart index d81fb6ece51..24e10ea428c 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_deprecated_extend_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_deprecated_extend_annotation_test.dart @@ -28,7 +28,7 @@ class C {} @Deprecated.extend() final class C {} ''', - [error(WarningCode.INVALID_DEPRECATED_EXTEND_ANNOTATION, 1, 17)], + [error(WarningCode.invalidDeprecatedExtendAnnotation, 1, 17)], ); } @@ -38,7 +38,7 @@ final class C {} @Deprecated.extend() interface class C {} ''', - [error(WarningCode.INVALID_DEPRECATED_EXTEND_ANNOTATION, 1, 17)], + [error(WarningCode.invalidDeprecatedExtendAnnotation, 1, 17)], ); } @@ -50,7 +50,7 @@ class C { C._(); } ''', - [error(WarningCode.INVALID_DEPRECATED_EXTEND_ANNOTATION, 1, 17)], + [error(WarningCode.invalidDeprecatedExtendAnnotation, 1, 17)], ); } @@ -60,7 +60,7 @@ class C { @Deprecated.extend() sealed class C {} ''', - [error(WarningCode.INVALID_DEPRECATED_EXTEND_ANNOTATION, 1, 17)], + [error(WarningCode.invalidDeprecatedExtendAnnotation, 1, 17)], ); } @@ -78,7 +78,7 @@ class C = Object with M; @Deprecated.extend() mixin M {} ''', - [error(WarningCode.INVALID_DEPRECATED_EXTEND_ANNOTATION, 1, 17)], + [error(WarningCode.invalidDeprecatedExtendAnnotation, 1, 17)], ); } @@ -97,7 +97,7 @@ enum E { one; } @Deprecated.extend() typedef F = E; ''', - [error(WarningCode.INVALID_DEPRECATED_EXTEND_ANNOTATION, 17, 17)], + [error(WarningCode.invalidDeprecatedExtendAnnotation, 17, 17)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_deprecated_implement_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_deprecated_implement_annotation_test.dart index b556be38ce5..a9c457b12b5 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_deprecated_implement_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_deprecated_implement_annotation_test.dart @@ -29,7 +29,7 @@ class C {} @Deprecated.implement() base class C {} ''', - [error(WarningCode.INVALID_DEPRECATED_IMPLEMENT_ANNOTATION, 1, 20)], + [error(WarningCode.invalidDeprecatedImplementAnnotation, 1, 20)], ); } @@ -39,7 +39,7 @@ base class C {} @Deprecated.implement() final class C {} ''', - [error(WarningCode.INVALID_DEPRECATED_IMPLEMENT_ANNOTATION, 1, 20)], + [error(WarningCode.invalidDeprecatedImplementAnnotation, 1, 20)], ); } @@ -49,7 +49,7 @@ final class C {} @Deprecated.implement() sealed class C {} ''', - [error(WarningCode.INVALID_DEPRECATED_IMPLEMENT_ANNOTATION, 1, 20)], + [error(WarningCode.invalidDeprecatedImplementAnnotation, 1, 20)], ); } @@ -67,7 +67,7 @@ class C = Object with M; @Deprecated.implement() void f() {} ''', - [error(WarningCode.INVALID_DEPRECATED_IMPLEMENT_ANNOTATION, 1, 20)], + [error(WarningCode.invalidDeprecatedImplementAnnotation, 1, 20)], ); } @@ -84,7 +84,7 @@ mixin M {} @Deprecated.implement() base mixin M {} ''', - [error(WarningCode.INVALID_DEPRECATED_IMPLEMENT_ANNOTATION, 1, 20)], + [error(WarningCode.invalidDeprecatedImplementAnnotation, 1, 20)], ); } @@ -103,7 +103,7 @@ enum E { one; } @Deprecated.implement() typedef F = E; ''', - [error(WarningCode.INVALID_DEPRECATED_IMPLEMENT_ANNOTATION, 17, 20)], + [error(WarningCode.invalidDeprecatedImplementAnnotation, 17, 20)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_deprecated_subclass_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_deprecated_subclass_annotation_test.dart index 9dc4a076484..806a4f48559 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_deprecated_subclass_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_deprecated_subclass_annotation_test.dart @@ -28,7 +28,7 @@ class C {} @Deprecated.subclass() final class C {} ''', - [error(WarningCode.INVALID_DEPRECATED_SUBCLASS_ANNOTATION, 1, 19)], + [error(WarningCode.invalidDeprecatedSubclassAnnotation, 1, 19)], ); } @@ -38,7 +38,7 @@ final class C {} @Deprecated.subclass() sealed class C {} ''', - [error(WarningCode.INVALID_DEPRECATED_SUBCLASS_ANNOTATION, 1, 19)], + [error(WarningCode.invalidDeprecatedSubclassAnnotation, 1, 19)], ); } @@ -48,7 +48,7 @@ sealed class C {} @Deprecated.subclass() enum E { one; } ''', - [error(WarningCode.INVALID_DEPRECATED_SUBCLASS_ANNOTATION, 1, 19)], + [error(WarningCode.invalidDeprecatedSubclassAnnotation, 1, 19)], ); } @@ -65,7 +65,7 @@ mixin M {} @Deprecated.subclass() base mixin M {} ''', - [error(WarningCode.INVALID_DEPRECATED_SUBCLASS_ANNOTATION, 1, 19)], + [error(WarningCode.invalidDeprecatedSubclassAnnotation, 1, 19)], ); } @@ -84,7 +84,7 @@ final class C {} @Deprecated.subclass() typedef D = C; ''', - [error(WarningCode.INVALID_DEPRECATED_SUBCLASS_ANNOTATION, 18, 19)], + [error(WarningCode.invalidDeprecatedSubclassAnnotation, 18, 19)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_do_not_submit_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_do_not_submit_test.dart index 01967cccb15..15dbfc2510b 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_do_not_submit_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_do_not_submit_test.dart @@ -44,7 +44,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 31, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 31, 1), ]); } @@ -69,7 +69,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 31, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 31, 1), ]); } @@ -169,7 +169,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 39, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 39, 1), ]); } @@ -193,7 +193,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 33, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 33, 1), ]); } @@ -217,7 +217,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 33, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 33, 1), ]); } @@ -237,7 +237,7 @@ void b() => a(); await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 30, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 30, 1), ]); } @@ -262,7 +262,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 54, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 54, 1), ]); } @@ -283,7 +283,7 @@ void b() { '''); await assertErrorsInFile2(a, [ - error(WarningCode.INVALID_ANNOTATION_TARGET, 35, 11), + error(WarningCode.invalidAnnotationTarget, 35, 11), ]); await assertErrorsInFile2(b, []); } @@ -309,7 +309,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 48, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 48, 1), ]); } @@ -330,7 +330,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 33, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 33, 1), ]); } @@ -351,7 +351,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 33, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 33, 1), ]); } @@ -366,7 +366,7 @@ void b() => a(); '''); await assertErrorsInFile2(a, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 72, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 72, 1), ]); } @@ -391,7 +391,7 @@ void b() { await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 48, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 48, 1), ]); } @@ -411,7 +411,7 @@ void b() => print(a); await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_DO_NOT_SUBMIT_MEMBER, 36, 1), + error(WarningCode.invalidUseOfDoNotSubmitMember, 36, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_exception_value_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_exception_value_test.dart index 356f4e7d9c1..7c5e431c101 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_exception_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_exception_value_test.dart @@ -25,7 +25,7 @@ void g() { Pointer.fromFunction(f, 42); } ''', - [error(FfiCode.INVALID_EXCEPTION_VALUE, 109, 2)], + [error(FfiCode.invalidExceptionValue, 109, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_export_of_internal_element_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_export_of_internal_element_test.dart index 30dfce9f7e8..e0b7b1fe74b 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_export_of_internal_element_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_export_of_internal_element_test.dart @@ -52,7 +52,7 @@ export 'src/foo.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 22), + error(WarningCode.invalidExportOfInternalElement, 0, 22), ]); } @@ -80,7 +80,7 @@ export 'src/foo.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 22), + error(WarningCode.invalidExportOfInternalElement, 0, 22), ]); } @@ -108,7 +108,7 @@ export 'src/foo.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 22), + error(WarningCode.invalidExportOfInternalElement, 0, 22), ]); } @@ -148,7 +148,7 @@ import 'package:meta/meta.dart'; r''' export 'package:dart.my/src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 38)], + [error(WarningCode.invalidExportOfInternalElement, 0, 38)], ); } @@ -162,7 +162,7 @@ import 'package:meta/meta.dart'; r''' export 'package:dart.my/src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 38)], + [error(WarningCode.invalidExportOfInternalElement, 0, 38)], ); } @@ -176,7 +176,7 @@ import 'package:meta/meta.dart'; r''' export 'package:dart.my/src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 38)], + [error(WarningCode.invalidExportOfInternalElement, 0, 38)], ); } } @@ -204,7 +204,7 @@ export 'package:test/src/foo.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 35), + error(WarningCode.invalidExportOfInternalElement, 0, 35), ]); } @@ -238,7 +238,7 @@ export 'package:test/src/foo.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 35), + error(WarningCode.invalidExportOfInternalElement, 0, 35), ]); } @@ -265,7 +265,7 @@ import 'package:meta/meta.dart'; r''' export 'package:test/src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 35)], + [error(WarningCode.invalidExportOfInternalElement, 0, 35)], ); } @@ -280,7 +280,7 @@ import 'package:meta/meta.dart'; r''' export 'package:test/src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 35)], + [error(WarningCode.invalidExportOfInternalElement, 0, 35)], ); } } @@ -310,7 +310,7 @@ export 'src/foo.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 22), + error(WarningCode.invalidExportOfInternalElement, 0, 22), ]); } @@ -350,7 +350,7 @@ import 'package:meta/meta.dart'; r''' export 'package:test/src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 35)], + [error(WarningCode.invalidExportOfInternalElement, 0, 35)], ); } } @@ -384,7 +384,7 @@ class Two {} r''' export 'src/foo.dart' hide Two; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 31)], + [error(WarningCode.invalidExportOfInternalElement, 0, 31)], ); } @@ -399,7 +399,7 @@ int func(IntFunc f, int x) => f(x); r''' export 'src/foo.dart' show func; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY, 0, 32)], + [error(WarningCode.invalidExportOfInternalElementIndirectly, 0, 32)], ); } @@ -414,7 +414,7 @@ int func(IntFunc f, int x) => f(x); r''' export 'src/foo.dart' show func; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY, 0, 32)], + [error(WarningCode.invalidExportOfInternalElementIndirectly, 0, 32)], ); } @@ -429,7 +429,7 @@ int func(IntFunc f, int x) => f(x); r''' export 'src/foo.dart' show func; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY, 0, 32)], + [error(WarningCode.invalidExportOfInternalElementIndirectly, 0, 32)], ); } @@ -444,7 +444,7 @@ IntFunc func() => (int x) => x; r''' export 'src/foo.dart' show func; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY, 0, 32)], + [error(WarningCode.invalidExportOfInternalElementIndirectly, 0, 32)], ); } @@ -459,7 +459,7 @@ void func() {} r''' export 'src/foo.dart' show func; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT_INDIRECTLY, 0, 32)], + [error(WarningCode.invalidExportOfInternalElementIndirectly, 0, 32)], ); } @@ -485,7 +485,7 @@ import 'package:meta/meta.dart'; r''' export 'src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 22)], + [error(WarningCode.invalidExportOfInternalElement, 0, 22)], ); } @@ -503,7 +503,7 @@ import 'package:meta/meta.dart'; r''' export 'src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 22)], + [error(WarningCode.invalidExportOfInternalElement, 0, 22)], ); } @@ -519,7 +519,7 @@ import 'package:meta/meta.dart'; r''' export 'src/foo.dart'; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 22)], + [error(WarningCode.invalidExportOfInternalElement, 0, 22)], ); } @@ -566,7 +566,7 @@ class Two {} r''' export 'src/foo.dart' show One; ''', - [error(WarningCode.INVALID_EXPORT_OF_INTERNAL_ELEMENT, 0, 31)], + [error(WarningCode.invalidExportOfInternalElement, 0, 31)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_extension_argument_count_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_extension_argument_count_test.dart index c9892aca656..6ef1450a18a 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_extension_argument_count_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_extension_argument_count_test.dart @@ -25,7 +25,7 @@ f() { E('a', 'b', 'c').m(); } ''', - [error(CompileTimeErrorCode.INVALID_EXTENSION_ARGUMENT_COUNT, 49, 15)], + [error(CompileTimeErrorCode.invalidExtensionArgumentCount, 49, 15)], ); assertTypeDynamic(findNode.extensionOverride('E(').extendedType); } @@ -51,7 +51,7 @@ f() { E().m(); } ''', - [error(CompileTimeErrorCode.INVALID_EXTENSION_ARGUMENT_COUNT, 49, 2)], + [error(CompileTimeErrorCode.invalidExtensionArgumentCount, 49, 2)], ); assertTypeDynamic(findNode.extensionOverride('E(').extendedType); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_factory_method_impl_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_factory_method_impl_test.dart index 73c2452e36b..2efaa97bf0a 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_factory_method_impl_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_factory_method_impl_test.dart @@ -44,7 +44,7 @@ class Stateful { } class State { } ''', - [error(WarningCode.INVALID_FACTORY_METHOD_IMPL, 96, 11)], + [error(WarningCode.invalidFactoryMethodImpl, 96, 11)], ); } @@ -59,7 +59,7 @@ extension type E(int i) { } } ''', - [error(WarningCode.INVALID_FACTORY_METHOD_IMPL, 79, 6)], + [error(WarningCode.invalidFactoryMethodImpl, 79, 6)], ); } @@ -165,7 +165,7 @@ class Stateful { void createState() {} } ''', - [error(WarningCode.INVALID_FACTORY_METHOD_DECL, 69, 11)], + [error(WarningCode.invalidFactoryMethodDecl, 69, 11)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_factory_name_not_a_class_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_factory_name_not_a_class_test.dart index 8e62f5e3608..e63db7ae968 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_factory_name_not_a_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_factory_name_not_a_class_test.dart @@ -23,7 +23,7 @@ class A { factory B() => throw 0; } ''', - [error(CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS, 31, 1)], + [error(CompileTimeErrorCode.invalidFactoryNameNotAClass, 31, 1)], ); } @@ -34,7 +34,7 @@ class A { factory B() => throw 0; } ''', - [error(CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS, 20, 1)], + [error(CompileTimeErrorCode.invalidFactoryNameNotAClass, 20, 1)], ); } @@ -56,7 +56,7 @@ augment class A { await resolveFile2(b); assertErrorsInResult([ - error(CompileTimeErrorCode.INVALID_FACTORY_NAME_NOT_A_CLASS, 47, 1), + error(CompileTimeErrorCode.invalidFactoryNameNotAClass, 47, 1), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_field_name_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_field_name_test.dart index 58d7c1a83a8..0574cb3d2f2 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_field_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_field_name_test.dart @@ -22,10 +22,10 @@ class InvalidFieldName_RecordLiteralTest extends PubPackageResolutionTest { var r = (hashCode: 1, noSuchMethod: 2, runtimeType: 3, toString: 4); ''', [ - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 9, 8), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 22, 12), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 39, 11), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 55, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 9, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 22, 12), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 39, 11), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 55, 8), ], ); } @@ -42,10 +42,10 @@ var r = (hashCode: 1, noSuchMethod: 2, runtimeType: 3, toString: 4); var r = (0, hashCode: 1, noSuchMethod: 2, runtimeType: 3, toString: 4); ''', [ - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 12, 8), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 25, 12), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 42, 11), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 58, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 12, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 25, 12), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 42, 11), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 58, 8), ], ); } @@ -55,7 +55,7 @@ var r = (0, hashCode: 1, noSuchMethod: 2, runtimeType: 3, toString: 4); r''' var r = (0, $1: 2); ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_POSITIONAL, 12, 2)], + [error(CompileTimeErrorCode.invalidFieldNamePositional, 12, 2)], ); } @@ -64,7 +64,7 @@ var r = (0, $1: 2); r''' var r = ($1: 2, 1); ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_POSITIONAL, 9, 2)], + [error(CompileTimeErrorCode.invalidFieldNamePositional, 9, 2)], ); } @@ -85,7 +85,7 @@ var r = (0, $2: 2); r''' var r = (_a: 1, b: 2); ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 9, 2)], + [error(CompileTimeErrorCode.invalidFieldNamePrivate, 9, 2)], ); } } @@ -99,10 +99,10 @@ class InvalidFieldName_RecordTypeAnnotationTest void f(({int hashCode, int noSuchMethod, int runtimeType, int toString}) r) {} ''', [ - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 13, 8), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 27, 12), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 45, 11), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 62, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 13, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 27, 12), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 45, 11), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 62, 8), ], ); } @@ -120,10 +120,10 @@ void g((int hashAll,) r) {} void f((int hashCode, int noSuchMethod, int runtimeType, int toString) r) {} ''', [ - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 12, 8), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 26, 12), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 44, 11), - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 61, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 12, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 26, 12), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 44, 11), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 61, 8), ], ); } @@ -133,7 +133,7 @@ void f((int hashCode, int noSuchMethod, int runtimeType, int toString) r) {} r''' void f((int, String, {int $2}) r) {} ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_POSITIONAL, 26, 2)], + [error(CompileTimeErrorCode.invalidFieldNamePositional, 26, 2)], ); } @@ -154,7 +154,7 @@ void f(({int $22}) r) {} r''' void f((int $2, int b) r) {} ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_POSITIONAL, 12, 2)], + [error(CompileTimeErrorCode.invalidFieldNamePositional, 12, 2)], ); } @@ -175,7 +175,7 @@ void f((int $4, int b) r) {} r''' void f(({int _a}) r) {} ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 13, 2)], + [error(CompileTimeErrorCode.invalidFieldNamePrivate, 13, 2)], ); } @@ -184,7 +184,7 @@ void f(({int _a}) r) {} r''' void f((int _a, int b) r) {} ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 12, 2)], + [error(CompileTimeErrorCode.invalidFieldNamePrivate, 12, 2)], ); } @@ -193,7 +193,7 @@ void f((int _a, int b) r) {} r''' void f(({int _, int b}) r) {} ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 13, 1)], + [error(CompileTimeErrorCode.invalidFieldNamePrivate, 13, 1)], ); } @@ -205,7 +205,7 @@ void f(({int _, int b}) r) {} void f(({int _, int b}) r) {} ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 57, 1)], + [error(CompileTimeErrorCode.invalidFieldNamePrivate, 57, 1)], ); } @@ -223,7 +223,7 @@ void f((int _, int b) r) {} void f((int _, int b) r) {} ''', - [error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 56, 1)], + [error(CompileTimeErrorCode.invalidFieldNamePrivate, 56, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_field_type_in_struct_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_field_type_in_struct_test.dart index 25862709af7..f572fb85ff1 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_field_type_in_struct_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_field_type_in_struct_test.dart @@ -27,7 +27,7 @@ final class C extends Struct { external Pointer notEmpty; } ''', - [error(FfiCode.INVALID_FIELD_TYPE_IN_STRUCT, 61, 6)], + [error(FfiCode.invalidFieldTypeInStruct, 61, 6)], ); } @@ -43,7 +43,7 @@ final class C extends Union { external Pointer notEmpty; } ''', - [error(FfiCode.INVALID_FIELD_TYPE_IN_STRUCT, 60, 6)], + [error(FfiCode.invalidFieldTypeInStruct, 60, 6)], ); } @@ -55,7 +55,7 @@ final class C extends Struct { external Pointer? p; } ''', - [error(FfiCode.INVALID_FIELD_TYPE_IN_STRUCT, 61, 8)], + [error(FfiCode.invalidFieldTypeInStruct, 61, 8)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_immutable_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_immutable_annotation_test.dart index ac65a9509fa..2ec29b9824f 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_immutable_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_immutable_annotation_test.dart @@ -48,7 +48,7 @@ class A { void m() {} } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 46, 9)], + [error(WarningCode.invalidAnnotationTarget, 46, 9)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_implementation_override_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_implementation_override_test.dart index ed63d6c0cf0..3c9105fadec 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_implementation_override_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_implementation_override_test.dart @@ -34,7 +34,7 @@ class B extends A { int get g; } ''', - [error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 36, 1)], + [error(CompileTimeErrorCode.invalidImplementationOverride, 36, 1)], ); } @@ -49,9 +49,9 @@ class B extends A { } ''', [ - error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 52, 1), + error(CompileTimeErrorCode.invalidImplementationOverride, 52, 1), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 72, 3, contextMessages: [message(testFile, 16, 3)], @@ -70,7 +70,7 @@ class B extends A { int add(num a); } ''', - [error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 41, 1)], + [error(CompileTimeErrorCode.invalidImplementationOverride, 41, 1)], ); } @@ -95,7 +95,7 @@ class B extends A { int add([int a = 0, int b = 0]); } ''', - [error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 36, 1)], + [error(CompileTimeErrorCode.invalidImplementationOverride, 36, 1)], ); } @@ -110,9 +110,9 @@ class A with M { } ''', [ - error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 52, 1), + error(CompileTimeErrorCode.invalidImplementationOverride, 52, 1), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 69, 3, contextMessages: [message(testFile, 16, 3)], @@ -133,9 +133,9 @@ mixin M { class B extends A with M {} ''', [ - error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 77, 1), + error(CompileTimeErrorCode.invalidImplementationOverride, 77, 1), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 94, 1, contextMessages: [message(testFile, 16, 3)], @@ -177,7 +177,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidImplementationOverrideSetter, 37, 1, messageContains: ["'A.c'", "'B.c'"], @@ -197,7 +197,7 @@ enum E with M { int get foo; } ''', - [error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 37, 1)], + [error(CompileTimeErrorCode.invalidImplementationOverride, 37, 1)], ); } @@ -212,7 +212,7 @@ enum E with M { int foo(); } ''', - [error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 35, 1)], + [error(CompileTimeErrorCode.invalidImplementationOverride, 35, 1)], ); } @@ -232,7 +232,7 @@ enum E2 implements I { String toString([int? value]) => ''; } ''', - [error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 60, 2)], + [error(CompileTimeErrorCode.invalidImplementationOverride, 60, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_internal_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_internal_annotation_test.dart index 0303a9b9e13..70a97cd7cc9 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_internal_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_internal_annotation_test.dart @@ -33,9 +33,7 @@ import 'package:meta/meta.dart'; @internal class One {} '''); - assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - ]); + assertErrorsInResult([error(WarningCode.invalidInternalAnnotation, 34, 8)]); } void test_annotationInLib_onLibrary() async { @@ -45,9 +43,7 @@ library foo; import 'package:meta/meta.dart'; '''); - assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 1, 8), - ]); + assertErrorsInResult([error(WarningCode.invalidInternalAnnotation, 1, 8)]); } void test_annotationInLibSrc() async { @@ -74,9 +70,7 @@ import 'package:meta/meta.dart'; @internal class One {} '''); - assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - ]); + assertErrorsInResult([error(WarningCode.invalidInternalAnnotation, 34, 8)]); } void test_annotationInTest() async { @@ -104,8 +98,8 @@ import 'package:meta/meta.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - error(WarningCode.UNUSED_ELEMENT, 49, 4), + error(WarningCode.invalidInternalAnnotation, 34, 8), + error(WarningCode.unusedElement, 49, 4), ]); } @@ -118,8 +112,8 @@ class _C { '''); assertErrorsInResult([ - error(WarningCode.UNUSED_ELEMENT, 39, 2), - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 47, 8), + error(WarningCode.unusedElement, 39, 2), + error(WarningCode.invalidInternalAnnotation, 47, 8), ]); } @@ -132,8 +126,8 @@ class _C { '''); assertErrorsInResult([ - error(WarningCode.UNUSED_ELEMENT, 39, 2), - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 47, 8), + error(WarningCode.unusedElement, 39, 2), + error(WarningCode.invalidInternalAnnotation, 47, 8), ]); } @@ -145,9 +139,7 @@ class C { } '''); - assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 46, 8), - ]); + assertErrorsInResult([error(WarningCode.invalidInternalAnnotation, 46, 8)]); } void test_privateEnum() async { @@ -157,9 +149,9 @@ import 'package:meta/meta.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - error(WarningCode.UNUSED_ELEMENT, 48, 2), - error(WarningCode.UNUSED_FIELD, 52, 3), + error(WarningCode.invalidInternalAnnotation, 34, 8), + error(WarningCode.unusedElement, 48, 2), + error(WarningCode.unusedField, 52, 3), ]); } @@ -170,8 +162,8 @@ enum E {@internal _one} '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 42, 8), - error(WarningCode.UNUSED_FIELD, 51, 4), + error(WarningCode.invalidInternalAnnotation, 42, 8), + error(WarningCode.unusedField, 51, 4), ]); } @@ -181,9 +173,7 @@ import 'package:meta/meta.dart'; @internal extension _One on String {} '''); - assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - ]); + assertErrorsInResult([error(WarningCode.invalidInternalAnnotation, 34, 8)]); } void test_privateExtension_unnamed() async { @@ -192,9 +182,7 @@ import 'package:meta/meta.dart'; @internal extension on String {} '''); - assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - ]); + assertErrorsInResult([error(WarningCode.invalidInternalAnnotation, 34, 8)]); } void test_privateExtensionType() async { @@ -204,8 +192,8 @@ import 'package:meta/meta.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - error(WarningCode.UNUSED_ELEMENT, 58, 2), + error(WarningCode.invalidInternalAnnotation, 34, 8), + error(WarningCode.unusedElement, 58, 2), ]); } @@ -218,8 +206,8 @@ class C { '''); assertErrorsInResult([ - error(WarningCode.UNUSED_FIELD, 59, 2), - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 59, 6), + error(WarningCode.unusedField, 59, 2), + error(WarningCode.invalidInternalAnnotation, 59, 6), ]); } @@ -232,8 +220,8 @@ class C { '''); assertErrorsInResult([ - error(WarningCode.UNUSED_FIELD, 66, 2), - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 66, 6), + error(WarningCode.unusedField, 66, 2), + error(WarningCode.invalidInternalAnnotation, 66, 6), ]); } @@ -246,8 +234,8 @@ class C { '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 46, 8), - error(WarningCode.UNUSED_ELEMENT, 63, 2), + error(WarningCode.invalidInternalAnnotation, 46, 8), + error(WarningCode.unusedElement, 63, 2), ]); } @@ -260,8 +248,8 @@ class C { '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 46, 8), - error(WarningCode.UNUSED_ELEMENT, 60, 2), + error(WarningCode.invalidInternalAnnotation, 46, 8), + error(WarningCode.unusedElement, 60, 2), ]); } @@ -274,8 +262,8 @@ class C { '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 46, 8), - error(WarningCode.UNUSED_ELEMENT, 67, 2), + error(WarningCode.invalidInternalAnnotation, 46, 8), + error(WarningCode.unusedElement, 67, 2), ]); } @@ -286,8 +274,8 @@ import 'package:meta/meta.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - error(WarningCode.UNUSED_ELEMENT, 49, 4), + error(WarningCode.invalidInternalAnnotation, 34, 8), + error(WarningCode.unusedElement, 49, 4), ]); } @@ -298,8 +286,8 @@ import 'package:meta/meta.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - error(WarningCode.UNUSED_ELEMENT, 48, 2), + error(WarningCode.invalidInternalAnnotation, 34, 8), + error(WarningCode.unusedElement, 48, 2), ]); } @@ -310,8 +298,8 @@ import 'package:meta/meta.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 47, 6), - error(WarningCode.UNUSED_ELEMENT, 47, 2), + error(WarningCode.invalidInternalAnnotation, 47, 6), + error(WarningCode.unusedElement, 47, 2), ]); } @@ -322,8 +310,8 @@ import 'package:meta/meta.dart'; '''); assertErrorsInResult([ - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 34, 8), - error(WarningCode.UNUSED_ELEMENT, 51, 2), + error(WarningCode.invalidInternalAnnotation, 34, 8), + error(WarningCode.unusedElement, 51, 2), ]); } @@ -335,7 +323,7 @@ class _C { } '''); - assertErrorsInResult([error(WarningCode.UNUSED_ELEMENT, 39, 2)]); + assertErrorsInResult([error(WarningCode.unusedElement, 39, 2)]); } void test_publicMethod_privateClass_static() async { @@ -347,8 +335,8 @@ class _C { '''); assertErrorsInResult([ - error(WarningCode.UNUSED_ELEMENT, 39, 2), - error(WarningCode.UNUSED_ELEMENT, 68, 1), + error(WarningCode.unusedElement, 39, 2), + error(WarningCode.unusedElement, 68, 1), ]); } @@ -360,6 +348,6 @@ extension type _E(int i) { } '''); - assertErrorsInResult([error(WarningCode.UNUSED_ELEMENT, 48, 2)]); + assertErrorsInResult([error(WarningCode.unusedElement, 48, 2)]); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_language_override_greater_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_language_override_greater_test.dart index e8b0e4bedc2..6d4b28d0956 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_language_override_greater_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_language_override_greater_test.dart @@ -29,7 +29,7 @@ class InvalidLanguageOverrideGreaterTest extends PubPackageResolutionTest { // @dart = ${latestVersion.major}.${latestVersion.minor + 1} class A {} ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER, 0, 15)], + [error(WarningCode.invalidLanguageVersionOverrideGreater, 0, 15)], ); _assertUnitLanguageVersion(package: latestVersion, override: null); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_language_override_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_language_override_test.dart index e5341fcea60..798a762e0e8 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_language_override_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_language_override_test.dart @@ -21,7 +21,7 @@ class InvalidLanguageOverrideTest extends PubPackageResolutionTest { // @dart = 11.12 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER, 0, 16)], + [error(WarningCode.invalidLanguageVersionOverrideGreater, 0, 16)], ); } @@ -31,7 +31,7 @@ int i = 0; // @dart = 3.190 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_GREATER, 0, 16)], + [error(WarningCode.invalidLanguageVersionOverrideGreater, 0, 16)], ); } @@ -91,7 +91,7 @@ class A { void test() {} } ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION, 15, 11)], + [error(WarningCode.invalidLanguageVersionOverrideLocation, 15, 11)], ); } @@ -101,7 +101,7 @@ class A { class A {} // @dart = 3.0 ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION, 14, 11)], + [error(WarningCode.invalidLanguageVersionOverrideLocation, 14, 11)], ); } @@ -111,7 +111,7 @@ class A {} class A {} // @dart = 3.0 ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION, 14, 11)], + [error(WarningCode.invalidLanguageVersionOverrideLocation, 14, 11)], ); } @@ -122,7 +122,7 @@ import 'dart:core'; // @dart = 3.0 class A {} ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOCATION, 23, 11)], + [error(WarningCode.invalidLanguageVersionOverrideLocation, 23, 11)], ); } @@ -150,7 +150,7 @@ class A { // dart = 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN, 0, 13)], + [error(WarningCode.invalidLanguageVersionOverrideAtSign, 0, 13)], ); } @@ -160,7 +160,7 @@ int i = 0; // @dart 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS, 0, 12)], + [error(WarningCode.invalidLanguageVersionOverrideEquals, 0, 12)], ); } @@ -227,7 +227,7 @@ int i = 0; // @dart >= 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS, 0, 15)], + [error(WarningCode.invalidLanguageVersionOverrideEquals, 0, 15)], ); } @@ -246,7 +246,7 @@ int i = 0; // @Dart = 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE, 16, 14)], + [error(WarningCode.invalidLanguageVersionOverrideLowerCase, 16, 14)], ); } @@ -256,7 +256,7 @@ int i = 0; /// @dart = 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TWO_SLASHES, 0, 15)], + [error(WarningCode.invalidLanguageVersionOverrideTwoSlashes, 0, 15)], ); } @@ -266,7 +266,7 @@ int i = 0; // dart @ 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_AT_SIGN, 0, 13)], + [error(WarningCode.invalidLanguageVersionOverrideAtSign, 0, 13)], ); } @@ -276,7 +276,7 @@ int i = 0; // @Dart = 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE, 0, 14)], + [error(WarningCode.invalidLanguageVersionOverrideLowerCase, 0, 14)], ); } @@ -287,7 +287,7 @@ int i = 0; // @Dart = 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE, 13, 14)], + [error(WarningCode.invalidLanguageVersionOverrideLowerCase, 13, 14)], ); } @@ -299,7 +299,7 @@ int i = 0; // @Dart = 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_LOWER_CASE, 14, 14)], + [error(WarningCode.invalidLanguageVersionOverrideLowerCase, 14, 14)], ); } @@ -309,7 +309,7 @@ int i = 0; // @dart:2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS, 0, 12)], + [error(WarningCode.invalidLanguageVersionOverrideEquals, 0, 12)], ); } @@ -319,7 +319,7 @@ int i = 0; // @dart : 2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_EQUALS, 0, 14)], + [error(WarningCode.invalidLanguageVersionOverrideEquals, 0, 14)], ); } @@ -331,7 +331,7 @@ int i = 0; ''', [ error( - WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_TRAILING_CHARACTERS, + WarningCode.invalidLanguageVersionOverrideTrailingCharacters, 0, 16, ), @@ -345,7 +345,7 @@ int i = 0; // @dart = 2 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_NUMBER, 0, 12)], + [error(WarningCode.invalidLanguageVersionOverrideNumber, 0, 12)], ); } @@ -355,7 +355,7 @@ int i = 0; // @dart = v2.0 int i = 0; ''', - [error(WarningCode.INVALID_LANGUAGE_VERSION_OVERRIDE_PREFIX, 0, 15)], + [error(WarningCode.invalidLanguageVersionOverridePrefix, 0, 15)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_literal_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_literal_annotation_test.dart index 582ba9e862d..653c830f016 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_literal_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_literal_annotation_test.dart @@ -48,7 +48,7 @@ import 'package:meta/meta.dart'; @literal extension type const E(int i) { } ''', - [error(WarningCode.INVALID_LITERAL_ANNOTATION, 34, 7)], + [error(WarningCode.invalidLiteralAnnotation, 34, 7)], ); } @@ -61,7 +61,7 @@ class A { A() {} } ''', - [error(WarningCode.INVALID_LITERAL_ANNOTATION, 46, 7)], + [error(WarningCode.invalidLiteralAnnotation, 46, 7)], ); } @@ -74,7 +74,7 @@ class A { void m() {} } ''', - [error(WarningCode.INVALID_LITERAL_ANNOTATION, 46, 7)], + [error(WarningCode.invalidLiteralAnnotation, 46, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_modifier_on_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_modifier_on_constructor_test.dart index 04fdaa741bc..07730c91038 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_modifier_on_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_modifier_on_constructor_test.dart @@ -22,7 +22,7 @@ class A { A() async {} } ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR, 16, 5)], + [error(CompileTimeErrorCode.invalidModifierOnConstructor, 16, 5)], ); } @@ -33,7 +33,7 @@ class A { A() async* {} } ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR, 16, 5)], + [error(CompileTimeErrorCode.invalidModifierOnConstructor, 16, 5)], ); } @@ -44,7 +44,7 @@ class A { A() sync* {} } ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_CONSTRUCTOR, 16, 4)], + [error(CompileTimeErrorCode.invalidModifierOnConstructor, 16, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_modifier_on_setter_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_modifier_on_setter_test.dart index d30719dfb95..b64cda80dd7 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_modifier_on_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_modifier_on_setter_test.dart @@ -22,7 +22,7 @@ class A { set x(v) async {} } ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER, 21, 5)], + [error(CompileTimeErrorCode.invalidModifierOnSetter, 21, 5)], ); } @@ -33,7 +33,7 @@ class A { set x(v) async* {} } ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER, 21, 5)], + [error(CompileTimeErrorCode.invalidModifierOnSetter, 21, 5)], ); } @@ -44,7 +44,7 @@ class A { set x(v) sync* {} } ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER, 21, 4)], + [error(CompileTimeErrorCode.invalidModifierOnSetter, 21, 4)], ); } @@ -53,7 +53,7 @@ class A { ''' set x(v) async {} ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER, 9, 5)], + [error(CompileTimeErrorCode.invalidModifierOnSetter, 9, 5)], ); } @@ -62,7 +62,7 @@ set x(v) async {} ''' set x(v) async* {} ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER, 9, 5)], + [error(CompileTimeErrorCode.invalidModifierOnSetter, 9, 5)], ); } @@ -71,7 +71,7 @@ set x(v) async* {} ''' set x(v) sync* {} ''', - [error(CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER, 9, 4)], + [error(CompileTimeErrorCode.invalidModifierOnSetter, 9, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_non_virtual_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_non_virtual_annotation_test.dart index cdb74704267..c5e8508f9c7 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_non_virtual_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_non_virtual_annotation_test.dart @@ -29,7 +29,7 @@ import 'package:meta/meta.dart'; @nonVirtual class C {} ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } @@ -43,7 +43,7 @@ abstract class C { void m(); } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 56, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 56, 10)], ); } @@ -102,7 +102,7 @@ class C { static int f = 0; } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 48, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 48, 10)], ); } @@ -116,7 +116,7 @@ class C { static void m() {} } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 48, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 48, 10)], ); } @@ -130,7 +130,7 @@ enum E { a, b, c } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } @@ -145,7 +145,7 @@ enum E { b, c } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 46, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 46, 10)], ); } @@ -157,7 +157,7 @@ import 'package:meta/meta.dart'; @nonVirtual extension E on Object {} ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } @@ -171,7 +171,7 @@ extension E on Object { void m() {} } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 62, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 62, 10)], ); } @@ -185,7 +185,7 @@ extension type E(int i) { void m() { } } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 63, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 63, 10)], ); } @@ -195,7 +195,7 @@ extension type E(int i) { @nonVirtual import 'package:meta/meta.dart'; ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 1, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 1, 10)], ); } @@ -207,7 +207,7 @@ import 'package:meta/meta.dart'; @nonVirtual mixin M {} ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } @@ -232,7 +232,7 @@ mixin M { static int f = 0; } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 47, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 47, 10)], ); } @@ -246,7 +246,7 @@ mixin M { static void m() {} } ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 47, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 47, 10)], ); } @@ -258,7 +258,7 @@ import 'package:meta/meta.dart'; @nonVirtual m() {} ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } @@ -270,7 +270,7 @@ import 'package:meta/meta.dart'; @nonVirtual int get g => 0; ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } @@ -282,7 +282,7 @@ import 'package:meta/meta.dart'; @nonVirtual set s(int v) {} ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } @@ -294,7 +294,7 @@ import 'package:meta/meta.dart'; @nonVirtual int x = 0; ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } @@ -306,7 +306,7 @@ import 'package:meta/meta.dart'; @nonVirtual typedef bool predicate(Object o); ''', - [error(WarningCode.INVALID_NON_VIRTUAL_ANNOTATION, 35, 10)], + [error(WarningCode.invalidNonVirtualAnnotation, 35, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_null_aware_elements_error_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_null_aware_elements_error_test.dart index 615508f2a22..3aa15330bc3 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_null_aware_elements_error_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_null_aware_elements_error_test.dart @@ -21,7 +21,7 @@ class InvalidNullAwareElementsErrorTest extends PubPackageResolutionTest { const stringConst = ""; const list = [0, ?stringConst]; ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_ELEMENT, 41, 1)], + [error(StaticWarningCode.invalidNullAwareElement, 41, 1)], ); } @@ -31,7 +31,7 @@ const list = [0, ?stringConst]; const stringConst = ""; const set = {0, ?stringConst}; ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_ELEMENT, 40, 1)], + [error(StaticWarningCode.invalidNullAwareElement, 40, 1)], ); } @@ -41,7 +41,7 @@ const set = {0, ?stringConst}; const intConst = 0; const map = {?0: intConst}; ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_KEY, 33, 1)], + [error(StaticWarningCode.invalidNullAwareMapEntryKey, 33, 1)], ); } @@ -51,7 +51,7 @@ const map = {?0: intConst}; const intConst = 0; const map = {0: ?intConst}; ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_MAP_ENTRY_VALUE, 36, 1)], + [error(StaticWarningCode.invalidNullAwareMapEntryValue, 36, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_null_aware_operator_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_null_aware_operator_test.dart index 538905784c5..d01e47990fd 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_null_aware_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_null_aware_operator_test.dart @@ -27,7 +27,7 @@ void f(String? s) { ''', [ error( - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit, 31, 2, contextMessages: [message(testFile, 23, 2)], @@ -45,7 +45,7 @@ void f(String? s) { ''', [ error( - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit, 27, 2, contextMessages: [message(testFile, 23, 1)], @@ -67,7 +67,7 @@ class C { ''', [ error( - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit, 75, 2, contextMessages: [message(testFile, 69, 2)], @@ -85,7 +85,7 @@ void f(String? s) { ''', [ error( - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit, 40, 2, contextMessages: [message(testFile, 23, 2)], @@ -103,13 +103,13 @@ void f(String? s) { ''', [ error( - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit, 40, 2, contextMessages: [message(testFile, 23, 2)], ), error( - StaticWarningCode.INVALID_NULL_AWARE_OPERATOR_AFTER_SHORT_CIRCUIT, + StaticWarningCode.invalidNullAwareOperatorAfterShortCircuit, 55, 2, contextMessages: [message(testFile, 23, 2)], @@ -133,7 +133,7 @@ void f(int? a, int b) { E(b)?[0] = true; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 109, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 109, 2)], ); } @@ -149,7 +149,7 @@ void f(int? a, int b) { E(b)?.foo = true; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 95, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 95, 2)], ); } @@ -165,7 +165,7 @@ void f(int? a, int b) { E(b)?[0]; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 104, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 104, 2)], ); assertType(findNode.index('E(a)'), 'bool?'); assertType(findNode.index('E(b)'), 'bool?'); @@ -183,7 +183,7 @@ void f(int? a, int b) { E(b)?.foo(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 91, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 91, 2)], ); assertType(findNode.methodInvocation('E(a)'), 'bool?'); @@ -202,7 +202,7 @@ void f(int? a, int b) { E(b)?.foo; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 91, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 91, 2)], ); assertType(findNode.propertyAccess('E(a)'), 'bool?'); assertType(findNode.propertyAccess('E(b)'), 'bool?'); @@ -219,7 +219,7 @@ f() { C?.x; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 42, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 42, 2)], ); } @@ -234,7 +234,7 @@ f() { E?.x; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 53, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 53, 2)], ); } @@ -249,7 +249,7 @@ f() { M?.x; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 42, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 42, 2)], ); } @@ -262,8 +262,8 @@ f(int x) { } ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 14, 2), - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 27, 3), + error(StaticWarningCode.invalidNullAwareOperator, 14, 2), + error(StaticWarningCode.invalidNullAwareOperator, 27, 3), ], ); } @@ -278,7 +278,7 @@ f(int? x) { } /// Here we test that analysis does not crash while checking whether to - /// report [StaticWarningCode.INVALID_NULL_AWARE_OPERATOR]. But we also + /// report [StaticWarningCode.invalidNullAwareOperator]. But we also /// report another error. test_getter_prefix() async { newFile('$testPackageLibPath/a.dart', r''' @@ -292,13 +292,7 @@ f() { p?.x; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 31, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 31, 1)], ); } @@ -311,8 +305,8 @@ f(List x) { } ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 20, 2), - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 29, 3), + error(StaticWarningCode.invalidNullAwareOperator, 20, 2), + error(StaticWarningCode.invalidNullAwareOperator, 29, 3), ], ); } @@ -335,9 +329,9 @@ f(Unresolved o) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_CLASS, 2, 10), + error(CompileTimeErrorCode.undefinedClass, 2, 10), error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 44, 6, ), @@ -353,7 +347,7 @@ f(Unresolved o) { i?.isEven; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 2, 10)], + [error(CompileTimeErrorCode.undefinedClass, 2, 10)], ); } @@ -368,7 +362,7 @@ f() { C?.foo(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 45, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 45, 2)], ); } @@ -387,7 +381,7 @@ void f() { prefix.C?.foo(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 49, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 49, 2)], ); } @@ -402,7 +396,7 @@ f() { E?.foo(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 56, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 56, 2)], ); } @@ -421,7 +415,7 @@ f() { prefix.E?.foo(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 44, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 44, 2)], ); } @@ -436,7 +430,7 @@ f() { M?.foo(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 45, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 45, 2)], ); } @@ -455,7 +449,7 @@ f() { prefix.M?.foo(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 44, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 44, 2)], ); } @@ -468,8 +462,8 @@ f(int x) { } ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 14, 2), - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 28, 3), + error(StaticWarningCode.invalidNullAwareOperator, 14, 2), + error(StaticWarningCode.invalidNullAwareOperator, 28, 3), ], ); } @@ -496,7 +490,7 @@ f() { B?.foo(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 62, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 62, 2)], ); } @@ -515,7 +509,7 @@ f(List x) { [...?x]; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 20, 4)], + [error(StaticWarningCode.invalidNullAwareOperator, 20, 4)], ); } @@ -538,7 +532,7 @@ f() { C?.x = 0; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 42, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 42, 2)], ); } @@ -553,7 +547,7 @@ f() { E?.x = 0; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 53, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 53, 2)], ); } @@ -568,12 +562,12 @@ f() { M?.x = 0; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 42, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 42, 2)], ); } /// Here we test that analysis does not crash while checking whether to - /// report [StaticWarningCode.INVALID_NULL_AWARE_OPERATOR]. But we also + /// report [StaticWarningCode.invalidNullAwareOperator]. But we also /// report another error. test_setter_prefix() async { newFile('$testPackageLibPath/a.dart', r''' @@ -587,13 +581,7 @@ f() { p?.x = 0; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 31, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 31, 1)], ); } @@ -610,13 +598,7 @@ class B extends A { } } ''', - [ - error( - ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER, - 73, - 2, - ), - ], + [error(ParserErrorCode.invalidOperatorQuestionmarkPeriodForSuper, 73, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_override_of_non_virtual_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_override_of_non_virtual_member_test.dart index c8e05c4fef0..65048854590 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_override_of_non_virtual_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_override_of_non_virtual_member_test.dart @@ -38,7 +38,7 @@ class B extends C { ''', [ error( - WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, + WarningCode.invalidOverrideOfNonVirtualMember, 113, 1, messageContains: ["member 'g'", "in 'C'"], @@ -61,7 +61,7 @@ class B extends C { int g = 0, h = 1; } ''', - [error(WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, 101, 1)], + [error(WarningCode.invalidOverrideOfNonVirtualMember, 101, 1)], ); } @@ -82,7 +82,7 @@ class B extends C { ''', [ error( - WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, + WarningCode.invalidOverrideOfNonVirtualMember, 117, 1, messageContains: ["member 'g'", "in 'C'"], @@ -106,7 +106,7 @@ class B extends C { set g(int v) {} } ''', - [error(WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, 113, 1)], + [error(WarningCode.invalidOverrideOfNonVirtualMember, 113, 1)], ); } @@ -125,7 +125,7 @@ class B extends C { int get g => 0; } ''', - [error(WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, 122, 1)], + [error(WarningCode.invalidOverrideOfNonVirtualMember, 122, 1)], ); } @@ -144,7 +144,7 @@ class B extends C { int g = 0; } ''', - [error(WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, 118, 1)], + [error(WarningCode.invalidOverrideOfNonVirtualMember, 118, 1)], ); } @@ -195,7 +195,7 @@ class B extends C { void f() {} } ''', - [error(WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, 115, 1)], + [error(WarningCode.invalidOverrideOfNonVirtualMember, 115, 1)], ); } @@ -214,7 +214,7 @@ class B extends C { set g(int v) {} } ''', - [error(WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, 118, 1)], + [error(WarningCode.invalidOverrideOfNonVirtualMember, 118, 1)], ); } @@ -233,7 +233,7 @@ class B extends C { int g = 0; } ''', - [error(WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, 118, 1)], + [error(WarningCode.invalidOverrideOfNonVirtualMember, 118, 1)], ); } @@ -254,7 +254,7 @@ class B with M { ''', [ error( - WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, + WarningCode.invalidOverrideOfNonVirtualMember, 111, 1, messageContains: ["member 'f'", "in 'M'"], @@ -278,7 +278,7 @@ class B with M { set g(int v) {} } ''', - [error(WarningCode.INVALID_OVERRIDE_OF_NON_VIRTUAL_MEMBER, 114, 1)], + [error(WarningCode.invalidOverrideOfNonVirtualMember, 114, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart index 15d3b46735c..99a381242a2 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart @@ -58,7 +58,7 @@ abstract class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 91, 1, contextMessages: [message(testFile, 44, 1)], @@ -91,7 +91,7 @@ abstract class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 87, 1, contextMessages: [message(testFile, 40, 1)], @@ -124,7 +124,7 @@ abstract class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 81, 1, contextMessages: [message(testFile, 34, 1)], @@ -157,7 +157,7 @@ abstract class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 82, 1, contextMessages: [message(testFile, 35, 1)], @@ -190,7 +190,7 @@ abstract class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 78, 1, contextMessages: [message(testFile, 31, 1)], @@ -223,7 +223,7 @@ abstract class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 72, 1, contextMessages: [message(testFile, 25, 1)], @@ -255,7 +255,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 71, 1, contextMessages: [message(testFile, 20, 1)], @@ -276,13 +276,13 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 52, 1, contextMessages: [message(testFile, 20, 1)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 52, 1, contextMessages: [message(testFile, 20, 1)], @@ -308,7 +308,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 157, 6, contextMessages: [message(testFile, 29, 6)], @@ -332,13 +332,13 @@ class B implements I, J { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 144, 1, contextMessages: [message(testFile, 30, 1)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 144, 1, contextMessages: [message(testFile, 76, 1)], @@ -370,9 +370,9 @@ class B extends A { } ''', [ - error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 52, 1), + error(CompileTimeErrorCode.invalidImplementationOverride, 52, 1), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 72, 3, contextMessages: [message(testFile, 16, 3)], @@ -392,9 +392,9 @@ class A with M { } ''', [ - error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 52, 1), + error(CompileTimeErrorCode.invalidImplementationOverride, 52, 1), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 69, 3, contextMessages: [message(testFile, 16, 3)], @@ -415,9 +415,9 @@ mixin M { class B extends A with M {} ''', [ - error(CompileTimeErrorCode.INVALID_IMPLEMENTATION_OVERRIDE, 77, 1), + error(CompileTimeErrorCode.invalidImplementationOverride, 77, 1), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 94, 1, contextMessages: [message(testFile, 16, 3)], @@ -469,7 +469,7 @@ class C extends B { void foo(covariant String a) {} } ''', - [error(CompileTimeErrorCode.INVALID_OVERRIDE, 109, 3)], + [error(CompileTimeErrorCode.invalidOverride, 109, 3)], ); } @@ -485,7 +485,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 49, 1, contextMessages: [message(testFile, 12, 1)], @@ -506,7 +506,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 49, 1, contextMessages: [message(testFile, 12, 1)], @@ -527,7 +527,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 54, 1, contextMessages: [message(testFile, 12, 1)], @@ -548,7 +548,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 51, 1, contextMessages: [message(testFile, 12, 1)], @@ -569,7 +569,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 48, 1, contextMessages: [message(testFile, 12, 1)], @@ -593,13 +593,13 @@ class B extends I implements J { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 147, 1, contextMessages: [message(testFile, 76, 1)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 147, 1, contextMessages: [message(testFile, 29, 1)], @@ -624,7 +624,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 124, 1, contextMessages: [message(testFile, 54, 1)], @@ -649,13 +649,13 @@ class B implements I, J { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 140, 1, contextMessages: [message(testFile, 29, 1)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 140, 1, contextMessages: [message(testFile, 76, 1)], @@ -676,7 +676,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 54, 1, contextMessages: [message(testFile, 12, 1)], @@ -701,7 +701,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 130, 1, contextMessages: [message(testFile, 57, 1)], @@ -722,7 +722,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 49, 1, contextMessages: [message(testFile, 12, 1)], @@ -743,7 +743,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 55, 1, contextMessages: [message(testFile, 12, 1)], @@ -764,7 +764,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 55, 1, contextMessages: [message(testFile, 12, 1)], @@ -785,7 +785,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 44, 1, contextMessages: [message(testFile, 12, 1)], @@ -806,7 +806,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 68, 1, contextMessages: [message(testFile, 16, 1)], @@ -831,7 +831,7 @@ augment class B implements A {} ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 50, 3, contextMessages: [message(testFile, 16, 3)], @@ -854,7 +854,7 @@ class C implements B { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 98, 1, contextMessages: [message(testFile, 25, 1)], @@ -875,7 +875,7 @@ class B extends Object with A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 83, 1, contextMessages: [message(testFile, 22, 1)], @@ -896,7 +896,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 65, 1, contextMessages: [message(testFile, 16, 1)], @@ -921,7 +921,7 @@ augment class B extends A {} ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 50, 3, contextMessages: [message(testFile, 16, 3)], @@ -944,7 +944,7 @@ class C extends B { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 87, 1, contextMessages: [message(testFile, 16, 1)], @@ -969,7 +969,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 129, 1, contextMessages: [message(testFile, 25, 1)], @@ -990,7 +990,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 63, 1, contextMessages: [message(testFile, 16, 1)], @@ -1012,13 +1012,13 @@ mixin M on A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 53, 3, contextMessages: [message(testFile, 19, 3)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 53, 3, contextMessages: [message(testFile, 19, 3)], @@ -1040,7 +1040,7 @@ mixin M on A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 62, 3, contextMessages: [message(testFile, 23, 3)], @@ -1062,7 +1062,7 @@ mixin M on A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 56, 3, contextMessages: [message(testFile, 19, 3)], @@ -1087,7 +1087,7 @@ augment mixin M on A {} ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 50, 3, contextMessages: [message(testFile, 16, 3)], @@ -1109,7 +1109,7 @@ mixin M on A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 57, 3, contextMessages: [message(testFile, 16, 3)], @@ -1130,7 +1130,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 66, 1, contextMessages: [message(testFile, 21, 1)], @@ -1155,7 +1155,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 173, 8, contextMessages: [message(testFile, 77, 8)], @@ -1181,7 +1181,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 166, 8, contextMessages: [message(testFile, 77, 8)], @@ -1205,13 +1205,13 @@ class B implements I, J { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 125, 1, contextMessages: [message(testFile, 28, 1)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 125, 1, contextMessages: [message(testFile, 68, 1)], @@ -1257,7 +1257,7 @@ abstract class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 95, 1, contextMessages: [message(testFile, 34, 1)], @@ -1315,7 +1315,7 @@ abstract class B implements A { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 86, 1, contextMessages: [message(testFile, 25, 1)], diff --git a/pkg/analyzer/test/src/diagnostics/invalid_reference_to_generative_enum_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_reference_to_generative_enum_constructor_test.dart index c9a2ed19630..f7851bda4bb 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_reference_to_generative_enum_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_reference_to_generative_enum_constructor_test.dart @@ -62,7 +62,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 58, 7, ), @@ -85,7 +85,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 58, 7, ), @@ -116,12 +116,12 @@ enum E { ''', [ error( - CompileTimeErrorCode.ENUM_CONSTANT_INVOKES_FACTORY_CONSTRUCTOR, + CompileTimeErrorCode.enumConstantInvokesFactoryConstructor, 11, 1, ), error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 37, 7, ), @@ -142,7 +142,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 29, 5, ), @@ -163,7 +163,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 35, 1, ), @@ -184,7 +184,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 33, 1, ), @@ -205,7 +205,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 29, 1, ), @@ -237,7 +237,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.INVALID_REFERENCE_TO_GENERATIVE_ENUM_CONSTRUCTOR, + CompileTimeErrorCode.invalidReferenceToGenerativeEnumConstructor, 43, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/invalid_reference_to_this_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_reference_to_this_test.dart index 9084fcd4fa1..ebf7636fa7e 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_reference_to_this_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_reference_to_this_test.dart @@ -24,7 +24,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 26, 1)], + [error(WarningCode.unusedLocalVariable, 26, 1)], ); } @@ -35,7 +35,7 @@ class A { factory A() { return this; } } ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 33, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 33, 4)], ); } @@ -57,7 +57,7 @@ class A { A() : f = this; } ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 31, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 31, 4)], ); } @@ -68,7 +68,7 @@ class A { var f = this; } ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 20, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 20, 4)], ); } @@ -79,7 +79,7 @@ class A { static m() { return this; } } ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 32, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 32, 4)], ); } @@ -90,7 +90,7 @@ class A { static A f = this; } ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 25, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 25, 4)], ); } @@ -104,7 +104,7 @@ class B extends A { B() : super(this); } ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 60, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 60, 4)], ); } @@ -129,7 +129,7 @@ mixin A { ''' f() { return this; } ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 13, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 13, 4)], ); } @@ -138,7 +138,7 @@ f() { return this; } ''' int x = this; ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 8, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 8, 4)], ); } @@ -147,7 +147,7 @@ int x = this; ''' late var x = this; ''', - [error(CompileTimeErrorCode.INVALID_REFERENCE_TO_THIS, 13, 4)], + [error(CompileTimeErrorCode.invalidReferenceToThis, 13, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_reopen_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_reopen_annotation_test.dart index ed323be847e..b18f3c9c3ff 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_reopen_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_reopen_annotation_test.dart @@ -31,7 +31,7 @@ base mixin M {} @reopen base class B with M {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 52, 6)], + [error(WarningCode.invalidReopenAnnotation, 52, 6)], ); } @@ -45,7 +45,7 @@ class A {} @reopen base class B extends A {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 47, 6)], + [error(WarningCode.invalidReopenAnnotation, 47, 6)], ); } @@ -59,7 +59,7 @@ base class A {} @reopen base class B extends A {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 52, 6)], + [error(WarningCode.invalidReopenAnnotation, 52, 6)], ); } @@ -95,7 +95,7 @@ sealed class A {} @reopen base class B extends A {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 54, 6)], + [error(WarningCode.invalidReopenAnnotation, 54, 6)], ); } @@ -109,7 +109,7 @@ final class A {} @reopen base mixin class B implements A {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 53, 6)], + [error(WarningCode.invalidReopenAnnotation, 53, 6)], ); } @@ -123,7 +123,7 @@ extension type E(int i) { void m() { } } ''', - [error(WarningCode.INVALID_ANNOTATION_TARGET, 35, 6)], + [error(WarningCode.invalidAnnotationTarget, 35, 6)], ); } @@ -137,7 +137,7 @@ final class A {} @reopen final class B extends A {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 53, 6)], + [error(WarningCode.invalidReopenAnnotation, 53, 6)], ); } @@ -152,7 +152,7 @@ mixin M {} @reopen final class B = A with M; ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 64, 6)], + [error(WarningCode.invalidReopenAnnotation, 64, 6)], ); } @@ -164,7 +164,7 @@ import 'package:meta/meta.dart'; @reopen class A {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 35, 6)], + [error(WarningCode.invalidReopenAnnotation, 35, 6)], ); } @@ -180,7 +180,7 @@ import 'lib.dart'; @reopen class B implements A {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 54, 6)], + [error(WarningCode.invalidReopenAnnotation, 54, 6)], ); } @@ -205,7 +205,7 @@ base mixin M {} @reopen sealed class B with M {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 52, 6)], + [error(WarningCode.invalidReopenAnnotation, 52, 6)], ); } @@ -219,7 +219,7 @@ final class A {} @reopen sealed class B extends A {} ''', - [error(WarningCode.INVALID_REOPEN_ANNOTATION, 53, 6)], + [error(WarningCode.invalidReopenAnnotation, 53, 6)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_required_named_param_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_required_named_param_test.dart index 2f38e860316..7d22ab2a61c 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_required_named_param_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_required_named_param_test.dart @@ -28,7 +28,7 @@ import 'package:meta/meta.dart'; m({@required a = 1}) => null; ''', - [error(WarningCode.INVALID_REQUIRED_NAMED_PARAM, 37, 15)], + [error(WarningCode.invalidRequiredNamedParam, 37, 15)], ); } @@ -39,7 +39,7 @@ import 'package:meta/meta.dart'; m(a, {@required b = 1}) => null; ''', - [error(WarningCode.INVALID_REQUIRED_NAMED_PARAM, 40, 15)], + [error(WarningCode.invalidRequiredNamedParam, 40, 15)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_required_optional_positional_param_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_required_optional_positional_param_test.dart index 7c33204cdc2..bff724528ed 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_required_optional_positional_param_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_required_optional_positional_param_test.dart @@ -29,7 +29,7 @@ import 'package:meta/meta.dart'; m([@required a]) => null; ''', - [error(WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM, 37, 11)], + [error(WarningCode.invalidRequiredOptionalPositionalParam, 37, 11)], ); } @@ -40,7 +40,7 @@ import 'package:meta/meta.dart'; m(a, [@required b]) => null; ''', - [error(WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM, 40, 11)], + [error(WarningCode.invalidRequiredOptionalPositionalParam, 40, 11)], ); } @@ -51,7 +51,7 @@ import 'package:meta/meta.dart'; m([@required a = 1]) => null; ''', - [error(WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM, 37, 15)], + [error(WarningCode.invalidRequiredOptionalPositionalParam, 37, 15)], ); } @@ -62,7 +62,7 @@ import 'package:meta/meta.dart'; m([a, @required b = 1]) => null; ''', - [error(WarningCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM, 40, 15)], + [error(WarningCode.invalidRequiredOptionalPositionalParam, 40, 15)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_required_positional_param_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_required_positional_param_test.dart index b57716701e7..cc81e30ccfb 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_required_positional_param_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_required_positional_param_test.dart @@ -28,7 +28,7 @@ import 'package:meta/meta.dart'; m(@required a) => null; ''', - [error(WarningCode.INVALID_REQUIRED_POSITIONAL_PARAM, 36, 11)], + [error(WarningCode.invalidRequiredPositionalParam, 36, 11)], ); } @@ -39,7 +39,7 @@ import 'package:meta/meta.dart'; m(a, @required b) => null; ''', - [error(WarningCode.INVALID_REQUIRED_POSITIONAL_PARAM, 39, 11)], + [error(WarningCode.invalidRequiredPositionalParam, 39, 11)], ); } @@ -50,7 +50,7 @@ import 'package:meta/meta.dart'; typedef F = void Function(@required int a); ''', - [error(WarningCode.INVALID_REQUIRED_POSITIONAL_PARAM, 60, 15)], + [error(WarningCode.invalidRequiredPositionalParam, 60, 15)], ); } @@ -61,7 +61,7 @@ import 'package:meta/meta.dart'; typedef F = void Function(@required int); ''', - [error(WarningCode.INVALID_REQUIRED_POSITIONAL_PARAM, 60, 13)], + [error(WarningCode.invalidRequiredPositionalParam, 60, 13)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_super_formal_parameter_location_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_super_formal_parameter_location_test.dart index da246570cae..cb65fa4e53a 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_super_formal_parameter_location_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_super_formal_parameter_location_test.dart @@ -22,13 +22,7 @@ class A { external A(super.a); } ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 23, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 23, 5)], ); } @@ -42,13 +36,7 @@ class A { A._(); } ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 22, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 22, 5)], ); } @@ -60,13 +48,7 @@ class A { A._(); } ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 14, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 14, 5)], ); } @@ -77,13 +59,7 @@ class A { void foo(super.a) {} } ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 21, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 21, 5)], ); } @@ -94,13 +70,7 @@ extension E on int { void foo(super.a) {} } ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 32, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 32, 5)], ); } @@ -112,13 +82,7 @@ void f() { void g(super.a) {} } ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 47, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 47, 5)], ); } @@ -129,13 +93,7 @@ mixin M { void foo(super.a) {} } ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 21, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 21, 5)], ); } @@ -144,13 +102,7 @@ mixin M { r''' void f(super.a) {} ''', - [ - error( - CompileTimeErrorCode.INVALID_SUPER_FORMAL_PARAMETER_LOCATION, - 7, - 5, - ), - ], + [error(CompileTimeErrorCode.invalidSuperFormalParameterLocation, 7, 5)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_super_in_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_super_in_initializer_test.dart index 0069053569e..e4c79084a2b 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_super_in_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_super_in_initializer_test.dart @@ -23,9 +23,9 @@ class C { } ''', [ - error(ParserErrorCode.INVALID_SUPER_IN_INITIALIZER, 18, 5), - error(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 24, 5), - error(ParserErrorCode.MISSING_IDENTIFIER, 24, 5), + error(ParserErrorCode.invalidSuperInInitializer, 18, 5), + error(ParserErrorCode.expectedIdentifierButGotKeyword, 24, 5), + error(ParserErrorCode.missingIdentifier, 24, 5), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_list_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_list_test.dart index ff3b5fa90d7..ddf3afbb58d 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_list_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_list_test.dart @@ -36,7 +36,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST, + CompileTimeErrorCode.invalidTypeArgumentInConstList, 37, 1, messageContains: ["'E'"], @@ -56,7 +56,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST, + CompileTimeErrorCode.invalidTypeArgumentInConstList, 51, 1, messageContains: ["'E'"], @@ -76,7 +76,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST, + CompileTimeErrorCode.invalidTypeArgumentInConstList, 37, 1, messageContains: ["'E'"], @@ -96,7 +96,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST, + CompileTimeErrorCode.invalidTypeArgumentInConstList, 42, 1, messageContains: ["'E'"], @@ -116,7 +116,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST, + CompileTimeErrorCode.invalidTypeArgumentInConstList, 38, 1, messageContains: ["'E'"], diff --git a/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_map_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_map_test.dart index eb1b62b6649..23ee942d701 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_map_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_map_test.dart @@ -25,7 +25,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP, + CompileTimeErrorCode.invalidTypeArgumentInConstMap, 96, 1, messageContains: ["'E'"], @@ -55,7 +55,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP, + CompileTimeErrorCode.invalidTypeArgumentInConstMap, 37, 1, messageContains: ["'E'"], @@ -75,7 +75,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP, + CompileTimeErrorCode.invalidTypeArgumentInConstMap, 56, 1, messageContains: ["'E'"], @@ -95,7 +95,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP, + CompileTimeErrorCode.invalidTypeArgumentInConstMap, 45, 1, messageContains: ["'E'"], @@ -115,7 +115,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP, + CompileTimeErrorCode.invalidTypeArgumentInConstMap, 50, 1, messageContains: ["'E'"], diff --git a/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_set_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_set_test.dart index 3ab9c0723ea..9dc97df8c46 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_set_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_type_argument_in_const_set_test.dart @@ -36,7 +36,7 @@ class A { ''', [ error( - CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_SET, + CompileTimeErrorCode.invalidTypeArgumentInConstSet, 37, 1, messageContains: ["'E'"], diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_covariant_in_extension_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_covariant_in_extension_test.dart index 7804aa6c028..9163ae4f5b0 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_covariant_in_extension_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_covariant_in_extension_test.dart @@ -22,7 +22,7 @@ extension E on String { void foo({covariant int a = 0}) {} } ''', - [error(ParserErrorCode.INVALID_USE_OF_COVARIANT_IN_EXTENSION, 36, 9)], + [error(ParserErrorCode.invalidUseOfCovariantInExtension, 36, 9)], ); } @@ -33,7 +33,7 @@ extension E on String { void foo([covariant int a = 0]) {} } ''', - [error(ParserErrorCode.INVALID_USE_OF_COVARIANT_IN_EXTENSION, 36, 9)], + [error(ParserErrorCode.invalidUseOfCovariantInExtension, 36, 9)], ); } @@ -44,7 +44,7 @@ extension E on String { void foo(covariant int a) {} } ''', - [error(ParserErrorCode.INVALID_USE_OF_COVARIANT_IN_EXTENSION, 35, 9)], + [error(ParserErrorCode.invalidUseOfCovariantInExtension, 35, 9)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_covariant_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_covariant_test.dart index 01aae3199c4..140d1008c16 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_covariant_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_covariant_test.dart @@ -21,7 +21,7 @@ class InvalidUseOfCovariantTest extends PubPackageResolutionTest { ''' Function f = (covariant int x) {}; ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, 14, 9)], + [error(CompileTimeErrorCode.invalidUseOfCovariant, 14, 9)], ); } @@ -32,7 +32,7 @@ class C { void m(void p(covariant int)) {} } ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, 26, 9)], + [error(CompileTimeErrorCode.invalidUseOfCovariant, 26, 9)], ); } @@ -43,7 +43,7 @@ class C { void m(void Function(covariant int) p) {} } ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, 33, 9)], + [error(CompileTimeErrorCode.invalidUseOfCovariant, 33, 9)], ); } @@ -52,7 +52,7 @@ class C { ''' typedef F = void Function(covariant int); ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, 26, 9)], + [error(CompileTimeErrorCode.invalidUseOfCovariant, 26, 9)], ); } @@ -63,10 +63,10 @@ List a = []; } ''', [ - error(CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, 19, 9), + error(CompileTimeErrorCode.invalidUseOfCovariant, 19, 9), // TODO(srawlins): Recover better from this situation (`covariant` in // parameter in type argument). - error(ParserErrorCode.EXPECTED_EXECUTABLE, 43, 1), + error(ParserErrorCode.expectedExecutable, 43, 1), ], ); } @@ -78,10 +78,10 @@ void foo() {} } ''', [ - error(CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, 33, 9), + error(CompileTimeErrorCode.invalidUseOfCovariant, 33, 9), // TODO(srawlins): Recover better from this situation (`covariant` in // parameter in bound). - error(ParserErrorCode.EXPECTED_EXECUTABLE, 54, 1), + error(ParserErrorCode.expectedExecutable, 54, 1), ], ); } @@ -94,8 +94,8 @@ void foo() { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 20, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_COVARIANT, 22, 9), + error(WarningCode.unusedElement, 20, 1), + error(CompileTimeErrorCode.invalidUseOfCovariant, 22, 9), ], ); } @@ -109,7 +109,7 @@ class C { ''', [ // INVALID_USE_OF_COVARIANT is not reported here; it would be redundant. - error(ParserErrorCode.EXTRANEOUS_MODIFIER, 26, 9), + error(ParserErrorCode.extraneousModifier, 26, 9), ], ); } @@ -123,7 +123,7 @@ mixin M { ''', [ // INVALID_USE_OF_COVARIANT is not reported here; it would be redundant. - error(ParserErrorCode.EXTRANEOUS_MODIFIER, 26, 9), + error(ParserErrorCode.extraneousModifier, 26, 9), ], ); } @@ -135,7 +135,7 @@ void f(covariant int x) {} ''', [ // INVALID_USE_OF_COVARIANT is not reported here; it would be redundant. - error(ParserErrorCode.EXTRANEOUS_MODIFIER, 7, 9), + error(ParserErrorCode.extraneousModifier, 7, 9), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_internal_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_internal_member_test.dart index 537740c391c..cfd59ff74b5 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_internal_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_internal_member_test.dart @@ -81,7 +81,7 @@ import 'package:foo/src/a.dart'; A a = A(); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 34, 1)], + [error(WarningCode.invalidUseOfInternalMember, 34, 1)], ); } @@ -100,7 +100,7 @@ void f(Object o) { o as A; } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 60, 1)], + [error(WarningCode.invalidUseOfInternalMember, 60, 1)], ); } @@ -119,7 +119,7 @@ void f(Object a, Object b) { (b as A, ) = (a, ); } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 71, 1)], + [error(WarningCode.invalidUseOfInternalMember, 71, 1)], ); } @@ -138,7 +138,7 @@ void f(Object o) { o is A; } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 60, 1)], + [error(WarningCode.invalidUseOfInternalMember, 60, 1)], ); } @@ -159,7 +159,7 @@ void f(Object a, Object b) { } } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 87, 1)], + [error(WarningCode.invalidUseOfInternalMember, 87, 1)], ); } @@ -176,7 +176,7 @@ import 'package:foo/src/a.dart'; A? a; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 34, 1)], + [error(WarningCode.invalidUseOfInternalMember, 34, 1)], ); } @@ -195,7 +195,7 @@ import 'package:foo/src/a.dart'; C a = C.named(); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 40, 7)], + [error(WarningCode.invalidUseOfInternalMember, 40, 7)], ); } @@ -214,7 +214,7 @@ import 'package:foo/src/a.dart'; C a = C(); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 40, 1)], + [error(WarningCode.invalidUseOfInternalMember, 40, 1)], ); } @@ -231,7 +231,7 @@ import 'package:foo/src/a.dart'; void f(E value) {} ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 41, 1)], + [error(WarningCode.invalidUseOfInternalMember, 41, 1)], ); } @@ -247,7 +247,7 @@ import 'package:foo/src/a.dart'; E f() => E.one; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 45, 3)], + [error(WarningCode.invalidUseOfInternalMember, 45, 3)], ); } @@ -266,7 +266,7 @@ import 'package:foo/src/a.dart'; int a = 'hello'.f(); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 50, 1)], + [error(WarningCode.invalidUseOfInternalMember, 50, 1)], ); } @@ -283,7 +283,7 @@ import 'package:foo/src/a.dart'; E e = E(1); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 34, 1)], + [error(WarningCode.invalidUseOfInternalMember, 34, 1)], ); } @@ -306,7 +306,7 @@ void f(Object o) { } } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 79, 1)], + [error(WarningCode.invalidUseOfInternalMember, 79, 1)], ); } @@ -323,7 +323,7 @@ import 'package:foo/src/a.dart'; int b = a() + 1; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 42, 1)], + [error(WarningCode.invalidUseOfInternalMember, 42, 1)], ); } @@ -340,7 +340,7 @@ import 'package:foo/src/a.dart'; int b = a() + 1; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 42, 1)], + [error(WarningCode.invalidUseOfInternalMember, 42, 1)], ); } @@ -357,7 +357,7 @@ import 'package:foo/src/a.dart'; int Function() b = a; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 53, 1)], + [error(WarningCode.invalidUseOfInternalMember, 53, 1)], ); } @@ -374,7 +374,7 @@ import 'package:foo/src/a.dart'; int Function() b = a; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 53, 1)], + [error(WarningCode.invalidUseOfInternalMember, 53, 1)], ); } @@ -419,8 +419,8 @@ import 'package:meta/meta.dart'; import 'package:foo/src/a.dart'; ''', [ - error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 0, 32), - error(WarningCode.UNUSED_IMPORT, 7, 24), + error(WarningCode.invalidUseOfInternalMember, 0, 32), + error(WarningCode.unusedImport, 7, 24), ], ); } @@ -440,7 +440,7 @@ import 'package:foo/src/a.dart'; int a = C().m(); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 46, 1)], + [error(WarningCode.invalidUseOfInternalMember, 46, 1)], ); } @@ -459,7 +459,7 @@ import 'package:foo/src/a.dart'; int a = C().m(); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 46, 1)], + [error(WarningCode.invalidUseOfInternalMember, 46, 1)], ); } @@ -479,7 +479,7 @@ import 'package:foo/src/a.dart'; int a = D().f(); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 46, 1)], + [error(WarningCode.invalidUseOfInternalMember, 46, 1)], ); } @@ -517,7 +517,7 @@ import 'package:foo/src/a.dart'; int Function() a = C().m; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 57, 1)], + [error(WarningCode.invalidUseOfInternalMember, 57, 1)], ); } @@ -535,7 +535,7 @@ import 'package:foo/src/a.dart'; int a = C().m(a: 5); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 48, 1)], + [error(WarningCode.invalidUseOfInternalMember, 48, 1)], ); } @@ -554,7 +554,7 @@ import 'package:foo/src/a.dart'; int a = C().m(5); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 48, 1)], + [error(WarningCode.invalidUseOfInternalMember, 48, 1)], ); } @@ -571,7 +571,7 @@ import 'package:foo/src/a.dart'; class C with A {} ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 47, 1)], + [error(WarningCode.invalidUseOfInternalMember, 47, 1)], ); } @@ -593,7 +593,7 @@ class D extends C { void g() => f(); } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 68, 1)], + [error(WarningCode.invalidUseOfInternalMember, 68, 1)], ); } @@ -614,7 +614,7 @@ class C { factory C() = D; } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 60, 1)], + [error(WarningCode.invalidUseOfInternalMember, 60, 1)], ); } @@ -635,7 +635,7 @@ f() { C().s = 7; } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 46, 1)], + [error(WarningCode.invalidUseOfInternalMember, 46, 1)], ); } @@ -658,7 +658,7 @@ f() { C().s += 7; } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 46, 1)], + [error(WarningCode.invalidUseOfInternalMember, 46, 1)], ); } @@ -681,7 +681,7 @@ f() { C().s ??= 7; } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 46, 1)], + [error(WarningCode.invalidUseOfInternalMember, 46, 1)], ); } @@ -701,7 +701,7 @@ class D extends C { D() : super(); } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 62, 7)], + [error(WarningCode.invalidUseOfInternalMember, 62, 7)], ); } @@ -721,7 +721,7 @@ class D extends C { D() : super.named(); } ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 68, 5)], + [error(WarningCode.invalidUseOfInternalMember, 68, 5)], ); } @@ -738,7 +738,7 @@ import 'package:foo/src/a.dart'; int b = a + 1; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 42, 1)], + [error(WarningCode.invalidUseOfInternalMember, 42, 1)], ); } @@ -755,7 +755,7 @@ import 'package:foo/src/a.dart'; t func = () {}; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 34, 1)], + [error(WarningCode.invalidUseOfInternalMember, 34, 1)], ); } @@ -772,7 +772,7 @@ import 'package:foo/src/a.dart'; void f(T t) => t(a: 5); ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 42, 1)], + [error(WarningCode.invalidUseOfInternalMember, 42, 1)], ); } @@ -789,7 +789,7 @@ import 'package:foo/src/a.dart'; int b = a + 1; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 42, 1)], + [error(WarningCode.invalidUseOfInternalMember, 42, 1)], ); } @@ -806,7 +806,7 @@ import 'package:foo/src/a.dart' as foo; int b = foo.a + 1; ''', - [error(WarningCode.INVALID_USE_OF_INTERNAL_MEMBER, 53, 1)], + [error(WarningCode.invalidUseOfInternalMember, 53, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_protected_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_protected_member_test.dart index ca44ed536d5..4bf3f7fdbba 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_protected_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_protected_member_test.dart @@ -42,7 +42,7 @@ void main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ error( - WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, + WarningCode.invalidUseOfProtectedMember, 56, 1, text: @@ -82,7 +82,7 @@ extension E on A { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 51, 1), + error(WarningCode.invalidUseOfProtectedMember, 51, 1), ]); } @@ -118,7 +118,7 @@ void main() { '''); await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 43, 1), + error(WarningCode.invalidUseOfProtectedMember, 43, 1), ]); } @@ -151,7 +151,7 @@ void main() { '''); await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 41, 1), + error(WarningCode.invalidUseOfProtectedMember, 41, 1), ]); } @@ -185,7 +185,7 @@ abstract class B { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 60, 1), + error(WarningCode.invalidUseOfProtectedMember, 60, 1), ]); } @@ -241,7 +241,7 @@ main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 40, 1), + error(WarningCode.invalidUseOfProtectedMember, 40, 1), ]); } @@ -301,7 +301,7 @@ class B { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 58, 1), + error(WarningCode.invalidUseOfProtectedMember, 58, 1), ]); } @@ -324,7 +324,7 @@ void f(Object o) { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 65, 1), + error(WarningCode.invalidUseOfProtectedMember, 65, 1), ]); } @@ -383,7 +383,7 @@ class B { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 53, 1), + error(WarningCode.invalidUseOfProtectedMember, 53, 1), ]); } @@ -471,7 +471,7 @@ class B { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_PROTECTED_MEMBER, 62, 1), + error(WarningCode.invalidUseOfProtectedMember, 62, 1), ]); } @@ -488,7 +488,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_FIELD, 49, 2)], + [error(WarningCode.unusedField, 49, 2)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_overriding_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_overriding_member_test.dart index a7baab25990..f0e0e62eb0a 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_overriding_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_overriding_member_test.dart @@ -41,7 +41,7 @@ class Child extends Parent { } } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 63, 3)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 63, 3)], ); } @@ -109,7 +109,7 @@ class B { } } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 56, 1)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 56, 1)], ); } @@ -133,7 +133,7 @@ void f(Object o) { } } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 63, 1)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 63, 1)], ); } @@ -155,7 +155,7 @@ class B { void m(A a) => a > A(); } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 47, 1)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 47, 1)], ); } @@ -180,7 +180,7 @@ class B extends A { int get x => super.g + 1; } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 100, 1)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 100, 1)], ); } @@ -205,7 +205,7 @@ class B extends A { void x() => super.m(); } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 96, 1)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 96, 1)], ); } @@ -230,7 +230,7 @@ class B extends A { void m() => super > A(); } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 111, 1)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 111, 1)], ); } @@ -255,7 +255,7 @@ class B extends A { set x(int i) => super.s = i; } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 106, 1)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 106, 1)], ); } @@ -296,7 +296,7 @@ class B { } } ''', - [error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_OVERRIDING_MEMBER, 50, 1)], + [error(WarningCode.invalidUseOfVisibleForOverridingMember, 50, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_template_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_template_member_test.dart index 900460ddaed..1d1a2307444 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_template_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_template_member_test.dart @@ -47,9 +47,9 @@ void f() { } '''); - await assertErrorsInFile2(lib1, [error(WarningCode.UNUSED_FIELD, 66, 2)]); + await assertErrorsInFile2(lib1, [error(WarningCode.unusedField, 66, 2)]); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 38, 13), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 38, 13), ]); } @@ -72,9 +72,9 @@ void f() { } '''); - await assertErrorsInFile2(lib1, [error(WarningCode.UNUSED_FIELD, 66, 2)]); + await assertErrorsInFile2(lib1, [error(WarningCode.unusedField, 66, 2)]); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 38, 1), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 38, 1), ]); } @@ -116,7 +116,7 @@ void f(A a) { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 39, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 39, 3), ]); } @@ -164,7 +164,7 @@ void f(A a) { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 39, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 39, 3), ]); } @@ -209,7 +209,7 @@ void f(C c) { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 39, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 39, 3), ]); } @@ -303,7 +303,7 @@ void f(A a) { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 39, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 39, 3), ]); } @@ -349,7 +349,7 @@ void f() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 36, 1), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 36, 1), ]); } @@ -434,7 +434,7 @@ void f() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 73, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 73, 3), ]); } @@ -457,7 +457,7 @@ class B extends A { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 63, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 63, 3), ]); } @@ -534,7 +534,7 @@ void f() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 40, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 40, 3), ]); } @@ -664,7 +664,7 @@ void f() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 34, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 34, 3), ]); } @@ -685,7 +685,7 @@ void f() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TEMPLATE_MEMBER, 34, 3), + error(WarningCode.invalidUseOfVisibleForTemplateMember, 34, 3), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_testing_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_testing_member_test.dart index 07b43868abb..336b66d491e 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_testing_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_testing_member_test.dart @@ -153,7 +153,7 @@ void main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 42, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 42, 1), ]); } @@ -193,7 +193,7 @@ void main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 44, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 44, 1), ]); } @@ -216,7 +216,7 @@ void f(Object o) { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 65, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 65, 1), ]); } @@ -258,8 +258,8 @@ void f(A _) {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 21, 1), - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 32, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 21, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 32, 1), ]); } @@ -280,7 +280,7 @@ class B { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 52, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 52, 1), ]); } @@ -321,7 +321,7 @@ void main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 41, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 41, 1), ]); } @@ -362,7 +362,7 @@ void main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 40, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 40, 1), ]); } @@ -383,10 +383,10 @@ void main() { } '''); - await assertErrorsInFile2(lib1, [error(WarningCode.UNUSED_FIELD, 49, 2)]); + await assertErrorsInFile2(lib1, [error(WarningCode.unusedField, 49, 2)]); await assertErrorsInFile2(lib2, [ error( - WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, + WarningCode.invalidUseOfVisibleForTestingMember, 40, 12, messageContains: ['A.forTesting'], @@ -451,7 +451,7 @@ void main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 44, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 44, 1), ]); } @@ -470,7 +470,7 @@ void main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 36, 3), + error(WarningCode.invalidUseOfVisibleForTestingMember, 36, 3), ]); } @@ -489,7 +489,7 @@ void main() { await assertErrorsInFile2(lib1, []); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 36, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 36, 1), ]); } @@ -510,9 +510,9 @@ void main() { } '''); - await assertErrorsInFile2(lib1, [error(WarningCode.UNUSED_FIELD, 49, 2)]); + await assertErrorsInFile2(lib1, [error(WarningCode.unusedField, 49, 2)]); await assertErrorsInFile2(lib2, [ - error(WarningCode.INVALID_USE_OF_VISIBLE_FOR_TESTING_MEMBER, 40, 1), + error(WarningCode.invalidUseOfVisibleForTestingMember, 40, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_visibility_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_visibility_annotation_test.dart index 86c426e2259..5c98ade1300 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_visibility_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_visibility_annotation_test.dart @@ -30,8 +30,8 @@ class C { } ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 46, 17), - error(WarningCode.UNUSED_FIELD, 68, 2), + error(WarningCode.invalidVisibilityAnnotation, 46, 17), + error(WarningCode.unusedField, 68, 2), ], ); } @@ -45,10 +45,10 @@ class C { } ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 46, 17), - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 46, 17), - error(WarningCode.UNUSED_FIELD, 68, 2), - error(WarningCode.UNUSED_FIELD, 76, 2), + error(WarningCode.invalidVisibilityAnnotation, 46, 17), + error(WarningCode.invalidVisibilityAnnotation, 46, 17), + error(WarningCode.unusedField, 68, 2), + error(WarningCode.unusedField, 76, 2), ], ); } @@ -69,8 +69,8 @@ import 'package:meta/meta.dart'; @visibleForTesting class _C {} ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.UNUSED_ELEMENT, 58, 2), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.unusedElement, 58, 2), ], ); } @@ -83,7 +83,7 @@ class C { @visibleForTesting C._() {} } ''', - [error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 46, 17)], + [error(WarningCode.invalidVisibilityAnnotation, 46, 17)], ); } @@ -94,7 +94,7 @@ import 'package:meta/meta.dart'; @visibleForTesting enum _E {a, b} void f(_E e) => e == _E.a || e == _E.b; ''', - [error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17)], + [error(WarningCode.invalidVisibilityAnnotation, 34, 17)], ); } @@ -105,8 +105,8 @@ import 'package:meta/meta.dart'; @visibleForTesting extension type _E(int i) {} ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.UNUSED_ELEMENT, 67, 2), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.unusedElement, 67, 2), ], ); } @@ -120,8 +120,8 @@ class C { } ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 46, 17), - error(WarningCode.UNUSED_FIELD, 68, 2), + error(WarningCode.invalidVisibilityAnnotation, 46, 17), + error(WarningCode.unusedField, 68, 2), ], ); } @@ -135,8 +135,8 @@ class C { } ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 46, 17), - error(WarningCode.UNUSED_ELEMENT, 69, 2), + error(WarningCode.invalidVisibilityAnnotation, 46, 17), + error(WarningCode.unusedElement, 69, 2), ], ); } @@ -148,8 +148,8 @@ import 'package:meta/meta.dart'; @visibleForTesting mixin _M {} ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.UNUSED_ELEMENT, 58, 2), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.unusedElement, 58, 2), ], ); } @@ -161,8 +161,8 @@ import 'package:meta/meta.dart'; @visibleForTesting void _f() {} ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.UNUSED_ELEMENT, 57, 2), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.unusedElement, 57, 2), ], ); } @@ -174,8 +174,8 @@ import 'package:meta/meta.dart'; @visibleForTesting final _a = 1; ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.UNUSED_ELEMENT, 58, 2), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.unusedElement, 58, 2), ], ); } @@ -187,8 +187,8 @@ import 'package:meta/meta.dart'; @visibleForTesting typedef _T = Function(); ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.UNUSED_ELEMENT, 60, 2), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.unusedElement, 60, 2), ], ); } @@ -200,8 +200,8 @@ import 'package:meta/meta.dart'; @visibleForTesting final _a = 1, b = 2; ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.UNUSED_ELEMENT, 58, 2), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.unusedElement, 58, 2), ], ); } @@ -213,10 +213,10 @@ import 'package:meta/meta.dart'; @visibleForTesting final _a = 1, _b = 2; ''', [ - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.INVALID_VISIBILITY_ANNOTATION, 34, 17), - error(WarningCode.UNUSED_ELEMENT, 58, 2), - error(WarningCode.UNUSED_ELEMENT, 66, 2), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.invalidVisibilityAnnotation, 34, 17), + error(WarningCode.unusedElement, 58, 2), + error(WarningCode.unusedElement, 66, 2), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_visible_for_overriding_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_visible_for_overriding_annotation_test.dart index 7cbb4609d53..161a64e9711 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_visible_for_overriding_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_visible_for_overriding_annotation_test.dart @@ -29,7 +29,7 @@ import 'package:meta/meta.dart'; @visibleForOverriding class C {} ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 34, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 34, 20)], ); } @@ -42,7 +42,7 @@ class C { C(); } ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 46, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 46, 20)], ); } @@ -53,7 +53,7 @@ import 'package:meta/meta.dart'; @visibleForOverriding extension on double {} ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 34, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 34, 20)], ); } @@ -66,7 +66,7 @@ extension E on String { void foo() {} } ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 60, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 60, 20)], ); } @@ -77,7 +77,7 @@ import 'package:meta/meta.dart'; @visibleForOverriding extension type E(int i) {} ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 34, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 34, 20)], ); } @@ -91,7 +91,7 @@ extension type E(int i) { void f() { } } ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 64, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 64, 20)], ); } @@ -104,7 +104,7 @@ class C { static void m() {} } ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 46, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 46, 20)], ); } @@ -114,7 +114,7 @@ class C { import 'package:meta/meta.dart'; @visibleForOverriding void foo() {} ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 34, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 34, 20)], ); } @@ -124,7 +124,7 @@ import 'package:meta/meta.dart'; import 'package:meta/meta.dart'; @visibleForOverriding final a = 1; ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 34, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 34, 20)], ); } @@ -134,7 +134,7 @@ import 'package:meta/meta.dart'; import 'package:meta/meta.dart'; @visibleForOverriding var a = 1, b; ''', - [error(WarningCode.INVALID_VISIBLE_FOR_OVERRIDING_ANNOTATION, 34, 20)], + [error(WarningCode.invalidVisibleForOverridingAnnotation, 34, 20)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_visible_outside_template_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_visible_outside_template_annotation_test.dart index 756703fbf40..05bf3c2a22d 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_visible_outside_template_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_visible_outside_template_annotation_test.dart @@ -38,7 +38,7 @@ class C { C(); } ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 63, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 63, 22)], ); } @@ -50,7 +50,7 @@ import 'package:angular_meta/angular_meta.dart'; @visibleOutsideTemplate class C {} ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 51, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 51, 22)], ); } @@ -64,7 +64,7 @@ class C { int a = 0; } ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 63, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 63, 22)], ); } @@ -78,7 +78,7 @@ class C { void m() {} } ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 63, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 63, 22)], ); } @@ -93,7 +93,7 @@ enum E { void test() {} } ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 67, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 67, 22)], ); } @@ -108,7 +108,7 @@ enum E { b, } ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 62, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 62, 22)], ); } @@ -120,7 +120,7 @@ import 'package:angular_meta/angular_meta.dart'; @visibleOutsideTemplate mixin class M2 {} ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 51, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 51, 22)], ); } @@ -134,7 +134,7 @@ mixin class M2 { int m() => 1; } ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 70, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 70, 22)], ); } @@ -147,7 +147,7 @@ import 'package:angular_meta/angular_meta.dart'; mixin M {} class C2 with M {} ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 51, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 51, 22)], ); } @@ -162,7 +162,7 @@ mixin M { } class C2 with M {} ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 63, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 63, 22)], ); } @@ -174,7 +174,7 @@ import 'package:angular_meta/angular_meta.dart'; @visibleOutsideTemplate void foo() {} ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 51, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 51, 22)], ); } @@ -186,7 +186,7 @@ import 'package:angular_meta/angular_meta.dart'; @visibleOutsideTemplate final a = 1; ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 51, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 51, 22)], ); } @@ -198,7 +198,7 @@ import 'package:angular_meta/angular_meta.dart'; @visibleOutsideTemplate var a = 1, b; ''', - [error(WarningCode.INVALID_VISIBLE_OUTSIDE_TEMPLATE_ANNOTATION, 51, 22)], + [error(WarningCode.invalidVisibleOutsideTemplateAnnotation, 51, 22)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_widget_preview_application_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_widget_preview_application_test.dart index 210c88c445d..e2245855218 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_widget_preview_application_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_widget_preview_application_test.dart @@ -39,7 +39,7 @@ abstract class B extends StatelessWidget { } } ''', - [error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 133, 7)], + [error(WarningCode.invalidWidgetPreviewApplication, 133, 7)], ); } @@ -55,7 +55,7 @@ class B extends StatelessWidget { B(); } ''', - [error(CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, 123, 8)], + [error(CompileTimeErrorCode.noAnnotationConstructorArguments, 123, 8)], ); } @@ -78,9 +78,9 @@ class B extends StatelessWidget { } ''', [ - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 88, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 159, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 189, 7), + error(WarningCode.invalidWidgetPreviewApplication, 88, 7), + error(WarningCode.invalidWidgetPreviewApplication, 159, 7), + error(WarningCode.invalidWidgetPreviewApplication, 189, 7), ], ); } @@ -99,7 +99,7 @@ class B { } } ''', - [error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 100, 7)], + [error(WarningCode.invalidWidgetPreviewApplication, 100, 7)], ); } @@ -129,8 +129,8 @@ class B { } ''', [ - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 105, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 223, 7), + error(WarningCode.invalidWidgetPreviewApplication, 105, 7), + error(WarningCode.invalidWidgetPreviewApplication, 223, 7), ], ); } @@ -177,11 +177,11 @@ extension type FooExtensionType(Foo foo) { } ''', [ - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 219, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 267, 7), - error(WarningCode.UNUSED_ELEMENT, 286, 23), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 359, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 469, 7), + error(WarningCode.invalidWidgetPreviewApplication, 219, 7), + error(WarningCode.invalidWidgetPreviewApplication, 267, 7), + error(WarningCode.unusedElement, 286, 23), + error(WarningCode.invalidWidgetPreviewApplication, 359, 7), + error(WarningCode.invalidWidgetPreviewApplication, 469, 7), ], ); } @@ -210,12 +210,12 @@ class _B extends StatelessWidget { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 93, 2), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 125, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 147, 7), - error(WarningCode.UNUSED_ELEMENT, 170, 3), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 189, 7), - error(WarningCode.UNUSED_ELEMENT, 215, 3), + error(WarningCode.unusedElement, 93, 2), + error(WarningCode.invalidWidgetPreviewApplication, 125, 7), + error(WarningCode.invalidWidgetPreviewApplication, 147, 7), + error(WarningCode.unusedElement, 170, 3), + error(WarningCode.invalidWidgetPreviewApplication, 189, 7), + error(WarningCode.unusedElement, 215, 3), ], ); } @@ -243,10 +243,10 @@ class B extends StatelessWidget { } ''', [ - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 124, 7), - error(WarningCode.UNUSED_ELEMENT, 138, 1), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 147, 7), - error(WarningCode.UNUSED_ELEMENT, 169, 4), + error(WarningCode.invalidWidgetPreviewApplication, 124, 7), + error(WarningCode.unusedElement, 138, 1), + error(WarningCode.invalidWidgetPreviewApplication, 147, 7), + error(WarningCode.unusedElement, 169, 4), ], ); } @@ -271,8 +271,8 @@ class B extends StatelessWidget { } ''', [ - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 124, 7), - error(WarningCode.UNUSED_ELEMENT, 150, 4), + error(WarningCode.invalidWidgetPreviewApplication, 124, 7), + error(WarningCode.unusedElement, 150, 4), ], ); } @@ -290,8 +290,8 @@ Widget _foo() { } ''', [ - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 88, 7), - error(WarningCode.UNUSED_ELEMENT, 105, 4), + error(WarningCode.invalidWidgetPreviewApplication, 88, 7), + error(WarningCode.unusedElement, 105, 4), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/invalid_widget_preview_private_argument_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_widget_preview_private_argument_test.dart index d98cf3e490c..c8a1cf52606 100644 --- a/pkg/analyzer/test/src/diagnostics/invalid_widget_preview_private_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invalid_widget_preview_private_argument_test.dart @@ -77,7 +77,7 @@ Widget privateThemeData() => Text('Foo'); ''', [ error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 388, 18, correctionContains: correctionMessageBuilder( @@ -86,7 +86,7 @@ Widget privateThemeData() => Text('Foo'); ), ), error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 455, 21, correctionContains: correctionMessageBuilder( @@ -95,7 +95,7 @@ Widget privateThemeData() => Text('Foo'); ), ), error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 537, 24, correctionContains: correctionMessageBuilder( @@ -104,7 +104,7 @@ Widget privateThemeData() => Text('Foo'); ), ), error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 615, 20, correctionContains: correctionMessageBuilder( @@ -113,7 +113,7 @@ Widget privateThemeData() => Text('Foo'); ), ), error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 645, 22, correctionContains: correctionMessageBuilder( @@ -122,7 +122,7 @@ Widget privateThemeData() => Text('Foo'); ), ), error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 677, 33, correctionContains: correctionMessageBuilder( @@ -131,7 +131,7 @@ Widget privateThemeData() => Text('Foo'); ), ), error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 762, 25, correctionContains: correctionMessageBuilder( @@ -140,7 +140,7 @@ Widget privateThemeData() => Text('Foo'); ), ), error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 859, 24, correctionContains: correctionMessageBuilder( @@ -149,7 +149,7 @@ Widget privateThemeData() => Text('Foo'); ), ), error( - WarningCode.INVALID_WIDGET_PREVIEW_PRIVATE_ARGUMENT, + WarningCode.invalidWidgetPreviewPrivateArgument, 935, 20, correctionContains: correctionMessageBuilder( diff --git a/pkg/analyzer/test/src/diagnostics/invocation_of_extension_without_call_test.dart b/pkg/analyzer/test/src/diagnostics/invocation_of_extension_without_call_test.dart index 6dcca7e9990..03f62e81218 100644 --- a/pkg/analyzer/test/src/diagnostics/invocation_of_extension_without_call_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invocation_of_extension_without_call_test.dart @@ -23,7 +23,7 @@ f() { E(0)(); } ''', - [error(CompileTimeErrorCode.INVOCATION_OF_EXTENSION_WITHOUT_CALL, 33, 4)], + [error(CompileTimeErrorCode.invocationOfExtensionWithoutCall, 33, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/invocation_of_non_function_expression_test.dart b/pkg/analyzer/test/src/diagnostics/invocation_of_non_function_expression_test.dart index 636863d4e33..d588da9cf6e 100644 --- a/pkg/analyzer/test/src/diagnostics/invocation_of_non_function_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/invocation_of_non_function_expression_test.dart @@ -22,13 +22,7 @@ void f() { 3(5); } ''', - [ - error( - CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION_EXPRESSION, - 13, - 1, - ), - ], + [error(CompileTimeErrorCode.invocationOfNonFunctionExpression, 13, 1)], ); var node = findNode.singleFunctionExpressionInvocation; diff --git a/pkg/analyzer/test/src/diagnostics/label_in_outer_scope_test.dart b/pkg/analyzer/test/src/diagnostics/label_in_outer_scope_test.dart index 1e4ee13ea84..725897e3021 100644 --- a/pkg/analyzer/test/src/diagnostics/label_in_outer_scope_test.dart +++ b/pkg/analyzer/test/src/diagnostics/label_in_outer_scope_test.dart @@ -29,8 +29,8 @@ class A { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 62, 1), - error(CompileTimeErrorCode.LABEL_IN_OUTER_SCOPE, 82, 1), + error(WarningCode.unusedElement, 62, 1), + error(CompileTimeErrorCode.labelInOuterScope, 82, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/label_undefined_test.dart b/pkg/analyzer/test/src/diagnostics/label_undefined_test.dart index b9b3977e7c3..98f466b6350 100644 --- a/pkg/analyzer/test/src/diagnostics/label_undefined_test.dart +++ b/pkg/analyzer/test/src/diagnostics/label_undefined_test.dart @@ -25,8 +25,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LABEL, 8, 2), - error(CompileTimeErrorCode.LABEL_UNDEFINED, 36, 1), + error(WarningCode.unusedLabel, 8, 2), + error(CompileTimeErrorCode.labelUndefined, 36, 1), ], ); } @@ -40,7 +40,7 @@ f(int x) { } } ''', - [error(CompileTimeErrorCode.LABEL_UNDEFINED, 38, 1)], + [error(CompileTimeErrorCode.labelUndefined, 38, 1)], ); } @@ -54,8 +54,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LABEL, 8, 2), - error(CompileTimeErrorCode.LABEL_UNDEFINED, 39, 1), + error(WarningCode.unusedLabel, 8, 2), + error(CompileTimeErrorCode.labelUndefined, 39, 1), ], ); } @@ -69,7 +69,7 @@ f(int x) { } } ''', - [error(CompileTimeErrorCode.LABEL_UNDEFINED, 41, 1)], + [error(CompileTimeErrorCode.labelUndefined, 41, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/late_final_field_with_const_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/late_final_field_with_const_constructor_test.dart index 942d6dee067..02f4b9973dc 100644 --- a/pkg/analyzer/test/src/diagnostics/late_final_field_with_const_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/late_final_field_with_const_constructor_test.dart @@ -16,7 +16,7 @@ main() { @reflectiveTest class LateFinalFieldWithConstConstructorTest extends PubPackageResolutionTest { static const _errorCode = - CompileTimeErrorCode.LATE_FINAL_FIELD_WITH_CONST_CONSTRUCTOR; + CompileTimeErrorCode.lateFinalFieldWithConstConstructor; test_class_hasConstConstructor_instance_hasInitializer() async { await assertErrorsInCode( @@ -121,7 +121,7 @@ extension E on int { late final int i; } ''', - [error(CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, 38, 1)], + [error(CompileTimeErrorCode.extensionDeclaresInstanceField, 38, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/late_final_local_already_assigned_test.dart b/pkg/analyzer/test/src/diagnostics/late_final_local_already_assigned_test.dart index b9a42ee3944..bd484471433 100644 --- a/pkg/analyzer/test/src/diagnostics/late_final_local_already_assigned_test.dart +++ b/pkg/analyzer/test/src/diagnostics/late_final_local_already_assigned_test.dart @@ -25,7 +25,7 @@ main() { v; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 40, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 40, 1)], ); } @@ -39,7 +39,7 @@ main() { v; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 40, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 40, 1)], ); } @@ -52,7 +52,7 @@ main() { v; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 35, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 35, 1)], ); } @@ -76,7 +76,7 @@ f() { } } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 33, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 33, 1)], ); } @@ -89,7 +89,7 @@ main() { v; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 35, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 35, 1)], ); } @@ -102,7 +102,7 @@ main() { v; } ''', - [error(StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION, 36, 1)], + [error(StaticWarningCode.unnecessaryNonNullAssertion, 36, 1)], ); } @@ -115,7 +115,7 @@ main() { v; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 37, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 37, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/list_element_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/list_element_type_not_assignable_test.dart index 4acb389eda8..b464f95e685 100644 --- a/pkg/analyzer/test/src/diagnostics/list_element_type_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/list_element_type_not_assignable_test.dart @@ -31,7 +31,7 @@ const dynamic a = 0; const dynamic b = 'b'; var v = const [if (1 < 0) a else b]; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 82, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 82, 1)], ); } @@ -40,7 +40,7 @@ var v = const [if (1 < 0) a else b]; ''' var v = const [if (1 < 0) 'a']; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 31, 3)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 31, 3)], ); } @@ -64,7 +64,7 @@ var v = const [if (true) a]; const dynamic a = 'a'; var v = const [if (true) a]; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 53, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 53, 1)], ); } @@ -83,7 +83,7 @@ var v = const [a]; ''', [ error( - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, 36, 1, ), @@ -98,7 +98,7 @@ var v = const [null]; ''', [ error( - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, 20, 4, ), @@ -117,7 +117,7 @@ var v = const [...[0, 1]]; ''' var v = const [42]; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 23, 2)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 23, 2)], ); } @@ -127,7 +127,7 @@ var v = const [42]; const dynamic x = 42; var v = const [x]; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 45, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 45, 1)], ); } @@ -158,7 +158,7 @@ List(U, int)> foo(T Function(T a) f) { return [f]; } ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 66, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 66, 1)], ); } @@ -177,7 +177,7 @@ List foo(T Function(T a) f) { return [f]; } ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 67, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 67, 1)], ); } @@ -202,7 +202,7 @@ var v = [if (1 < 0) a else b]; ''' var v = [if (1 < 0) 'a']; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 25, 3)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 25, 3)], ); } @@ -231,7 +231,7 @@ var v = [...[0, 1]]; ''' var v = [42]; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 17, 2)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 17, 2)], ); } @@ -260,7 +260,7 @@ void f(bool c, dynamic a) { [if (c) 0 else a]; } ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 50, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 50, 1)], ); } @@ -271,7 +271,7 @@ void f(bool c, dynamic a) { [if (c) a]; } ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 43, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 43, 1)], ); } @@ -282,7 +282,7 @@ void f(Iterable a) { [...a]; } ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 41, 1)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 41, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/main_first_positional_parameter_type_test.dart b/pkg/analyzer/test/src/diagnostics/main_first_positional_parameter_type_test.dart index 5c2c6c72ccd..3e3fc941291 100644 --- a/pkg/analyzer/test/src/diagnostics/main_first_positional_parameter_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/main_first_positional_parameter_type_test.dart @@ -20,7 +20,7 @@ class MainFirstPositionalParameterTest extends PubPackageResolutionTest { void main([List args = const []]) {} '''); assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_FIRST_POSITIONAL_PARAMETER_TYPE, 11, 9), + error(CompileTimeErrorCode.mainFirstPositionalParameterType, 11, 9), ]); } @@ -35,7 +35,7 @@ void main(dynamic args) {} void main(void args()) {} '''); assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_FIRST_POSITIONAL_PARAMETER_TYPE, 10, 11), + error(CompileTimeErrorCode.mainFirstPositionalParameterType, 10, 11), ]); } @@ -50,7 +50,7 @@ void main(Iterable args) {} void main(List args) {} '''); assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_FIRST_POSITIONAL_PARAMETER_TYPE, 10, 9), + error(CompileTimeErrorCode.mainFirstPositionalParameterType, 10, 9), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/main_has_required_named_parameters_test.dart b/pkg/analyzer/test/src/diagnostics/main_has_required_named_parameters_test.dart index 8f1b14b2e68..c157dae1408 100644 --- a/pkg/analyzer/test/src/diagnostics/main_has_required_named_parameters_test.dart +++ b/pkg/analyzer/test/src/diagnostics/main_has_required_named_parameters_test.dart @@ -27,7 +27,7 @@ void main({int a = 0}) {} ''' void main({required List a}) {} ''', - [error(CompileTimeErrorCode.MAIN_HAS_REQUIRED_NAMED_PARAMETERS, 5, 4)], + [error(CompileTimeErrorCode.mainHasRequiredNamedParameters, 5, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/main_has_too_many_required_positional_parameters_test.dart b/pkg/analyzer/test/src/diagnostics/main_has_too_many_required_positional_parameters_test.dart index f85f2a97969..568b8ab44b6 100644 --- a/pkg/analyzer/test/src/diagnostics/main_has_too_many_required_positional_parameters_test.dart +++ b/pkg/analyzer/test/src/diagnostics/main_has_too_many_required_positional_parameters_test.dart @@ -64,7 +64,7 @@ void main(args, int a, int b) {} '''); assertErrorsInResult([ error( - CompileTimeErrorCode.MAIN_HAS_TOO_MANY_REQUIRED_POSITIONAL_PARAMETERS, + CompileTimeErrorCode.mainHasTooManyRequiredPositionalParameters, 5, 4, ), @@ -77,7 +77,7 @@ void main(args, int a, int b, {int c = 0}) {} '''); assertErrorsInResult([ error( - CompileTimeErrorCode.MAIN_HAS_TOO_MANY_REQUIRED_POSITIONAL_PARAMETERS, + CompileTimeErrorCode.mainHasTooManyRequiredPositionalParameters, 5, 4, ), @@ -89,9 +89,9 @@ void main(args, int a, int b, {int c = 0}) {} void main(args, int a, int b, {required int c}) {} '''); assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_HAS_REQUIRED_NAMED_PARAMETERS, 5, 4), + error(CompileTimeErrorCode.mainHasRequiredNamedParameters, 5, 4), error( - CompileTimeErrorCode.MAIN_HAS_TOO_MANY_REQUIRED_POSITIONAL_PARAMETERS, + CompileTimeErrorCode.mainHasTooManyRequiredPositionalParameters, 5, 4, ), diff --git a/pkg/analyzer/test/src/diagnostics/main_is_not_function_test.dart b/pkg/analyzer/test/src/diagnostics/main_is_not_function_test.dart index 279d58e49d9..869143c320d 100644 --- a/pkg/analyzer/test/src/diagnostics/main_is_not_function_test.dart +++ b/pkg/analyzer/test/src/diagnostics/main_is_not_function_test.dart @@ -19,9 +19,7 @@ class MainIsNotFunctionTest extends PubPackageResolutionTest { await resolveTestCode(''' class main {} '''); - assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, 6, 4), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.mainIsNotFunction, 6, 4)]); } test_classAlias() async { @@ -31,7 +29,7 @@ mixin M {} class main = A with M; '''); assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, 28, 4), + error(CompileTimeErrorCode.mainIsNotFunction, 28, 4), ]); } @@ -41,9 +39,7 @@ enum main { v } '''); - assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, 5, 4), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.mainIsNotFunction, 5, 4)]); } test_function() async { @@ -56,9 +52,7 @@ void main() {} await resolveTestCode(''' int get main => 0; '''); - assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, 8, 4), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.mainIsNotFunction, 8, 4)]); } test_mixin() async { @@ -67,7 +61,7 @@ class A {} mixin main on A {} '''); assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, 17, 4), + error(CompileTimeErrorCode.mainIsNotFunction, 17, 4), ]); } @@ -75,9 +69,7 @@ mixin main on A {} await resolveTestCode(''' typedef main = void Function(); '''); - assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, 8, 4), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.mainIsNotFunction, 8, 4)]); } test_typedef_legacy() async { @@ -85,7 +77,7 @@ typedef main = void Function(); typedef void main(); '''); assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, 13, 4), + error(CompileTimeErrorCode.mainIsNotFunction, 13, 4), ]); } @@ -93,8 +85,6 @@ typedef void main(); await resolveTestCode(''' var main = 0; '''); - assertErrorsInResult([ - error(CompileTimeErrorCode.MAIN_IS_NOT_FUNCTION, 4, 4), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.mainIsNotFunction, 4, 4)]); } } diff --git a/pkg/analyzer/test/src/diagnostics/map_entry_not_in_map_test.dart b/pkg/analyzer/test/src/diagnostics/map_entry_not_in_map_test.dart index 527ed200616..9c9097c50aa 100644 --- a/pkg/analyzer/test/src/diagnostics/map_entry_not_in_map_test.dart +++ b/pkg/analyzer/test/src/diagnostics/map_entry_not_in_map_test.dart @@ -20,7 +20,7 @@ class MapEntryNotInMapTest extends PubPackageResolutionTest { ''' var c = {1:2}; ''', - [error(CompileTimeErrorCode.MAP_ENTRY_NOT_IN_MAP, 14, 3)], + [error(CompileTimeErrorCode.mapEntryNotInMap, 14, 3)], ); } @@ -29,7 +29,7 @@ var c = {1:2}; ''' var c = const {1:2}; ''', - [error(CompileTimeErrorCode.MAP_ENTRY_NOT_IN_MAP, 20, 3)], + [error(CompileTimeErrorCode.mapEntryNotInMap, 20, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/map_key_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/map_key_type_not_assignable_test.dart index 3132b3b0762..d01171060d4 100644 --- a/pkg/analyzer/test/src/diagnostics/map_key_type_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/map_key_type_not_assignable_test.dart @@ -31,7 +31,7 @@ const dynamic a = 0; const dynamic b = 'b'; var v = const {if (1 < 0) a: true else b: false}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 94, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 94, 1)], ); } @@ -47,7 +47,7 @@ var v = const {if (1 < 0) a: true}; ''' var v = const {if (1 < 0) 'a': true}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 37, 3)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 37, 3)], ); } @@ -64,7 +64,7 @@ var v = const {if (true) a: true}; const dynamic a = 'a'; var v = const {if (true) a: true}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 59, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 59, 1)], ); } @@ -74,7 +74,7 @@ var v = const {if (true) a: true}; final a = 0; var v = const {if (1 < 2) a: true}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 50, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 50, 1)], ); } @@ -91,13 +91,7 @@ var v = const {a : true}; const dynamic a = null; var v = const {a : true}; ''', - [ - error( - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE_NULLABILITY, - 50, - 1, - ), - ], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignableNullability, 50, 1)], ); } @@ -106,13 +100,7 @@ var v = const {a : true}; ''' var v = const {null : true}; ''', - [ - error( - CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE_NULLABILITY, - 26, - 4, - ), - ], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignableNullability, 26, 4)], ); } @@ -135,7 +123,7 @@ var v = const {null : true}; const dynamic a = 'a'; var v = const {a : true}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 49, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 49, 1)], ); } @@ -144,7 +132,7 @@ var v = const {a : true}; ''' var v = const {'a' : true}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 26, 3)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 26, 3)], ); } @@ -160,7 +148,7 @@ var v = const {...{1: 'a'}}; const dynamic a = 'a'; var v = const {...{a: 'a'}}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 55, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 55, 1)], ); } @@ -191,7 +179,7 @@ var v = {if (1 < 0) a: true else b: false}; ''' var v = {if (1 < 0) 'a': true}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 31, 3)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 31, 3)], ); } @@ -228,7 +216,7 @@ var v = {a : true}; ''' var v = {'a' : true}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 20, 3)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 20, 3)], ); } @@ -243,7 +231,7 @@ var v = {...{1: 'a'}}; ''' var v = {...{'a': 'a'}}; ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 26, 3)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 26, 3)], ); } @@ -266,7 +254,7 @@ void f(bool c, dynamic a) { {if (c) 0: 0 else a: 0}; } ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 58, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 58, 1)], ); } @@ -277,7 +265,7 @@ void f(bool c, dynamic a) { {if (c) a: 0 }; } ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 48, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 48, 1)], ); } @@ -288,7 +276,7 @@ void f(Map a) { {...a}; } ''', - [error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 46, 1)], + [error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 46, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/map_value_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/map_value_type_not_assignable_test.dart index c6255b993c7..44f118dc673 100644 --- a/pkg/analyzer/test/src/diagnostics/map_value_type_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/map_value_type_not_assignable_test.dart @@ -31,7 +31,7 @@ const dynamic a = 0; const dynamic b = 'b'; var v = const {if (1 < 0) true: a else false: b}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 101, 1)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 101, 1)], ); } @@ -47,7 +47,7 @@ var v = const {if (1 < 0) true: a}; ''' var v = const {if (1 < 0) true: 'a'}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 43, 3)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 43, 3)], ); } @@ -64,7 +64,7 @@ var v = const {if (true) true: a}; const dynamic a = 'a'; var v = const {if (true) true: a}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 65, 1)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 65, 1)], ); } @@ -74,7 +74,7 @@ var v = const {if (true) true: a}; final a = 0; var v = const {if (1 < 2) true: a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 56, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 56, 1)], ); } @@ -91,13 +91,7 @@ var v = const {true: a}; const dynamic a = null; var v = const {true: a}; ''', - [ - error( - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE_NULLABILITY, - 56, - 1, - ), - ], + [error(CompileTimeErrorCode.mapValueTypeNotAssignableNullability, 56, 1)], ); } @@ -106,13 +100,7 @@ var v = const {true: a}; ''' var v = const {true: null}; ''', - [ - error( - CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE_NULLABILITY, - 32, - 4, - ), - ], + [error(CompileTimeErrorCode.mapValueTypeNotAssignableNullability, 32, 4)], ); } @@ -135,7 +123,7 @@ var v = const {true: null}; const dynamic a = 'a'; var v = const {true: a}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 55, 1)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 55, 1)], ); } @@ -144,7 +132,7 @@ var v = const {true: a}; ''' var v = const {true: 'a'}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 32, 3)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 32, 3)], ); } @@ -160,7 +148,7 @@ var v = const {...{true: 1}}; const dynamic a = 'a'; var v = const {...{true: a}}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 59, 1)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 59, 1)], ); } @@ -185,7 +173,7 @@ var v = {if (1 < 0) true: a else false: b}; ''' var v = {if (1 < 0) true: 'a'}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 37, 3)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 37, 3)], ); } @@ -222,7 +210,7 @@ var v = {true: a}; ''' var v = {true: 'a'}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 26, 3)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 26, 3)], ); } @@ -237,7 +225,7 @@ var v = {...{true: 1}}; ''' var v = {...{true: 'a'}}; ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 30, 3)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 30, 3)], ); } @@ -260,7 +248,7 @@ void f(bool c, dynamic a) { {if (c) 0: 0 else 0: a}; } ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 61, 1)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 61, 1)], ); } @@ -271,7 +259,7 @@ void f(bool c, dynamic a) { {if (c) 0: a}; } ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 51, 1)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 51, 1)], ); } @@ -282,7 +270,7 @@ void f(Map a) { {...a}; } ''', - [error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 46, 1)], + [error(CompileTimeErrorCode.mapValueTypeNotAssignable, 46, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/member_with_class_name_test.dart b/pkg/analyzer/test/src/diagnostics/member_with_class_name_test.dart index 7a86cffa464..10940a55a0f 100644 --- a/pkg/analyzer/test/src/diagnostics/member_with_class_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/member_with_class_name_test.dart @@ -22,7 +22,7 @@ class A { int A = 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 16, 1)], + [error(ParserErrorCode.memberWithClassName, 16, 1)], ); } @@ -33,7 +33,7 @@ class A { int z = 0, A = 0, b = 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 23, 1)], + [error(ParserErrorCode.memberWithClassName, 23, 1)], ); } @@ -44,7 +44,7 @@ class A { get A => 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 16, 1)], + [error(ParserErrorCode.memberWithClassName, 16, 1)], ); } @@ -55,7 +55,7 @@ class A { static int get A => 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 27, 1)], + [error(ParserErrorCode.memberWithClassName, 27, 1)], ); } @@ -71,7 +71,7 @@ class A { set A(_) {} } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 16, 1)], + [error(ParserErrorCode.memberWithClassName, 16, 1)], ); } @@ -82,7 +82,7 @@ class A { static set A(_) {} } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 23, 1)], + [error(ParserErrorCode.memberWithClassName, 23, 1)], ); } @@ -94,7 +94,7 @@ enum E { final int E = 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 26, 1)], + [error(ParserErrorCode.memberWithClassName, 26, 1)], ); } @@ -106,7 +106,7 @@ enum E { int get E => 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 24, 1)], + [error(ParserErrorCode.memberWithClassName, 24, 1)], ); } @@ -118,7 +118,7 @@ enum E { static int get E => 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 31, 1)], + [error(ParserErrorCode.memberWithClassName, 31, 1)], ); } @@ -130,7 +130,7 @@ enum E { set E(int _) {} } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 20, 1)], + [error(ParserErrorCode.memberWithClassName, 20, 1)], ); } @@ -142,7 +142,7 @@ enum E { static set E(int _) {} } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 27, 1)], + [error(ParserErrorCode.memberWithClassName, 27, 1)], ); } @@ -153,7 +153,7 @@ mixin M { int get M => 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 20, 1)], + [error(ParserErrorCode.memberWithClassName, 20, 1)], ); } @@ -164,7 +164,7 @@ mixin M { static int get M => 0; } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 27, 1)], + [error(ParserErrorCode.memberWithClassName, 27, 1)], ); } @@ -175,7 +175,7 @@ mixin M { void set M(_) {} } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 21, 1)], + [error(ParserErrorCode.memberWithClassName, 21, 1)], ); } @@ -186,7 +186,7 @@ mixin M { static void set M(_) {} } ''', - [error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 28, 1)], + [error(ParserErrorCode.memberWithClassName, 28, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/mismatched_annotation_on_struct_field_test.dart b/pkg/analyzer/test/src/diagnostics/mismatched_annotation_on_struct_field_test.dart index b29ca461b96..21d5b99ae3e 100644 --- a/pkg/analyzer/test/src/diagnostics/mismatched_annotation_on_struct_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mismatched_annotation_on_struct_field_test.dart @@ -24,7 +24,7 @@ final class C extends Struct { external int x; } ''', - [error(FfiCode.MISMATCHED_ANNOTATION_ON_STRUCT_FIELD, 52, 9)], + [error(FfiCode.mismatchedAnnotationOnStructField, 52, 9)], ); } @@ -37,7 +37,7 @@ final class C extends Struct { external double x; } ''', - [error(FfiCode.MISMATCHED_ANNOTATION_ON_STRUCT_FIELD, 52, 8)], + [error(FfiCode.mismatchedAnnotationOnStructField, 52, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/missing_annotation_on_struct_field_test.dart b/pkg/analyzer/test/src/diagnostics/missing_annotation_on_struct_field_test.dart index 6b40b4ab917..c98b9df91d2 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_annotation_on_struct_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_annotation_on_struct_field_test.dart @@ -23,7 +23,7 @@ final class C extends Struct { external int x; } ''', - [error(FfiCode.MISSING_ANNOTATION_ON_STRUCT_FIELD, 61, 3)], + [error(FfiCode.missingAnnotationOnStructField, 61, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/missing_default_value_for_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/missing_default_value_for_parameter_test.dart index a5d2dffe27b..29a2c10190e 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_default_value_for_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_default_value_for_parameter_test.dart @@ -28,7 +28,7 @@ var f = ({int a = 0}) {}; ''' var f = ({int a}) {}; ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 14, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 14, 1)], ); } @@ -45,7 +45,7 @@ var f = ([int a]) {}; ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 14, 1, ), @@ -85,7 +85,7 @@ class C { C._(); } ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 27, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 27, 1)], ); } @@ -99,7 +99,7 @@ class C { ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 27, 1, ), @@ -123,7 +123,7 @@ class C { C({int a}); } ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 19, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 19, 1)], ); } @@ -173,7 +173,7 @@ class B extends A{ B({int super.a}); } ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 61, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 61, 1)], ); } @@ -187,7 +187,7 @@ class B extends A{ B({int super.a}); } ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 66, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 66, 1)], ); } @@ -200,7 +200,7 @@ class C { ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 19, 1, ), @@ -242,7 +242,7 @@ class B extends A{ ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 61, 1, ), @@ -262,7 +262,7 @@ class B extends A{ ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 66, 1, ), @@ -303,7 +303,7 @@ class C extends B { C({super.a}); } ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 126, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 126, 1)], ); } @@ -431,7 +431,7 @@ external void f([int? a]); ''' void f({int a = 0}) native; ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 20, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 20, 7)], ); } @@ -440,7 +440,7 @@ void f({int a = 0}) native; ''' void f({int a}) native; ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 16, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 16, 7)], ); } @@ -449,7 +449,7 @@ void f({int a}) native; ''' void f([int a = 0]) native; ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 20, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 20, 7)], ); } @@ -458,7 +458,7 @@ void f([int a = 0]) native; ''' void f([int a]) native; ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 16, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 16, 7)], ); } @@ -473,7 +473,7 @@ void f({int a = 0}) {} ''' void f({int a}) {} ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 12, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 12, 1)], ); } @@ -496,7 +496,7 @@ void f([int a]) {} ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 12, 1, ), @@ -675,7 +675,7 @@ class C { void foo({int a}) native; } ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 30, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 30, 7)], ); } @@ -686,7 +686,7 @@ class C { void foo([int a]) native; } ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 30, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 30, 7)], ); } @@ -697,7 +697,7 @@ class C { void foo({int? a}) native; } ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 31, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 31, 7)], ); } @@ -708,7 +708,7 @@ class A { void foo({T a}) native; } ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 31, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 31, 7)], ); } @@ -719,7 +719,7 @@ class A { void foo([T a]) native; } ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 47, 7)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 47, 7)], ); } @@ -730,7 +730,7 @@ class C { void foo({int a}) {} } ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 26, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 26, 1)], ); } @@ -743,7 +743,7 @@ class C { ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 26, 1, ), @@ -766,7 +766,7 @@ class A { void foo({T a}) {} } ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 43, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 43, 1)], ); } @@ -779,7 +779,7 @@ class A { ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 43, 1, ), @@ -817,8 +817,7 @@ class C { ''', [ error( - CompileTimeErrorCode - .MISSING_DEFAULT_VALUE_FOR_PARAMETER_WITH_ANNOTATION, + CompileTimeErrorCode.missingDefaultValueForParameterWithAnnotation, 70, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/missing_enum_constant_in_switch_test.dart b/pkg/analyzer/test/src/diagnostics/missing_enum_constant_in_switch_test.dart index 144d18d1d94..3fccf125202 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_enum_constant_in_switch_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_enum_constant_in_switch_test.dart @@ -81,9 +81,9 @@ void f(E e) { ''', [ if (!_arePatternsEnabled) - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 44, 10) + error(StaticWarningCode.missingEnumConstantInSwitch, 44, 10) else - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 44, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 44, 6), ], ); } @@ -103,9 +103,9 @@ void f(E e) { ''', [ if (!_arePatternsEnabled) - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 44, 10) + error(StaticWarningCode.missingEnumConstantInSwitch, 44, 10) else - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 44, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 44, 6), ], ); } @@ -125,9 +125,9 @@ void f(E e) { ''', [ if (!_arePatternsEnabled) - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 44, 10) + error(StaticWarningCode.missingEnumConstantInSwitch, 44, 10) else - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 44, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 44, 6), ], ); } @@ -147,9 +147,9 @@ void f(E? e) { ''', [ if (!_arePatternsEnabled) - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 38, 10) + error(StaticWarningCode.missingEnumConstantInSwitch, 38, 10) else - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 38, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 38, 6), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/missing_exception_value_test.dart b/pkg/analyzer/test/src/diagnostics/missing_exception_value_test.dart index 9fb7bc2a0fb..a5374fc0667 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_exception_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_exception_value_test.dart @@ -25,7 +25,7 @@ void g() { Pointer.fromFunction(f); } ''', - [error(FfiCode.MISSING_EXCEPTION_VALUE, 96, 12)], + [error(FfiCode.missingExceptionValue, 96, 12)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/missing_field_type_in_struct_test.dart b/pkg/analyzer/test/src/diagnostics/missing_field_type_in_struct_test.dart index b5d9c488a3b..dc51c6c3eb2 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_field_type_in_struct_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_field_type_in_struct_test.dart @@ -25,7 +25,7 @@ final class C extends Struct { external Pointer notEmpty; } ''', - [error(FfiCode.MISSING_FIELD_TYPE_IN_STRUCT, 65, 3)], + [error(FfiCode.missingFieldTypeInStruct, 65, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/missing_override_of_must_be_overridden_test.dart b/pkg/analyzer/test/src/diagnostics/missing_override_of_must_be_overridden_test.dart index fb0fc22402f..d32bd4fd593 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_override_of_must_be_overridden_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_override_of_must_be_overridden_test.dart @@ -33,7 +33,7 @@ class A { class B extends A {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 86, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 86, 1)], ); } @@ -54,7 +54,7 @@ class B extends A {} ''', [ error( - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO, + WarningCode.missingOverrideOfMustBeOverriddenTwo, 121, 1, messageContains: ["'f'", "'m'"], @@ -109,7 +109,7 @@ class B extends A { int get f => 0; } ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 86, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 86, 1)], ); } @@ -140,7 +140,7 @@ class A { class B extends A {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 91, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 91, 1)], ); } @@ -186,7 +186,7 @@ mixin M { class A with M {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 87, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 87, 1)], ); } @@ -202,7 +202,7 @@ class A { class B extends A {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 87, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 87, 1)], ); } @@ -224,13 +224,7 @@ class A { class B extends A {} ''', - [ - error( - WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_THREE_PLUS, - 157, - 1, - ), - ], + [error(WarningCode.missingOverrideOfMustBeOverriddenThreePlus, 157, 1)], ); } @@ -249,7 +243,7 @@ class A { class B extends A {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_TWO, 122, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenTwo, 122, 1)], ); } @@ -314,7 +308,7 @@ class A with M { class B extends A {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 121, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 121, 1)], ); } @@ -334,7 +328,7 @@ class B extends A { class C extends B {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 124, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 124, 1)], ); } @@ -355,7 +349,7 @@ class B extends A { class C extends B {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 144, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 144, 1)], ); } @@ -371,7 +365,7 @@ mixin A { class B = Object with A; ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 87, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 87, 1)], ); } @@ -465,7 +459,7 @@ class A { class B extends A {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 107, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 107, 1)], ); } @@ -481,7 +475,7 @@ class A { class B extends A {} ''', - [error(WarningCode.MISSING_OVERRIDE_OF_MUST_BE_OVERRIDDEN_ONE, 100, 1)], + [error(WarningCode.missingOverrideOfMustBeOverriddenOne, 100, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/missing_required_param_test.dart b/pkg/analyzer/test/src/diagnostics/missing_required_param_test.dart index 035c455c464..ceea5e6bf8f 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_required_param_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_required_param_test.dart @@ -25,7 +25,7 @@ class A { @A.named() void f() {} ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 51, 5)], + [error(CompileTimeErrorCode.missingRequiredArgument, 51, 5)], ); } @@ -39,7 +39,7 @@ class A { @A() void f() {} ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 43, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 43, 1)], ); } @@ -57,7 +57,7 @@ import 'a.dart' as a; @a.A.named() void f() {} ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 28, 5)], + [error(CompileTimeErrorCode.missingRequiredArgument, 28, 5)], ); } @@ -75,7 +75,7 @@ import 'a.dart' as a; @a.A() void f() {} ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 26, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 26, 1)], ); } @@ -101,7 +101,7 @@ main() { new C(); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 52, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 52, 1)], ); } @@ -113,7 +113,7 @@ class C { C.named() : this(); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 47, 6)], + [error(CompileTimeErrorCode.missingRequiredArgument, 47, 6)], ); } @@ -128,7 +128,7 @@ class D extends C { D() : super(); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 66, 7)], + [error(CompileTimeErrorCode.missingRequiredArgument, 66, 7)], ); } @@ -152,7 +152,7 @@ enum E { const E({required int a}); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 11, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 11, 1)], ); } @@ -164,7 +164,7 @@ enum E { const E({required int a}); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 11, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 11, 1)], ); } @@ -177,7 +177,7 @@ main() { f(); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 40, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 40, 1)], ); } @@ -190,7 +190,7 @@ main() { f.call(); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 46, 2)], + [error(CompileTimeErrorCode.missingRequiredArgument, 46, 2)], ); } @@ -202,7 +202,7 @@ g() { f()(); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 57, 5)], + [error(CompileTimeErrorCode.missingRequiredArgument, 57, 5)], ); } @@ -216,7 +216,7 @@ f() { new A().m(); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 58, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 58, 1)], ); } @@ -233,7 +233,7 @@ f() { new A().m(); } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 37, 1)], + [error(CompileTimeErrorCode.missingRequiredArgument, 37, 1)], ); } @@ -248,7 +248,7 @@ class C { F m() => ({required String x}) => throw ''; } ''', - [error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 20, 7)], + [error(CompileTimeErrorCode.missingRequiredArgument, 20, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/missing_size_annotation_carray_test.dart b/pkg/analyzer/test/src/diagnostics/missing_size_annotation_carray_test.dart index 48f580d0c44..890cd342500 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_size_annotation_carray_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_size_annotation_carray_test.dart @@ -35,7 +35,7 @@ final class C extends Struct { external Array a0; } ''', - [error(FfiCode.MISSING_SIZE_ANNOTATION_CARRAY, 62, 12)], + [error(FfiCode.missingSizeAnnotationCarray, 62, 12)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/missing_variable_pattern_test.dart b/pkg/analyzer/test/src/diagnostics/missing_variable_pattern_test.dart index c5a51dcdc78..9613f9dcd5e 100644 --- a/pkg/analyzer/test/src/diagnostics/missing_variable_pattern_test.dart +++ b/pkg/analyzer/test/src/diagnostics/missing_variable_pattern_test.dart @@ -25,8 +25,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 61, 1), + error(WarningCode.unusedLocalVariable, 35, 1), + error(WarningCode.unusedLocalVariable, 61, 1), ], ); @@ -64,8 +64,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 60, 1), + error(WarningCode.unusedLocalVariable, 35, 1), + error(WarningCode.unusedLocalVariable, 60, 1), ], ); @@ -102,9 +102,9 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 1), - error(WarningCode.DEAD_CODE, 37, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1), + error(WarningCode.unusedLocalVariable, 35, 1), + error(WarningCode.deadCode, 37, 10), + error(WarningCode.unusedLocalVariable, 46, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -137,8 +137,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 51, 1), + error(WarningCode.unusedLocalVariable, 40, 1), + error(WarningCode.unusedLocalVariable, 51, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -179,8 +179,8 @@ void f(num x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 44, 1), + error(WarningCode.unusedLocalVariable, 39, 1), + error(CompileTimeErrorCode.missingVariablePattern, 44, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -215,8 +215,8 @@ void f(int x) { } ''', [ - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 29, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1), + error(CompileTimeErrorCode.missingVariablePattern, 29, 1), + error(WarningCode.unusedLocalVariable, 40, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -247,9 +247,9 @@ void f(num x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 44, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 49, 1), + error(WarningCode.unusedLocalVariable, 39, 1), + error(CompileTimeErrorCode.missingVariablePattern, 44, 1), + error(CompileTimeErrorCode.missingVariablePattern, 49, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -292,9 +292,9 @@ void f(num x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 59, 1), + error(WarningCode.unusedLocalVariable, 39, 1), + error(WarningCode.unusedLocalVariable, 54, 1), + error(CompileTimeErrorCode.missingVariablePattern, 59, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -343,11 +343,11 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 1), - error(WarningCode.DEAD_CODE, 37, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1), - error(WarningCode.DEAD_CODE, 48, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 57, 1), + error(WarningCode.unusedLocalVariable, 35, 1), + error(WarningCode.deadCode, 37, 10), + error(WarningCode.unusedLocalVariable, 46, 1), + error(WarningCode.deadCode, 48, 10), + error(WarningCode.unusedLocalVariable, 57, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -390,9 +390,9 @@ void f(num x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 44, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 59, 1), + error(WarningCode.unusedLocalVariable, 39, 1), + error(CompileTimeErrorCode.missingVariablePattern, 44, 1), + error(WarningCode.unusedLocalVariable, 59, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -441,9 +441,9 @@ void f(num x) { } ''', [ - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 29, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 44, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 49, 1), + error(CompileTimeErrorCode.missingVariablePattern, 29, 1), + error(WarningCode.unusedLocalVariable, 44, 1), + error(CompileTimeErrorCode.missingVariablePattern, 49, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -486,10 +486,10 @@ void f(int x) { } ''', [ - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 29, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1), - error(WarningCode.DEAD_CODE, 42, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 51, 1), + error(CompileTimeErrorCode.missingVariablePattern, 29, 1), + error(WarningCode.unusedLocalVariable, 40, 1), + error(WarningCode.deadCode, 42, 10), + error(WarningCode.unusedLocalVariable, 51, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -530,8 +530,8 @@ void f(int x) { } ''', [ - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 29, 6), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1), + error(CompileTimeErrorCode.missingVariablePattern, 29, 6), + error(WarningCode.unusedLocalVariable, 45, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -573,9 +573,9 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1), - error(WarningCode.DEAD_CODE, 48, 10), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 57, 1), + error(WarningCode.unusedLocalVariable, 46, 1), + error(WarningCode.deadCode, 48, 10), + error(WarningCode.unusedLocalVariable, 57, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -613,8 +613,8 @@ void f(num x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 50, 1), - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 55, 1), + error(WarningCode.unusedLocalVariable, 50, 1), + error(CompileTimeErrorCode.missingVariablePattern, 55, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -652,8 +652,8 @@ void f(int x) { } ''', [ - error(CompileTimeErrorCode.MISSING_VARIABLE_PATTERN, 40, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 51, 1), + error(CompileTimeErrorCode.missingVariablePattern, 40, 1), + error(WarningCode.unusedLocalVariable, 51, 1), ], ); var node = findNode.singleGuardedPattern.pattern; @@ -688,10 +688,10 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 52, 1), - error(WarningCode.DEAD_CODE, 59, 4), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 59, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 76, 1), + error(WarningCode.unusedLocalVariable, 52, 1), + error(WarningCode.deadCode, 59, 4), + error(WarningCode.unreachableSwitchCase, 59, 4), + error(WarningCode.unusedLocalVariable, 76, 1), ], ); @@ -733,7 +733,7 @@ void f(num x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 53, 1)], + [error(WarningCode.unusedLocalVariable, 53, 1)], ); } @@ -748,7 +748,7 @@ void f(int x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 58, 1)], + [error(WarningCode.unusedLocalVariable, 58, 1)], ); } @@ -766,7 +766,7 @@ void f(int x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1)], + [error(WarningCode.unusedLocalVariable, 46, 1)], ); } @@ -784,7 +784,7 @@ void f(num x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 53, 1)], + [error(WarningCode.unusedLocalVariable, 53, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/mixin_application_concrete_super_invoked_member_type_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_application_concrete_super_invoked_member_type_test.dart index 374eef77d52..0220b6866f5 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_application_concrete_super_invoked_member_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_application_concrete_super_invoked_member_type_test.dart @@ -41,8 +41,7 @@ abstract class X extends B with M {} ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_CONCRETE_SUPER_INVOKED_MEMBER_TYPE, + CompileTimeErrorCode.mixinApplicationConcreteSuperInvokedMemberType, 227, 1, ), @@ -92,8 +91,7 @@ enum E with M1, M2, M3 { ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_CONCRETE_SUPER_INVOKED_MEMBER_TYPE, + CompileTimeErrorCode.mixinApplicationConcreteSuperInvokedMemberType, 183, 2, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_application_no_concrete_super_invoked_member_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_application_no_concrete_super_invoked_member_test.dart index 5d1b1e665ee..b4048b33ca5 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_application_no_concrete_super_invoked_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_application_no_concrete_super_invoked_member_test.dart @@ -33,8 +33,7 @@ abstract class X extends A with M {} ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedMember, 121, 1, ), @@ -63,8 +62,7 @@ class X extends A with M1, M2 {} ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedMember, 149, 2, ), @@ -89,8 +87,7 @@ class X extends A with M {} ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedMember, 113, 1, ), @@ -115,8 +112,7 @@ abstract class X extends A with M {} ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedMember, 122, 1, ), @@ -259,8 +255,7 @@ abstract class X extends A with M {} ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_SETTER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedSetter, 129, 1, ), @@ -288,8 +283,7 @@ enum E with M1, M2 { ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedMember, 99, 2, ), @@ -349,8 +343,7 @@ enum E with M1, M2 { ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_MEMBER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedMember, 100, 2, ), @@ -414,8 +407,7 @@ enum E with M1, M2 { ''', [ error( - CompileTimeErrorCode - .MIXIN_APPLICATION_NO_CONCRETE_SUPER_INVOKED_SETTER, + CompileTimeErrorCode.mixinApplicationNoConcreteSuperInvokedSetter, 106, 2, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_application_not_implemented_interface_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_application_not_implemented_interface_test.dart index 88628578e63..07262bb1466 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_application_not_implemented_interface_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_application_not_implemented_interface_test.dart @@ -45,7 +45,7 @@ class C extends Object with M {} ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 84, 1, ), @@ -64,7 +64,7 @@ augment mixin M on A {} ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 13, 1, ), @@ -82,7 +82,7 @@ class C extends Object with M {} ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 84, 1, ), @@ -111,7 +111,7 @@ class X = C with M; ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 134, 1, ), @@ -158,8 +158,8 @@ abstract class Directory implements FileSystemEntity, ioDirectory {} mixin DirectoryAddOnsMixin implements Directory {} ''', [ - error(CompileTimeErrorCode.CONFLICTING_GENERIC_INTERFACES, 96, 15), - error(WarningCode.UNUSED_ELEMENT, 96, 15), + error(CompileTimeErrorCode.conflictingGenericInterfaces, 96, 15), + error(WarningCode.unusedElement, 96, 15), ], ); @@ -178,7 +178,7 @@ class X = A with M; ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 62, 1, ), @@ -196,7 +196,7 @@ class C = Object with M; ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 78, 1, ), @@ -215,7 +215,7 @@ class X = Object with M; ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 51, 1, ), @@ -278,7 +278,7 @@ class X = C with M; ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 71, 1, ), @@ -313,7 +313,7 @@ enum E with M { ''', [ error( - CompileTimeErrorCode.MIXIN_APPLICATION_NOT_IMPLEMENTED_INTERFACE, + CompileTimeErrorCode.mixinApplicationNotImplementedInterface, 50, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_class_declaration_extends_not_object_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_class_declaration_extends_not_object_test.dart index da5b20eff3b..72ea0ed0f0e 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_class_declaration_extends_not_object_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_class_declaration_extends_not_object_test.dart @@ -24,7 +24,7 @@ mixin class B extends A {} ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 33, 1, ), @@ -46,7 +46,7 @@ mixin class A extends Object with M {} ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 40, 6, ), @@ -70,7 +70,7 @@ mixin class A = Object with M1, M2; ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 47, 11, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_class_declares_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_class_declares_constructor_test.dart index 8fc203f13a0..09ab270943a 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_class_declares_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_class_declares_constructor_test.dart @@ -23,7 +23,7 @@ class A { } class B extends Object with A {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 49, 1)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 49, 1)], ); } @@ -35,7 +35,7 @@ class A { } class B = Object with A; ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 43, 1)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 43, 1)], ); } @@ -50,7 +50,7 @@ enum E with A { v } ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 34, 1)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 34, 1)], ); } @@ -82,7 +82,7 @@ mixin class A { } class B with A {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 18, 1)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 18, 1)], ); } @@ -94,7 +94,7 @@ mixin class A { } class B with A {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 27, 1)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 27, 1)], ); } @@ -107,7 +107,7 @@ mixin class A { } class B with A {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 35, 1)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 35, 1)], ); } @@ -119,7 +119,7 @@ mixin class A { } class B with A {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 18, 1)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 18, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/mixin_declares_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_declares_constructor_test.dart index dda15992b23..f4cf94fd463 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_declares_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_declares_constructor_test.dart @@ -22,7 +22,7 @@ mixin M { factory M.named() => throw 0; } ''', - [error(ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR, 12, 7)], + [error(ParserErrorCode.mixinDeclaresConstructor, 12, 7)], ); var node = findNode.singleMixinDeclaration; @@ -43,7 +43,7 @@ mixin M { factory M() => throw 0; } ''', - [error(ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR, 12, 7)], + [error(ParserErrorCode.mixinDeclaresConstructor, 12, 7)], ); var node = findNode.singleMixinDeclaration; @@ -64,7 +64,7 @@ mixin M { M.named(); } ''', - [error(ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR, 12, 1)], + [error(ParserErrorCode.mixinDeclaresConstructor, 12, 1)], ); var node = findNode.singleMixinDeclaration; @@ -85,7 +85,7 @@ mixin M { M(); } ''', - [error(ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR, 12, 1)], + [error(ParserErrorCode.mixinDeclaresConstructor, 12, 1)], ); var node = findNode.singleMixinDeclaration; diff --git a/pkg/analyzer/test/src/diagnostics/mixin_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_deferred_class_test.dart index d4e5cbb5fd0..b6e4fd591ab 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_deferred_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_deferred_class_test.dart @@ -27,7 +27,7 @@ import 'lib1.dart' deferred as a; class B {} class C = B with a.A; ''', - [error(CompileTimeErrorCode.MIXIN_DEFERRED_CLASS, 76, 3)], + [error(CompileTimeErrorCode.mixinDeferredClass, 76, 3)], ); } @@ -42,7 +42,7 @@ enum E with a.A { v; } ''', - [error(CompileTimeErrorCode.MIXIN_DEFERRED_CLASS, 43, 3)], + [error(CompileTimeErrorCode.mixinDeferredClass, 43, 3)], ); } @@ -57,7 +57,7 @@ library root; import 'lib1.dart' deferred as a; class B extends Object with a.A {} ''', - [error(CompileTimeErrorCode.MIXIN_DEFERRED_CLASS, 76, 3)], + [error(CompileTimeErrorCode.mixinDeferredClass, 76, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/mixin_inherits_from_not_object_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_inherits_from_not_object_test.dart index 2c6d31e2c3b..4771d991088 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_inherits_from_not_object_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_inherits_from_not_object_test.dart @@ -24,11 +24,11 @@ class C extends Object with B {} ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 33, 1, ), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 66, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 66, 1), ], ); } @@ -41,7 +41,7 @@ class A {} class B extends A {} class C extends Object with B {} ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 74, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 74, 1)], ); } @@ -71,11 +71,11 @@ class C extends Object with B {} ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 46, 6, ), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 84, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 84, 1), ], ); } @@ -88,7 +88,7 @@ class A {} class B extends Object with A {} class C extends Object with B {} ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 86, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 86, 1)], ); } @@ -110,11 +110,11 @@ class D extends Object with C {} ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 57, 9, ), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 96, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 96, 1), ], ); } @@ -128,7 +128,7 @@ class B {} class C = Object with A, B; class D extends Object with C {} ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 92, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 92, 1)], ); } @@ -158,11 +158,11 @@ class C = Object with B; ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 33, 1, ), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 60, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 60, 1), ], ); } @@ -175,7 +175,7 @@ class A {} class B extends A {} class C = Object with B; ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 68, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 68, 1)], ); } @@ -188,11 +188,11 @@ class C = Object with B; ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 46, 6, ), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 78, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 78, 1), ], ); } @@ -205,7 +205,7 @@ class A {} class B extends Object with A {} class C = Object with B; ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 80, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 80, 1)], ); } @@ -227,11 +227,11 @@ class D = Object with C; ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 57, 9, ), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 90, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 90, 1), ], ); } @@ -245,7 +245,7 @@ class B {} class C = Object with A, B; class D = Object with C; ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 86, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 86, 1)], ); } @@ -277,11 +277,11 @@ enum E with B { ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 33, 1, ), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 50, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 50, 1), ], ); } @@ -296,7 +296,7 @@ enum E with B { v } ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 58, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 58, 1)], ); } @@ -332,11 +332,11 @@ enum E with B { ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 46, 6, ), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 68, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 68, 1), ], ); } @@ -351,7 +351,7 @@ enum E with B { v } ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 70, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 70, 1)], ); } @@ -375,7 +375,7 @@ enum E with C { v } ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 74, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 74, 1)], ); } @@ -390,7 +390,7 @@ enum E with C { v } ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 76, 1)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 76, 1)], ); } @@ -413,7 +413,7 @@ mixin class B extends A {} ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 39, 1, ), @@ -435,7 +435,7 @@ mixin class B extends Object with A {} ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 46, 6, ), @@ -451,7 +451,7 @@ mixin class A with M {} ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 25, 6, ), @@ -475,7 +475,7 @@ mixin class C = Object with A, B; ''', [ error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 57, 9, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_instantiate_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_instantiate_test.dart index 6b115237fbc..f9b89015bcf 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_instantiate_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_instantiate_test.dart @@ -28,8 +28,8 @@ void f() { } ''', [ - error(ParserErrorCode.MIXIN_DECLARES_CONSTRUCTOR, 12, 1), - error(CompileTimeErrorCode.MIXIN_INSTANTIATE, 45, 1), + error(ParserErrorCode.mixinDeclaresConstructor, 12, 1), + error(CompileTimeErrorCode.mixinInstantiate, 45, 1), ], ); @@ -64,7 +64,7 @@ void f() { new M(); } ''', - [error(CompileTimeErrorCode.MIXIN_INSTANTIATE, 29, 1)], + [error(CompileTimeErrorCode.mixinInstantiate, 29, 1)], ); var node = findNode.singleInstanceCreationExpression; diff --git a/pkg/analyzer/test/src/diagnostics/mixin_of_disallowed_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_of_disallowed_class_test.dart index 8ad3ecfaf8e..49bf56bf5dd 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_of_disallowed_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_of_disallowed_class_test.dart @@ -20,7 +20,7 @@ class MixinOfDisallowedClassTest extends PubPackageResolutionTest { ''' class A extends Object with bool {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 4)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 4)], ); } @@ -29,7 +29,7 @@ class A extends Object with bool {} ''' class A extends Object with double {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 6)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 6)], ); } @@ -39,7 +39,7 @@ class A extends Object with double {} import 'dart:async'; class A extends Object with FutureOr {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 49, 8)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 49, 8)], ); } @@ -49,7 +49,7 @@ class A extends Object with FutureOr {} import 'dart:async'; class A extends Object with FutureOr {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 49, 13)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 49, 13)], ); } @@ -59,7 +59,7 @@ class A extends Object with FutureOr {} import 'dart:async'; class A extends Object with FutureOr {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 52, 11)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 52, 11)], ); } @@ -68,7 +68,7 @@ class A extends Object with FutureOr {} ''' class A extends Object with int {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 3)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 3)], ); } @@ -86,7 +86,7 @@ augment class A with int {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 39, 3), + error(CompileTimeErrorCode.mixinOfDisallowedClass, 39, 3), ]); } @@ -95,7 +95,7 @@ augment class A with int {} ''' class A extends Object with Null {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 4)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 4)], ); } @@ -104,7 +104,7 @@ class A extends Object with Null {} ''' class A extends Object with num {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 3)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 3)], ); } @@ -113,7 +113,7 @@ class A extends Object with num {} ''' class A extends Object with Record {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 6)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 6)], ); } @@ -122,7 +122,7 @@ class A extends Object with Record {} ''' class A extends Object with String {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 6)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 6)], ); } @@ -132,7 +132,7 @@ class A extends Object with String {} class A {} class C = A with bool; ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 4)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 4)], ); } @@ -142,7 +142,7 @@ class C = A with bool; class A {} class C = A with double; ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 6)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 6)], ); } @@ -153,7 +153,7 @@ import 'dart:async'; class A {} class C = A with FutureOr; ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 49, 8)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 49, 8)], ); } @@ -163,7 +163,7 @@ class C = A with FutureOr; class A {} class C = A with int; ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 3)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 3)], ); } @@ -173,7 +173,7 @@ class C = A with int; class A {} class C = A with Null; ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 4)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 4)], ); } @@ -183,7 +183,7 @@ class C = A with Null; class A {} class C = A with num; ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 3)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 3)], ); } @@ -193,7 +193,7 @@ class C = A with num; class A {} class C = A with String; ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 6)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 6)], ); } @@ -204,8 +204,8 @@ class A {} class C = A with String, num; ''', [ - error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 28, 6), - error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 36, 3), + error(CompileTimeErrorCode.mixinOfDisallowedClass, 28, 6), + error(CompileTimeErrorCode.mixinOfDisallowedClass, 36, 3), ], ); } @@ -217,7 +217,7 @@ enum E with int { v } ''', - [error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 12, 3)], + [error(CompileTimeErrorCode.mixinOfDisallowedClass, 12, 3)], ); } @@ -235,7 +235,7 @@ augment enum A with int {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.MIXIN_OF_DISALLOWED_CLASS, 38, 3), + error(CompileTimeErrorCode.mixinOfDisallowedClass, 38, 3), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/mixin_of_non_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_of_non_class_test.dart index 017a419590f..896afe421a0 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_of_non_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_of_non_class_test.dart @@ -21,7 +21,7 @@ class MixinOfNonClassTest extends PubPackageResolutionTest { enum E { ONE } class A extends Object with E {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 43, 1)], + [error(CompileTimeErrorCode.mixinOfNonClass, 43, 1)], ); } @@ -31,7 +31,7 @@ class A extends Object with E {} extension type A(int it) {} class B with A {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 41, 1)], + [error(CompileTimeErrorCode.mixinOfNonClass, 41, 1)], ); } @@ -41,7 +41,7 @@ class B with A {} int A = 7; class B extends Object with A {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 39, 1)], + [error(CompileTimeErrorCode.mixinOfNonClass, 39, 1)], ); } @@ -52,7 +52,7 @@ class A {} int B = 7; class C = A with B; ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 39, 1)], + [error(CompileTimeErrorCode.mixinOfNonClass, 39, 1)], ); } @@ -61,7 +61,7 @@ class C = A with B; r''' class C with M {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 13, 1)], + [error(CompileTimeErrorCode.mixinOfNonClass, 13, 1)], ); } @@ -71,7 +71,7 @@ class C with M {} enum E1 { v } enum E2 with E1 { v } ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 27, 2)], + [error(CompileTimeErrorCode.mixinOfNonClass, 27, 2)], ); } @@ -81,7 +81,7 @@ enum E2 with E1 { v } extension type A(int it) {} enum E with A { v } ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 40, 1)], + [error(CompileTimeErrorCode.mixinOfNonClass, 40, 1)], ); } @@ -93,7 +93,7 @@ enum E with A { v } ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 23, 1)], + [error(CompileTimeErrorCode.mixinOfNonClass, 23, 1)], ); } @@ -104,7 +104,7 @@ enum E with M { v } ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 12, 1)], + [error(CompileTimeErrorCode.mixinOfNonClass, 12, 1)], ); } @@ -113,7 +113,7 @@ enum E with M { ''' class A with Never {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 13, 5)], + [error(CompileTimeErrorCode.mixinOfNonClass, 13, 5)], ); } @@ -124,7 +124,7 @@ import 'a.dart' as p; class C with p.M {} ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 8)], ); } @@ -135,7 +135,7 @@ import 'a.dart' show M; class C with M {} ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 8)], ); } @@ -147,8 +147,8 @@ import 'a.dart' show N; class C with M {} ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8), - error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 38, 1), + error(CompileTimeErrorCode.uriDoesNotExist, 7, 8), + error(CompileTimeErrorCode.mixinOfNonClass, 38, 1), ], ); } @@ -164,7 +164,7 @@ part 'a.g.dart'; class C with _$M {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 31, 3)], + [error(CompileTimeErrorCode.mixinOfNonClass, 31, 3)], ); } @@ -175,7 +175,7 @@ part 'a.g.dart'; class C with _$M {} ''', - [error(CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, 5, 10)], + [error(CompileTimeErrorCode.uriHasNotBeenGenerated, 5, 10)], ); } @@ -187,8 +187,8 @@ part 'a.g.dart'; class C with M {} ''', [ - error(CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, 5, 10), - error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 31, 1), + error(CompileTimeErrorCode.uriHasNotBeenGenerated, 5, 10), + error(CompileTimeErrorCode.mixinOfNonClass, 31, 1), ], ); } @@ -201,8 +201,8 @@ part 'a.dart'; class C with _$M {} ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 8), - error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 29, 3), + error(CompileTimeErrorCode.uriDoesNotExist, 5, 8), + error(CompileTimeErrorCode.mixinOfNonClass, 29, 3), ], ); } @@ -215,8 +215,8 @@ part 'a.dart'; class C with M {} ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 8), - error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 29, 1), + error(CompileTimeErrorCode.uriDoesNotExist, 5, 8), + error(CompileTimeErrorCode.mixinOfNonClass, 29, 1), ], ); } @@ -228,7 +228,7 @@ import 'dart:math' as p; class C with p.M {} ''', - [error(CompileTimeErrorCode.MIXIN_OF_NON_CLASS, 39, 3)], + [error(CompileTimeErrorCode.mixinOfNonClass, 39, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/mixin_of_type_alias_expands_to_type_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_of_type_alias_expands_to_type_parameter_test.dart index 4110f5ceb5d..dbe995caf8d 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_of_type_alias_expands_to_type_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_of_type_alias_expands_to_type_parameter_test.dart @@ -33,7 +33,7 @@ class B with T {} ''', [ error( - CompileTimeErrorCode.MIXIN_OF_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.mixinOfTypeAliasExpandsToTypeParameter, 52, 1, ), @@ -50,7 +50,7 @@ class B with T {} ''', [ error( - CompileTimeErrorCode.MIXIN_OF_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.mixinOfTypeAliasExpandsToTypeParameter, 52, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_on_sealed_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_on_sealed_class_test.dart index f856bacdb47..108c17b1588 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_on_sealed_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_on_sealed_class_test.dart @@ -39,7 +39,7 @@ import 'package:meta/meta.dart'; import 'package:foo/foo.dart'; mixin Bar on Foo {} ''', - [error(WarningCode.MIXIN_ON_SEALED_CLASS, 31, 19)], + [error(WarningCode.mixinOnSealedClass, 31, 19)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/mixin_on_type_alias_expands_to_type_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_on_type_alias_expands_to_type_parameter_test.dart index 6dac313bbbc..0386a9a36f0 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_on_type_alias_expands_to_type_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_on_type_alias_expands_to_type_parameter_test.dart @@ -33,7 +33,7 @@ mixin M on T {} ''', [ error( - CompileTimeErrorCode.MIXIN_ON_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.mixinOnTypeAliasExpandsToTypeParameter, 50, 1, ), @@ -50,7 +50,7 @@ mixin M on T {} ''', [ error( - CompileTimeErrorCode.MIXIN_ON_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.mixinOnTypeAliasExpandsToTypeParameter, 50, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_subtype_of_base_is_not_base_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_subtype_of_base_is_not_base_test.dart index 054de0c8fb6..67bca2132dc 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_subtype_of_base_is_not_base_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_subtype_of_base_is_not_base_test.dart @@ -24,7 +24,7 @@ mixin B implements A {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE, + CompileTimeErrorCode.mixinSubtypeOfBaseIsNotBase, 22, 1, text: @@ -43,7 +43,7 @@ mixin C implements B {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE, + CompileTimeErrorCode.mixinSubtypeOfBaseIsNotBase, 53, 1, text: @@ -70,7 +70,7 @@ mixin B on A {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE, + CompileTimeErrorCode.mixinSubtypeOfBaseIsNotBase, 22, 1, text: @@ -88,7 +88,7 @@ mixin B implements A {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_BASE_IS_NOT_BASE, + CompileTimeErrorCode.mixinSubtypeOfBaseIsNotBase, 22, 1, text: diff --git a/pkg/analyzer/test/src/diagnostics/mixin_subtype_of_final_is_not_base_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_subtype_of_final_is_not_base_test.dart index bc6459fcd73..681eb6bcc26 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_subtype_of_final_is_not_base_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_subtype_of_final_is_not_base_test.dart @@ -24,7 +24,7 @@ mixin B implements A {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE, + CompileTimeErrorCode.mixinSubtypeOfFinalIsNotBase, 23, 1, text: @@ -43,7 +43,7 @@ mixin C implements B {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE, + CompileTimeErrorCode.mixinSubtypeOfFinalIsNotBase, 54, 1, text: @@ -70,7 +70,7 @@ mixin B on A {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUBTYPE_OF_FINAL_IS_NOT_BASE, + CompileTimeErrorCode.mixinSubtypeOfFinalIsNotBase, 23, 1, text: diff --git a/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_deferred_class_test.dart index e978c9fe689..377faaf9258 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_deferred_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_deferred_class_test.dart @@ -24,7 +24,7 @@ mixin M on math.Random {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DEFERRED_CLASS, + CompileTimeErrorCode.mixinSuperClassConstraintDeferredClass, 48, 11, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_disallowed_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_disallowed_class_test.dart index 1ecc1ef1edf..06a83688c9e 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_disallowed_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_disallowed_class_test.dart @@ -30,7 +30,7 @@ mixin M on Enum {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS, + CompileTimeErrorCode.mixinSuperClassConstraintDisallowedClass, 27, 4, ), @@ -64,7 +64,7 @@ augment mixin A on int {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS, + CompileTimeErrorCode.mixinSuperClassConstraintDisallowedClass, 37, 3, ), @@ -78,7 +78,7 @@ mixin M on int {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_DISALLOWED_CLASS, + CompileTimeErrorCode.mixinSuperClassConstraintDisallowedClass, 11, 3, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_non_interface_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_non_interface_test.dart index a0d72088223..d362b13dd71 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_non_interface_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_super_class_constraint_non_interface_test.dart @@ -24,7 +24,7 @@ mixin M on dynamic {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE, + CompileTimeErrorCode.mixinSuperClassConstraintNonInterface, 11, 7, ), @@ -51,7 +51,7 @@ mixin M on E {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE, + CompileTimeErrorCode.mixinSuperClassConstraintNonInterface, 24, 1, ), @@ -78,7 +78,7 @@ mixin M on A {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE, + CompileTimeErrorCode.mixinSuperClassConstraintNonInterface, 39, 1, ), @@ -104,7 +104,7 @@ mixin M on Never {} ''', [ error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE, + CompileTimeErrorCode.mixinSuperClassConstraintNonInterface, 11, 5, ), @@ -129,9 +129,9 @@ MixinOnClause mixin M on void {} ''', [ - error(ParserErrorCode.EXPECTED_TYPE_NAME, 11, 4), + error(ParserErrorCode.expectedTypeName, 11, 4), error( - CompileTimeErrorCode.MIXIN_SUPER_CLASS_CONSTRAINT_NON_INTERFACE, + CompileTimeErrorCode.mixinSuperClassConstraintNonInterface, 11, 4, ), diff --git a/pkg/analyzer/test/src/diagnostics/mixin_with_non_class_superclass_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_with_non_class_superclass_test.dart index 863ed582d03..cb2f27195c8 100644 --- a/pkg/analyzer/test/src/diagnostics/mixin_with_non_class_superclass_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixin_with_non_class_superclass_test.dart @@ -22,7 +22,7 @@ int A = 0; mixin B {} class C extends A with B {} ''', - [error(CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS, 38, 1)], + [error(CompileTimeErrorCode.mixinWithNonClassSuperclass, 38, 1)], ); } @@ -33,7 +33,7 @@ int A = 0; mixin B {} class C = A with B; ''', - [error(CompileTimeErrorCode.MIXIN_WITH_NON_CLASS_SUPERCLASS, 32, 1)], + [error(CompileTimeErrorCode.mixinWithNonClassSuperclass, 32, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/mixins_super_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixins_super_class_test.dart index 58916c483b0..3bf709b92ea 100644 --- a/pkg/analyzer/test/src/diagnostics/mixins_super_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/mixins_super_class_test.dart @@ -21,7 +21,7 @@ class MixinsSuperClassTest extends PubPackageResolutionTest { mixin class A {} class B extends A with A {} ''', - [error(CompileTimeErrorCode.MIXINS_SUPER_CLASS, 40, 1)], + [error(CompileTimeErrorCode.mixinsSuperClass, 40, 1)], ); } @@ -32,7 +32,7 @@ mixin class A {} typedef B = A; class C extends A with B {} ''', - [error(CompileTimeErrorCode.MIXINS_SUPER_CLASS, 55, 1)], + [error(CompileTimeErrorCode.mixinsSuperClass, 55, 1)], ); } @@ -42,7 +42,7 @@ class C extends A with B {} mixin class A {} class B = A with A; ''', - [error(CompileTimeErrorCode.MIXINS_SUPER_CLASS, 34, 1)], + [error(CompileTimeErrorCode.mixinsSuperClass, 34, 1)], ); } @@ -53,7 +53,7 @@ mixin class A {} typedef B = A; class C = A with B; ''', - [error(CompileTimeErrorCode.MIXINS_SUPER_CLASS, 49, 1)], + [error(CompileTimeErrorCode.mixinsSuperClass, 49, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/multiple_combinators_test.dart b/pkg/analyzer/test/src/diagnostics/multiple_combinators_test.dart index 82e31ec00fd..ed54c2a7710 100644 --- a/pkg/analyzer/test/src/diagnostics/multiple_combinators_test.dart +++ b/pkg/analyzer/test/src/diagnostics/multiple_combinators_test.dart @@ -27,7 +27,7 @@ export 'dart:async' hide Future, Stream; r''' export 'dart:async' hide Future, Stream hide Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 20, 31)], + [error(WarningCode.multipleCombinators, 20, 31)], ); } @@ -36,7 +36,7 @@ export 'dart:async' hide Future, Stream hide Stream; r''' export 'dart:async' hide Future, Stream show Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 20, 31)], + [error(WarningCode.multipleCombinators, 20, 31)], ); } @@ -57,7 +57,7 @@ export 'dart:async' show Future, Stream; r''' export 'dart:async' show Future, Stream hide Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 20, 31)], + [error(WarningCode.multipleCombinators, 20, 31)], ); } @@ -66,7 +66,7 @@ export 'dart:async' show Future, Stream hide Stream; r''' export 'dart:async' show Future, Stream show Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 20, 31)], + [error(WarningCode.multipleCombinators, 20, 31)], ); } } @@ -86,7 +86,7 @@ import 'dart:async' hide Future, Stream; //ignore: unused_import import 'dart:async' hide Future, Stream hide Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 44, 31)], + [error(WarningCode.multipleCombinators, 44, 31)], ); } @@ -96,7 +96,7 @@ import 'dart:async' hide Future, Stream hide Stream; //ignore: unused_import import 'dart:async' hide Future, Stream show Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 44, 31)], + [error(WarningCode.multipleCombinators, 44, 31)], ); } @@ -113,7 +113,7 @@ import 'dart:async'; //ignore: unused_import import 'dart:async' as async hide Future, Stream show Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 53, 31)], + [error(WarningCode.multipleCombinators, 53, 31)], ); } @@ -130,7 +130,7 @@ import 'dart:async' show Future, Stream; //ignore: unused_import import 'dart:async' show Future, Stream hide Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 44, 31)], + [error(WarningCode.multipleCombinators, 44, 31)], ); } @@ -140,7 +140,7 @@ import 'dart:async' show Future, Stream hide Stream; //ignore: unused_import import 'dart:async' show Future, Stream show Stream; ''', - [error(WarningCode.MULTIPLE_COMBINATORS, 44, 31)], + [error(WarningCode.multipleCombinators, 44, 31)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/multiple_redirecting_constructor_invocations_test.dart b/pkg/analyzer/test/src/diagnostics/multiple_redirecting_constructor_invocations_test.dart index 56170d513ed..1f367091ad2 100644 --- a/pkg/analyzer/test/src/diagnostics/multiple_redirecting_constructor_invocations_test.dart +++ b/pkg/analyzer/test/src/diagnostics/multiple_redirecting_constructor_invocations_test.dart @@ -27,7 +27,7 @@ class A { ''', [ error( - CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, + CompileTimeErrorCode.multipleRedirectingConstructorInvocations, 28, 8, ), @@ -47,7 +47,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, + CompileTimeErrorCode.multipleRedirectingConstructorInvocations, 40, 10, ), diff --git a/pkg/analyzer/test/src/diagnostics/multiple_super_initializers_test.dart b/pkg/analyzer/test/src/diagnostics/multiple_super_initializers_test.dart index 67ef2db3ac0..2dfe3430bc1 100644 --- a/pkg/analyzer/test/src/diagnostics/multiple_super_initializers_test.dart +++ b/pkg/analyzer/test/src/diagnostics/multiple_super_initializers_test.dart @@ -32,7 +32,7 @@ class B extends A { B() : super(), super() {} } ''', - [error(CompileTimeErrorCode.MULTIPLE_SUPER_INITIALIZERS, 48, 7)], + [error(CompileTimeErrorCode.multipleSuperInitializers, 48, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/must_be_a_native_function_type_test.dart b/pkg/analyzer/test/src/diagnostics/must_be_a_native_function_type_test.dart index ecbda3c83bd..810bfcdf100 100644 --- a/pkg/analyzer/test/src/diagnostics/must_be_a_native_function_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/must_be_a_native_function_type_test.dart @@ -26,7 +26,7 @@ class C { } } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 110, 1)], + [error(FfiCode.mustBeANativeFunctionType, 110, 1)], ); } @@ -40,7 +40,7 @@ void f(DynamicLibrary lib) { lib.lookupFunction('g'); } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 137, 1)], + [error(FfiCode.mustBeANativeFunctionType, 137, 1)], ); } @@ -67,7 +67,7 @@ void f(DynamicLibrary lib) { lib.lookupFunction('g'); } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 173, 1)], + [error(FfiCode.mustBeANativeFunctionType, 173, 1)], ); } @@ -104,7 +104,7 @@ class C { } } ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 152, 1)], + [error(FfiCode.mustBeANativeFunctionType, 152, 1)], ); } @@ -151,7 +151,7 @@ final variadicAt1Int64x5Leaf = isLeaf:true ); ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 187, 40)], + [error(FfiCode.mustBeASubtype, 187, 40)], ); } @@ -169,7 +169,7 @@ final variadicAt1Int64x5Leaf = isLeaf:true ); ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 121, 68)], + [error(FfiCode.mustBeANativeFunctionType, 121, 68)], ); } @@ -187,7 +187,7 @@ final variadicAt1Int64x5Leaf = isLeaf:true ); ''', - [error(FfiCode.MUST_BE_A_NATIVE_FUNCTION_TYPE, 121, 60)], + [error(FfiCode.mustBeANativeFunctionType, 121, 60)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/must_be_a_subtype_test.dart b/pkg/analyzer/test/src/diagnostics/must_be_a_subtype_test.dart index 976dc3f5845..6225e5fc6e6 100644 --- a/pkg/analyzer/test/src/diagnostics/must_be_a_subtype_test.dart +++ b/pkg/analyzer/test/src/diagnostics/must_be_a_subtype_test.dart @@ -25,7 +25,7 @@ void g() { Pointer.fromFunction(f, 5); } ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 122, 1)], + [error(FfiCode.mustBeASubtype, 122, 1)], ); } @@ -39,7 +39,7 @@ void g() { Pointer.fromFunction(f, ''); } ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 115, 2)], + [error(FfiCode.mustBeASubtype, 115, 2)], ); } @@ -87,7 +87,7 @@ class C { } } ''', - [error(FfiCode.MUST_BE_A_SUBTYPE, 166, 1)], + [error(FfiCode.mustBeASubtype, 166, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/must_be_immutable_test.dart b/pkg/analyzer/test/src/diagnostics/must_be_immutable_test.dart index 3db2aa859df..0ea29868e37 100644 --- a/pkg/analyzer/test/src/diagnostics/must_be_immutable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/must_be_immutable_test.dart @@ -30,7 +30,7 @@ class A { int x = 0; } ''', - [error(WarningCode.MUST_BE_IMMUTABLE, 50, 1)], + [error(WarningCode.mustBeImmutable, 50, 1)], ); } @@ -43,7 +43,7 @@ mixin A { int x = 0; } ''', - [error(WarningCode.MUST_BE_IMMUTABLE, 50, 1)], + [error(WarningCode.mustBeImmutable, 50, 1)], ); } @@ -57,7 +57,7 @@ class B extends A { int x = 0; } ''', - [error(WarningCode.MUST_BE_IMMUTABLE, 61, 1)], + [error(WarningCode.mustBeImmutable, 61, 1)], ); } @@ -82,7 +82,7 @@ mixin B { } class C extends A with B {} ''', - [error(WarningCode.MUST_BE_IMMUTABLE, 86, 1)], + [error(WarningCode.mustBeImmutable, 86, 1)], ); } @@ -97,7 +97,7 @@ mixin B { } class C = A with B; ''', - [error(WarningCode.MUST_BE_IMMUTABLE, 86, 1)], + [error(WarningCode.mustBeImmutable, 86, 1)], ); } @@ -112,7 +112,7 @@ mixin B {} @immutable class C = A with B; ''', - [error(WarningCode.MUST_BE_IMMUTABLE, 86, 1)], + [error(WarningCode.mustBeImmutable, 86, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/must_call_super_test.dart b/pkg/analyzer/test/src/diagnostics/must_call_super_test.dart index bd4de48b964..9ab372888fc 100644 --- a/pkg/analyzer/test/src/diagnostics/must_call_super_test.dart +++ b/pkg/analyzer/test/src/diagnostics/must_call_super_test.dart @@ -50,7 +50,7 @@ class B extends A { void a() {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 115, 1)], + [error(WarningCode.mustCallSuper, 115, 1)], ); } @@ -95,7 +95,7 @@ class B extends A { void a() {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 123, 1)], + [error(WarningCode.mustCallSuper, 123, 1)], ); } @@ -112,7 +112,7 @@ class B extends A { void a() {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 118, 1)], + [error(WarningCode.mustCallSuper, 118, 1)], ); } @@ -129,7 +129,7 @@ class B extends A { int get a => 2; } ''', - [error(WarningCode.MUST_CALL_SUPER, 122, 1)], + [error(WarningCode.mustCallSuper, 122, 1)], ); } @@ -169,7 +169,7 @@ class B extends A { } } ''', - [error(WarningCode.MUST_CALL_SUPER, 135, 3)], + [error(WarningCode.mustCallSuper, 135, 3)], ); } @@ -186,7 +186,7 @@ class B extends A { operator ==(Object o) => o is B; } ''', - [error(WarningCode.MUST_CALL_SUPER, 140, 2)], + [error(WarningCode.mustCallSuper, 140, 2)], ); } @@ -217,7 +217,7 @@ class B extends A { set a(int value) {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 122, 1)], + [error(WarningCode.mustCallSuper, 122, 1)], ); } @@ -255,7 +255,7 @@ class B extends A { } } ''', - [error(WarningCode.MUST_CALL_SUPER, 131, 3)], + [error(WarningCode.mustCallSuper, 131, 3)], ); } @@ -286,7 +286,7 @@ class C with Mixin { void a() {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 120, 1)], + [error(WarningCode.mustCallSuper, 120, 1)], ); } @@ -303,7 +303,7 @@ class C with Mixin { void set a(int value) {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 137, 1)], + [error(WarningCode.mustCallSuper, 137, 1)], ); } @@ -321,7 +321,7 @@ class D extends C { void a() {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 133, 1)], + [error(WarningCode.mustCallSuper, 133, 1)], ); } @@ -344,7 +344,7 @@ class D extends C { void a() {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 181, 1)], + [error(WarningCode.mustCallSuper, 181, 1)], ); } @@ -362,7 +362,7 @@ class D extends C { void b() {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 156, 1)], + [error(WarningCode.mustCallSuper, 156, 1)], ); } @@ -379,7 +379,7 @@ mixin C on A { void a() {} } ''', - [error(WarningCode.MUST_CALL_SUPER, 110, 1)], + [error(WarningCode.mustCallSuper, 110, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/native_clause_in_non_sdk_code_test.dart b/pkg/analyzer/test/src/diagnostics/native_clause_in_non_sdk_code_test.dart index 5af139e7d0e..3649ceab6d9 100644 --- a/pkg/analyzer/test/src/diagnostics/native_clause_in_non_sdk_code_test.dart +++ b/pkg/analyzer/test/src/diagnostics/native_clause_in_non_sdk_code_test.dart @@ -20,7 +20,7 @@ class NativeClauseInNonSdkCodeTest extends PubPackageResolutionTest { ''' class A native 'string' {} ''', - [error(ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE, 8, 15)], + [error(ParserErrorCode.nativeClauseInNonSdkCode, 8, 15)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/native_function_body_in_non_sdk_code_test.dart b/pkg/analyzer/test/src/diagnostics/native_function_body_in_non_sdk_code_test.dart index b8003cd9ee9..3e33251d996 100644 --- a/pkg/analyzer/test/src/diagnostics/native_function_body_in_non_sdk_code_test.dart +++ b/pkg/analyzer/test/src/diagnostics/native_function_body_in_non_sdk_code_test.dart @@ -20,7 +20,7 @@ class NativeFunctionBodyInNonSdkCodeTest extends PubPackageResolutionTest { ''' int m(a) native 'string'; ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 9, 16)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 9, 16)], ); } @@ -31,7 +31,7 @@ class A { static int m(a) native 'string'; } ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 28, 16)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 28, 16)], ); } @@ -42,7 +42,7 @@ mixin A { static int m(a) native 'string'; } ''', - [error(ParserErrorCode.NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE, 28, 16)], + [error(ParserErrorCode.nativeFunctionBodyInNonSdkCode, 28, 16)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/new_with_non_type_test.dart b/pkg/analyzer/test/src/diagnostics/new_with_non_type_test.dart index 3cbb87a6de6..ff5d00ae099 100644 --- a/pkg/analyzer/test/src/diagnostics/new_with_non_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/new_with_non_type_test.dart @@ -24,7 +24,7 @@ void foo() { new F(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 49, 1)], + [error(CompileTimeErrorCode.newWithNonType, 49, 1)], ); var node = findNode.namedType('F()'); @@ -48,7 +48,7 @@ void f() { } lib.B b = lib.B(); ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 47, 1)], + [error(CompileTimeErrorCode.newWithNonType, 47, 1)], ); } @@ -60,7 +60,7 @@ void f() { new A(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 28, 1)], + [error(CompileTimeErrorCode.newWithNonType, 28, 1)], ); var node = findNode.namedType('A()'); @@ -80,7 +80,7 @@ void f() { new A(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 28, 1)], + [error(CompileTimeErrorCode.newWithNonType, 28, 1)], ); var node = findNode.namedType('A()'); @@ -110,7 +110,7 @@ main() { new C.x.y(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 36, 3)], + [error(CompileTimeErrorCode.newWithNonType, 36, 3)], ); } @@ -121,7 +121,7 @@ void foo() { new T(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 22, 1)], + [error(CompileTimeErrorCode.newWithNonType, 22, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/new_with_undefined_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/new_with_undefined_constructor_test.dart index 69441060620..6161d93669b 100644 --- a/pkg/analyzer/test/src/diagnostics/new_with_undefined_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/new_with_undefined_constructor_test.dart @@ -34,7 +34,7 @@ f() { ''', [ error( - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, + CompileTimeErrorCode.newWithUndefinedConstructorDefault, 38, 1, messageContains: ["'A'"], @@ -53,13 +53,7 @@ f() { A(); } ''', - [ - error( - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, - 34, - 1, - ), - ], + [error(CompileTimeErrorCode.newWithUndefinedConstructorDefault, 34, 1)], ); } @@ -79,7 +73,7 @@ f() { ''', [ error( - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, + CompileTimeErrorCode.newWithUndefinedConstructorDefault, 41, 6, messageContains: ["'lib1.A'"], @@ -98,13 +92,7 @@ f() { A.new(); } ''', - [ - error( - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, - 36, - 3, - ), - ], + [error(CompileTimeErrorCode.newWithUndefinedConstructorDefault, 36, 3)], ); } @@ -153,7 +141,7 @@ f() { ''', [ error( - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, + CompileTimeErrorCode.newWithUndefinedConstructor, 35, 4, messageContains: ["class 'A'", "named 'name'"], @@ -177,7 +165,7 @@ f() { ''', [ error( - CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, + CompileTimeErrorCode.newWithUndefinedConstructor, 47, 4, messageContains: ["class 'lib1.A'", "named 'name'"], @@ -199,7 +187,7 @@ void f() { new A._named(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, 36, 6)], + [error(CompileTimeErrorCode.newWithUndefinedConstructor, 36, 6)], ); } @@ -216,7 +204,7 @@ void f() { new A._named(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, 36, 6)], + [error(CompileTimeErrorCode.newWithUndefinedConstructor, 36, 6)], ); } @@ -233,7 +221,7 @@ void f() { new A._named(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, 41, 6)], + [error(CompileTimeErrorCode.newWithUndefinedConstructor, 41, 6)], ); } } @@ -252,7 +240,7 @@ f() { A(); } ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 14, 3)], + [error(ParserErrorCode.experimentNotEnabled, 14, 3)], ); } @@ -266,7 +254,7 @@ f() { A.new(); } ''', - [error(ParserErrorCode.EXPERIMENT_NOT_ENABLED, 37, 3)], + [error(ParserErrorCode.experimentNotEnabled, 37, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/no_annotation_constructor_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/no_annotation_constructor_arguments_test.dart index e8bf12f9dd3..fef14e8fcae 100644 --- a/pkg/analyzer/test/src/diagnostics/no_annotation_constructor_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/no_annotation_constructor_arguments_test.dart @@ -25,7 +25,7 @@ class A { main() { } ''', - [error(CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS, 25, 2)], + [error(CompileTimeErrorCode.noAnnotationConstructorArguments, 25, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/no_combined_super_signature_test.dart b/pkg/analyzer/test/src/diagnostics/no_combined_super_signature_test.dart index 101f57ec4e7..968af94b1cd 100644 --- a/pkg/analyzer/test/src/diagnostics/no_combined_super_signature_test.dart +++ b/pkg/analyzer/test/src/diagnostics/no_combined_super_signature_test.dart @@ -30,7 +30,7 @@ abstract class C implements A, B { foo(num x); } ''', - [error(CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, 122, 3)], + [error(CompileTimeErrorCode.noCombinedSuperSignature, 122, 3)], ); } @@ -54,7 +54,7 @@ abstract class C implements A, B { Never foo(x); } ''', - [error(CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, 126, 3)], + [error(CompileTimeErrorCode.noCombinedSuperSignature, 126, 3)], ); } @@ -73,7 +73,7 @@ abstract class C implements A, B { foo(a); } ''', - [error(CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, 123, 3)], + [error(CompileTimeErrorCode.noCombinedSuperSignature, 123, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/no_default_super_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/no_default_super_constructor_test.dart index 384e9f03fac..6cde7b54ad1 100644 --- a/pkg/analyzer/test/src/diagnostics/no_default_super_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/no_default_super_constructor_test.dart @@ -116,7 +116,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS, + CompileTimeErrorCode.implicitSuperInitializerMissingArguments, 58, 1, ), @@ -132,13 +132,7 @@ class A { } class B extends A {} ''', - [ - error( - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, - 42, - 1, - ), - ], + [error(CompileTimeErrorCode.noDefaultSuperConstructorImplicit, 42, 1)], ); } @@ -165,7 +159,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS, + CompileTimeErrorCode.implicitSuperInitializerMissingArguments, 75, 1, ), @@ -207,7 +201,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.IMPLICIT_SUPER_INITIALIZER_MISSING_ARGUMENTS, + CompileTimeErrorCode.implicitSuperInitializerMissingArguments, 42, 1, ), @@ -234,13 +228,7 @@ class A { } class B extends A {} ''', - [ - error( - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, - 26, - 1, - ), - ], + [error(CompileTimeErrorCode.noDefaultSuperConstructorImplicit, 26, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/no_generative_constructors_in_superclass_test.dart b/pkg/analyzer/test/src/diagnostics/no_generative_constructors_in_superclass_test.dart index 2e4d81fb047..fc7e1909d6d 100644 --- a/pkg/analyzer/test/src/diagnostics/no_generative_constructors_in_superclass_test.dart +++ b/pkg/analyzer/test/src/diagnostics/no_generative_constructors_in_superclass_test.dart @@ -26,13 +26,7 @@ class B extends A { B() : super(); } ''', - [ - error( - CompileTimeErrorCode.NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS, - 55, - 1, - ), - ], + [error(CompileTimeErrorCode.noGenerativeConstructorsInSuperclass, 55, 1)], ); } @@ -47,13 +41,7 @@ class B extends A { factory B.second() => throw ''; } ''', - [ - error( - CompileTimeErrorCode.NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS, - 55, - 1, - ), - ], + [error(CompileTimeErrorCode.noGenerativeConstructorsInSuperclass, 55, 1)], ); } @@ -90,13 +78,7 @@ class B extends A { B(); } ''', - [ - error( - CompileTimeErrorCode.NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS, - 55, - 1, - ), - ], + [error(CompileTimeErrorCode.noGenerativeConstructorsInSuperclass, 55, 1)], ); } @@ -109,13 +91,7 @@ class A { class B extends A { } ''', - [ - error( - CompileTimeErrorCode.NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS, - 55, - 1, - ), - ], + [error(CompileTimeErrorCode.noGenerativeConstructorsInSuperclass, 55, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_abstract_class_inherits_abstract_member_test.dart b/pkg/analyzer/test/src/diagnostics/non_abstract_class_inherits_abstract_member_test.dart index f41491a6bff..cb35413ec44 100644 --- a/pkg/analyzer/test/src/diagnostics/non_abstract_class_inherits_abstract_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_abstract_class_inherits_abstract_member_test.dart @@ -37,7 +37,7 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 51, 1, ), @@ -57,7 +57,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 45, 1, ), @@ -87,7 +87,7 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberTwo, 45, 1, ), @@ -107,7 +107,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 45, 1, ), @@ -166,7 +166,7 @@ class D extends C {} ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 42, 1, ), @@ -224,7 +224,7 @@ enum E implements A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 38, 1, ), @@ -245,7 +245,7 @@ enum E with M { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 33, 1, ), @@ -266,7 +266,7 @@ enum E implements A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 34, 1, ), @@ -287,7 +287,7 @@ enum E with M { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 32, 1, ), @@ -308,7 +308,7 @@ enum E implements A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 38, 1, ), @@ -329,7 +329,7 @@ enum E with M { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 36, 1, ), @@ -358,7 +358,7 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 42, 1, ), @@ -378,7 +378,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 36, 1, ), @@ -408,7 +408,7 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberTwo, 36, 1, ), @@ -428,7 +428,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 36, 1, ), @@ -451,8 +451,7 @@ class C extends A { ''', [ error( - CompileTimeErrorCode - .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFivePlus, 62, 1, ), @@ -474,7 +473,7 @@ class C extends A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberFour, 55, 1, ), @@ -584,7 +583,7 @@ class B = A with M implements I; ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 87, 1, ), @@ -605,7 +604,7 @@ class B = A with M; ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 67, 1, ), @@ -626,7 +625,7 @@ class B = A with M; ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 58, 1, ), @@ -645,7 +644,7 @@ class C implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 42, 1, ), @@ -664,7 +663,7 @@ class C extends A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 40, 1, ), @@ -683,7 +682,7 @@ class C implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 28, 1, ), @@ -703,7 +702,7 @@ class C implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 28, 1, ), @@ -737,7 +736,7 @@ class C implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 55, 1, ), @@ -756,7 +755,7 @@ class C extends A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 35, 1, ), @@ -779,7 +778,7 @@ class C implements A, B { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 89, 1, ), @@ -798,7 +797,7 @@ class C extends Object with B {} ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 103, 1, ), @@ -817,7 +816,7 @@ class C extends Object with B {} ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 97, 1, ), @@ -836,7 +835,7 @@ class C extends Object with B {} ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 109, 1, ), @@ -859,7 +858,7 @@ class B extends A implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 71, 1, ), @@ -883,7 +882,7 @@ class B extends A implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 77, 1, ), @@ -902,7 +901,7 @@ class C implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 36, 1, ), @@ -921,7 +920,7 @@ class C extends A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 43, 1, ), @@ -944,7 +943,7 @@ class C extends B { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 84, 1, ), @@ -965,7 +964,7 @@ class C implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 27, 1, ), @@ -986,7 +985,7 @@ class C implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 27, 1, ), @@ -1018,8 +1017,7 @@ class C extends A { ''', [ error( - CompileTimeErrorCode - .NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberThree, 48, 1, ), @@ -1039,7 +1037,7 @@ class C extends A { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberTwo, 41, 1, ), @@ -1059,7 +1057,7 @@ class C implements I { ''', [ error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberTwo, 27, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/non_bool_condition_test.dart b/pkg/analyzer/test/src/diagnostics/non_bool_condition_test.dart index 84490c40b6c..2af9815d7a9 100644 --- a/pkg/analyzer/test/src/diagnostics/non_bool_condition_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_bool_condition_test.dart @@ -21,7 +21,7 @@ class NonBoolConditionTest extends PubPackageResolutionTest { ''' f() { return 3 ? 2 : 1; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 13, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 13, 1)], ); } @@ -30,7 +30,7 @@ f() { return 3 ? 2 : 1; } ''' f() { return [1, 2, 3] ? 2 : 1; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 13, 9)], + [error(CompileTimeErrorCode.nonBoolCondition, 13, 9)], ); } @@ -39,7 +39,7 @@ f() { return [1, 2, 3] ? 2 : 1; } ''' f(Object o) { return o ? 2 : 1; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 21, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 21, 1)], ); } @@ -49,7 +49,7 @@ f(Object o) { return o ? 2 : 1; } const dynamic c = 2; const x = [1, if (c) 2 else 3, 4]; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 39, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 39, 1)], ); } @@ -58,7 +58,7 @@ const x = [1, if (c) 2 else 3, 4]; r''' const x = [1, if (1) 2 else 3, 4]; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 18, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 18, 1)], ); } @@ -69,7 +69,7 @@ f() { do {} while (3); } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 21, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 21, 1)], ); } @@ -80,7 +80,7 @@ f(Object o) { do {} while ([1, 2, 3]); } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 29, 9)], + [error(CompileTimeErrorCode.nonBoolCondition, 29, 9)], ); } @@ -91,7 +91,7 @@ f(Object o) { do {} while (o); } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 29, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 29, 1)], ); } @@ -103,7 +103,7 @@ f() { for (;3;) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 14, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 14, 1)], ); } @@ -116,8 +116,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(CompileTimeErrorCode.NON_BOOL_CONDITION, 24, 1), + error(WarningCode.unusedLocalVariable, 17, 1), + error(CompileTimeErrorCode.nonBoolCondition, 24, 1), ], ); } @@ -131,8 +131,8 @@ f() { for (i = 0; 3;) {} }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1), - error(CompileTimeErrorCode.NON_BOOL_CONDITION, 29, 1), + error(WarningCode.unusedLocalVariable, 12, 1), + error(CompileTimeErrorCode.nonBoolCondition, 29, 1), ], ); } @@ -144,7 +144,7 @@ f() { for (;[1, 2, 3];) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 14, 9)], + [error(CompileTimeErrorCode.nonBoolCondition, 14, 9)], ); } @@ -155,7 +155,7 @@ f(Object o) { for (;o;) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 22, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 22, 1)], ); } @@ -164,7 +164,7 @@ f(Object o) { ''' var v = [for (; 0;) 1]; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 16, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 16, 1)], ); } @@ -175,7 +175,7 @@ void f() { if (0 case _ when 1) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 31, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 31, 1)], ); } @@ -186,7 +186,7 @@ f() { if (3) return 2; else return 1; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 12, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 12, 1)], ); } @@ -197,7 +197,7 @@ f() { if ([1, 2, 3]) return 2; else return 1; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 12, 9)], + [error(CompileTimeErrorCode.nonBoolCondition, 12, 9)], ); } @@ -208,7 +208,7 @@ f(Object o) { if (o) return 2; else return 1; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 20, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 20, 1)], ); } @@ -218,7 +218,7 @@ f(Object o) { const dynamic nonBool = null; const c = const {if (nonBool) 'a' : 1}; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 51, 7)], + [error(CompileTimeErrorCode.nonBoolCondition, 51, 7)], ); } @@ -229,7 +229,7 @@ void f(Null a) { if (a) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 23, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 23, 1)], ); } @@ -239,7 +239,7 @@ void f(Null a) { const dynamic nonBool = 'a'; const c = const {if (nonBool) 3}; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 50, 7)], + [error(CompileTimeErrorCode.nonBoolCondition, 50, 7)], ); } @@ -248,7 +248,7 @@ const c = const {if (nonBool) 3}; ''' var v = [if (3) 1]; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 13, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 13, 1)], ); } @@ -257,7 +257,7 @@ var v = [if (3) 1]; ''' var v = [if ([1, 2, 3]) 'x']; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 13, 9)], + [error(CompileTimeErrorCode.nonBoolCondition, 13, 9)], ); } @@ -267,7 +267,7 @@ var v = [if ([1, 2, 3]) 'x']; final o = Object(); var v = [if (o) 'x']; ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 33, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 33, 1)], ); } @@ -278,7 +278,7 @@ void f(Null a) { a ? 0 : 1; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 19, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 19, 1)], ); } @@ -289,7 +289,7 @@ f() { while (3) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 15, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 15, 1)], ); } @@ -300,7 +300,7 @@ f() { while ([1, 2, 3]) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 15, 9)], + [error(CompileTimeErrorCode.nonBoolCondition, 15, 9)], ); } @@ -311,7 +311,7 @@ f(Object o) { while (o) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 23, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 23, 1)], ); } } @@ -326,7 +326,7 @@ void f(dynamic c) { {if (c) 0: 0}; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 37, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 37, 1)], ); } @@ -337,7 +337,7 @@ void f(dynamic c) { {if (c) 0}; } ''', - [error(CompileTimeErrorCode.NON_BOOL_CONDITION, 32, 1)], + [error(CompileTimeErrorCode.nonBoolCondition, 32, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_bool_expression_test.dart b/pkg/analyzer/test/src/diagnostics/non_bool_expression_test.dart index 7e212a13333..d471691a630 100644 --- a/pkg/analyzer/test/src/diagnostics/non_bool_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_bool_expression_test.dart @@ -24,7 +24,7 @@ f() { assert(makeAssertion); } ''', - [error(CompileTimeErrorCode.NON_BOOL_EXPRESSION, 45, 13)], + [error(CompileTimeErrorCode.nonBoolExpression, 45, 13)], ); } @@ -36,7 +36,7 @@ f() { assert(makeAssertion); } ''', - [error(CompileTimeErrorCode.NON_BOOL_EXPRESSION, 41, 13)], + [error(CompileTimeErrorCode.nonBoolExpression, 41, 13)], ); } @@ -47,7 +47,7 @@ f() { assert(0); } ''', - [error(CompileTimeErrorCode.NON_BOOL_EXPRESSION, 15, 1)], + [error(CompileTimeErrorCode.nonBoolExpression, 15, 1)], ); } } @@ -62,7 +62,7 @@ void f(dynamic a) { assert(a); } ''', - [error(CompileTimeErrorCode.NON_BOOL_EXPRESSION, 29, 1)], + [error(CompileTimeErrorCode.nonBoolExpression, 29, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_bool_negation_expression_test.dart b/pkg/analyzer/test/src/diagnostics/non_bool_negation_expression_test.dart index b8b5959250b..f135b3f8a4a 100644 --- a/pkg/analyzer/test/src/diagnostics/non_bool_negation_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_bool_negation_expression_test.dart @@ -23,7 +23,7 @@ f() { !42; } ''', - [error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 9, 2)], + [error(CompileTimeErrorCode.nonBoolNegationExpression, 9, 2)], ); } @@ -34,7 +34,7 @@ f() { ![1, 2, 3]; } ''', - [error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 9, 9)], + [error(CompileTimeErrorCode.nonBoolNegationExpression, 9, 9)], ); } @@ -45,7 +45,7 @@ f(Object o) { !o; } ''', - [error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 17, 1)], + [error(CompileTimeErrorCode.nonBoolNegationExpression, 17, 1)], ); } @@ -56,7 +56,7 @@ void m(Null x) { !x; } ''', - [error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 20, 1)], + [error(CompileTimeErrorCode.nonBoolNegationExpression, 20, 1)], ); } } @@ -72,7 +72,7 @@ void f(dynamic a) { !a; } ''', - [error(CompileTimeErrorCode.NON_BOOL_NEGATION_EXPRESSION, 23, 1)], + [error(CompileTimeErrorCode.nonBoolNegationExpression, 23, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_bool_operand_test.dart b/pkg/analyzer/test/src/diagnostics/non_bool_operand_test.dart index 989138ce34e..85d8055f644 100644 --- a/pkg/analyzer/test/src/diagnostics/non_bool_operand_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_bool_operand_test.dart @@ -23,7 +23,7 @@ bool f(int left, bool right) { return left && right; } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 40, 4)], + [error(CompileTimeErrorCode.nonBoolOperand, 40, 4)], ); } @@ -34,7 +34,7 @@ main() { new Object() && true; } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 11, 12)], + [error(CompileTimeErrorCode.nonBoolOperand, 11, 12)], ); } @@ -45,7 +45,7 @@ bool f(List left, bool right) { return left && right; } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 46, 4)], + [error(CompileTimeErrorCode.nonBoolOperand, 46, 4)], ); } @@ -56,7 +56,7 @@ bool f(Object left, bool right) { return left && right; } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 43, 4)], + [error(CompileTimeErrorCode.nonBoolOperand, 43, 4)], ); } @@ -68,7 +68,7 @@ m() { if(x && true) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 21, 1)], + [error(CompileTimeErrorCode.nonBoolOperand, 21, 1)], ); } @@ -79,7 +79,7 @@ bool f(bool left, String right) { return left && right; } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 51, 5)], + [error(CompileTimeErrorCode.nonBoolOperand, 51, 5)], ); } @@ -90,7 +90,7 @@ bool f(List left, bool right) { return left || right; } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 46, 4)], + [error(CompileTimeErrorCode.nonBoolOperand, 46, 4)], ); } @@ -102,7 +102,7 @@ m() { if(x || false) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 21, 1)], + [error(CompileTimeErrorCode.nonBoolOperand, 21, 1)], ); } @@ -113,7 +113,7 @@ bool f(bool left, double right) { return left || right; } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 51, 5)], + [error(CompileTimeErrorCode.nonBoolOperand, 51, 5)], ); } } @@ -128,7 +128,7 @@ void f(dynamic a) { if(a && true) {} } ''', - [error(CompileTimeErrorCode.NON_BOOL_OPERAND, 25, 1)], + [error(CompileTimeErrorCode.nonBoolOperand, 25, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_const_argument_for_const_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/non_const_argument_for_const_parameter_test.dart index 00d06a6e454..cf2c9916f6b 100644 --- a/pkg/analyzer/test/src/diagnostics/non_const_argument_for_const_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_const_argument_for_const_parameter_test.dart @@ -47,7 +47,7 @@ class A { bool operator <(@mustBeConst A other) => false; } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 86, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 86, 1)], ); } @@ -109,7 +109,7 @@ class C { C(@mustBeConst int i); } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 77, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 77, 1)], ); } @@ -134,7 +134,7 @@ void f(int x) { g(x); } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 106, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 106, 1)], ); } @@ -157,7 +157,7 @@ void f(void g(@mustBeConst int i), int x) { g(x); } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 99, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 99, 1)], ); } @@ -193,7 +193,7 @@ class A { void operator []=(@mustBeConst int i, @mustBeConst A v) {} } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 74, 3)], + [error(WarningCode.nonConstArgumentForConstParameter, 74, 3)], ); } @@ -210,7 +210,7 @@ class C { C(@mustBeConst String s); } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 82, 5)], + [error(WarningCode.nonConstArgumentForConstParameter, 82, 5)], ); } @@ -235,7 +235,7 @@ void f(int x) { g(x); } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 103, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 103, 1)], ); } @@ -264,7 +264,7 @@ class C { void g([@mustBeConst int? value]) {} } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 84, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 84, 1)], ); } @@ -301,7 +301,7 @@ void f() => g(value: v); void g({@mustBeConst int? value}) {} ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 79, 8)], + [error(WarningCode.nonConstArgumentForConstParameter, 79, 8)], ); } @@ -338,7 +338,7 @@ void f() => g(v); void g([@mustBeConst int? value]) {} ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 79, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 79, 1)], ); } @@ -352,7 +352,7 @@ class A { A.named(int i) : this(i); } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 110, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 110, 1)], ); } @@ -430,7 +430,7 @@ void f(int value) => g(value); void g(@mustBeConst int value) {} ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 74, 5)], + [error(WarningCode.nonConstArgumentForConstParameter, 74, 5)], ); } @@ -457,7 +457,7 @@ void f() => g(v); void g(@mustBeConst int value) {} ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 79, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 79, 1)], ); } @@ -473,7 +473,7 @@ void f() { set i(@mustBeConst int? value) {} ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 83, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 83, 1)], ); } @@ -545,7 +545,7 @@ class B extends A { void f(@mustBeConst int i) {} } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 81, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 81, 1)], ); } @@ -562,7 +562,7 @@ class B extends A { B(int i) : super(i); } ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 128, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 128, 1)], ); } @@ -619,7 +619,7 @@ class C { void g(int x) => T(x); ''', - [error(WarningCode.NON_CONST_ARGUMENT_FOR_CONST_PARAMETER, 124, 1)], + [error(WarningCode.nonConstArgumentForConstParameter, 124, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_const_call_to_literal_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/non_const_call_to_literal_constructor_test.dart index 04757a69610..c963fbb414a 100644 --- a/pkg/analyzer/test/src/diagnostics/non_const_call_to_literal_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_const_call_to_literal_constructor_test.dart @@ -74,7 +74,7 @@ class A { } A a = .named(); ''', - [error(WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, 81, 8)], + [error(WarningCode.nonConstCallToLiteralConstructor, 81, 8)], ); } @@ -88,7 +88,7 @@ class A { } A a = .new(); ''', - [error(WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, 75, 6)], + [error(WarningCode.nonConstCallToLiteralConstructor, 75, 6)], ); } @@ -102,7 +102,7 @@ class A { } var a = A.named(); ''', - [error(WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, 83, 9)], + [error(WarningCode.nonConstCallToLiteralConstructor, 83, 9)], ); } @@ -116,7 +116,7 @@ class A { } var a = A(); ''', - [error(WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, 77, 3)], + [error(WarningCode.nonConstCallToLiteralConstructor, 77, 3)], ); } @@ -141,13 +141,7 @@ class A { } var a = new A(); ''', - [ - error( - WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR_USING_NEW, - 77, - 7, - ), - ], + [error(WarningCode.nonConstCallToLiteralConstructorUsingNew, 77, 7)], ); } @@ -161,7 +155,7 @@ extension type const E(int i) { } E e = E.zero(); ''', - [error(WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, 112, 8)], + [error(WarningCode.nonConstCallToLiteralConstructor, 112, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_const_generative_enum_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/non_const_generative_enum_constructor_test.dart index 07e39a2e0e3..5db5ca6e889 100644 --- a/pkg/analyzer/test/src/diagnostics/non_const_generative_enum_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_const_generative_enum_constructor_test.dart @@ -32,13 +32,7 @@ enum E { E.named(); } ''', - [ - error( - CompileTimeErrorCode.NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR, - 24, - 7, - ), - ], + [error(CompileTimeErrorCode.nonConstGenerativeEnumConstructor, 24, 7)], ); } @@ -50,13 +44,7 @@ enum E { E(); } ''', - [ - error( - CompileTimeErrorCode.NON_CONST_GENERATIVE_ENUM_CONSTRUCTOR, - 16, - 1, - ), - ], + [error(CompileTimeErrorCode.nonConstGenerativeEnumConstructor, 16, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_const_map_as_expression_statement_test.dart b/pkg/analyzer/test/src/diagnostics/non_const_map_as_expression_statement_test.dart index 1b02da3057f..320035797d0 100644 --- a/pkg/analyzer/test/src/diagnostics/non_const_map_as_expression_statement_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_const_map_as_expression_statement_test.dart @@ -29,7 +29,7 @@ f() { await resolveTestFile(); expect( result.diagnostics[0].diagnosticCode, - CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, + CompileTimeErrorCode.nonConstMapAsExpressionStatement, ); } @@ -46,7 +46,7 @@ f() { await resolveTestFile(); expect( result.diagnostics[0].diagnosticCode, - CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT, + CompileTimeErrorCode.nonConstMapAsExpressionStatement, ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_annotation_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_annotation_constructor_test.dart index 80cbe76e97b..a5d50dc1dd6 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_annotation_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_annotation_constructor_test.dart @@ -25,7 +25,7 @@ class A { main() { } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR, 29, 12)], + [error(CompileTimeErrorCode.nonConstantAnnotationConstructor, 29, 12)], ); } @@ -39,7 +39,7 @@ class A { main() { } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_ANNOTATION_CONSTRUCTOR, 21, 4)], + [error(CompileTimeErrorCode.nonConstantAnnotationConstructor, 21, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_from_deferred_library_test.dart index e046289e3b3..e8608423393 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_from_deferred_library_test.dart @@ -40,13 +40,7 @@ void f(int e) { } } ''', - [ - error( - CompileTimeErrorCode.PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY, - 81, - 1, - ), - ], + [error(CompileTimeErrorCode.patternConstantFromDeferredLibrary, 81, 1)], ); } } @@ -78,8 +72,7 @@ void f(int e) { ''', [ error( - CompileTimeErrorCode - .NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantCaseExpressionFromDeferredLibrary, 74, 1, ), @@ -101,11 +94,10 @@ const int c = 0; switch (_variant) { case _Variant.nullSafe: expectedDiagnosticCode = - CompileTimeErrorCode - .NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY; + CompileTimeErrorCode.nonConstantCaseExpressionFromDeferredLibrary; case _Variant.patterns: expectedDiagnosticCode = - CompileTimeErrorCode.PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY; + CompileTimeErrorCode.patternConstantFromDeferredLibrary; } await assertErrorsInCode( @@ -132,11 +124,10 @@ class A {} switch (_variant) { case _Variant.nullSafe: expectedDiagnosticCode = - CompileTimeErrorCode - .NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY; + CompileTimeErrorCode.nonConstantCaseExpressionFromDeferredLibrary; case _Variant.patterns: expectedDiagnosticCode = - CompileTimeErrorCode.PATTERN_CONSTANT_FROM_DEFERRED_LIBRARY; + CompileTimeErrorCode.patternConstantFromDeferredLibrary; } await assertErrorsInCode( diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_test.dart index 932c2408864..26a6ddd3664 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_test.dart @@ -31,7 +31,7 @@ void f(var e, int a) { } } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_CASE_EXPRESSION, 51, 1)], + [error(CompileTimeErrorCode.nonConstantCaseExpression, 51, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_from_deferred_library_test.dart index f1326effcff..63b6a1af9ce 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_from_deferred_library_test.dart @@ -29,7 +29,7 @@ f({x = a.V}) {} ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantDefaultValueFromDeferredLibrary, 57, 1, ), @@ -50,7 +50,7 @@ f({x = a.V + 1}) {} ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantDefaultValueFromDeferredLibrary, 57, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart index 896c1d81a45..44939c2aee6 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart @@ -23,7 +23,7 @@ class A { A({x = y}) {} } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 32, 1)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 32, 1)], ); } @@ -35,7 +35,7 @@ class A { A([x = y]) {} } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 32, 1)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 32, 1)], ); } @@ -48,7 +48,7 @@ class A { void f([A a = .new()]) {} ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 40, 6)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 40, 6)], ); } @@ -77,7 +77,7 @@ enum E { int y = 0; f({x = y}) {} ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 18, 1)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 18, 1)], ); } @@ -122,7 +122,7 @@ void f({x = (a: 0, b: 1)}) {} r''' void f({x = (a: 0, b: [1])}) {} ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 22, 3)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 22, 3)], ); } @@ -143,7 +143,7 @@ void f({x = (0, 1)}) {} r''' void f({x = (0, [1])}) {} ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 16, 3)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 16, 3)], ); } @@ -158,7 +158,7 @@ void f({x = (0, const [1])}) {} r''' void f({int x = X}) {} ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 16, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 16, 1)], ); } @@ -168,7 +168,7 @@ void f({int x = X}) {} int y = 0; f([x = y]) {} ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 18, 1)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 18, 1)], ); } @@ -177,7 +177,7 @@ f([x = y]) {} r''' void f([int x = X]) {} ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 16, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 16, 1)], ); } @@ -189,7 +189,7 @@ class A { m({x = y}) {} } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 32, 1)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 32, 1)], ); } @@ -201,7 +201,7 @@ class A { m([x = y]) {} } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE, 32, 1)], + [error(CompileTimeErrorCode.nonConstantDefaultValue, 32, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_list_element_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_list_element_from_deferred_library_test.dart index bb5849146a3..01d885d5ea1 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_list_element_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_list_element_from_deferred_library_test.dart @@ -30,7 +30,7 @@ var v = const [ if (cond) 'a' else a.c ]; ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantListElementFromDeferredLibrary, 0, 0, ), @@ -50,7 +50,7 @@ var v = const [ if (cond) a.c ]; ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantListElementFromDeferredLibrary, 81, 1, ), @@ -69,7 +69,7 @@ var v = const [a.c]; ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantListElementFromDeferredLibrary, 51, 1, ), @@ -88,7 +88,7 @@ var v = const [a.c + 1]; ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantListElementFromDeferredLibrary, 51, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_list_element_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_list_element_test.dart index a77a5a1e94c..dda1d6cd678 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_list_element_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_list_element_test.dart @@ -24,7 +24,7 @@ mixin NonConstantListElementTestCases on PubPackageResolutionTest { final dynamic a = 0; var v = const [if (1 < 0) 0 else a]; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 54, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 54, 1)], ); } @@ -34,7 +34,7 @@ var v = const [if (1 < 0) 0 else a]; final dynamic a = 0; var v = const [if (1 < 0) a else 0]; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 47, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 47, 1)], ); } @@ -44,7 +44,7 @@ var v = const [if (1 < 0) a else 0]; final dynamic a = 0; var v = const [if (1 > 0) 0 else a]; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 54, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 54, 1)], ); } @@ -54,7 +54,7 @@ var v = const [if (1 > 0) 0 else a]; final dynamic a = 0; var v = const [if (1 > 0) a else 0]; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 47, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 47, 1)], ); } @@ -71,7 +71,7 @@ var v = const [if (1 < 0) a]; final dynamic a = 0; var v = const [if (1 < 0) a]; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 47, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 47, 1)], ); } @@ -88,7 +88,7 @@ var v = const [if (1 > 0) a]; final dynamic a = 0; var v = const [if (1 > 0) a]; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 47, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 47, 1)], ); } @@ -98,7 +98,7 @@ var v = const [if (1 > 0) a]; final dynamic a = 0; var v = const [a]; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 36, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 36, 1)], ); } @@ -108,7 +108,7 @@ var v = const [a]; final dynamic a = 0; var v = const [a + 1]; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 36, 1)], + [error(CompileTimeErrorCode.nonConstantListElement, 36, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_map_element_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_map_element_test.dart index b6a580d7ee5..4c54ae673a5 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_map_element_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_map_element_test.dart @@ -53,7 +53,7 @@ void main() { const {1: null, if (notConst) null: null}; } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_ELEMENT, 60, 8)], + [error(CompileTimeErrorCode.nonConstantMapElement, 60, 8)], ); } @@ -65,7 +65,7 @@ void main() { const {1: null, if (isTrue) null: null else null: null}; } ''', - [error(WarningCode.DEAD_CODE, 83, 10)], + [error(WarningCode.deadCode, 83, 10)], ); } @@ -85,7 +85,7 @@ void main() { const {1: null, ...notConst}; } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_ELEMENT, 56, 8)], + [error(CompileTimeErrorCode.nonConstantMapElement, 56, 8)], ); } } @@ -102,7 +102,7 @@ mixin NonConstantMapKeyTestCases on PubPackageResolutionTest { final dynamic a = 0; var v = const {if (1 < 0) 0: 0 else a: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 67, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 67, 1)], ); } @@ -112,7 +112,7 @@ var v = const {if (1 < 0) 0: 0 else a: 0}; final dynamic a = 0; var v = const {if (1 < 0) a: 0 else 0: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 57, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 57, 1)], ); } @@ -122,7 +122,7 @@ var v = const {if (1 < 0) a: 0 else 0: 0}; final dynamic a = 0; var v = const {if (1 > 0) 0: 0 else a: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 67, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 67, 1)], ); } @@ -132,7 +132,7 @@ var v = const {if (1 > 0) 0: 0 else a: 0}; final dynamic a = 0; var v = const {if (1 > 0) a: 0 else 0: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 57, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 57, 1)], ); } @@ -149,7 +149,7 @@ var v = const {if (1 < 0) a: 0}; final dynamic a = 0; var v = const {if (1 < 0) a: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 57, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 57, 1)], ); } @@ -166,7 +166,7 @@ var v = const {if (1 > 0) a: 0}; final dynamic a = 0; var v = const {if (1 > 0) a: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 57, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 57, 1)], ); } @@ -176,7 +176,7 @@ var v = const {if (1 > 0) a: 0}; final dynamic a = 0; var v = const {a: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 46, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 46, 1)], ); } @@ -199,7 +199,7 @@ mixin NonConstantMapValueTestCases on PubPackageResolutionTest { final dynamic a = 0; var v = const {if (1 < 0) 0: 0 else 0: a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 70, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 70, 1)], ); } @@ -209,7 +209,7 @@ var v = const {if (1 < 0) 0: 0 else 0: a}; final dynamic a = 0; var v = const {if (1 < 0) 0: a else 0: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 60, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 60, 1)], ); } @@ -219,7 +219,7 @@ var v = const {if (1 < 0) 0: a else 0: 0}; final dynamic a = 0; var v = const {if (1 > 0) 0: 0 else 0: a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 70, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 70, 1)], ); } @@ -229,7 +229,7 @@ var v = const {if (1 > 0) 0: 0 else 0: a}; final dynamic a = 0; var v = const {if (1 > 0) 0: a else 0: 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 60, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 60, 1)], ); } @@ -246,7 +246,7 @@ var v = const {if (1 < 0) 0: a}; final dynamic a = 0; var v = const {if (1 < 0) 0: a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 60, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 60, 1)], ); } @@ -263,7 +263,7 @@ var v = const {if (1 > 0) 0: a}; final dynamic a = 0; var v = const {if (1 > 0) 0: a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 60, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 60, 1)], ); } @@ -273,7 +273,7 @@ var v = const {if (1 > 0) 0: a}; final dynamic a = 0; var v = const {0: a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 49, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 49, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_map_key_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_map_key_from_deferred_library_test.dart index a63dc7b339b..61f5354519f 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_map_key_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_map_key_from_deferred_library_test.dart @@ -30,13 +30,7 @@ import 'lib1.dart' deferred as a; const cond = true; var v = const { if (cond) 0: 1 else a.c : 0}; ''', - [ - error( - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY, - 0, - 0, - ), - ], + [error(CompileTimeErrorCode.nonConstantMapKeyFromDeferredLibrary, 0, 0)], ); } @@ -49,13 +43,7 @@ import 'lib1.dart' deferred as a; const cond = true; var v = const { if (cond) a.c : 0}; ''', - [ - error( - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY, - 81, - 1, - ), - ], + [error(CompileTimeErrorCode.nonConstantMapKeyFromDeferredLibrary, 81, 1)], ); } @@ -67,13 +55,7 @@ const int c = 1;'''); import 'lib1.dart' deferred as a; var v = const {a.c : 0}; ''', - [ - error( - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY, - 51, - 1, - ), - ], + [error(CompileTimeErrorCode.nonConstantMapKeyFromDeferredLibrary, 51, 1)], ); } @@ -85,13 +67,7 @@ const int c = 1;'''); import 'lib1.dart' deferred as a; var v = const {a.c + 1 : 0}; ''', - [ - error( - CompileTimeErrorCode.NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY, - 51, - 1, - ), - ], + [error(CompileTimeErrorCode.nonConstantMapKeyFromDeferredLibrary, 51, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_map_key_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_map_key_test.dart index f62114a453e..cb1cfe0edaa 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_map_key_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_map_key_test.dart @@ -25,7 +25,7 @@ final dynamic a = 0; const cond = true; var v = const {if (cond) 0: 1 else a : 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 75, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 75, 1)], ); } @@ -36,7 +36,7 @@ final dynamic a = 0; const cond = true; var v = const {if (cond) a : 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 65, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 65, 1)], ); } @@ -46,7 +46,7 @@ var v = const {if (cond) a : 0}; final dynamic a = 0; var v = const {a : 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 36, 1)], + [error(CompileTimeErrorCode.nonConstantMapKey, 36, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_map_pattern_key_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_map_pattern_key_test.dart index 52c6454794a..1a3fca1120e 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_map_pattern_key_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_map_pattern_key_test.dart @@ -22,7 +22,7 @@ void f(x, int a) { if (x case {a: 0}) {} } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_PATTERN_KEY, 33, 1)], + [error(CompileTimeErrorCode.nonConstantMapPatternKey, 33, 1)], ); } @@ -37,7 +37,7 @@ class A { const A(); } ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_PATTERN_KEY, 26, 3)], + [error(CompileTimeErrorCode.nonConstantMapPatternKey, 26, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_map_value_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_map_value_from_deferred_library_test.dart index cda17aa2777..02a7c50a81d 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_map_value_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_map_value_from_deferred_library_test.dart @@ -33,7 +33,7 @@ var v = const { if (cond) 'a': 'b' else 'c' : a.c}; ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantMapValueFromDeferredLibrary, 99, 3, ), @@ -52,7 +52,7 @@ var v = const { if (cond) 'a' : a.c}; ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantMapValueFromDeferredLibrary, 87, 1, ), @@ -70,7 +70,7 @@ var v = const {'a' : a.c}; ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantMapValueFromDeferredLibrary, 57, 1, ), @@ -88,7 +88,7 @@ var v = const {'a' : a.c + 1}; ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantMapValueFromDeferredLibrary, 57, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_map_value_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_map_value_test.dart index 3d7f247d67f..d930e72c467 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_map_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_map_value_test.dart @@ -25,7 +25,7 @@ final dynamic a = 0; const cond = true; var v = const {if (cond) 'a': 'b', 'c' : a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 81, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 81, 1)], ); } @@ -36,7 +36,7 @@ final dynamic a = 0; const cond = true; var v = const {if (cond) 'a' : a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 71, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 71, 1)], ); } @@ -46,7 +46,7 @@ var v = const {if (cond) 'a' : a}; final dynamic a = 0; var v = const {'a' : a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 42, 1)], + [error(CompileTimeErrorCode.nonConstantMapValue, 42, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_record_field_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_record_field_from_deferred_library_test.dart index 0353ed1cb4a..3306c3ca41f 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_record_field_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_record_field_from_deferred_library_test.dart @@ -27,7 +27,7 @@ var v = const (a.c, ); ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD_FROM_DEFERRED_LIBRARY, + CompileTimeErrorCode.nonConstantRecordFieldFromDeferredLibrary, 51, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_record_field_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_record_field_test.dart index ccc390c7dac..f3260d52f2e 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_record_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_record_field_test.dart @@ -21,7 +21,7 @@ class NonConstantRecordFieldTest extends PubPackageResolutionTest { final a = 0; var v = const (a: a); ''', - [error(CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD, 31, 1)], + [error(CompileTimeErrorCode.nonConstantRecordField, 31, 1)], ); } @@ -31,7 +31,7 @@ var v = const (a: a); final a = 0; var v = const (a, ); ''', - [error(CompileTimeErrorCode.NON_CONSTANT_RECORD_FIELD, 28, 1)], + [error(CompileTimeErrorCode.nonConstantRecordField, 28, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_relational_pattern_expression_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_relational_pattern_expression_test.dart index 947b3f83802..13df5f14f8c 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_relational_pattern_expression_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_relational_pattern_expression_test.dart @@ -68,7 +68,7 @@ void f(x, int a) { ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, 34, 1, ), @@ -87,7 +87,7 @@ void f(x) { ''', [ error( - CompileTimeErrorCode.NON_CONSTANT_RELATIONAL_PATTERN_EXPRESSION, + CompileTimeErrorCode.nonConstantRelationalPatternExpression, 41, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_set_element_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_set_element_test.dart index 8825011099a..d0637576093 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_set_element_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_set_element_test.dart @@ -24,7 +24,7 @@ mixin NonConstantSetElementTestCases on PubPackageResolutionTest { final dynamic a = 0; var v = const {if (1 < 0) 0 else a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 59, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 59, 1)], ); } @@ -34,7 +34,7 @@ var v = const {if (1 < 0) 0 else a}; final dynamic a = 0; var v = const {if (1 < 0) a else 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 52, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 52, 1)], ); } @@ -44,7 +44,7 @@ var v = const {if (1 < 0) a else 0}; final dynamic a = 0; var v = const {if (1 > 0) 0 else a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 59, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 59, 1)], ); } @@ -54,7 +54,7 @@ var v = const {if (1 > 0) 0 else a}; final dynamic a = 0; var v = const {if (1 > 0) a else 0}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 52, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 52, 1)], ); } @@ -71,7 +71,7 @@ var v = const {if (1 < 0) a}; final dynamic a = 0; var v = const {if (1 < 0) a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 52, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 52, 1)], ); } @@ -88,7 +88,7 @@ var v = const {if (1 > 0) a}; final dynamic a = 0; var v = const {if (1 > 0) a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 52, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 52, 1)], ); } @@ -98,7 +98,7 @@ var v = const {if (1 > 0) a}; f(a) { return const {a}; }''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 23, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 23, 1)], ); } @@ -108,7 +108,7 @@ f(a) { final Set x = {}; var v = const {...x}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 36, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 36, 1)], ); } @@ -118,7 +118,7 @@ var v = const {...x}; final dynamic a = 0; var v = const {a}; ''', - [error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 41, 1)], + [error(CompileTimeErrorCode.nonConstantSetElement, 41, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart index 67a5ee04fa9..d677525c705 100644 --- a/pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_constant_type_argument_test.dart @@ -27,7 +27,7 @@ class C { } } ''', - [error(FfiCode.NON_CONSTANT_TYPE_ARGUMENT, 147, 1)], + [error(FfiCode.nonConstantTypeArgument, 147, 1)], ); } } @@ -75,7 +75,7 @@ import 'dart:ffi'; T genericRef(Pointer p) => p.ref; ''', - [error(FfiCode.NON_CONSTANT_TYPE_ARGUMENT, 72, 5)], + [error(FfiCode.nonConstantTypeArgument, 72, 5)], ); } @@ -120,7 +120,7 @@ import 'dart:ffi'; T genericRefWithFinalizer(Pointer p) => p.refWithFinalizer(nullptr); ''', - [error(FfiCode.NON_CONSTANT_TYPE_ARGUMENT, 85, 27)], + [error(FfiCode.nonConstantTypeArgument, 85, 27)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_covariant_type_parameter_position_in_representation_type_test.dart b/pkg/analyzer/test/src/diagnostics/non_covariant_type_parameter_position_in_representation_type_test.dart index ccf65d30f4c..da4038c0c7f 100644 --- a/pkg/analyzer/test/src/diagnostics/non_covariant_type_parameter_position_in_representation_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_covariant_type_parameter_position_in_representation_type_test.dart @@ -26,7 +26,7 @@ extension type A(void Function(T) it) {} [ error( CompileTimeErrorCode - .NON_COVARIANT_TYPE_PARAMETER_POSITION_IN_REPRESENTATION_TYPE, + .nonCovariantTypeParameterPositionInRepresentationType, 17, 1, ), @@ -48,7 +48,7 @@ extension type A(T Function(T) it) {} [ error( CompileTimeErrorCode - .NON_COVARIANT_TYPE_PARAMETER_POSITION_IN_REPRESENTATION_TYPE, + .nonCovariantTypeParameterPositionInRepresentationType, 17, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/non_exhaustive_switch_test.dart b/pkg/analyzer/test/src/diagnostics/non_exhaustive_switch_test.dart index 93e48401873..c260e3637bc 100644 --- a/pkg/analyzer/test/src/diagnostics/non_exhaustive_switch_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_exhaustive_switch_test.dart @@ -25,7 +25,7 @@ Object f(bool x) { }; } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 28, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchExpression, 28, 6)], ); } @@ -78,7 +78,7 @@ Object f(E x) { ''', [ error( - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, + CompileTimeErrorCode.nonExhaustiveSwitchExpression, 44, 6, correctionContains: 'E.a', @@ -92,7 +92,7 @@ Object f(E x) { r''' void f(Unresolved x) => switch (x) {}; ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 7, 10)], + [error(CompileTimeErrorCode.undefinedClass, 7, 10)], ); } } @@ -109,7 +109,7 @@ void f(bool x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 19, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 19, 6)], ); } @@ -147,8 +147,8 @@ void f(bool x) { } ''', [ - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 19, 6), - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 41, 3), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 19, 6), + error(WarningCode.patternNeverMatchesValueType, 41, 3), ], ); } @@ -175,7 +175,7 @@ void f(bool? x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 20, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 20, 6)], ); } @@ -206,7 +206,7 @@ void f(E x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 35, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 35, 6)], ); } @@ -243,7 +243,7 @@ void f(E x) { ''', [ error( - CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, + CompileTimeErrorCode.nonExhaustiveSwitchStatement, 35, 6, correctionContains: 'E.a', @@ -284,8 +284,8 @@ void f(E x) { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 11, 2), - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 19, 2), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 11, 2), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 19, 2), ], ); } @@ -297,7 +297,7 @@ void f(Null x) { switch (x) {} } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 19, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 19, 6)], ); } @@ -340,7 +340,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 77, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 77, 6)], ); } @@ -394,7 +394,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 74, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 74, 6)], ); } @@ -428,7 +428,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 117, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 117, 6)], ); } @@ -451,7 +451,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 92, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 92, 6)], ); } @@ -492,7 +492,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 85, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 85, 6)], ); } @@ -527,7 +527,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 78, 10)], + [error(CompileTimeErrorCode.undefinedIdentifier, 78, 10)], ); } @@ -544,7 +544,7 @@ void f(A x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 78, 10)], + [error(CompileTimeErrorCode.undefinedClass, 78, 10)], ); } @@ -558,7 +558,7 @@ void f(T x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 32, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 32, 6)], ); } @@ -586,7 +586,7 @@ void f(T x) { } } ''', - [error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 40, 6)], + [error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 40, 6)], ); } @@ -611,7 +611,7 @@ void f(Unresolved x) { switch (x) {} } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 7, 10)], + [error(CompileTimeErrorCode.undefinedClass, 7, 10)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_final_field_in_enum_test.dart b/pkg/analyzer/test/src/diagnostics/non_final_field_in_enum_test.dart index 6bc764bac59..82c17a5613a 100644 --- a/pkg/analyzer/test/src/diagnostics/non_final_field_in_enum_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_final_field_in_enum_test.dart @@ -23,7 +23,7 @@ enum E { int foo = 0; } ''', - [error(CompileTimeErrorCode.NON_FINAL_FIELD_IN_ENUM, 20, 3)], + [error(CompileTimeErrorCode.nonFinalFieldInEnum, 20, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_generative_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/non_generative_constructor_test.dart index aea043063ce..9a336c0c634 100644 --- a/pkg/analyzer/test/src/diagnostics/non_generative_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_generative_constructor_test.dart @@ -26,7 +26,7 @@ class B extends A { B() : super.named(); } ''', - [error(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, 90, 13)], + [error(CompileTimeErrorCode.nonGenerativeConstructor, 90, 13)], ); } @@ -65,7 +65,7 @@ class B extends A { B(); } ''', - [error(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, 73, 1)], + [error(CompileTimeErrorCode.nonGenerativeConstructor, 73, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_generative_implicit_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/non_generative_implicit_constructor_test.dart index cfa6e429516..6e85cf12109 100644 --- a/pkg/analyzer/test/src/diagnostics/non_generative_implicit_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_generative_implicit_constructor_test.dart @@ -43,7 +43,7 @@ class A { class B extends A { } ''', - [error(CompileTimeErrorCode.NON_GENERATIVE_IMPLICIT_CONSTRUCTOR, 57, 1)], + [error(CompileTimeErrorCode.nonGenerativeImplicitConstructor, 57, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_native_function_type_argument_to_pointer_test.dart b/pkg/analyzer/test/src/diagnostics/non_native_function_type_argument_to_pointer_test.dart index 03ffa439cbe..0f5c7bfe073 100644 --- a/pkg/analyzer/test/src/diagnostics/non_native_function_type_argument_to_pointer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_native_function_type_argument_to_pointer_test.dart @@ -31,7 +31,7 @@ class C { [ // This changed from a method to a extension method, uses Dart semantics // instead of manual check now. - error(CompileTimeErrorCode.UNDEFINED_METHOD, 98, 10), + error(CompileTimeErrorCode.undefinedMethod, 98, 10), ], ); } @@ -48,7 +48,7 @@ class C { } } ''', - [error(FfiCode.NON_NATIVE_FUNCTION_TYPE_ARGUMENT_TO_POINTER, 165, 1)], + [error(FfiCode.nonNativeFunctionTypeArgumentToPointer, 165, 1)], ); } @@ -63,7 +63,7 @@ class C { } } ''', - [error(FfiCode.NON_CONSTANT_TYPE_ARGUMENT, 125, 1)], + [error(FfiCode.nonConstantTypeArgument, 125, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_nullable_equals_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/non_nullable_equals_parameter_test.dart index f8623835528..4321937a4c1 100644 --- a/pkg/analyzer/test/src/diagnostics/non_nullable_equals_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_nullable_equals_parameter_test.dart @@ -23,7 +23,7 @@ class C { bool operator ==(dynamic other) => false; } ''', - [error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 38, 2)], + [error(WarningCode.nonNullableEqualsParameter, 38, 2)], ); } @@ -40,8 +40,8 @@ class D extends C { } ''', [ - error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 38, 2), - error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 116, 2), + error(WarningCode.nonNullableEqualsParameter, 38, 2), + error(WarningCode.nonNullableEqualsParameter, 116, 2), ], ); } @@ -72,7 +72,7 @@ class C { bool operator ==(Object? other) => false; } ''', - [error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 38, 2)], + [error(WarningCode.nonNullableEqualsParameter, 38, 2)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_positive_array_dimension_test.dart b/pkg/analyzer/test/src/diagnostics/non_positive_array_dimension_test.dart index 6bc451c4bf6..48ae51e63e5 100644 --- a/pkg/analyzer/test/src/diagnostics/non_positive_array_dimension_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_positive_array_dimension_test.dart @@ -25,7 +25,7 @@ final class MyStruct extends Struct { external Array a0; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 74, 2)], + [error(FfiCode.nonPositiveArrayDimension, 74, 2)], ); } @@ -39,7 +39,7 @@ final class MyStruct extends Struct { external Array>>>>> a0; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 83, 2)], + [error(FfiCode.nonPositiveArrayDimension, 83, 2)], ); } @@ -64,7 +64,7 @@ final class MyStruct extends Struct { external Array a0; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 74, 1)], + [error(FfiCode.nonPositiveArrayDimension, 74, 1)], ); } @@ -78,7 +78,7 @@ final class MyStruct extends Struct { external Array a0; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 67, 3)], + [error(FfiCode.nonPositiveArrayDimension, 67, 3)], ); } @@ -103,7 +103,7 @@ final class MyStruct extends Struct { external Array a0; } ''', - [error(FfiCode.NON_POSITIVE_ARRAY_DIMENSION, 67, 1)], + [error(FfiCode.nonPositiveArrayDimension, 67, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_sized_type_argument_test.dart b/pkg/analyzer/test/src/diagnostics/non_sized_type_argument_test.dart index 2adbac8e8f4..14e63683209 100644 --- a/pkg/analyzer/test/src/diagnostics/non_sized_type_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_sized_type_argument_test.dart @@ -25,7 +25,7 @@ final class C extends Struct { external Array a0; } ''', - [error(FfiCode.NON_SIZED_TYPE_ARGUMENT, 80, 4)], + [error(FfiCode.nonSizedTypeArgument, 80, 4)], ); } @@ -39,7 +39,7 @@ final class C extends Union { external Array a0; } ''', - [error(FfiCode.NON_SIZED_TYPE_ARGUMENT, 79, 4)], + [error(FfiCode.nonSizedTypeArgument, 79, 4)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_type_as_type_argument_test.dart b/pkg/analyzer/test/src/diagnostics/non_type_as_type_argument_test.dart index da6aac86d68..c464b67c28b 100644 --- a/pkg/analyzer/test/src/diagnostics/non_type_as_type_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_type_as_type_argument_test.dart @@ -34,7 +34,7 @@ A doOption( ); } ''', - [error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 62, 1)], + [error(CompileTimeErrorCode.nonTypeAsTypeArgument, 62, 1)], ); } @@ -45,7 +45,7 @@ int A = 0; class B {} f(B b) {} ''', - [error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 29, 1)], + [error(CompileTimeErrorCode.nonTypeAsTypeArgument, 29, 1)], ); } @@ -55,7 +55,7 @@ f(B b) {} class B {} f(B b) {} ''', - [error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 18, 1)], + [error(CompileTimeErrorCode.nonTypeAsTypeArgument, 18, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/non_type_in_catch_clause_test.dart b/pkg/analyzer/test/src/diagnostics/non_type_in_catch_clause_test.dart index bbf09f4eff9..0e4ba15bac0 100644 --- a/pkg/analyzer/test/src/diagnostics/non_type_in_catch_clause_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_type_in_catch_clause_test.dart @@ -85,7 +85,7 @@ f() { } } ''', - [error(CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE, 21, 1)], + [error(CompileTimeErrorCode.nonTypeInCatchClause, 21, 1)], ); } @@ -100,7 +100,7 @@ f() { } } ''', - [error(CompileTimeErrorCode.NON_TYPE_IN_CATCH_CLAUSE, 32, 1)], + [error(CompileTimeErrorCode.nonTypeInCatchClause, 32, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_void_return_for_operator_test.dart b/pkg/analyzer/test/src/diagnostics/non_void_return_for_operator_test.dart index 2dd1c6e88f8..c36d3999924 100644 --- a/pkg/analyzer/test/src/diagnostics/non_void_return_for_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_void_return_for_operator_test.dart @@ -21,7 +21,7 @@ class NonVoidReturnForOperatorTest extends PubPackageResolutionTest { class A { int operator []=(a, b) { return a; } }''', - [error(CompileTimeErrorCode.NON_VOID_RETURN_FOR_OPERATOR, 12, 3)], + [error(CompileTimeErrorCode.nonVoidReturnForOperator, 12, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/non_void_return_for_setter_test.dart b/pkg/analyzer/test/src/diagnostics/non_void_return_for_setter_test.dart index 750641e3665..90cc03ed2a6 100644 --- a/pkg/analyzer/test/src/diagnostics/non_void_return_for_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/non_void_return_for_setter_test.dart @@ -21,7 +21,7 @@ class NonVoidReturnForSetterTest extends PubPackageResolutionTest { int set x(int v) { return 42; }''', - [error(CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, 0, 3)], + [error(CompileTimeErrorCode.nonVoidReturnForSetter, 0, 3)], ); } @@ -45,7 +45,7 @@ class A { return 42; } }''', - [error(CompileTimeErrorCode.NON_VOID_RETURN_FOR_SETTER, 12, 3)], + [error(CompileTimeErrorCode.nonVoidReturnForSetter, 12, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/not_a_type_test.dart b/pkg/analyzer/test/src/diagnostics/not_a_type_test.dart index da10d873024..e093a99bdde 100644 --- a/pkg/analyzer/test/src/diagnostics/not_a_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_a_type_test.dart @@ -26,7 +26,7 @@ A.foo bar() {} ''', [ error( - CompileTimeErrorCode.NOT_A_TYPE, + CompileTimeErrorCode.notAType, 24, 5, contextMessages: [message(testFile, 14, 3)], @@ -46,7 +46,7 @@ A.foo bar() {} ''', [ error( - CompileTimeErrorCode.NOT_A_TYPE, + CompileTimeErrorCode.notAType, 36, 5, contextMessages: [message(testFile, 24, 3)], @@ -63,7 +63,7 @@ E a; ''', [ error( - CompileTimeErrorCode.NOT_A_TYPE, + CompileTimeErrorCode.notAType, 22, 1, contextMessages: [message(testFile, 10, 1)], @@ -89,12 +89,12 @@ main() { }''', [ error( - CompileTimeErrorCode.NOT_A_TYPE, + CompileTimeErrorCode.notAType, 18, 1, contextMessages: [message(testFile, 0, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 20, 1), + error(WarningCode.unusedLocalVariable, 20, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/not_assigned_potentially_non_nullable_local_variable_test.dart b/pkg/analyzer/test/src/diagnostics/not_assigned_potentially_non_nullable_local_variable_test.dart index c210db2aeb4..e1a2811c932 100644 --- a/pkg/analyzer/test/src/diagnostics/not_assigned_potentially_non_nullable_local_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_assigned_potentially_non_nullable_local_variable_test.dart @@ -89,8 +89,8 @@ void f() { ''', [ _notAssignedError(22, 1), - error(WarningCode.DEAD_CODE, 28, 2), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 28, 1), + error(WarningCode.deadCode, 28, 2), + error(StaticWarningCode.deadNullAwareExpression, 28, 1), ], ); } @@ -105,8 +105,8 @@ void f() { ''', [ _notAssignedError(22, 1), - error(WarningCode.DEAD_CODE, 28, 2), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 28, 1), + error(WarningCode.deadCode, 28, 2), + error(StaticWarningCode.deadNullAwareExpression, 28, 1), _notAssignedError(28, 1), ], ); @@ -132,8 +132,8 @@ void f() { } ''', [ - error(WarningCode.DEAD_CODE, 30, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 33, 1), + error(WarningCode.deadCode, 30, 4), + error(StaticWarningCode.deadNullAwareExpression, 33, 1), ], ); } @@ -148,8 +148,8 @@ void f(int a) { } ''', [ - error(WarningCode.DEAD_CODE, 29, 10), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 32, 7), + error(WarningCode.deadCode, 29, 10), + error(StaticWarningCode.deadNullAwareExpression, 32, 7), _notAssignedError(43, 1), ], ); @@ -562,7 +562,7 @@ void f() { v; } ''', - [error(WarningCode.DEAD_CODE, 51, 2)], + [error(WarningCode.deadCode, 51, 2)], ); } @@ -578,8 +578,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 31, 1), - error(WarningCode.DEAD_CODE, 61, 2), + error(WarningCode.unusedLocalVariable, 31, 1), + error(WarningCode.deadCode, 61, 2), ], ); } @@ -596,7 +596,7 @@ void f(bool b) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 31, 2), + error(WarningCode.unusedLocalVariable, 31, 2), _notAssignedError(75, 2), _notAssignedError(85, 2), _notAssignedError(95, 2), @@ -718,8 +718,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(WarningCode.UNUSED_ELEMENT, 38, 1), + error(WarningCode.unusedLocalVariable, 17, 1), + error(WarningCode.unusedElement, 38, 1), _notAssignedError(64, 1), ], ); @@ -742,7 +742,7 @@ void f() { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 40, 1), _notAssignedError(94, 2)], + [error(WarningCode.unusedElement, 40, 1), _notAssignedError(94, 2)], ); } @@ -762,7 +762,7 @@ void f() { v2 = 0; } ''', - [error(WarningCode.UNUSED_ELEMENT, 44, 1), _notAssignedError(62, 2)], + [error(WarningCode.unusedElement, 44, 1), _notAssignedError(62, 2)], ); } @@ -779,7 +779,7 @@ void f() { v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 28, 1), _notAssignedError(52, 1)], + [error(WarningCode.unusedElement, 28, 1), _notAssignedError(52, 1)], ); } @@ -792,7 +792,7 @@ f() { FutureOr v; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1)], + [error(WarningCode.unusedLocalVariable, 45, 1)], ); } @@ -832,7 +832,7 @@ void f() { v; } ''', - [error(WarningCode.DEAD_CODE, 33, 25)], + [error(WarningCode.deadCode, 33, 25)], ); } @@ -895,7 +895,7 @@ void f() { v; } ''', - [error(WarningCode.DEAD_CODE, 33, 25)], + [error(WarningCode.deadCode, 33, 25)], ); } @@ -1022,7 +1022,7 @@ void f() { int v; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); } @@ -1288,7 +1288,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.DEAD_CODE, 45, 8)], + [error(WarningCode.deadCode, 45, 8)], ); } @@ -1302,7 +1302,7 @@ void f(Object? x) { }); } ''', - [error(WarningCode.DEAD_CODE, 52, 8)], + [error(WarningCode.deadCode, 52, 8)], ); } @@ -1316,7 +1316,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.DEAD_CODE, 56, 8)], + [error(WarningCode.deadCode, 56, 8)], ); } @@ -1507,7 +1507,7 @@ f() { dynamic v; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 16, 1)], + [error(WarningCode.unusedLocalVariable, 16, 1)], ); } @@ -1518,7 +1518,7 @@ f() { var v; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -1529,7 +1529,7 @@ f() { void v; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1)], + [error(WarningCode.unusedLocalVariable, 13, 1)], ); } @@ -1613,7 +1613,7 @@ void f(bool b) { v; } ''', - [error(WarningCode.DEAD_CODE, 131, 2)], + [error(WarningCode.deadCode, 131, 2)], ); } @@ -1693,10 +1693,9 @@ void f(bool b) { } ''', [ - error(WarningCode.DEAD_CODE, 81, 2), + error(WarningCode.deadCode, 81, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 81, 1, ), @@ -1717,10 +1716,9 @@ void f() { } ''', [ - error(WarningCode.DEAD_CODE, 114, 2), + error(WarningCode.deadCode, 114, 2), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 114, 1, ), @@ -1730,7 +1728,7 @@ void f() { ExpectedError _notAssignedError(int offset, int length) { return error( - CompileTimeErrorCode.NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, offset, length, ); diff --git a/pkg/analyzer/test/src/diagnostics/not_binary_operator_test.dart b/pkg/analyzer/test/src/diagnostics/not_binary_operator_test.dart index 1b75e2d26e3..c2656e4edbf 100644 --- a/pkg/analyzer/test/src/diagnostics/not_binary_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_binary_operator_test.dart @@ -17,7 +17,7 @@ main() { class NonBinaryOperatorTest extends PubPackageResolutionTest { test_unaryTilde() async { await assertErrorsInCode('var a = 5 ~ 3;', [ - error(CompileTimeErrorCode.NOT_BINARY_OPERATOR, 10, 1), + error(CompileTimeErrorCode.notBinaryOperator, 10, 1), ]); } } diff --git a/pkg/analyzer/test/src/diagnostics/not_enough_positional_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/not_enough_positional_arguments_test.dart index ae4bfad4ce0..7a21ad8d336 100644 --- a/pkg/analyzer/test/src/diagnostics/not_enough_positional_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_enough_positional_arguments_test.dart @@ -27,7 +27,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 45, 1, messageContains: ["expected by 'named'"], @@ -48,7 +48,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 33, 1, messageContains: ["expected by 'A.new'"], @@ -70,7 +70,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 42, 1, messageContains: ["expected by 'A.new'"], @@ -89,7 +89,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 13, 1, messageContains: ["expected by 'E'"], @@ -108,7 +108,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 11, 1, messageContains: ["expected by 'E'"], @@ -127,7 +127,7 @@ main() { }''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 66, 1, messageContains: ["expected by 'getter'"], @@ -142,13 +142,7 @@ main() { main() { (int x, int y) {} (); }''', - [ - error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_PLURAL, - 30, - 1, - ), - ], + [error(CompileTimeErrorCode.notEnoughPositionalArgumentsPlural, 30, 1)], ); } @@ -158,13 +152,7 @@ main() { main() { (int x) {} (); }''', - [ - error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_SINGULAR, - 23, - 1, - ), - ], + [error(CompileTimeErrorCode.notEnoughPositionalArgumentsSingular, 23, 1)], ); } @@ -180,7 +168,7 @@ main() { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 49, 1, messageContains: ["expected by 'A.new'"], @@ -201,11 +189,11 @@ main() { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 49, 1, ), - error(CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, 49, 1), + error(CompileTimeErrorCode.undefinedNamedParameter, 49, 1), ], ); } @@ -223,7 +211,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL, + CompileTimeErrorCode.notEnoughPositionalArgumentsNamePlural, 70, 1, messageContains: ["expected by 'named'"], @@ -245,7 +233,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL, + CompileTimeErrorCode.notEnoughPositionalArgumentsNamePlural, 58, 1, messageContains: [ @@ -265,7 +253,7 @@ main() { }''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_PLURAL, + CompileTimeErrorCode.notEnoughPositionalArgumentsNamePlural, 35, 1, messageContains: ["expected by 'f'"], @@ -284,7 +272,7 @@ class A { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 58, 1, messageContains: ["expected by 'A.new'"], @@ -303,7 +291,7 @@ class A { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 64, 1, messageContains: ["expected by 'named'"], @@ -324,7 +312,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 70, 1, messageContains: ["expected by 'A.new'"], @@ -345,7 +333,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 82, 1, messageContains: ["expected by 'named'"], diff --git a/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_instance_field_test.dart b/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_instance_field_test.dart index a7a57081b02..998dbf5533d 100644 --- a/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_instance_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_instance_field_test.dart @@ -67,7 +67,7 @@ class A { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 16, 1, ), @@ -151,7 +151,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 61, 1, ), @@ -168,7 +168,7 @@ mixin M { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 16, 1, ), @@ -198,7 +198,7 @@ class A { [ error( CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + .notInitializedNonNullableInstanceFieldConstructor, 38, 1, ), @@ -218,7 +218,7 @@ class A { [ error( CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + .notInitializedNonNullableInstanceFieldConstructor, 28, 1, ), @@ -259,7 +259,7 @@ class A { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 18, 1, ), @@ -284,7 +284,7 @@ class A { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 17, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_variable_test.dart b/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_variable_test.dart index 49fd9d7fc87..9c3491a3267 100644 --- a/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_initialized_non_nullable_variable_test.dart @@ -62,13 +62,7 @@ class A { static int x = 0, y, z = 2; } ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 30, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 30, 1)], ); } @@ -80,13 +74,7 @@ class A { A(); } ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 30, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 30, 1)], ); } @@ -98,13 +86,7 @@ class A { A(); } ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 36, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 36, 1)], ); } @@ -139,13 +121,7 @@ class A { static Never v; } ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 25, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 25, 1)], ); } @@ -176,13 +152,7 @@ int v = 0; ''' int x = 0, y, z = 2; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 11, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 11, 1)], ); } @@ -209,7 +179,7 @@ var v; ''' Never v; ''', - [error(CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, 6, 1)], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 6, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/not_instantiated_bound_test.dart b/pkg/analyzer/test/src/diagnostics/not_instantiated_bound_test.dart index 7b74edc37fd..548eb79fb55 100644 --- a/pkg/analyzer/test/src/diagnostics/not_instantiated_bound_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_instantiated_bound_test.dart @@ -21,7 +21,7 @@ class NotInstantiatedBoundTest extends PubPackageResolutionTest { class A> {} class C {} ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 51, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 51, 1)], ); } @@ -31,7 +31,7 @@ class C {} class A>> {} class C {} ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 57, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 57, 1)], ); } @@ -81,8 +81,8 @@ class A> {} class B> {} ''', [ - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 20, 1), - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 47, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 20, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 47, 1), ], ); } @@ -95,9 +95,9 @@ class B {} // points to b class C {} // points to a cyclical type ''', [ - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 18, 1), - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 57, 1), - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 96, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 18, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 57, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 96, 1), ], ); } @@ -107,7 +107,7 @@ class C {} // points to a cyclical type r''' class A {} ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 32, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 32, 1)], ); } @@ -116,7 +116,7 @@ class A {} r''' class A()> {} ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 42, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 42, 1)], ); } @@ -128,9 +128,9 @@ class C {} class D {} ''', [ - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1), - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 38, 1), - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 62, 1), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 38, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 62, 1), ], ); } @@ -148,7 +148,7 @@ class C {} class A {} class C {} ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 45, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 45, 1)], ); } @@ -161,8 +161,8 @@ class C {} class D {} ''', [ - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 87, 1), - error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 111, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 87, 1), + error(CompileTimeErrorCode.notInstantiatedBound, 111, 1), ], ); } @@ -173,7 +173,7 @@ class D {} class A {} class C> {} ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 50, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 50, 1)], ); } @@ -183,7 +183,7 @@ class C> {} class A> {} typedef void F(); ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 58, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 58, 1)], ); } @@ -193,7 +193,7 @@ typedef void F(); class A>> {} typedef void F(); ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 64, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 64, 1)], ); } @@ -210,7 +210,7 @@ typedef void F(); class A {} typedef void F(); ''', - [error(CompileTimeErrorCode.NOT_INSTANTIATED_BOUND, 52, 1)], + [error(CompileTimeErrorCode.notInstantiatedBound, 52, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/not_iterable_spread_test.dart b/pkg/analyzer/test/src/diagnostics/not_iterable_spread_test.dart index 589886b91dc..0cf4238b170 100644 --- a/pkg/analyzer/test/src/diagnostics/not_iterable_spread_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_iterable_spread_test.dart @@ -63,7 +63,7 @@ void f?>(T a) { var a = 0; var v = [...a]; ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 23, 1)], + [error(CompileTimeErrorCode.notIterableSpread, 23, 1)], ); } @@ -74,8 +74,8 @@ var a = 0; var v = [for (var i in []) ...a]; ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1), - error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 41, 1), + error(WarningCode.unusedLocalVariable, 29, 1), + error(CompileTimeErrorCode.notIterableSpread, 41, 1), ], ); } @@ -86,7 +86,7 @@ var v = [for (var i in []) ...a]; var a = 0; var v = [if (1 > 0) ...[] else ...a]; ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 45, 1)], + [error(CompileTimeErrorCode.notIterableSpread, 45, 1)], ); } @@ -96,7 +96,7 @@ var v = [if (1 > 0) ...[] else ...a]; var a = 0; var v = [if (1 > 0) ...a]; ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 34, 1)], + [error(CompileTimeErrorCode.notIterableSpread, 34, 1)], ); } @@ -108,7 +108,7 @@ void f(T a) { v; } ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 43, 1)], + [error(CompileTimeErrorCode.notIterableSpread, 43, 1)], ); } @@ -117,7 +117,7 @@ void f(T a) { ''' List f() => [...{1: 2, 3: 4}]; ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 21, 12)], + [error(CompileTimeErrorCode.notIterableSpread, 21, 12)], ); } } @@ -132,7 +132,7 @@ void f(dynamic a) { [...a]; } ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 26, 1)], + [error(CompileTimeErrorCode.notIterableSpread, 26, 1)], ); } @@ -143,7 +143,7 @@ void f(dynamic a) { {...a}; } ''', - [error(CompileTimeErrorCode.NOT_ITERABLE_SPREAD, 31, 1)], + [error(CompileTimeErrorCode.notIterableSpread, 31, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/not_map_spread_test.dart b/pkg/analyzer/test/src/diagnostics/not_map_spread_test.dart index b0bd0e40764..8b60e230a6a 100644 --- a/pkg/analyzer/test/src/diagnostics/not_map_spread_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_map_spread_test.dart @@ -53,7 +53,7 @@ void f?>(T a) { var a = 0; var v = {...a}; ''', - [error(CompileTimeErrorCode.NOT_MAP_SPREAD, 33, 1)], + [error(CompileTimeErrorCode.notMapSpread, 33, 1)], ); } @@ -64,8 +64,8 @@ var a = 0; var v = {for (var i in []) ...a}; ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 1), - error(CompileTimeErrorCode.NOT_MAP_SPREAD, 51, 1), + error(WarningCode.unusedLocalVariable, 39, 1), + error(CompileTimeErrorCode.notMapSpread, 51, 1), ], ); } @@ -76,7 +76,7 @@ var v = {for (var i in []) ...a}; var a = 0; var v = {if (1 > 0) ...{} else ...a}; ''', - [error(CompileTimeErrorCode.NOT_MAP_SPREAD, 65, 1)], + [error(CompileTimeErrorCode.notMapSpread, 65, 1)], ); } @@ -86,7 +86,7 @@ var v = {if (1 > 0) ...{} else ...a}; var a = 0; var v = {if (1 > 0) ...a}; ''', - [error(CompileTimeErrorCode.NOT_MAP_SPREAD, 44, 1)], + [error(CompileTimeErrorCode.notMapSpread, 44, 1)], ); } @@ -98,7 +98,7 @@ void f(T a) { v; } ''', - [error(CompileTimeErrorCode.NOT_MAP_SPREAD, 53, 1)], + [error(CompileTimeErrorCode.notMapSpread, 53, 1)], ); } } @@ -113,7 +113,7 @@ void f(dynamic a) { {...a}; } ''', - [error(CompileTimeErrorCode.NOT_MAP_SPREAD, 39, 1)], + [error(CompileTimeErrorCode.notMapSpread, 39, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/not_null_aware_null_spread_test.dart b/pkg/analyzer/test/src/diagnostics/not_null_aware_null_spread_test.dart index 193d25115d1..ca774d6003f 100644 --- a/pkg/analyzer/test/src/diagnostics/not_null_aware_null_spread_test.dart +++ b/pkg/analyzer/test/src/diagnostics/not_null_aware_null_spread_test.dart @@ -21,8 +21,8 @@ class NotNullAwareNullSpreadTest extends PubPackageResolutionTest { var v = [...null]; ''', [ - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 12, 4), - error(CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, 12, 4), + error(CompileTimeErrorCode.invalidUseOfNullValue, 12, 4), + error(CompileTimeErrorCode.notNullAwareNullSpread, 12, 4), ], ); } @@ -34,8 +34,8 @@ Null a = null; var v = [...a]; ''', [ - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 27, 1), - error(CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, 27, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 27, 1), + error(CompileTimeErrorCode.notNullAwareNullSpread, 27, 1), ], ); } @@ -59,8 +59,8 @@ var v = [...?a]; var v = {...null}; ''', [ - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 22, 4), - error(CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, 22, 4), + error(CompileTimeErrorCode.invalidUseOfNullValue, 22, 4), + error(CompileTimeErrorCode.notNullAwareNullSpread, 22, 4), ], ); } @@ -72,8 +72,8 @@ Null a = null; var v = {...a}; ''', [ - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 37, 1), - error(CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, 37, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 37, 1), + error(CompileTimeErrorCode.notNullAwareNullSpread, 37, 1), ], ); } @@ -97,8 +97,8 @@ var v = {...?a}; var v = {...null}; ''', [ - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 17, 4), - error(CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, 17, 4), + error(CompileTimeErrorCode.invalidUseOfNullValue, 17, 4), + error(CompileTimeErrorCode.notNullAwareNullSpread, 17, 4), ], ); } @@ -110,8 +110,8 @@ Null a = null; var v = {...a}; ''', [ - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 32, 1), - error(CompileTimeErrorCode.NOT_NULL_AWARE_NULL_SPREAD, 32, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 32, 1), + error(CompileTimeErrorCode.notNullAwareNullSpread, 32, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/null_argument_to_non_null_type_test.dart b/pkg/analyzer/test/src/diagnostics/null_argument_to_non_null_type_test.dart index f91adef17ac..6a7453be853 100644 --- a/pkg/analyzer/test/src/diagnostics/null_argument_to_non_null_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/null_argument_to_non_null_type_test.dart @@ -23,7 +23,7 @@ class NullArgumentToNonNullCompleterCompleteTest import 'dart:async'; void f() => Completer().complete(); ''', - [error(WarningCode.NULL_ARGUMENT_TO_NON_NULL_TYPE, 33, 27)], + [error(WarningCode.nullArgumentToNonNullType, 33, 27)], ); } @@ -42,7 +42,7 @@ void f() { import 'dart:async'; void f() => Completer().complete(null); ''', - [error(WarningCode.NULL_ARGUMENT_TO_NON_NULL_TYPE, 59, 4)], + [error(WarningCode.nullArgumentToNonNullType, 59, 4)], ); } @@ -63,7 +63,7 @@ void f() { import 'dart:async'; void f(Null a) => Completer().complete(a); ''', - [error(WarningCode.NULL_ARGUMENT_TO_NON_NULL_TYPE, 65, 1)], + [error(WarningCode.nullArgumentToNonNullType, 65, 1)], ); } } @@ -75,7 +75,7 @@ class NullArgumentToNonNullFutureValueTest extends PubPackageResolutionTest { ''' void foo() => Future.value(); ''', - [error(WarningCode.NULL_ARGUMENT_TO_NON_NULL_TYPE, 14, 19)], + [error(WarningCode.nullArgumentToNonNullType, 14, 19)], ); } @@ -93,7 +93,7 @@ void f() { ''' void foo() => Future.value(null); ''', - [error(WarningCode.NULL_ARGUMENT_TO_NON_NULL_TYPE, 32, 4)], + [error(WarningCode.nullArgumentToNonNullType, 32, 4)], ); } @@ -111,7 +111,7 @@ void f() { ''' void foo(Null a) => Future.value(a); ''', - [error(WarningCode.NULL_ARGUMENT_TO_NON_NULL_TYPE, 38, 1)], + [error(WarningCode.nullArgumentToNonNullType, 38, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/null_aware_elements_const_literals_error_test.dart b/pkg/analyzer/test/src/diagnostics/null_aware_elements_const_literals_error_test.dart index 9e6b4ecd056..ee4eede7f36 100644 --- a/pkg/analyzer/test/src/diagnostics/null_aware_elements_const_literals_error_test.dart +++ b/pkg/analyzer/test/src/diagnostics/null_aware_elements_const_literals_error_test.dart @@ -24,7 +24,7 @@ const map = {intConst: null, 0: ?intConst, null: 1, stringConst: 1}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 86, 1, contextMessages: [message(testFile, 70, 8)], @@ -42,7 +42,7 @@ const set = {0, ?intConst, stringConst}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 74, 8, contextMessages: [message(testFile, 70, 1)], @@ -60,7 +60,7 @@ const map = {intConst: null, ?(0 as int?): intConst, null: 1, stringConst: 1}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 87, 11, contextMessages: [message(testFile, 70, 8)], @@ -79,7 +79,7 @@ const set = {nullConst, null, intConst, stringConst}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 110, 4, contextMessages: [message(testFile, 99, 9)], @@ -98,7 +98,7 @@ const map = {null: 1, nullConst: 1, intConst: 1, stringConst: 1}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 103, 9, contextMessages: [message(testFile, 94, 4)], @@ -117,7 +117,7 @@ const map = {null: 1, nullConst: ?intConst, stringConst: 1}; ''', [ error( - CompileTimeErrorCode.EQUAL_KEYS_IN_CONST_MAP, + CompileTimeErrorCode.equalKeysInConstMap, 103, 9, contextMessages: [message(testFile, 94, 4)], @@ -135,7 +135,7 @@ const set = {null, intConst, "", ?stringConst}; ''', [ error( - CompileTimeErrorCode.EQUAL_ELEMENTS_IN_CONST_SET, + CompileTimeErrorCode.equalElementsInConstSet, 91, 11, contextMessages: [message(testFile, 86, 2)], @@ -153,12 +153,8 @@ const String? stringConst = ""; const list = [?null, ?nullVar, intConst, stringConst]; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 99, 7), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 99, - 7, - ), + error(CompileTimeErrorCode.nonConstantListElement, 99, 7), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 99, 7), ], ); } @@ -171,12 +167,8 @@ int? intVar = 0; const map = {null: 1, ?intVar: 1, stringConst: 1}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 72, 6), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 72, - 6, - ), + error(CompileTimeErrorCode.nonConstantMapKey, 72, 6), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 72, 6), ], ); } @@ -190,12 +182,8 @@ int? intVar = 0; const set = {nullConst, ?intVar, stringConst}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 98, 6), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 98, - 6, - ), + error(CompileTimeErrorCode.nonConstantSetElement, 98, 6), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 98, 6), ], ); } @@ -208,12 +196,8 @@ int? intVar = 0; const map = {null: 1, 0: ?intVar, stringConst: 1}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 75, 6), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 75, - 6, - ), + error(CompileTimeErrorCode.nonConstantMapValue, 75, 6), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 75, 6), ], ); } @@ -227,12 +211,8 @@ const String? stringConst = ""; const map = {?nullVar: 1, intConst: 1, stringConst: 1}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 91, 7), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 91, - 7, - ), + error(CompileTimeErrorCode.nonConstantMapKey, 91, 7), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 91, 7), ], ); } @@ -246,12 +226,8 @@ const String? stringConst = ""; const set = {?nullVar, intConst, stringConst}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 91, 7), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 91, - 7, - ), + error(CompileTimeErrorCode.nonConstantSetElement, 91, 7), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 91, 7), ], ); } @@ -265,12 +241,8 @@ const String? stringConst = ""; const map = {null: ?nullVar, intConst: 1, stringConst: 1}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 97, 7), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 97, - 7, - ), + error(CompileTimeErrorCode.nonConstantMapValue, 97, 7), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 97, 7), ], ); } @@ -282,12 +254,8 @@ String? stringVar = ""; const map = {null: 1, 0: 1, ?stringVar: 1}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_MAP_KEY, 53, 9), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 53, - 9, - ), + error(CompileTimeErrorCode.nonConstantMapKey, 53, 9), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 53, 9), ], ); } @@ -301,9 +269,9 @@ String? stringVar = ""; const set = {nullConst, intConst, ?stringVar}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_SET_ELEMENT, 108, 9), + error(CompileTimeErrorCode.nonConstantSetElement, 108, 9), error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 108, 9, ), @@ -318,12 +286,8 @@ String? stringVar = ""; const map = {null: 1, 0: 1, "": ?stringVar}; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_MAP_VALUE, 57, 9), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 57, - 9, - ), + error(CompileTimeErrorCode.nonConstantMapValue, 57, 9), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 57, 9), ], ); } @@ -337,12 +301,8 @@ const String? stringConst = ""; const list = [?nullVar, intConst, stringConst]; ''', [ - error(CompileTimeErrorCode.NON_CONSTANT_LIST_ELEMENT, 92, 7), - error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, - 92, - 7, - ), + error(CompileTimeErrorCode.nonConstantListElement, 92, 7), + error(CompileTimeErrorCode.constInitializedWithNonConstantValue, 92, 7), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/null_check_always_fails_test.dart b/pkg/analyzer/test/src/diagnostics/null_check_always_fails_test.dart index 7040aeeb151..aea858f6e32 100644 --- a/pkg/analyzer/test/src/diagnostics/null_check_always_fails_test.dart +++ b/pkg/analyzer/test/src/diagnostics/null_check_always_fails_test.dart @@ -30,7 +30,7 @@ void f() { null!; } ''', - [error(WarningCode.NULL_CHECK_ALWAYS_FAILS, 13, 5)], + [error(WarningCode.nullCheckAlwaysFails, 13, 5)], ); } @@ -41,7 +41,7 @@ void f() { (null)!; } ''', - [error(WarningCode.NULL_CHECK_ALWAYS_FAILS, 13, 7)], + [error(WarningCode.nullCheckAlwaysFails, 13, 7)], ); } @@ -53,7 +53,7 @@ void f() { } Null g() => null; ''', - [error(WarningCode.NULL_CHECK_ALWAYS_FAILS, 13, 4)], + [error(WarningCode.nullCheckAlwaysFails, 13, 4)], ); } @@ -65,7 +65,7 @@ void f() async { } Future g() async => null; ''', - [error(WarningCode.NULL_CHECK_ALWAYS_FAILS, 19, 12)], + [error(WarningCode.nullCheckAlwaysFails, 19, 12)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/null_safety_read_write_test.dart b/pkg/analyzer/test/src/diagnostics/null_safety_read_write_test.dart index 95fa3387ea4..68275fcdd27 100644 --- a/pkg/analyzer/test/src/diagnostics/null_safety_read_write_test.dart +++ b/pkg/analyzer/test/src/diagnostics/null_safety_read_write_test.dart @@ -44,7 +44,7 @@ void f(final x) { x += 1; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 20, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 20, 1)], ); _assertAssigned('x +=', assigned: true, unassigned: false); } @@ -56,7 +56,7 @@ void f(final x) { x++; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 20, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 20, 1)], ); _assertAssigned('x++', assigned: true, unassigned: false); } @@ -68,7 +68,7 @@ void f(final x) { ++x; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 22, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 22, 1)], ); _assertAssigned('x;', assigned: true, unassigned: false); } @@ -80,7 +80,7 @@ void f(final x) { x = 0; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 20, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 20, 1)], ); _assertAssigned('x =', assigned: true, unassigned: false); } @@ -94,7 +94,7 @@ void f(final x) { } } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 25, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 25, 1)], ); _assertAssigned('x in', assigned: true, unassigned: false); } @@ -109,8 +109,8 @@ void f() { } ''', [ - error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 24, 1), - error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 34, 1), + error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 24, 1), + error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 34, 1), ], ); _assertAssigned('x; // 0', assigned: false, unassigned: true); @@ -126,7 +126,7 @@ void f() { x += 1; } ''', - [error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 58, 1)], + [error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 58, 1)], ); _assertAssigned('x +=', assigned: false, unassigned: true); } @@ -140,7 +140,7 @@ void f() { x++; } ''', - [error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 58, 1)], + [error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 58, 1)], ); _assertAssigned('x++', assigned: false, unassigned: true); } @@ -154,7 +154,7 @@ void f() { ++x; // 0 } ''', - [error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 60, 1)], + [error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 60, 1)], ); _assertAssigned('x; // 0', assigned: false, unassigned: true); } @@ -179,7 +179,7 @@ void f(bool b) { x; // 0 } ''', - [error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 46, 1)], + [error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 46, 1)], ); _assertAssigned('x; // 0', assigned: false, unassigned: false); } @@ -195,8 +195,8 @@ void f(bool b) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 80, 1), - error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 80, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 80, 1), + error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 80, 1), ], ); _assertAssigned('x +=', assigned: false, unassigned: false); @@ -213,8 +213,8 @@ void f(bool b) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 80, 1), - error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 80, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 80, 1), + error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 80, 1), ], ); _assertAssigned('x++', assigned: false, unassigned: false); @@ -231,8 +231,8 @@ void f(bool b) { } ''', [ - error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 82, 1), - error(CompileTimeErrorCode.READ_POTENTIALLY_UNASSIGNED_FINAL, 82, 1), + error(CompileTimeErrorCode.assignmentToFinalLocal, 82, 1), + error(CompileTimeErrorCode.readPotentiallyUnassignedFinal, 82, 1), ], ); _assertAssigned('x; // 0', assigned: false, unassigned: false); @@ -248,7 +248,7 @@ void f(bool b) { x = 1; } ''', - [error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL_LOCAL, 80, 1)], + [error(CompileTimeErrorCode.assignmentToFinalLocal, 80, 1)], ); _assertAssigned('x = 1', assigned: false, unassigned: false); } @@ -274,7 +274,7 @@ void f() { x += 1; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 72, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 72, 1)], ); _assertAssigned('x +=', assigned: true, unassigned: false); } @@ -289,7 +289,7 @@ void f() { x++; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 72, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 72, 1)], ); _assertAssigned('x++', assigned: true, unassigned: false); } @@ -304,7 +304,7 @@ void f() { ++x; // 0 } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 74, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 74, 1)], ); _assertAssigned('x; // 0', assigned: true, unassigned: false); } @@ -319,7 +319,7 @@ void f() { x = 1; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 72, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 72, 1)], ); _assertAssigned('x = 1', assigned: true, unassigned: false); } @@ -334,7 +334,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 29, 1, ), @@ -354,7 +354,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 63, 1, ), @@ -374,7 +374,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 63, 1, ), @@ -394,7 +394,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 65, 1, ), @@ -494,7 +494,7 @@ void f() { x += 1; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 77, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 77, 1)], ); _assertAssigned('x +=', assigned: true, unassigned: false); } @@ -509,7 +509,7 @@ void f() { x++; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 77, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 77, 1)], ); _assertAssigned('x++', assigned: true, unassigned: false); } @@ -524,7 +524,7 @@ void f() { ++x; // 0 } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 79, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 79, 1)], ); _assertAssigned('x; // 0', assigned: true, unassigned: false); } @@ -539,7 +539,7 @@ void f() { x = 1; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 77, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 77, 1)], ); _assertAssigned('x = 1', assigned: true, unassigned: false); } @@ -554,7 +554,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 34, 1, ), @@ -574,12 +574,12 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 68, 1, ), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 70, 2, ), @@ -599,12 +599,12 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 68, 1, ), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 69, 2, ), @@ -624,12 +624,12 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 70, 1, ), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 68, 2, ), @@ -672,7 +672,7 @@ void f(bool b) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 92, 2, ), @@ -693,7 +693,7 @@ void f(bool b) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 91, 2, ), @@ -714,7 +714,7 @@ void f(bool b) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 90, 2, ), @@ -756,7 +756,7 @@ void f(T t, T t2) { x = t2; } ''', - [error(CompileTimeErrorCode.LATE_FINAL_LOCAL_ALREADY_ASSIGNED, 86, 1)], + [error(CompileTimeErrorCode.lateFinalLocalAlreadyAssigned, 86, 1)], ); _assertAssigned('x = t2', assigned: true, unassigned: false); } @@ -771,7 +771,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 34, 1, ), @@ -835,7 +835,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 28, 1, ), @@ -876,7 +876,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 28, 1, ), @@ -965,7 +965,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.DEFINITELY_UNASSIGNED_LATE_LOCAL_VARIABLE, + CompileTimeErrorCode.definitelyUnassignedLateLocalVariable, 27, 1, ), @@ -1136,8 +1136,7 @@ void f() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 23, 1, ), @@ -1168,8 +1167,7 @@ void f(bool b, T t) { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 50, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/nullable_type_in_catch_clause_test.dart b/pkg/analyzer/test/src/diagnostics/nullable_type_in_catch_clause_test.dart index 33ad5467a24..a7f374e4bba 100644 --- a/pkg/analyzer/test/src/diagnostics/nullable_type_in_catch_clause_test.dart +++ b/pkg/analyzer/test/src/diagnostics/nullable_type_in_catch_clause_test.dart @@ -35,7 +35,7 @@ f() { } } ''', - [error(WarningCode.NULLABLE_TYPE_IN_CATCH_CLAUSE, 32, 7)], + [error(WarningCode.nullableTypeInCatchClause, 32, 7)], ); } @@ -58,7 +58,7 @@ f() { } } ''', - [error(WarningCode.NULLABLE_TYPE_IN_CATCH_CLAUSE, 21, 16)], + [error(WarningCode.nullableTypeInCatchClause, 21, 16)], ); } @@ -81,7 +81,7 @@ f() { } } ''', - [error(WarningCode.NULLABLE_TYPE_IN_CATCH_CLAUSE, 21, 4)], + [error(WarningCode.nullableTypeInCatchClause, 21, 4)], ); } @@ -108,7 +108,7 @@ class A { } } ''', - [error(WarningCode.NULLABLE_TYPE_IN_CATCH_CLAUSE, 40, 1)], + [error(WarningCode.nullableTypeInCatchClause, 40, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/nullable_type_in_extends_clause_test.dart b/pkg/analyzer/test/src/diagnostics/nullable_type_in_extends_clause_test.dart index 5e9d1d9d695..87252de0047 100644 --- a/pkg/analyzer/test/src/diagnostics/nullable_type_in_extends_clause_test.dart +++ b/pkg/analyzer/test/src/diagnostics/nullable_type_in_extends_clause_test.dart @@ -28,7 +28,7 @@ class B extends A {} class A {} class B extends A? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 27, 2)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 27, 2)], ); } @@ -39,7 +39,7 @@ class A {} typedef B = A; class C extends B? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 42, 2)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 42, 2)], ); } @@ -50,7 +50,7 @@ class A {} typedef B = A?; class C extends B {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 43, 1)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 43, 1)], ); } @@ -69,7 +69,7 @@ class A {} mixin B {} class C = A? with B; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 32, 2)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 32, 2)], ); } @@ -81,7 +81,7 @@ mixin B {} typedef C = A; class D = C? with B; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 47, 2)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 47, 2)], ); } @@ -93,7 +93,7 @@ mixin B {} typedef C = A?; class D = C with B; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 48, 1)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 48, 1)], ); } @@ -112,7 +112,7 @@ class A {} mixin B {} class C = A? with B; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 32, 2)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 32, 2)], ); } @@ -124,7 +124,7 @@ mixin B {} typedef C = A; class D = C? with B; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 47, 2)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 47, 2)], ); } @@ -136,7 +136,7 @@ mixin B {} typedef C = A?; class D = C with B; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_EXTENDS_CLAUSE, 48, 1)], + [error(CompileTimeErrorCode.nullableTypeInExtendsClause, 48, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/nullable_type_in_implements_clause_test.dart b/pkg/analyzer/test/src/diagnostics/nullable_type_in_implements_clause_test.dart index af279b54d72..0c70671e162 100644 --- a/pkg/analyzer/test/src/diagnostics/nullable_type_in_implements_clause_test.dart +++ b/pkg/analyzer/test/src/diagnostics/nullable_type_in_implements_clause_test.dart @@ -28,7 +28,7 @@ class B implements A {} class A {} class B implements A? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 30, 2)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 30, 2)], ); } @@ -39,7 +39,7 @@ class A {} typedef B = A; class C implements B? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 45, 2)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 45, 2)], ); } @@ -50,7 +50,7 @@ class A {} typedef B = A?; class C implements B {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 46, 1)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 46, 1)], ); } @@ -67,7 +67,7 @@ extension type E(A _) implements A {} class A {} extension type E(A _) implements A? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 44, 2)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 44, 2)], ); } @@ -78,7 +78,7 @@ class A {} typedef B = A; extension type E(A _) implements B? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 59, 2)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 59, 2)], ); } @@ -89,7 +89,7 @@ class A {} typedef B = A?; extension type E(A _) implements B {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 60, 1)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 60, 1)], ); } @@ -106,7 +106,7 @@ mixin B implements A {} class A {} mixin B implements A? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 30, 2)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 30, 2)], ); } @@ -117,7 +117,7 @@ class A {} typedef B = A; mixin C implements B? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 45, 2)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 45, 2)], ); } @@ -128,7 +128,7 @@ class A {} typedef B = A?; mixin C implements B {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_IMPLEMENTS_CLAUSE, 46, 1)], + [error(CompileTimeErrorCode.nullableTypeInImplementsClause, 46, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/nullable_type_in_on_clause_test.dart b/pkg/analyzer/test/src/diagnostics/nullable_type_in_on_clause_test.dart index 85ce6ede25e..d04f7107f37 100644 --- a/pkg/analyzer/test/src/diagnostics/nullable_type_in_on_clause_test.dart +++ b/pkg/analyzer/test/src/diagnostics/nullable_type_in_on_clause_test.dart @@ -28,7 +28,7 @@ mixin B on A {} class A {} mixin B on A? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_ON_CLAUSE, 22, 2)], + [error(CompileTimeErrorCode.nullableTypeInOnClause, 22, 2)], ); } @@ -39,7 +39,7 @@ class A {} typedef B = A; mixin C on B? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_ON_CLAUSE, 37, 2)], + [error(CompileTimeErrorCode.nullableTypeInOnClause, 37, 2)], ); } @@ -50,7 +50,7 @@ class A {} typedef B = A?; mixin C on B {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_ON_CLAUSE, 38, 1)], + [error(CompileTimeErrorCode.nullableTypeInOnClause, 38, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/nullable_type_in_with_clause_test.dart b/pkg/analyzer/test/src/diagnostics/nullable_type_in_with_clause_test.dart index 66ddd35efa9..4c750f07d12 100644 --- a/pkg/analyzer/test/src/diagnostics/nullable_type_in_with_clause_test.dart +++ b/pkg/analyzer/test/src/diagnostics/nullable_type_in_with_clause_test.dart @@ -28,7 +28,7 @@ class B with A {} mixin A {} class B with A? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 24, 2)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 24, 2)], ); } @@ -39,7 +39,7 @@ mixin A {} typedef B = A; class C with B? {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 39, 2)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 39, 2)], ); } @@ -50,7 +50,7 @@ mixin A {} typedef B = A?; class C with B {} ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 40, 1)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 40, 1)], ); } @@ -69,7 +69,7 @@ class A {} mixin B {} class C = A with B?; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 39, 2)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 39, 2)], ); } @@ -81,7 +81,7 @@ mixin B {} typedef C = B; class D = A with C?; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 54, 2)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 54, 2)], ); } @@ -93,7 +93,7 @@ mixin B {} typedef C = B?; class D = A with C; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 55, 1)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 55, 1)], ); } @@ -112,7 +112,7 @@ class A {} mixin B {} class C = A with B?; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 39, 2)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 39, 2)], ); } @@ -124,7 +124,7 @@ mixin B {} typedef C = B; class D = A with C?; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 54, 2)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 54, 2)], ); } @@ -136,7 +136,7 @@ mixin B {} typedef C = B?; class D = A with C; ''', - [error(CompileTimeErrorCode.NULLABLE_TYPE_IN_WITH_CLAUSE, 55, 1)], + [error(CompileTimeErrorCode.nullableTypeInWithClause, 55, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/number_literals_with_separators_test.dart b/pkg/analyzer/test/src/diagnostics/number_literals_with_separators_test.dart index d4d8709857a..fdd2347731d 100644 --- a/pkg/analyzer/test/src/diagnostics/number_literals_with_separators_test.dart +++ b/pkg/analyzer/test/src/diagnostics/number_literals_with_separators_test.dart @@ -28,13 +28,13 @@ class NumberLiteralsWithSeparatorsTest extends PubPackageResolutionTest { Future test_missing_number_after_e_1() async { await assertErrorsInCode('dynamic x = 1_234_567e;', [ - error(ScannerErrorCode.MISSING_DIGIT, 21, 1), + error(ScannerErrorCode.missingDigit, 21, 1), ]); } Future test_missing_number_after_e_2() async { await assertErrorsInCode('dynamic x = 1.234_567e;', [ - error(ScannerErrorCode.MISSING_DIGIT, 21, 1), + error(ScannerErrorCode.missingDigit, 21, 1), ]); } diff --git a/pkg/analyzer/test/src/diagnostics/object_cannot_extend_another_class_test.dart b/pkg/analyzer/test/src/diagnostics/object_cannot_extend_another_class_test.dart index b5ba1daa8a6..40673d85b93 100644 --- a/pkg/analyzer/test/src/diagnostics/object_cannot_extend_another_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/object_cannot_extend_another_class_test.dart @@ -22,7 +22,7 @@ class ObjectCannotExtendAnotherClassTest extends PubPackageResolutionTest { r''' class Object extends List {} ''', - [error(CompileTimeErrorCode.OBJECT_CANNOT_EXTEND_ANOTHER_CLASS, 0, 0)], + [error(CompileTimeErrorCode.objectCannotExtendAnotherClass, 0, 0)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/obsolete_colon_for_default_value_test.dart b/pkg/analyzer/test/src/diagnostics/obsolete_colon_for_default_value_test.dart index 68f33876908..dc7d4400cb9 100644 --- a/pkg/analyzer/test/src/diagnostics/obsolete_colon_for_default_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/obsolete_colon_for_default_value_test.dart @@ -33,7 +33,7 @@ class B extends A { B({super.a : ''}); } ''', - [error(CompileTimeErrorCode.OBSOLETE_COLON_FOR_DEFAULT_VALUE, 74, 1)], + [error(CompileTimeErrorCode.obsoleteColonForDefaultValue, 74, 1)], ); } @@ -42,7 +42,7 @@ class B extends A { ''' void f({int x : 0}) {} ''', - [error(CompileTimeErrorCode.OBSOLETE_COLON_FOR_DEFAULT_VALUE, 14, 1)], + [error(CompileTimeErrorCode.obsoleteColonForDefaultValue, 14, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/on_repeated_test.dart b/pkg/analyzer/test/src/diagnostics/on_repeated_test.dart index 493637da992..ea8174b0c73 100644 --- a/pkg/analyzer/test/src/diagnostics/on_repeated_test.dart +++ b/pkg/analyzer/test/src/diagnostics/on_repeated_test.dart @@ -21,7 +21,7 @@ class OnRepeatedTest extends PubPackageResolutionTest { class A {} mixin M on A, A {} ''', - [error(CompileTimeErrorCode.ON_REPEATED, 25, 1)], + [error(CompileTimeErrorCode.onRepeated, 25, 1)], ); } @@ -43,7 +43,7 @@ augment mixin M on A {} await assertErrorsInFile2(a, []); await assertErrorsInFile2(b, [ - error(CompileTimeErrorCode.ON_REPEATED, 38, 1), + error(CompileTimeErrorCode.onRepeated, 38, 1), ]); } @@ -54,7 +54,7 @@ class A {} typedef B = A; mixin M on A, B {} ''', - [error(CompileTimeErrorCode.ON_REPEATED, 40, 1)], + [error(CompileTimeErrorCode.onRepeated, 40, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/optional_parameter_in_operator_test.dart b/pkg/analyzer/test/src/diagnostics/optional_parameter_in_operator_test.dart index 0e3da2ba7ba..4a64e5860b2 100644 --- a/pkg/analyzer/test/src/diagnostics/optional_parameter_in_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/optional_parameter_in_operator_test.dart @@ -22,7 +22,7 @@ class A { operator +({p}) {} } ''', - [error(CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, 24, 1)], + [error(CompileTimeErrorCode.optionalParameterInOperator, 24, 1)], ); } @@ -33,7 +33,7 @@ class A { operator +([p]) {} } ''', - [error(CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, 24, 1)], + [error(CompileTimeErrorCode.optionalParameterInOperator, 24, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_field_test.dart b/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_field_test.dart index 5129ebac917..29152929b5d 100644 --- a/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_field_test.dart @@ -23,7 +23,7 @@ class A { int? foo; } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_FIELD, 29, 3)], + [error(WarningCode.overrideOnNonOverridingField, 29, 3)], ); } @@ -45,7 +45,7 @@ class B extends A { }''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 131, 1, contextMessages: [message(testFile, 39, 1)], @@ -72,7 +72,7 @@ class B implements A { }''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE_SETTER, + CompileTimeErrorCode.invalidOverrideSetter, 134, 1, contextMessages: [message(testFile, 39, 1)], @@ -90,7 +90,7 @@ enum E { final int foo = 0; } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_FIELD, 38, 3)], + [error(WarningCode.overrideOnNonOverridingField, 38, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_getter_test.dart b/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_getter_test.dart index 72fa2f28ce2..fa8e1ad9306 100644 --- a/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_getter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_getter_test.dart @@ -23,7 +23,7 @@ class A { int get foo => 0; } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, 32, 3)], + [error(WarningCode.overrideOnNonOverridingGetter, 32, 3)], ); } @@ -62,7 +62,7 @@ enum E { int get foo => 0; } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, 36, 3)], + [error(WarningCode.overrideOnNonOverridingGetter, 36, 3)], ); } @@ -102,7 +102,7 @@ extension E on int { int get foo => 1; } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, 43, 3)], + [error(WarningCode.overrideOnNonOverridingGetter, 43, 3)], ); } @@ -114,7 +114,7 @@ mixin M { int get foo => 0; } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_GETTER, 32, 3)], + [error(WarningCode.overrideOnNonOverridingGetter, 32, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_method_test.dart b/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_method_test.dart index 0f4ccabd8a9..f1394c185f1 100644 --- a/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_method_test.dart @@ -25,7 +25,7 @@ class B extends A { void foo() {} } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, 51, 3)], + [error(WarningCode.overrideOnNonOverridingMethod, 51, 3)], ); } @@ -117,7 +117,7 @@ enum E { void foo() {} } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, 33, 3)], + [error(WarningCode.overrideOnNonOverridingMethod, 33, 3)], ); } @@ -129,7 +129,7 @@ extension E on int { void foo() {} } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, 40, 3)], + [error(WarningCode.overrideOnNonOverridingMethod, 40, 3)], ); } @@ -143,7 +143,7 @@ mixin M on A { void foo() {} } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_METHOD, 46, 3)], + [error(WarningCode.overrideOnNonOverridingMethod, 46, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_setter_test.dart b/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_setter_test.dart index 9bb811420cb..5f464b5264f 100644 --- a/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/override_on_non_overriding_setter_test.dart @@ -25,7 +25,7 @@ class B extends A { set foo(int _) {} } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, 50, 3)], + [error(WarningCode.overrideOnNonOverridingSetter, 50, 3)], ); } @@ -60,7 +60,7 @@ enum E { set foo(int _) {} } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, 32, 3)], + [error(WarningCode.overrideOnNonOverridingSetter, 32, 3)], ); } @@ -100,7 +100,7 @@ extension E on int { set foo(int _) {} } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, 39, 3)], + [error(WarningCode.overrideOnNonOverridingSetter, 39, 3)], ); } @@ -114,7 +114,7 @@ mixin M on A { set foo(int _) {} } ''', - [error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_SETTER, 45, 3)], + [error(WarningCode.overrideOnNonOverridingSetter, 45, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/packed_annotation_alignment_test.dart b/pkg/analyzer/test/src/diagnostics/packed_annotation_alignment_test.dart index bc965df4c1f..5f873ac29b4 100644 --- a/pkg/analyzer/test/src/diagnostics/packed_annotation_alignment_test.dart +++ b/pkg/analyzer/test/src/diagnostics/packed_annotation_alignment_test.dart @@ -25,7 +25,7 @@ final class C extends Struct { external Pointer notEmpty; } ''', - [error(FfiCode.PACKED_ANNOTATION_ALIGNMENT, 28, 1)], + [error(FfiCode.packedAnnotationAlignment, 28, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/packed_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/packed_annotation_test.dart index ee55f3cd819..d63b1b24f8a 100644 --- a/pkg/analyzer/test/src/diagnostics/packed_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/packed_annotation_test.dart @@ -27,7 +27,7 @@ final class C extends Struct { external Pointer notEmpty; } ''', - [error(FfiCode.PACKED_ANNOTATION, 31, 10)], + [error(FfiCode.packedAnnotation, 31, 10)], ); } @@ -43,9 +43,9 @@ final class C extends Struct { } ''', [ - error(FfiCode.PACKED_ANNOTATION_ALIGNMENT, 20, 9), + error(FfiCode.packedAnnotationAlignment, 20, 9), error( - CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS_NAME_SINGULAR, + CompileTimeErrorCode.notEnoughPositionalArgumentsNameSingular, 28, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/part_of_non_part_test.dart b/pkg/analyzer/test/src/diagnostics/part_of_non_part_test.dart index 1e066f53525..2ed2aa3c4ef 100644 --- a/pkg/analyzer/test/src/diagnostics/part_of_non_part_test.dart +++ b/pkg/analyzer/test/src/diagnostics/part_of_non_part_test.dart @@ -24,7 +24,7 @@ library l2; library l1; part 'l2.dart'; ''', - [error(CompileTimeErrorCode.PART_OF_NON_PART, 17, 9)], + [error(CompileTimeErrorCode.partOfNonPart, 17, 9)], ); } @@ -46,7 +46,7 @@ part 'a.dart'; library lib; part 'test.dart'; ''', - [error(CompileTimeErrorCode.PART_OF_NON_PART, 18, 11)], + [error(CompileTimeErrorCode.partOfNonPart, 18, 11)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/pattern_assignment_not_local_variable_test.dart b/pkg/analyzer/test/src/diagnostics/pattern_assignment_not_local_variable_test.dart index 06ed02c25bd..e37fa600df0 100644 --- a/pkg/analyzer/test/src/diagnostics/pattern_assignment_not_local_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/pattern_assignment_not_local_variable_test.dart @@ -22,13 +22,7 @@ void f() { (int) = 0; } ''', - [ - error( - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - 14, - 3, - ), - ], + [error(CompileTimeErrorCode.patternAssignmentNotLocalVariable, 14, 3)], ); } @@ -43,13 +37,7 @@ class A { } } ''', - [ - error( - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - 42, - 1, - ), - ], + [error(CompileTimeErrorCode.patternAssignmentNotLocalVariable, 42, 1)], ); } @@ -62,13 +50,7 @@ class A { } } ''', - [ - error( - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - 31, - 1, - ), - ], + [error(CompileTimeErrorCode.patternAssignmentNotLocalVariable, 31, 1)], ); } @@ -79,13 +61,7 @@ void f() { (dynamic) = 0; } ''', - [ - error( - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - 14, - 7, - ), - ], + [error(CompileTimeErrorCode.patternAssignmentNotLocalVariable, 14, 7)], ); } @@ -96,13 +72,7 @@ void f() { (f) = 0; } ''', - [ - error( - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - 14, - 1, - ), - ], + [error(CompileTimeErrorCode.patternAssignmentNotLocalVariable, 14, 1)], ); } @@ -115,13 +85,7 @@ void f() { (x) = 0; } ''', - [ - error( - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - 26, - 1, - ), - ], + [error(CompileTimeErrorCode.patternAssignmentNotLocalVariable, 26, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/pattern_never_matches_value_type_test.dart b/pkg/analyzer/test/src/diagnostics/pattern_never_matches_value_type_test.dart index 5dcb79b5a9a..839e07cddf7 100644 --- a/pkg/analyzer/test/src/diagnostics/pattern_never_matches_value_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/pattern_never_matches_value_type_test.dart @@ -22,7 +22,7 @@ void f(void Function() x) { if (x case int _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 41, 3)], + [error(WarningCode.patternNeverMatchesValueType, 41, 3)], ); } @@ -57,7 +57,7 @@ void f(void Function() x) { if (x case (int,) _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 41, 6)], + [error(WarningCode.patternNeverMatchesValueType, 41, 6)], ); } @@ -98,7 +98,7 @@ void f(List x) { final class A {} final class B {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 33, 7)], + [error(WarningCode.patternNeverMatchesValueType, 33, 7)], ); } @@ -143,7 +143,7 @@ class B {} final class C {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -172,7 +172,7 @@ final class A2 extends A {} final class A3 implements A {} class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -246,7 +246,7 @@ void f(A x) { final class A extends R {} class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 6)], + [error(WarningCode.patternNeverMatchesValueType, 27, 6)], ); } @@ -296,7 +296,7 @@ void f(A x) { if (x case FutureOr _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 78, 11)], + [error(WarningCode.patternNeverMatchesValueType, 78, 11)], ); } @@ -310,7 +310,7 @@ void f(A x) { final class A {} class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -481,7 +481,7 @@ final class A2 extends A {} final class A3 implements A {} class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -497,7 +497,7 @@ sealed class A2 extends A {} final class A3 implements A {} class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -546,7 +546,7 @@ final class A {} final class B {} final class C {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 4)], + [error(WarningCode.patternNeverMatchesValueType, 30, 4)], ); } @@ -573,7 +573,7 @@ final class B extends A {} final class C {} final class D {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 4)], + [error(WarningCode.patternNeverMatchesValueType, 27, 4)], ); } @@ -612,7 +612,7 @@ final class B extends A {} final class C {} final class D {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 1)], + [error(WarningCode.patternNeverMatchesValueType, 30, 1)], ); } @@ -637,7 +637,7 @@ void f(A x) { class A {} final class B {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -666,7 +666,7 @@ sealed class R {} final class R1 extends R {} final class R2 extends R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -690,7 +690,7 @@ void f(int x) { if (x case void Function() _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 29, 15)], + [error(WarningCode.patternNeverMatchesValueType, 29, 15)], ); } @@ -719,7 +719,7 @@ void f(A x) { class A {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 4)], + [error(WarningCode.patternNeverMatchesValueType, 27, 4)], ); } @@ -749,7 +749,7 @@ void f(A x) { enum A { v } enum R { v } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -763,7 +763,7 @@ void f(A x) { enum A { v } class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 1)], + [error(WarningCode.patternNeverMatchesValueType, 27, 1)], ); } @@ -814,7 +814,7 @@ void f(A x) { enum A implements R { v } class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 6)], + [error(WarningCode.patternNeverMatchesValueType, 27, 6)], ); } @@ -832,7 +832,7 @@ enum A implements R { class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 9)], + [error(WarningCode.patternNeverMatchesValueType, 27, 9)], ); } @@ -876,7 +876,7 @@ void f(E? x) { enum E { v1(), v2() } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 34, 9)], + [error(WarningCode.patternNeverMatchesValueType, 34, 9)], ); } @@ -899,7 +899,7 @@ void f(FutureOr<(int,)> x) { if (x case Future<(String,)> _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 64, 17)], + [error(WarningCode.patternNeverMatchesValueType, 64, 17)], ); } @@ -922,7 +922,7 @@ void f(FutureOr<(int,)> x) { if (x case (String,) _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 64, 9)], + [error(WarningCode.patternNeverMatchesValueType, 64, 9)], ); } @@ -945,7 +945,7 @@ void f(Future<(int,)> x) { if (x case FutureOr<(String,)> _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 62, 19)], + [error(WarningCode.patternNeverMatchesValueType, 62, 19)], ); } @@ -959,8 +959,8 @@ void f(Null x) { class A {} ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 1), - error(WarningCode.DEAD_CODE, 35, 2), + error(WarningCode.patternNeverMatchesValueType, 30, 1), + error(WarningCode.deadCode, 35, 2), ], ); } @@ -981,8 +981,8 @@ void f(Null x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 6), - error(WarningCode.DEAD_CODE, 40, 2), + error(WarningCode.patternNeverMatchesValueType, 30, 6), + error(WarningCode.deadCode, 40, 2), ], ); } @@ -1006,7 +1006,7 @@ void f((int,) x) { if (x case FutureOr<(String,)> _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 54, 19)], + [error(WarningCode.patternNeverMatchesValueType, 54, 19)], ); } @@ -1017,7 +1017,7 @@ void f(({int f1,}) x) { if (x case ({int f1, int f2,}) _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 37, 19)], + [error(WarningCode.patternNeverMatchesValueType, 37, 19)], ); } @@ -1028,7 +1028,7 @@ void f(({int a, int b}) x) { if (x case ({int f1, int f2,}) _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 42, 19)], + [error(WarningCode.patternNeverMatchesValueType, 42, 19)], ); } @@ -1042,7 +1042,7 @@ void f(({A f1,}) x) { final class A {} class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 35, 9)], + [error(WarningCode.patternNeverMatchesValueType, 35, 9)], ); } @@ -1064,7 +1064,7 @@ void f((int,) x) { if (x case (int, String) _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 32, 13)], + [error(WarningCode.patternNeverMatchesValueType, 32, 13)], ); } @@ -1078,7 +1078,7 @@ void f((A,) x) { final class A {} class R {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 4)], + [error(WarningCode.patternNeverMatchesValueType, 30, 4)], ); } @@ -1089,7 +1089,7 @@ void f((int,) x) { if (x case void Function() _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 32, 15)], + [error(WarningCode.patternNeverMatchesValueType, 32, 15)], ); } @@ -1102,7 +1102,7 @@ void f((A,) x) { class A {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 1)], + [error(WarningCode.patternNeverMatchesValueType, 30, 1)], ); } @@ -1137,7 +1137,7 @@ void f(String x) { if (x case _ as int) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 37, 3)], + [error(WarningCode.patternNeverMatchesValueType, 37, 3)], ); } @@ -1148,7 +1148,7 @@ void f(num x) { if (x case int a) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1)], + [error(WarningCode.unusedLocalVariable, 33, 1)], ); } @@ -1160,8 +1160,8 @@ void f(String x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 32, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1), + error(WarningCode.patternNeverMatchesValueType, 32, 3), + error(WarningCode.unusedLocalVariable, 36, 1), ], ); } @@ -1181,7 +1181,7 @@ void f(int x) { if (x case []) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 29, 7)], + [error(WarningCode.patternNeverMatchesValueType, 29, 7)], ); } @@ -1200,7 +1200,7 @@ void f(int x) { if (x case {0: _}) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 29, 19)], + [error(WarningCode.patternNeverMatchesValueType, 29, 19)], ); } @@ -1219,7 +1219,7 @@ void f(String x) { if (x case int()) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 32, 3)], + [error(WarningCode.patternNeverMatchesValueType, 32, 3)], ); } @@ -1233,7 +1233,7 @@ void f((int,) x) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 48, 1)], + [error(WarningCode.unusedLocalVariable, 48, 1)], ); } @@ -1248,9 +1248,9 @@ void f((int,) x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 43, 16), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 48, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 2), + error(WarningCode.patternNeverMatchesValueType, 43, 16), + error(WarningCode.unusedLocalVariable, 48, 2), + error(WarningCode.unusedLocalVariable, 56, 2), ], ); } @@ -1270,7 +1270,7 @@ void f(String x) { if (x case int _) {} } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 32, 3)], + [error(WarningCode.patternNeverMatchesValueType, 32, 3)], ); } @@ -1284,8 +1284,8 @@ void f(A x) { class A {} ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 4), - error(WarningCode.DEAD_CODE, 35, 2), + error(WarningCode.patternNeverMatchesValueType, 27, 4), + error(WarningCode.deadCode, 35, 2), ], ); } @@ -1298,8 +1298,8 @@ void f(void Function() x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 41, 4), - error(WarningCode.DEAD_CODE, 49, 2), + error(WarningCode.patternNeverMatchesValueType, 41, 4), + error(WarningCode.deadCode, 49, 2), ], ); } @@ -1312,8 +1312,8 @@ void f(Object x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 32, 4), - error(WarningCode.DEAD_CODE, 40, 2), + error(WarningCode.patternNeverMatchesValueType, 32, 4), + error(WarningCode.deadCode, 40, 2), ], ); } @@ -1326,8 +1326,8 @@ void f(T x) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 42, 4), - error(WarningCode.DEAD_CODE, 50, 2), + error(WarningCode.patternNeverMatchesValueType, 42, 4), + error(WarningCode.deadCode, 50, 2), ], ); } @@ -1389,7 +1389,7 @@ void f(A x) { final class A {} final class B {} ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 27, 2)], + [error(WarningCode.patternNeverMatchesValueType, 27, 2)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/pattern_type_mismatch_in_irrefutable_context_test.dart b/pkg/analyzer/test/src/diagnostics/pattern_type_mismatch_in_irrefutable_context_test.dart index 173e5f49cbb..c6f4c977bd8 100644 --- a/pkg/analyzer/test/src/diagnostics/pattern_type_mismatch_in_irrefutable_context_test.dart +++ b/pkg/analyzer/test/src/diagnostics/pattern_type_mismatch_in_irrefutable_context_test.dart @@ -29,7 +29,7 @@ class A { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 41, 1, ), @@ -62,7 +62,7 @@ void f(int a, num x) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 26, 1, ), @@ -83,11 +83,11 @@ class A { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 24, 19, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 42, 1), + error(WarningCode.unusedLocalVariable, 42, 1), ], ); } @@ -99,7 +99,7 @@ void f(dynamic x) { var (int a) = x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 31, 1)], + [error(WarningCode.unusedLocalVariable, 31, 1)], ); } @@ -110,7 +110,7 @@ void f(int x) { var (num a) = x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 27, 1)], + [error(WarningCode.unusedLocalVariable, 27, 1)], ); } @@ -123,11 +123,11 @@ void f(num x) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 23, 5, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 27, 1), + error(WarningCode.unusedLocalVariable, 27, 1), ], ); } @@ -141,11 +141,11 @@ void f(List x) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 31, 8, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 37, 1), + error(WarningCode.unusedLocalVariable, 37, 1), ], ); } @@ -159,11 +159,11 @@ void f(Object x) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 25, 3, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 26, 1), + error(WarningCode.unusedLocalVariable, 26, 1), ], ); } @@ -177,11 +177,11 @@ void f(Object x) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 25, 19, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 42, 1), + error(WarningCode.unusedLocalVariable, 42, 1), ], ); } @@ -195,11 +195,11 @@ void f(Object x) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 25, 17, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1), + error(WarningCode.unusedLocalVariable, 40, 1), ], ); } @@ -213,7 +213,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 19, 1, ), @@ -230,11 +230,11 @@ void f(Object x) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 25, 4, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 26, 1), + error(WarningCode.unusedLocalVariable, 26, 1), ], ); } @@ -248,11 +248,11 @@ void f(({int foo}) x) { ''', [ error( - CompileTimeErrorCode.PATTERN_TYPE_MISMATCH_IN_IRREFUTABLE_CONTEXT, + CompileTimeErrorCode.patternTypeMismatchInIrrefutableContext, 30, 4, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 31, 1), + error(WarningCode.unusedLocalVariable, 31, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/pattern_variable_assignment_inside_guard_test.dart b/pkg/analyzer/test/src/diagnostics/pattern_variable_assignment_inside_guard_test.dart index 2b74bfa4f90..f4324477cf6 100644 --- a/pkg/analyzer/test/src/diagnostics/pattern_variable_assignment_inside_guard_test.dart +++ b/pkg/analyzer/test/src/diagnostics/pattern_variable_assignment_inside_guard_test.dart @@ -27,12 +27,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error( - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, - 68, - 1, - ), + error(WarningCode.unusedLocalVariable, 33, 1), + error(CompileTimeErrorCode.patternVariableAssignmentInsideGuard, 68, 1), ], ); } @@ -48,12 +44,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error( - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, - 49, - 1, - ), + error(WarningCode.unusedLocalVariable, 33, 1), + error(CompileTimeErrorCode.patternVariableAssignmentInsideGuard, 49, 1), ], ); } @@ -66,12 +58,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error( - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, - 41, - 1, - ), + error(WarningCode.unusedLocalVariable, 33, 1), + error(CompileTimeErrorCode.patternVariableAssignmentInsideGuard, 41, 1), ], ); } @@ -83,13 +71,7 @@ void f(int x) { if (x case var a when (a += 1) > 0) {} } ''', - [ - error( - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, - 41, - 1, - ), - ], + [error(CompileTimeErrorCode.patternVariableAssignmentInsideGuard, 41, 1)], ); } @@ -101,14 +83,10 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(WarningCode.DEAD_CODE, 35, 8), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 42, 1), - error( - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, - 50, - 1, - ), + error(WarningCode.unusedLocalVariable, 33, 1), + error(WarningCode.deadCode, 35, 8), + error(WarningCode.unusedLocalVariable, 42, 1), + error(CompileTimeErrorCode.patternVariableAssignmentInsideGuard, 50, 1), ], ); } @@ -120,13 +98,7 @@ void f(int x) { if (x case var a when (a++) > 0) {} } ''', - [ - error( - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, - 41, - 1, - ), - ], + [error(CompileTimeErrorCode.patternVariableAssignmentInsideGuard, 41, 1)], ); } @@ -137,13 +109,7 @@ void f(int x) { if (x case var a when (++a) > 0) {} } ''', - [ - error( - CompileTimeErrorCode.PATTERN_VARIABLE_ASSIGNMENT_INSIDE_GUARD, - 43, - 1, - ), - ], + [error(CompileTimeErrorCode.patternVariableAssignmentInsideGuard, 43, 1)], ); } @@ -166,7 +132,7 @@ void f(int x) { if (x case var a when (b = 1) > 0) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 80, 1)], + [error(WarningCode.unusedLocalVariable, 80, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/positional_super_formal_parameter_with_positional_argument_test.dart b/pkg/analyzer/test/src/diagnostics/positional_super_formal_parameter_with_positional_argument_test.dart index 37384ebf5c2..da70784d327 100644 --- a/pkg/analyzer/test/src/diagnostics/positional_super_formal_parameter_with_positional_argument_test.dart +++ b/pkg/analyzer/test/src/diagnostics/positional_super_formal_parameter_with_positional_argument_test.dart @@ -44,7 +44,7 @@ class B extends A { [ error( CompileTimeErrorCode - .POSITIONAL_SUPER_FORMAL_PARAMETER_WITH_POSITIONAL_ARGUMENT, + .positionalSuperFormalParameterWithPositionalArgument, 62, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/prefix_collides_with_top_level_member_test.dart b/pkg/analyzer/test/src/diagnostics/prefix_collides_with_top_level_member_test.dart index 0747e04b7d6..3432983b8cf 100644 --- a/pkg/analyzer/test/src/diagnostics/prefix_collides_with_top_level_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/prefix_collides_with_top_level_member_test.dart @@ -22,9 +22,9 @@ import 'dart:math' as foo; typedef foo = void Function(); ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), + error(WarningCode.unusedImport, 7, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 22, 3, contextMessages: [message(testFile, 35, 3)], @@ -39,7 +39,7 @@ typedef foo = void Function(); import 'dart:math' as foo; void bar() {} ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); } @@ -50,9 +50,9 @@ import 'dart:math' as foo; void foo() {} ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), + error(WarningCode.unusedImport, 7, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 22, 3, contextMessages: [message(testFile, 32, 3)], @@ -68,9 +68,9 @@ import 'dart:math' as foo; int get foo => 0; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), + error(WarningCode.unusedImport, 7, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 22, 3, contextMessages: [message(testFile, 35, 3)], @@ -86,9 +86,9 @@ import 'dart:math' as foo; set foo(int _) {} ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), + error(WarningCode.unusedImport, 7, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 22, 3, contextMessages: [message(testFile, 31, 3)], @@ -104,9 +104,9 @@ import 'dart:math' as foo; var foo = 0; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), + error(WarningCode.unusedImport, 7, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 22, 3, contextMessages: [message(testFile, 31, 3)], @@ -122,9 +122,9 @@ import 'dart:math' as foo; class foo {} ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), + error(WarningCode.unusedImport, 7, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 22, 3, contextMessages: [message(testFile, 33, 3)], @@ -145,9 +145,9 @@ part of 'a.dart'; import 'dart:math' as foo; ''', [ - error(WarningCode.UNUSED_IMPORT, 25, 11), + error(WarningCode.unusedImport, 25, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 40, 3, contextMessages: [message(a, 23, 3)], @@ -168,9 +168,9 @@ import 'dart:math' as foo; void foo() {} ''', [ - error(WarningCode.UNUSED_IMPORT, 25, 11), + error(WarningCode.unusedImport, 25, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 40, 3, contextMessages: [message(testFile, 50, 3)], @@ -196,9 +196,9 @@ part of 'a.dart'; import 'dart:math' as foo; ''', [ - error(WarningCode.UNUSED_IMPORT, 25, 11), + error(WarningCode.unusedImport, 25, 11), error( - CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, + CompileTimeErrorCode.prefixCollidesWithTopLevelMember, 40, 3, contextMessages: [message(b, 23, 3)], diff --git a/pkg/analyzer/test/src/diagnostics/prefix_identifier_not_followed_by_dot_test.dart b/pkg/analyzer/test/src/diagnostics/prefix_identifier_not_followed_by_dot_test.dart index a57aaaaefc3..42c1cdbe841 100644 --- a/pkg/analyzer/test/src/diagnostics/prefix_identifier_not_followed_by_dot_test.dart +++ b/pkg/analyzer/test/src/diagnostics/prefix_identifier_not_followed_by_dot_test.dart @@ -28,13 +28,7 @@ class C { } } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 46, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 46, 1)], ); } @@ -49,13 +43,7 @@ f() { p += 1; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 32, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 32, 1)], ); } @@ -72,13 +60,7 @@ class C { } } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 46, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 46, 1)], ); } @@ -97,13 +79,7 @@ class B extends A { } } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 85, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 85, 1)], ); } @@ -118,13 +94,7 @@ f() { p = 1; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 32, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 32, 1)], ); } @@ -139,13 +109,7 @@ f() { p += 1; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 32, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 32, 1)], ); } @@ -161,13 +125,7 @@ f() { p?.g(); } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 32, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 32, 1)], ); } @@ -182,13 +140,7 @@ f() { p?.loadLibrary(); } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 41, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 41, 1)], ); } @@ -204,13 +156,7 @@ f() { return p?.x; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 39, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 39, 1)], ); } @@ -225,13 +171,7 @@ f() { return p?.loadLibrary; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 48, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 48, 1)], ); } @@ -247,13 +187,7 @@ f() { p?.x = null; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 32, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 32, 1)], ); } @@ -268,13 +202,7 @@ f() { p?.loadLibrary = null; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 41, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 41, 1)], ); } @@ -289,13 +217,7 @@ f() { return p; } ''', - [ - error( - CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, - 39, - 1, - ), - ], + [error(CompileTimeErrorCode.prefixIdentifierNotFollowedByDot, 39, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/prefix_shadowed_by_local_declaration_test.dart b/pkg/analyzer/test/src/diagnostics/prefix_shadowed_by_local_declaration_test.dart index 8f7a806a897..87e91036a17 100644 --- a/pkg/analyzer/test/src/diagnostics/prefix_shadowed_by_local_declaration_test.dart +++ b/pkg/analyzer/test/src/diagnostics/prefix_shadowed_by_local_declaration_test.dart @@ -34,8 +34,8 @@ f(int a) { } ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 12), - error(CompileTimeErrorCode.PREFIX_SHADOWED_BY_LOCAL_DECLARATION, 39, 1), + error(WarningCode.unusedImport, 7, 12), + error(CompileTimeErrorCode.prefixShadowedByLocalDeclaration, 39, 1), ], ); } @@ -51,14 +51,14 @@ f() { } ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 12), + error(WarningCode.unusedImport, 7, 12), error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 34, 1, contextMessages: [message(testFile, 60, 1)], ), - error(CompileTimeErrorCode.PREFIX_SHADOWED_BY_LOCAL_DECLARATION, 34, 1), + error(CompileTimeErrorCode.prefixShadowedByLocalDeclaration, 34, 1), ], ); } @@ -74,8 +74,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 12), - error(CompileTimeErrorCode.PREFIX_SHADOWED_BY_LOCAL_DECLARATION, 47, 1), + error(WarningCode.unusedImport, 7, 12), + error(CompileTimeErrorCode.prefixShadowedByLocalDeclaration, 47, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/private_collision_in_mixin_application_test.dart b/pkg/analyzer/test/src/diagnostics/private_collision_in_mixin_application_test.dart index ac1ac94d186..b512a9a5943 100644 --- a/pkg/analyzer/test/src/diagnostics/private_collision_in_mixin_application_test.dart +++ b/pkg/analyzer/test/src/diagnostics/private_collision_in_mixin_application_test.dart @@ -62,13 +62,7 @@ import 'a.dart'; class C extends Object with A, B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 49, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 49, 1)], ); } @@ -90,13 +84,7 @@ import 'a.dart'; class C extends Object with A {} class D extends C with B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 74, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 74, 1)], ); } @@ -118,13 +106,7 @@ import 'a.dart'; class C extends Object with A {} class D extends C with B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 74, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 74, 1)], ); } @@ -145,13 +127,7 @@ import 'a.dart'; class C extends Object with A, B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 49, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 49, 1)], ); } @@ -172,13 +148,7 @@ import 'a.dart'; class C with A, B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 34, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 34, 1)], ); } @@ -199,13 +169,7 @@ import 'a.dart'; class C with A, B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 34, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 34, 1)], ); } @@ -298,13 +262,7 @@ import 'a.dart'; class C extends A with B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 41, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 41, 1)], ); } @@ -325,13 +283,7 @@ import 'a.dart'; class C extends A with B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 41, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 41, 1)], ); } @@ -352,13 +304,7 @@ import 'a.dart'; class C extends A with B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 41, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 41, 1)], ); } @@ -379,13 +325,7 @@ import 'a.dart'; class C extends A with B {} ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 41, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 41, 1)], ); } @@ -403,8 +343,8 @@ mixin B { class C extends Object with A, B {} ''', [ - error(WarningCode.UNUSED_ELEMENT, 17, 4), - error(WarningCode.UNUSED_ELEMENT, 47, 4), + error(WarningCode.unusedElement, 17, 4), + error(WarningCode.unusedElement, 47, 4), ], ); } @@ -423,8 +363,8 @@ mixin class B { class C extends Object with A, B {} ''', [ - error(WarningCode.UNUSED_ELEMENT, 23, 4), - error(WarningCode.UNUSED_ELEMENT, 59, 4), + error(WarningCode.unusedElement, 23, 4), + error(WarningCode.unusedElement, 59, 4), ], ); } @@ -448,7 +388,7 @@ class C extends A with B {} ''', [ error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, + CompileTimeErrorCode.privateCollisionInMixinApplication, 41, 1, messageContains: ["'_foo'"], @@ -476,7 +416,7 @@ class C extends A with B {} ''', [ error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, + CompileTimeErrorCode.privateCollisionInMixinApplication, 41, 1, messageContains: ["'_foo'"], @@ -502,13 +442,7 @@ import 'a.dart'; class C = Object with A, B; ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 43, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 43, 1)], ); } @@ -530,13 +464,7 @@ import 'a.dart'; class C = Object with A; class D = C with B; ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 60, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 60, 1)], ); } @@ -558,13 +486,7 @@ import 'a.dart'; class C = Object with A; class D = C with B; ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 60, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 60, 1)], ); } @@ -585,13 +507,7 @@ import 'a.dart'; class C = Object with A, B; ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 43, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 43, 1)], ); } @@ -612,13 +528,7 @@ import 'a.dart'; class C = A with B; ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 35, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 35, 1)], ); } @@ -639,13 +549,7 @@ import 'a.dart'; class C = A with B; ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 35, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 35, 1)], ); } @@ -668,13 +572,7 @@ enum E with A, B { v } ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 33, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 33, 1)], ); } @@ -714,13 +612,7 @@ enum E with A, B { v } ''', - [ - error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, - 33, - 1, - ), - ], + [error(CompileTimeErrorCode.privateCollisionInMixinApplication, 33, 1)], ); } @@ -765,7 +657,7 @@ enum E with A, B { ''', [ error( - CompileTimeErrorCode.PRIVATE_COLLISION_IN_MIXIN_APPLICATION, + CompileTimeErrorCode.privateCollisionInMixinApplication, 33, 1, messageContains: ["'_foo'"], diff --git a/pkg/analyzer/test/src/diagnostics/private_optional_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/private_optional_parameter_test.dart index 220b212938d..00162844b62 100644 --- a/pkg/analyzer/test/src/diagnostics/private_optional_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/private_optional_parameter_test.dart @@ -24,8 +24,8 @@ class A { } ''', [ - error(WarningCode.UNUSED_FIELD, 16, 2), - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 30, 2), + error(WarningCode.unusedField, 16, 2), + error(CompileTimeErrorCode.privateOptionalParameter, 30, 2), ], ); } @@ -35,7 +35,7 @@ class A { ''' f({var _p}) {} ''', - [error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 7, 2)], + [error(CompileTimeErrorCode.privateOptionalParameter, 7, 2)], ); } @@ -44,7 +44,7 @@ f({var _p}) {} ''' f({_p = 0}) {} ''', - [error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 3, 2)], + [error(CompileTimeErrorCode.privateOptionalParameter, 3, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/private_setter_test.dart b/pkg/analyzer/test/src/diagnostics/private_setter_test.dart index 206283cee6b..2d0ba2a1b0e 100644 --- a/pkg/analyzer/test/src/diagnostics/private_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/private_setter_test.dart @@ -29,7 +29,7 @@ main() { A._foo = 0; } ''', - [error(CompileTimeErrorCode.PRIVATE_SETTER, 31, 4)], + [error(CompileTimeErrorCode.privateSetter, 31, 4)], ); var assignment = findNode.assignment('_foo ='); @@ -90,7 +90,7 @@ main() { A._foo = 0; } ''', - [error(CompileTimeErrorCode.PRIVATE_SETTER, 31, 4)], + [error(CompileTimeErrorCode.privateSetter, 31, 4)], ); var assignment = findNode.assignment('_foo ='); @@ -136,7 +136,7 @@ main() { A._foo = 0; } ''', - [error(CompileTimeErrorCode.PRIVATE_SETTER, 31, 4)], + [error(CompileTimeErrorCode.privateSetter, 31, 4)], ); var assignment = findNode.assignment('_foo ='); diff --git a/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart b/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart index 845e75d3a3f..629a8497df6 100644 --- a/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart +++ b/pkg/analyzer/test/src/diagnostics/receiver_of_type_never_test.dart @@ -23,8 +23,8 @@ void f() { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 13, 10), - error(WarningCode.DEAD_CODE, 24, 8), + error(WarningCode.receiverOfTypeNever, 13, 10), + error(WarningCode.deadCode, 24, 8), ], ); @@ -67,8 +67,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 22, 8), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 22, 8), ], ); @@ -106,8 +106,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 22, 9), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 22, 9), ], ); @@ -183,7 +183,7 @@ void f(Never? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue, 23, 1, ), @@ -228,8 +228,8 @@ void f() { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 13, 10), - error(WarningCode.DEAD_CODE, 24, 9), + error(WarningCode.receiverOfTypeNever, 13, 10), + error(WarningCode.deadCode, 24, 9), ], ); @@ -294,8 +294,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 21, 3), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 21, 3), ], ); } @@ -307,13 +307,7 @@ void f(Never? x) { x(); } ''', - [ - error( - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, - 21, - 1, - ), - ], + [error(CompileTimeErrorCode.uncheckedInvocationOfNullableValue, 21, 1)], ); } @@ -325,8 +319,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 22, 3), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 22, 3), ], ); @@ -355,8 +349,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 22, 12), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 22, 12), ], ); @@ -407,8 +401,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 22, 11), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 22, 11), ], ); @@ -459,7 +453,7 @@ void f(Never? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 22, 1, ), @@ -492,7 +486,7 @@ void f(Never? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 22, 1, ), @@ -547,7 +541,7 @@ void f(Never? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 22, 1, ), @@ -608,8 +602,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 25, 8), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 25, 8), ], ); @@ -655,8 +649,8 @@ void f(Never x) { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1), - error(WarningCode.DEAD_CODE, 30, 8), + error(WarningCode.receiverOfTypeNever, 20, 1), + error(WarningCode.deadCode, 30, 8), ], ); @@ -701,7 +695,7 @@ void f(Never? x) { x.toString(1 + 2); } ''', - [error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 32, 5)], + [error(CompileTimeErrorCode.extraPositionalArguments, 32, 5)], ); var node = findNode.methodInvocation('.toString(1 + 2)'); @@ -746,8 +740,8 @@ void f() { } ''', [ - error(WarningCode.RECEIVER_OF_TYPE_NEVER, 13, 10), - error(WarningCode.DEAD_CODE, 32, 3), + error(WarningCode.receiverOfTypeNever, 13, 10), + error(WarningCode.deadCode, 32, 3), ], ); @@ -783,7 +777,7 @@ void f(Never x) { x++; } ''', - [error(WarningCode.RECEIVER_OF_TYPE_NEVER, 20, 1)], + [error(WarningCode.receiverOfTypeNever, 20, 1)], ); assertResolvedNodeText(findNode.postfix('x++'), r''' @@ -811,7 +805,7 @@ void f(Never? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 22, 2, ), @@ -842,7 +836,7 @@ void f(Never x) { ++x; } ''', - [error(WarningCode.RECEIVER_OF_TYPE_NEVER, 22, 1)], + [error(WarningCode.receiverOfTypeNever, 22, 1)], ); assertResolvedNodeText(findNode.prefix('++x'), r''' @@ -870,7 +864,7 @@ void f(Never? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 21, 2, ), @@ -900,7 +894,7 @@ void f(Never x) { x.foo; } ''', - [error(WarningCode.DEAD_CODE, 22, 4)], + [error(WarningCode.deadCode, 22, 4)], ); var node = findNode.singlePrefixedIdentifier; @@ -927,7 +921,7 @@ void f(Never x) { x.hashCode; } ''', - [error(WarningCode.DEAD_CODE, 22, 9)], + [error(WarningCode.deadCode, 22, 9)], ); var node = findNode.singlePrefixedIdentifier; @@ -954,7 +948,7 @@ void f(Never x) { x.foo += 0; } ''', - [error(WarningCode.DEAD_CODE, 29, 2)], + [error(WarningCode.deadCode, 29, 2)], ); var assignment = findNode.assignment('foo += 0'); @@ -993,7 +987,7 @@ void f(Never x) { x.toString; } ''', - [error(WarningCode.DEAD_CODE, 22, 9)], + [error(WarningCode.deadCode, 22, 9)], ); var node = findNode.singlePrefixedIdentifier; @@ -1020,7 +1014,7 @@ void f(Never x) { x.foo = 0; } ''', - [error(WarningCode.DEAD_CODE, 28, 2)], + [error(WarningCode.deadCode, 28, 2)], ); var assignment = findNode.assignment('foo = 0'); @@ -1061,7 +1055,7 @@ void f(Never? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 23, 3, ), @@ -1140,7 +1134,7 @@ void f() { (throw '').toString; } ''', - [error(WarningCode.DEAD_CODE, 24, 9)], + [error(WarningCode.deadCode, 24, 9)], ); var node = findNode.singlePropertyAccess; @@ -1171,7 +1165,7 @@ void f() { (throw '').hashCode; } ''', - [error(WarningCode.DEAD_CODE, 24, 9)], + [error(WarningCode.deadCode, 24, 9)], ); var node = findNode.singlePropertyAccess; diff --git a/pkg/analyzer/test/src/diagnostics/record_literal_one_positional_no_trailing_comma_test.dart b/pkg/analyzer/test/src/diagnostics/record_literal_one_positional_no_trailing_comma_test.dart index e5a05af1319..7e6d068e254 100644 --- a/pkg/analyzer/test/src/diagnostics/record_literal_one_positional_no_trailing_comma_test.dart +++ b/pkg/analyzer/test/src/diagnostics/record_literal_one_positional_no_trailing_comma_test.dart @@ -23,7 +23,7 @@ void f((int,) i) { f(('')); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 24, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 24, 2)], ); } @@ -34,7 +34,7 @@ void f((int,) i) { f(1); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 23, 1)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 23, 1)], ); } @@ -47,7 +47,7 @@ void f((int,) i) { ''', [ error( - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, 23, 3, ), @@ -70,7 +70,7 @@ void f((int,) r) { r = (''); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 25, 4)], + [error(CompileTimeErrorCode.invalidAssignment, 25, 4)], ); } @@ -81,7 +81,7 @@ void f((int,) r) { r = 1; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 25, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 25, 1)], ); } @@ -94,7 +94,7 @@ void f((int,) r) { ''', [ error( - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, 25, 3, ), @@ -117,7 +117,7 @@ void f((int,) r) { ''', [ error( - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, 11, 3, ), @@ -130,7 +130,7 @@ void f((int,) r) { ''' (int,) r = (''); ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 12, 2)], + [error(CompileTimeErrorCode.invalidAssignment, 12, 2)], ); } @@ -147,7 +147,7 @@ void f((int,) r) { return 1; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 22, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 22, 1)], ); } @@ -160,7 +160,7 @@ void f((int,) r) { ''', [ error( - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, 22, 3, ), @@ -173,7 +173,7 @@ void f((int,) r) { ''' (int,) f() => (''); ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 14, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 14, 4)], ); } @@ -182,7 +182,7 @@ void f((int,) r) { ''' (int,) f() => 1; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 14, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 14, 1)], ); } @@ -193,7 +193,7 @@ void f((int,) r) { ''', [ error( - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, 14, 3, ), @@ -206,7 +206,7 @@ void f((int,) r) { ''' (int,) f() { return (''); } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 20, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 20, 4)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_compile_time_constant_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_compile_time_constant_test.dart index 71e5c5dafad..149b476f9c5 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_compile_time_constant_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_compile_time_constant_test.dart @@ -22,8 +22,8 @@ const x = y + 1; const y = x + 1; ''', [ - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 23, 1), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 6, 1), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 23, 1), ], ); } @@ -36,7 +36,7 @@ enum E { const E(Object a); } ''', - [error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 11, 1)], + [error(CompileTimeErrorCode.recursiveCompileTimeConstant, 11, 1)], ); } @@ -49,8 +49,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 11, 2), - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 19, 2), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 11, 2), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 19, 2), ], ); } @@ -65,8 +65,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 29, 1), - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 55, 1), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 29, 1), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 55, 1), ], ); } @@ -88,7 +88,7 @@ final z = {x: 0, y: 1}; r''' const x = x; ''', - [error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 6, 1)], + [error(CompileTimeErrorCode.recursiveCompileTimeConstant, 6, 1)], ); } @@ -101,7 +101,7 @@ const elems = const [ ], ]; ''', - [error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 6, 5)], + [error(CompileTimeErrorCode.recursiveCompileTimeConstant, 6, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_constant_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_constant_constructor_test.dart index 74696bc2423..97fb8f7d9d8 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_constant_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_constant_constructor_test.dart @@ -24,8 +24,8 @@ class A { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 18, 1), - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 31, 1), + error(CompileTimeErrorCode.recursiveConstantConstructor, 18, 1), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 31, 1), ], ); } @@ -40,8 +40,8 @@ class C { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 39, 1), + error(CompileTimeErrorCode.recursiveCompileTimeConstant, 6, 1), + error(CompileTimeErrorCode.recursiveConstantConstructor, 39, 1), ], ); } @@ -54,7 +54,7 @@ class A { const A() : a = const A(); } ''', - [error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 31, 1)], + [error(CompileTimeErrorCode.recursiveConstantConstructor, 31, 1)], ); } @@ -71,8 +71,8 @@ class A { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 31, 1), - error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 85, 1), + error(CompileTimeErrorCode.recursiveConstantConstructor, 31, 1), + error(CompileTimeErrorCode.recursiveConstantConstructor, 85, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_constructor_redirect_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_constructor_redirect_test.dart index 983c6c6fd02..2549aed3d50 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_constructor_redirect_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_constructor_redirect_test.dart @@ -22,7 +22,7 @@ class A { A() : this(); } ''', - [error(CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, 18, 6)], + [error(CompileTimeErrorCode.recursiveConstructorRedirect, 18, 6)], ); } @@ -35,8 +35,8 @@ class A { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, 20, 8), - error(CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, 40, 8), + error(CompileTimeErrorCode.recursiveConstructorRedirect, 20, 8), + error(CompileTimeErrorCode.recursiveConstructorRedirect, 40, 8), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_factory_redirect_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_factory_redirect_test.dart index c907bdbb3a8..8fa49ee7b44 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_factory_redirect_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_factory_redirect_test.dart @@ -22,7 +22,7 @@ class A { factory A() = A; } ''', - [error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 26, 1)], + [error(CompileTimeErrorCode.recursiveFactoryRedirect, 26, 1)], ); } @@ -39,7 +39,7 @@ main() { const C(); } ''', - [error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 35, 7)], + [error(CompileTimeErrorCode.recursiveFactoryRedirect, 35, 7)], ); } @@ -57,12 +57,12 @@ class C implements A { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 45, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 56, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 95, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 106, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 145, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 45, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 56, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 95, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 106, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 145, 1), ], ); } @@ -81,12 +81,12 @@ class C implements A { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 39, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 50, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 83, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 94, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 127, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 39, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 50, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 83, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 94, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 127, 1), ], ); } @@ -105,12 +105,12 @@ class C implements A { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 45, 7), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 62, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 101, 7), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 118, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 157, 7), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 45, 7), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 62, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 101, 7), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 118, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 157, 7), ], ); } @@ -131,10 +131,10 @@ class C implements A, B { } ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 37, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 70, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 81, 1), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 117, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 37, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 70, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 81, 1), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 117, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_extends_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_extends_test.dart index 64b7dd241f5..5545b93143f 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_extends_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_extends_test.dart @@ -21,13 +21,7 @@ class RecursiveInterfaceInheritanceExtendsTest r''' class A extends A {} ''', - [ - error( - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_EXTENDS, - 6, - 1, - ), - ], + [error(CompileTimeErrorCode.recursiveInterfaceInheritanceExtends, 6, 1)], ); } @@ -39,13 +33,7 @@ class C extends C { bar(); } ''', - [ - error( - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_EXTENDS, - 6, - 1, - ), - ], + [error(CompileTimeErrorCode.recursiveInterfaceInheritanceExtends, 6, 1)], ); } @@ -56,13 +44,7 @@ class C extends C { class A {} augment class A extends A {} ''', - [ - error( - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_EXTENDS, - 6, - 1, - ), - ], + [error(CompileTimeErrorCode.recursiveInterfaceInheritanceExtends, 6, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_implements_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_implements_test.dart index 60ed7bd199e..eab23c197d6 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_implements_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_implements_test.dart @@ -23,7 +23,7 @@ class A implements A {} ''', [ error( - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_IMPLEMENTS, + CompileTimeErrorCode.recursiveInterfaceInheritanceImplements, 6, 1, ), @@ -40,7 +40,7 @@ augment class A implements A {} ''', [ error( - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_IMPLEMENTS, + CompileTimeErrorCode.recursiveInterfaceInheritanceImplements, 6, 1, ), @@ -56,7 +56,7 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_IMPLEMENTS, + CompileTimeErrorCode.recursiveInterfaceInheritanceImplements, 15, 1, ), @@ -73,7 +73,7 @@ class B = A with M implements B; ''', [ error( - CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_IMPLEMENTS, + CompileTimeErrorCode.recursiveInterfaceInheritanceImplements, 28, 1, ), @@ -87,8 +87,8 @@ class B = A with M implements B; mixin A implements B {} mixin B implements A {}''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 30, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 30, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_on_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_on_test.dart index adba177d2ff..296297bdce1 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_on_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_on_test.dart @@ -20,7 +20,7 @@ class RecursiveInterfaceInheritanceOnTest extends PubPackageResolutionTest { r''' mixin A on A {} ''', - [error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_ON, 6, 1)], + [error(CompileTimeErrorCode.recursiveInterfaceInheritanceOn, 6, 1)], ); } @@ -31,7 +31,7 @@ mixin A on A {} mixin A {} augment mixin A on A {} ''', - [error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_ON, 6, 1)], + [error(CompileTimeErrorCode.recursiveInterfaceInheritanceOn, 6, 1)], ); } @@ -42,8 +42,8 @@ mixin A on B {} mixin B on A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 22, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 22, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_test.dart index 1266ec77bc6..8ff03ac9175 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_test.dart @@ -22,8 +22,8 @@ class A extends B {} class B extends A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 27, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 27, 1), ], ); } @@ -35,8 +35,8 @@ class A extends B {} class B implements A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 27, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 27, 1), ], ); } @@ -48,8 +48,8 @@ class A implements B {} class B implements A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 30, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 30, 1), ], ); } @@ -61,8 +61,8 @@ class A implements B {} class B implements A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 36, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 36, 1), ], ); } @@ -74,8 +74,8 @@ class A implements B> {} class B implements A> {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 42, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 42, 1), ], ); } @@ -88,8 +88,8 @@ abstract class B implements A {} class C implements A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 15, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 48, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 15, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 48, 1), ], ); } @@ -103,9 +103,9 @@ abstract class C implements A {} class D implements A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 15, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 48, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 81, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 15, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 48, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 81, 1), ], ); } @@ -117,8 +117,8 @@ mixin class M1 = Object with M2; mixin class M2 = Object with M1; ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 12, 2), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 45, 2), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 12, 2), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 45, 2), ], ); } @@ -133,8 +133,8 @@ class D = C with M; mixin M {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 26, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 26, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_with_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_with_test.dart index 19f0c199297..fc9ffbea945 100644 --- a/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_with_test.dart +++ b/pkg/analyzer/test/src/diagnostics/recursive_interface_inheritance_with_test.dart @@ -23,8 +23,8 @@ class A extends Object {} augment class A with A {} ''', [ - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_WITH, 6, 1), - error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 47, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritanceWith, 6, 1), + error(CompileTimeErrorCode.classUsedAsMixin, 47, 1), ], ); } @@ -34,7 +34,7 @@ augment class A with A {} r''' mixin class M = Object with M; ''', - [error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE_WITH, 12, 1)], + [error(CompileTimeErrorCode.recursiveInterfaceInheritanceWith, 12, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/redeclare_on_non_redeclaring_member_test.dart b/pkg/analyzer/test/src/diagnostics/redeclare_on_non_redeclaring_member_test.dart index 58bf6292540..d386288ad04 100644 --- a/pkg/analyzer/test/src/diagnostics/redeclare_on_non_redeclaring_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redeclare_on_non_redeclaring_member_test.dart @@ -34,7 +34,7 @@ extension type E(C c) implements C { int get i => 0; } ''', - [error(WarningCode.REDECLARE_ON_NON_REDECLARING_MEMBER, 106, 1)], + [error(WarningCode.redeclareOnNonRedeclaringMember, 106, 1)], ); } @@ -65,7 +65,7 @@ extension type E(C c) implements C { void n() {} } ''', - [error(WarningCode.REDECLARE_ON_NON_REDECLARING_MEMBER, 103, 1)], + [error(WarningCode.redeclareOnNonRedeclaringMember, 103, 1)], ); } @@ -83,7 +83,7 @@ class D implements C { ''', [ // No REDECLARE_ON_NON_REDECLARING_MEMBER warning. - error(WarningCode.INVALID_ANNOTATION_TARGET, 72, 9), + error(WarningCode.invalidAnnotationTarget, 72, 9), ], ); } @@ -118,8 +118,8 @@ extension type E(A it) implements A { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 51, 4), - error(WarningCode.UNUSED_ELEMENT, 122, 4), + error(WarningCode.unusedElement, 51, 4), + error(WarningCode.unusedElement, 122, 4), ], ); } @@ -138,7 +138,7 @@ extension type E(C c) implements C { ''', [ // No REDECLARE_ON_NON_REDECLARING_MEMBER warning. - error(WarningCode.INVALID_ANNOTATION_TARGET, 86, 9), + error(WarningCode.invalidAnnotationTarget, 86, 9), ], ); } @@ -155,7 +155,7 @@ extension type E(C c) implements C { set i(int i) {} } ''', - [error(WarningCode.REDECLARE_ON_NON_REDECLARING_MEMBER, 102, 1)], + [error(WarningCode.redeclareOnNonRedeclaringMember, 102, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/redirect_generative_to_missing_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_generative_to_missing_constructor_test.dart index 61f4aeb93b3..aa8f77cfde3 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_generative_to_missing_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_generative_to_missing_constructor_test.dart @@ -25,7 +25,7 @@ class A { ''', [ error( - CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, + CompileTimeErrorCode.redirectGenerativeToMissingConstructor, 18, 24, ), @@ -43,7 +43,7 @@ enum E { ''', [ error( - CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, + CompileTimeErrorCode.redirectGenerativeToMissingConstructor, 28, 24, ), diff --git a/pkg/analyzer/test/src/diagnostics/redirect_generative_to_non_generative_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_generative_to_non_generative_constructor_test.dart index 8869f4b003f..89bcd554d61 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_generative_to_non_generative_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_generative_to_non_generative_constructor_test.dart @@ -26,8 +26,7 @@ class A { ''', [ error( - CompileTimeErrorCode - .REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR, + CompileTimeErrorCode.redirectGenerativeToNonGenerativeConstructor, 18, 8, ), diff --git a/pkg/analyzer/test/src/diagnostics/redirect_to_abstract_class_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_to_abstract_class_constructor_test.dart index c338751aab8..5ea17063b86 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_to_abstract_class_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_to_abstract_class_constructor_test.dart @@ -23,13 +23,7 @@ abstract class A { A._(); } ''', - [ - error( - CompileTimeErrorCode.REDIRECT_TO_ABSTRACT_CLASS_CONSTRUCTOR, - 35, - 3, - ), - ], + [error(CompileTimeErrorCode.redirectToAbstractClassConstructor, 35, 3)], ); } @@ -43,13 +37,7 @@ class A { abstract class B extends A {} ''', - [ - error( - CompileTimeErrorCode.REDIRECT_TO_ABSTRACT_CLASS_CONSTRUCTOR, - 32, - 1, - ), - ], + [error(CompileTimeErrorCode.redirectToAbstractClassConstructor, 32, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/redirect_to_invalid_function_type_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_to_invalid_function_type_test.dart index c0b60007b0e..8bec8b5d524 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_to_invalid_function_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_to_invalid_function_type_test.dart @@ -24,7 +24,7 @@ class A implements B { class B { factory B() = A; }''', - [error(CompileTimeErrorCode.REDIRECT_TO_INVALID_FUNCTION_TYPE, 65, 1)], + [error(CompileTimeErrorCode.redirectToInvalidFunctionType, 65, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/redirect_to_invalid_return_type_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_to_invalid_return_type_test.dart index 8a5a116bf87..568fbd29fa2 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_to_invalid_return_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_to_invalid_return_type_test.dart @@ -24,7 +24,7 @@ class A { class B { factory B() = A; }''', - [error(CompileTimeErrorCode.REDIRECT_TO_INVALID_RETURN_TYPE, 47, 1)], + [error(CompileTimeErrorCode.redirectToInvalidReturnType, 47, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/redirect_to_missing_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_to_missing_constructor_test.dart index a4ce04aa38c..6e1773eec2b 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_to_missing_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_to_missing_constructor_test.dart @@ -24,7 +24,7 @@ class A implements B{ class B { factory B() = A.name; }''', - [error(CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR, 59, 6)], + [error(CompileTimeErrorCode.redirectToMissingConstructor, 59, 6)], ); } @@ -37,7 +37,7 @@ class A implements B{ class B { factory B() = A; }''', - [error(CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR, 64, 1)], + [error(CompileTimeErrorCode.redirectToMissingConstructor, 64, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/redirect_to_non_class_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_to_non_class_test.dart index 1756b3adeaa..951eb5f2e50 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_to_non_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_to_non_class_test.dart @@ -22,7 +22,7 @@ class B { int A = 0; factory B() = A; }''', - [error(CompileTimeErrorCode.REDIRECT_TO_NON_CLASS, 39, 1)], + [error(CompileTimeErrorCode.redirectToNonClass, 39, 1)], ); } @@ -32,7 +32,7 @@ class B { class B { factory B() = A; }''', - [error(CompileTimeErrorCode.REDIRECT_TO_NON_CLASS, 26, 1)], + [error(CompileTimeErrorCode.redirectToNonClass, 26, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/redirect_to_non_const_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_to_non_const_constructor_test.dart index 4a0aae01362..5f51be609c4 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_to_non_const_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_to_non_const_constructor_test.dart @@ -23,7 +23,7 @@ class A { const factory A.b() = A.a; } ''', - [error(CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR, 34, 3)], + [error(CompileTimeErrorCode.redirectToMissingConstructor, 34, 3)], ); } @@ -67,7 +67,7 @@ class A { const factory A.b() = A.a; } ''', - [error(CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, 43, 3)], + [error(CompileTimeErrorCode.redirectToNonConstConstructor, 43, 3)], ); } @@ -79,7 +79,7 @@ class A { const A.b() : this.a(); } ''', - [error(CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, 40, 1)], + [error(CompileTimeErrorCode.redirectToNonConstConstructor, 40, 1)], ); } @@ -91,7 +91,7 @@ class A { const A.named() : this(); } ''', - [error(CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, 37, 4)], + [error(CompileTimeErrorCode.redirectToNonConstConstructor, 37, 4)], ); } @@ -105,7 +105,7 @@ class A { ''', [ error( - CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR, + CompileTimeErrorCode.redirectGenerativeToMissingConstructor, 26, 8, ), diff --git a/pkg/analyzer/test/src/diagnostics/redirect_to_type_alias_expands_to_type_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/redirect_to_type_alias_expands_to_type_parameter_test.dart index 393a2ddcaef..c9518ff7eed 100644 --- a/pkg/analyzer/test/src/diagnostics/redirect_to_type_alias_expands_to_type_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/redirect_to_type_alias_expands_to_type_parameter_test.dart @@ -31,7 +31,7 @@ class C { ''', [ error( - CompileTimeErrorCode.REDIRECT_TO_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.redirectToTypeAliasExpandsToTypeParameter, 84, 1, ), @@ -52,7 +52,7 @@ class C { ''', [ error( - CompileTimeErrorCode.REDIRECT_TO_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.redirectToTypeAliasExpandsToTypeParameter, 70, 1, ), @@ -73,7 +73,7 @@ class C { ''', [ error( - CompileTimeErrorCode.REDIRECT_TO_TYPE_ALIAS_EXPANDS_TO_TYPE_PARAMETER, + CompileTimeErrorCode.redirectToTypeAliasExpandsToTypeParameter, 70, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/referenced_before_declaration_test.dart b/pkg/analyzer/test/src/diagnostics/referenced_before_declaration_test.dart index 6dc912a7c05..b11c384a23e 100644 --- a/pkg/analyzer/test/src/diagnostics/referenced_before_declaration_test.dart +++ b/pkg/analyzer/test/src/diagnostics/referenced_before_declaration_test.dart @@ -26,7 +26,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 24, 1, contextMessages: [message(testFile, 34, 1)], @@ -76,7 +76,7 @@ main() { } print(x) {} ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1)], + [error(WarningCode.unusedLocalVariable, 40, 1)], ); } @@ -92,7 +92,7 @@ print(x) {} ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 28, 1, contextMessages: [message(testFile, 34, 1)], @@ -113,7 +113,7 @@ print(x) {} ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 28, 1, contextMessages: [message(testFile, 38, 1)], @@ -136,7 +136,7 @@ print(x) {} ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 34, 1, contextMessages: [message(testFile, 48, 1)], @@ -160,7 +160,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 61, 1, contextMessages: [message(testFile, 75, 1)], @@ -193,7 +193,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 77, 1, contextMessages: [message(testFile, 91, 1)], @@ -225,7 +225,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 61, 1, contextMessages: [message(testFile, 74, 1)], @@ -258,7 +258,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 77, 1, contextMessages: [message(testFile, 90, 1)], @@ -290,7 +290,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 62, 1, contextMessages: [message(testFile, 76, 1)], @@ -323,7 +323,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 78, 1, contextMessages: [message(testFile, 92, 1)], @@ -355,7 +355,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 62, 1, contextMessages: [message(testFile, 75, 1)], @@ -388,7 +388,7 @@ void f(int a) { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 78, 1, contextMessages: [message(testFile, 91, 1)], @@ -414,7 +414,7 @@ main() { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 25, 1, contextMessages: [message(testFile, 15, 1)], @@ -432,7 +432,7 @@ main() { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 19, 1, contextMessages: [message(testFile, 15, 1)], @@ -488,7 +488,7 @@ void testTypeRef() { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 23, 6, contextMessages: [message(testFile, 44, 6)], @@ -508,7 +508,7 @@ void testTypeRef() { ''', [ error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 23, 6, contextMessages: [message(testFile, 44, 6)], diff --git a/pkg/analyzer/test/src/diagnostics/refutable_pattern_in_irrefutable_context_test.dart b/pkg/analyzer/test/src/diagnostics/refutable_pattern_in_irrefutable_context_test.dart index fea3e293422..4df56434c70 100644 --- a/pkg/analyzer/test/src/diagnostics/refutable_pattern_in_irrefutable_context_test.dart +++ b/pkg/analyzer/test/src/diagnostics/refutable_pattern_in_irrefutable_context_test.dart @@ -23,13 +23,7 @@ void f() { var (0) = 0; } ''', - [ - error( - CompileTimeErrorCode.REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT, - 18, - 1, - ), - ], + [error(CompileTimeErrorCode.refutablePatternInIrrefutableContext, 18, 1)], ); var node = findNode.singlePatternVariableDeclaration; @@ -61,12 +55,8 @@ void f() { } ''', [ - error( - CompileTimeErrorCode.REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT, - 18, - 6, - ), - error(WarningCode.DEAD_CODE, 20, 4), + error(CompileTimeErrorCode.refutablePatternInIrrefutableContext, 18, 6), + error(WarningCode.deadCode, 20, 4), ], ); @@ -102,13 +92,7 @@ void f(int? x) { var (_?) = x; } ''', - [ - error( - CompileTimeErrorCode.REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT, - 24, - 2, - ), - ], + [error(CompileTimeErrorCode.refutablePatternInIrrefutableContext, 24, 2)], ); var node = findNode.singlePatternVariableDeclaration; @@ -141,13 +125,7 @@ void f() { var (> 0) = 0; } ''', - [ - error( - CompileTimeErrorCode.REFUTABLE_PATTERN_IN_IRREFUTABLE_CONTEXT, - 18, - 3, - ), - ], + [error(CompileTimeErrorCode.refutablePatternInIrrefutableContext, 18, 3)], ); var node = findNode.singlePatternVariableDeclaration; diff --git a/pkg/analyzer/test/src/diagnostics/relational_pattern_operand_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/relational_pattern_operand_type_not_assignable_test.dart index ccdfe4d4477..90fd8fe48ef 100644 --- a/pkg/analyzer/test/src/diagnostics/relational_pattern_operand_type_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/relational_pattern_operand_type_not_assignable_test.dart @@ -86,7 +86,7 @@ void f(A x) { ''', [ error( - CompileTimeErrorCode.RELATIONAL_PATTERN_OPERAND_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.relationalPatternOperandTypeNotAssignable, 101, 1, ), @@ -133,7 +133,7 @@ void f(A x) { } } ''', - [error(WarningCode.DEAD_CODE, 65, 6)], + [error(WarningCode.deadCode, 65, 6)], ); } @@ -168,7 +168,7 @@ void f(A x) { ''', [ error( - CompileTimeErrorCode.RELATIONAL_PATTERN_OPERAND_TYPE_NOT_ASSIGNABLE, + CompileTimeErrorCode.relationalPatternOperandTypeNotAssignable, 89, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/relational_pattern_operator_return_type_not_assignable_to_bool_test.dart b/pkg/analyzer/test/src/diagnostics/relational_pattern_operator_return_type_not_assignable_to_bool_test.dart index 81127459218..6f7bff9efc2 100644 --- a/pkg/analyzer/test/src/diagnostics/relational_pattern_operator_return_type_not_assignable_to_bool_test.dart +++ b/pkg/analyzer/test/src/diagnostics/relational_pattern_operator_return_type_not_assignable_to_bool_test.dart @@ -44,7 +44,7 @@ void f(A x) { [ error( CompileTimeErrorCode - .RELATIONAL_PATTERN_OPERATOR_RETURN_TYPE_NOT_ASSIGNABLE_TO_BOOL, + .relationalPatternOperatorReturnTypeNotAssignableToBool, 67, 1, ), @@ -66,7 +66,7 @@ void f(A x) { [ error( CompileTimeErrorCode - .RELATIONAL_PATTERN_OPERATOR_RETURN_TYPE_NOT_ASSIGNABLE_TO_BOOL, + .relationalPatternOperatorReturnTypeNotAssignableToBool, 70, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/removed_lint_use_test.dart b/pkg/analyzer/test/src/diagnostics/removed_lint_use_test.dart index 9595abd651f..250dcc717ef 100644 --- a/pkg/analyzer/test/src/diagnostics/removed_lint_use_test.dart +++ b/pkg/analyzer/test/src/diagnostics/removed_lint_use_test.dart @@ -55,7 +55,7 @@ class ReplacedLintUseTest extends PubPackageResolutionTest void f() { } ''', - [error(WarningCode.REMOVED_LINT_USE, 20, 12)], + [error(WarningCode.removedLintUse, 20, 12)], ); } @@ -69,7 +69,7 @@ void f() { } // ignore: removed_lint void f() { } ''', - [error(WarningCode.REMOVED_LINT_USE, 11, 12)], + [error(WarningCode.removedLintUse, 11, 12)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/replaced_lint_use_test.dart b/pkg/analyzer/test/src/diagnostics/replaced_lint_use_test.dart index 2384e6429d7..67ab9b2934e 100644 --- a/pkg/analyzer/test/src/diagnostics/replaced_lint_use_test.dart +++ b/pkg/analyzer/test/src/diagnostics/replaced_lint_use_test.dart @@ -56,7 +56,7 @@ class ReplacedLintUseTest extends PubPackageResolutionTest void f() { } ''', - [error(WarningCode.REPLACED_LINT_USE, 20, 12)], + [error(WarningCode.replacedLintUse, 20, 12)], ); } @@ -70,7 +70,7 @@ void f() { } // ignore: removed_lint void f() { } ''', - [error(WarningCode.REPLACED_LINT_USE, 11, 12)], + [error(WarningCode.replacedLintUse, 11, 12)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/rethrow_outside_catch_test.dart b/pkg/analyzer/test/src/diagnostics/rethrow_outside_catch_test.dart index b511886e182..30522d6f556 100644 --- a/pkg/analyzer/test/src/diagnostics/rethrow_outside_catch_test.dart +++ b/pkg/analyzer/test/src/diagnostics/rethrow_outside_catch_test.dart @@ -36,7 +36,7 @@ void f() { } } ''', - [error(CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH, 47, 7)], + [error(CompileTimeErrorCode.rethrowOutsideCatch, 47, 7)], ); } @@ -61,7 +61,7 @@ void f() { rethrow; } ''', - [error(CompileTimeErrorCode.RETHROW_OUTSIDE_CATCH, 13, 7)], + [error(CompileTimeErrorCode.rethrowOutsideCatch, 13, 7)], ); var node = findNode.singleRethrowExpression; diff --git a/pkg/analyzer/test/src/diagnostics/return_in_generative_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/return_in_generative_constructor_test.dart index e8c8f663c87..a434158d7d9 100644 --- a/pkg/analyzer/test/src/diagnostics/return_in_generative_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/return_in_generative_constructor_test.dart @@ -22,7 +22,7 @@ class A { A() { return 0; } } ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, 25, 1)], + [error(CompileTimeErrorCode.returnInGenerativeConstructor, 25, 1)], ); } @@ -33,7 +33,7 @@ class A { A() => A(); } ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATIVE_CONSTRUCTOR, 16, 7)], + [error(CompileTimeErrorCode.returnInGenerativeConstructor, 16, 7)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/return_in_generator_test.dart b/pkg/analyzer/test/src/diagnostics/return_in_generator_test.dart index 53f26b0b28f..e4c826ddaf1 100644 --- a/pkg/analyzer/test/src/diagnostics/return_in_generator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/return_in_generator_test.dart @@ -30,7 +30,7 @@ f() async* { return 0; } ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 15, 6)], + [error(CompileTimeErrorCode.returnInGenerator, 15, 6)], ); } @@ -47,7 +47,7 @@ Stream f() async* { r''' f() async* => 0; ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 11, 2)], + [error(CompileTimeErrorCode.returnInGenerator, 11, 2)], ); } @@ -66,7 +66,7 @@ f() sync* { return 0; } ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 14, 6)], + [error(CompileTimeErrorCode.returnInGenerator, 14, 6)], ); } @@ -83,7 +83,7 @@ Iterable f() sync* { r''' f() sync* => 0; ''', - [error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 10, 2)], + [error(CompileTimeErrorCode.returnInGenerator, 10, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/return_of_do_not_store_test.dart b/pkg/analyzer/test/src/diagnostics/return_of_do_not_store_test.dart index cc5e15a4968..30d69f8a1e1 100644 --- a/pkg/analyzer/test/src/diagnostics/return_of_do_not_store_test.dart +++ b/pkg/analyzer/test/src/diagnostics/return_of_do_not_store_test.dart @@ -70,7 +70,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 95, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 95, 3)], ); } @@ -87,7 +87,7 @@ String f() { return v(); } ''', - [error(WarningCode.RETURN_OF_DO_NOT_STORE, 97, 2)], + [error(WarningCode.returnOfDoNotStore, 97, 2)], ); } @@ -109,14 +109,9 @@ String getV2() => v; String getV3() => v; ''', [ + error(WarningCode.returnOfDoNotStore, 92, 1, messageContains: ['getV']), error( - WarningCode.RETURN_OF_DO_NOT_STORE, - 92, - 1, - messageContains: ['getV'], - ), - error( - WarningCode.RETURN_OF_DO_NOT_STORE, + WarningCode.returnOfDoNotStore, 116, 1, messageContains: ['getV2'], @@ -143,18 +138,8 @@ String get v2 => _v; String get v3 => _v; ''', [ - error( - WarningCode.RETURN_OF_DO_NOT_STORE, - 92, - 2, - messageContains: ['v'], - ), - error( - WarningCode.RETURN_OF_DO_NOT_STORE, - 116, - 2, - messageContains: ['v2'], - ), + error(WarningCode.returnOfDoNotStore, 92, 2, messageContains: ['v']), + error(WarningCode.returnOfDoNotStore, 116, 2, messageContains: ['v2']), ], ); } @@ -173,18 +158,8 @@ String? get _v2 => ''; String? get v => _v ?? _v2; ''', [ - error( - WarningCode.RETURN_OF_DO_NOT_STORE, - 122, - 2, - messageContains: ['_v'], - ), - error( - WarningCode.RETURN_OF_DO_NOT_STORE, - 128, - 3, - messageContains: ['_v2'], - ), + error(WarningCode.returnOfDoNotStore, 122, 2, messageContains: ['_v']), + error(WarningCode.returnOfDoNotStore, 128, 3, messageContains: ['_v2']), ], ); } @@ -214,8 +189,8 @@ var b = true; String get v => b ? _v : _v2; ''', [ - error(WarningCode.RETURN_OF_DO_NOT_STORE, 138, 2), - error(WarningCode.RETURN_OF_DO_NOT_STORE, 143, 3), + error(WarningCode.returnOfDoNotStore, 138, 2), + error(WarningCode.returnOfDoNotStore, 143, 3), ], ); } @@ -241,13 +216,13 @@ class A { ''', [ error( - WarningCode.RETURN_OF_DO_NOT_STORE, + WarningCode.returnOfDoNotStore, 111, 2, messageContains: ['getV'], ), error( - WarningCode.RETURN_OF_DO_NOT_STORE, + WarningCode.returnOfDoNotStore, 140, 2, messageContains: ['getV2'], diff --git a/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_from_catch_error_test.dart b/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_from_catch_error_test.dart index f94dff15ee6..0a271e39962 100644 --- a/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_from_catch_error_test.dart +++ b/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_from_catch_error_test.dart @@ -32,7 +32,7 @@ void f(Future future) { }); } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 69, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 69, 6)], ); } @@ -65,7 +65,7 @@ void f(Future future) { }); } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 63, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 63, 6)], ); } @@ -92,7 +92,7 @@ void f(Future future) { }); } ''', - [error(WarningCode.RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR, 119, 3)], + [error(WarningCode.returnOfInvalidTypeFromCatchError, 119, 3)], ); } @@ -129,7 +129,7 @@ void f(Future future) { future.catchError((e, st) => 'c'); } ''', - [error(WarningCode.RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR, 60, 3)], + [error(WarningCode.returnOfInvalidTypeFromCatchError, 60, 3)], ); } @@ -150,7 +150,7 @@ void f(Future future) { }); } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 64, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 64, 6)], ); } @@ -161,7 +161,7 @@ void f(Future future) { future.catchError((e, st) => ''); } ''', - [error(WarningCode.RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR, 61, 2)], + [error(WarningCode.returnOfInvalidTypeFromCatchError, 61, 2)], ); } @@ -188,7 +188,7 @@ void f(Future future, void Function() g) { future.catchError((e, st) => g()); } ''', - [error(WarningCode.RETURN_OF_INVALID_TYPE_FROM_CATCH_ERROR, 79, 3)], + [error(WarningCode.returnOfInvalidTypeFromCatchError, 79, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart index e978ac9f978..1e93dc1edc5 100644 --- a/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/return_of_invalid_type_test.dart @@ -24,7 +24,7 @@ Td f() { return () => "hello"; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 53, 7)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 53, 7)], ); } @@ -35,13 +35,7 @@ class C { factory C.named() => 7; } ''', - [ - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, - 33, - 1, - ), - ], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromConstructor, 33, 1)], ); } @@ -52,13 +46,7 @@ class C { factory C() => 7; } ''', - [ - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, - 27, - 1, - ), - ], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromConstructor, 27, 1)], ); } @@ -81,7 +69,7 @@ Future f(Future> a) async { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 54, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 54, 1)], ); } @@ -92,7 +80,7 @@ Future f(Future a) async { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 49, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 49, 1)], ); } @@ -110,7 +98,7 @@ int f() async { return 5; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_RETURN_TYPE, 0, 3)], + [error(CompileTimeErrorCode.illegalAsyncReturnType, 0, 3)], ); } @@ -137,7 +125,7 @@ Future f() async { return 5; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 36, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 36, 1)], ); } @@ -148,7 +136,7 @@ Future f() async { return 0; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 34, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 34, 1)], ); } @@ -159,7 +147,7 @@ void f() async { return 5; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 26, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 26, 1)], ); } @@ -178,7 +166,7 @@ Future f(void a) async { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 39, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 39, 1)], ); } @@ -189,7 +177,7 @@ Future f(void a) async { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 40, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 40, 1)], ); } @@ -202,7 +190,7 @@ FutureOr f(void a) async { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 67, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 67, 1)], ); } @@ -227,7 +215,7 @@ Stream f() async* => 3; ''', [ // RETURN_OF_INVALID_TYPE shouldn't be reported in addition to this error. - error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 23, 2), + error(CompileTimeErrorCode.returnInGenerator, 23, 2), ], ); } @@ -239,7 +227,7 @@ void f() { return new X(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 24, 1)], + [error(CompileTimeErrorCode.newWithNonType, 24, 1)], ); } @@ -282,7 +270,7 @@ U Function(U, int) foo(T Function(T a) f) { return f; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 59, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 59, 1)], ); } @@ -301,7 +289,7 @@ int Function(int, int) foo(T Function(T a) f) { return f; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 60, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 60, 1)], ); } @@ -320,7 +308,7 @@ void f() { return 42; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 20, 2)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 20, 2)], ); } @@ -331,7 +319,7 @@ int f(num a) { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 24, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 24, 1)], ); } @@ -342,7 +330,7 @@ int f() { return '0'; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 19, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 19, 3)], ); } @@ -379,7 +367,7 @@ int f(void a) { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 25, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 25, 1)], ); } @@ -390,7 +378,7 @@ Null f(void a) { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 26, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 26, 1)], ); } @@ -413,7 +401,7 @@ U Function(U) foo(T Function(T a) f) => f; ''' U Function(U, int) foo(T Function(T a) f) => f; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 51, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 51, 1)], ); } @@ -428,7 +416,7 @@ int Function(int) foo(T Function(T a) f) => f; ''' int Function(int, int) foo(T Function(T a) f) => f; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 52, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 52, 1)], ); } @@ -443,7 +431,7 @@ void f() => 42; ''' int f() => '0'; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 11, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 11, 3)], ); } @@ -454,7 +442,7 @@ Iterable f() sync* => 3; ''', [ // RETURN_OF_INVALID_TYPE shouldn't be reported in addition to this error. - error(CompileTimeErrorCode.RETURN_IN_GENERATOR, 24, 2), + error(CompileTimeErrorCode.returnInGenerator, 24, 2), ], ); } @@ -498,7 +486,7 @@ int get g { return '0'; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 21, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 21, 3)], ); } @@ -507,7 +495,7 @@ int get g { ''' int get g => '0'; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 13, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 13, 3)], ); } @@ -521,7 +509,7 @@ void f() { g(); } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 34, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 34, 3)], ); } @@ -535,7 +523,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 38, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 38, 3)], ); } @@ -562,7 +550,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 33, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 33, 3)], ); } @@ -585,7 +573,7 @@ class A { int f() => '0'; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 23, 3)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 23, 3)], ); } @@ -594,13 +582,7 @@ class A { ''' Map f() => {...[1, 2, 3, 4]}; ''', - [ - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 21, - 17, - ), - ], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 21, 17)], ); } } @@ -613,7 +595,7 @@ class ReturnOfInvalidTypeWithStrictCastsTest extends PubPackageResolutionTest ''' int f(dynamic a) => a; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 20, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 20, 1)], ); } @@ -624,7 +606,7 @@ Future f(dynamic a) async { return a; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 42, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 42, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/return_type_invalid_for_catch_error_test.dart b/pkg/analyzer/test/src/diagnostics/return_type_invalid_for_catch_error_test.dart index be27b77fd0f..d3fd2b08b9c 100644 --- a/pkg/analyzer/test/src/diagnostics/return_type_invalid_for_catch_error_test.dart +++ b/pkg/analyzer/test/src/diagnostics/return_type_invalid_for_catch_error_test.dart @@ -39,7 +39,7 @@ void f(Future future, String Function(dynamic, StackTrace) cb) { future.catchError(cb); } ''', - [error(WarningCode.RETURN_TYPE_INVALID_FOR_CATCH_ERROR, 90, 2)], + [error(WarningCode.returnTypeInvalidForCatchError, 90, 2)], ); } @@ -50,7 +50,7 @@ void f(Future future, String? Function(dynamic, StackTrace) cb) { future.catchError(cb); } ''', - [error(WarningCode.RETURN_TYPE_INVALID_FOR_CATCH_ERROR, 91, 2)], + [error(WarningCode.returnTypeInvalidForCatchError, 91, 2)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/return_without_value_test.dart b/pkg/analyzer/test/src/diagnostics/return_without_value_test.dart index e2000523103..e1cb014d193 100644 --- a/pkg/analyzer/test/src/diagnostics/return_without_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/return_without_value_test.dart @@ -22,7 +22,7 @@ Future f() async { return; } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 26, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 26, 6)], ); } @@ -33,7 +33,7 @@ Future f() async { return; } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 29, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 29, 6)], ); } @@ -56,7 +56,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 30, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 30, 6)], ); } @@ -67,7 +67,7 @@ int f() { return; } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 12, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 12, 6)], ); } @@ -125,7 +125,7 @@ f() { }; } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 48, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 48, 6)], ); } @@ -146,7 +146,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 26, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 26, 6)], ); } @@ -162,7 +162,7 @@ int f(int x) { return; } ''', - [error(CompileTimeErrorCode.RETURN_WITHOUT_VALUE, 50, 6)], + [error(CompileTimeErrorCode.returnWithoutValue, 50, 6)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/sdk_version_gt_gt_gt_operator_test.dart b/pkg/analyzer/test/src/diagnostics/sdk_version_gt_gt_gt_operator_test.dart index 9ec4026fc5a..95ca1dc7fb9 100644 --- a/pkg/analyzer/test/src/diagnostics/sdk_version_gt_gt_gt_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/sdk_version_gt_gt_gt_operator_test.dart @@ -33,7 +33,7 @@ const a = 42 >>> 3; ''' const a = 42 >>> 3; ''', - expectedErrors: [error(WarningCode.SDK_VERSION_GT_GT_GT_OPERATOR, 13, 3)], + expectedErrors: [error(WarningCode.sdkVersionGtGtGtOperator, 13, 3)], ); } @@ -53,7 +53,7 @@ class A { A operator >>>(A a) => this; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_GT_GT_GT_OPERATOR, 23, 3)], + expectedErrors: [error(WarningCode.sdkVersionGtGtGtOperator, 23, 3)], ); } @@ -69,7 +69,7 @@ var a = 42 >>> 3; ''' var a = 42 >>> 3; ''', - expectedErrors: [error(WarningCode.SDK_VERSION_GT_GT_GT_OPERATOR, 11, 3)], + expectedErrors: [error(WarningCode.sdkVersionGtGtGtOperator, 11, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/sdk_version_since_test.dart b/pkg/analyzer/test/src/diagnostics/sdk_version_since_test.dart index ab75a636f24..21e8c73ec48 100644 --- a/pkg/analyzer/test/src/diagnostics/sdk_version_since_test.dart +++ b/pkg/analyzer/test/src/diagnostics/sdk_version_since_test.dart @@ -37,7 +37,7 @@ void f() { A(foo: 0); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 35, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 35, 3)], ); } @@ -59,7 +59,7 @@ void f() { A(42); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 35, 2)], + expectedErrors: [error(WarningCode.sdkVersionSince, 35, 2)], ); } @@ -82,7 +82,7 @@ void f() { A.named(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 40, 5)], + expectedErrors: [error(WarningCode.sdkVersionSince, 40, 5)], ); } @@ -105,7 +105,7 @@ void f() { A.named; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 40, 5)], + expectedErrors: [error(WarningCode.sdkVersionSince, 40, 5)], ); } @@ -128,7 +128,7 @@ void f() { A(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 33, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 33, 1)], ); } @@ -153,8 +153,8 @@ void f(A a) { } ''', expectedErrors: [ - error(WarningCode.SDK_VERSION_SINCE, 40, 3), - error(WarningCode.SDK_VERSION_SINCE, 49, 3), + error(WarningCode.sdkVersionSince, 40, 3), + error(WarningCode.sdkVersionSince, 49, 3), ], ); } @@ -180,8 +180,8 @@ void f(A a) { } ''', expectedErrors: [ - error(WarningCode.SDK_VERSION_SINCE, 40, 3), - error(WarningCode.SDK_VERSION_SINCE, 54, 3), + error(WarningCode.sdkVersionSince, 40, 3), + error(WarningCode.sdkVersionSince, 54, 3), ], ); } @@ -207,8 +207,8 @@ void f(A a) { } ''', expectedErrors: [ - error(WarningCode.SDK_VERSION_SINCE, 40, 3), - error(WarningCode.SDK_VERSION_SINCE, 53, 3), + error(WarningCode.sdkVersionSince, 40, 3), + error(WarningCode.sdkVersionSince, 53, 3), ], ); } @@ -234,8 +234,8 @@ void f(A a) { } ''', expectedErrors: [ - error(WarningCode.SDK_VERSION_SINCE, 40, 3), - error(WarningCode.SDK_VERSION_SINCE, 49, 3), + error(WarningCode.sdkVersionSince, 40, 3), + error(WarningCode.sdkVersionSince, 49, 3), ], ); } @@ -261,7 +261,7 @@ void f(A a) { a.foo += 0; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 38, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 38, 3)], ); } @@ -285,7 +285,7 @@ void f(A a) { a.foo += 0; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 38, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 38, 3)], ); } @@ -309,7 +309,7 @@ void f(A a) { a.foo += 0; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 38, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 38, 3)], ); } @@ -332,7 +332,7 @@ void f(A a) { a[0]; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 37, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 37, 1)], ); } @@ -355,7 +355,7 @@ void f(A a) { a[0] = 0; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 37, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 37, 1)], ); } @@ -376,7 +376,7 @@ void f() { foo.A(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 44, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 44, 1)], ); } @@ -397,7 +397,7 @@ void f() { A(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 33, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 33, 1)], ); } @@ -420,7 +420,7 @@ void f(A a) { a(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 37, 2)], + expectedErrors: [error(WarningCode.sdkVersionSince, 37, 2)], ); } @@ -444,7 +444,7 @@ void f() { foo(0, bar: 1); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 40, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 40, 3)], ); } @@ -468,7 +468,7 @@ void f() { foo(0, 42); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 40, 2)], + expectedErrors: [error(WarningCode.sdkVersionSince, 40, 2)], ); } @@ -491,7 +491,7 @@ void f(A a) { a.foo(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 38, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 38, 3)], ); } @@ -514,7 +514,7 @@ void f(A a) { a.foo; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 38, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 38, 3)], ); var node = findNode.prefixed('.foo'); @@ -553,7 +553,7 @@ void f(A a) { (a).foo; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 40, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 40, 3)], ); var node = findNode.propertyAccess('.foo'); @@ -597,8 +597,8 @@ void f(A a) { } ''', expectedErrors: [ - error(WarningCode.SDK_VERSION_SINCE, 40, 3), - error(WarningCode.SDK_VERSION_SINCE, 53, 3), + error(WarningCode.sdkVersionSince, 40, 3), + error(WarningCode.sdkVersionSince, 53, 3), ], ); } @@ -618,7 +618,7 @@ import 'dart:foo' as foo; void f(foo.A a) {} ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 38, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 38, 1)], ); } @@ -637,7 +637,7 @@ import 'dart:foo'; void f(A a) {} ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 27, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 27, 1)], ); } @@ -686,7 +686,7 @@ import 'dart:foo'; void f(A a) {} ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 27, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 27, 1)], ); } @@ -765,7 +765,7 @@ import 'dart:foo'; void f(A a) {} ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 27, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 27, 1)], ); } @@ -789,7 +789,7 @@ void f() { E.v2; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 35, 2)], + expectedErrors: [error(WarningCode.sdkVersionSince, 35, 2)], ); } @@ -812,8 +812,8 @@ void f(Enum e) { } ''', expectedErrors: [ - error(WarningCode.SDK_VERSION_SINCE, 7, 4), - error(WarningCode.SDK_VERSION_SINCE, 21, 5), + error(WarningCode.sdkVersionSince, 7, 4), + error(WarningCode.sdkVersionSince, 21, 5), ], ); } @@ -832,7 +832,7 @@ void f() { myEnum.index; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 38, 5)], + expectedErrors: [error(WarningCode.sdkVersionSince, 38, 5)], ); } @@ -853,7 +853,7 @@ import 'dart:foo'; void f(E a) {} ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 27, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 27, 1)], ); } @@ -876,7 +876,7 @@ void f() { 0.foo; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 35, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 35, 3)], ); } @@ -899,7 +899,7 @@ void f() { E(0).foo(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 38, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 38, 3)], ); } @@ -922,7 +922,7 @@ void f() { 0.foo(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 35, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 35, 3)], ); } @@ -945,7 +945,7 @@ void f() { 0.foo(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 35, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 35, 3)], ); } @@ -968,7 +968,7 @@ void f() { 0.foo = 1; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 35, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 35, 3)], ); } @@ -987,7 +987,7 @@ import 'dart:foo'; void f(X a) {} ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 27, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 27, 1)], ); } @@ -1006,7 +1006,7 @@ import 'dart:foo'; void f(X a) {} ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 27, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 27, 1)], ); } @@ -1025,7 +1025,7 @@ import 'dart:foo'; void f(M a) {} ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 27, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 27, 1)], ); } @@ -1046,7 +1046,7 @@ void f() { foo.bar(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 44, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 44, 3)], ); } @@ -1067,7 +1067,7 @@ void f() { foo(); } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 33, 3)], + expectedErrors: [error(WarningCode.sdkVersionSince, 33, 3)], ); } @@ -1088,7 +1088,7 @@ void f() { foo.v; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 44, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 44, 1)], ); } @@ -1109,7 +1109,7 @@ void f() { v; } ''', - expectedErrors: [error(WarningCode.SDK_VERSION_SINCE, 33, 1)], + expectedErrors: [error(WarningCode.sdkVersionSince, 33, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/sealed_class_subtype_outside_of_library_test.dart b/pkg/analyzer/test/src/diagnostics/sealed_class_subtype_outside_of_library_test.dart index 61cab181c4a..11b3055ae8a 100644 --- a/pkg/analyzer/test/src/diagnostics/sealed_class_subtype_outside_of_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/sealed_class_subtype_outside_of_library_test.dart @@ -32,13 +32,7 @@ sealed class Foo {} import 'foo.dart'; class Bar extends Foo {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 37, - 3, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 37, 3)], ); } @@ -53,13 +47,7 @@ typedef FooTypedef = Foo; import 'foo.dart'; class Bar extends FooTypedef {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 37, - 10, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 37, 10)], ); } @@ -74,13 +62,7 @@ import 'foo.dart'; typedef FooTypedef = Foo; class Bar extends FooTypedef {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 63, - 10, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 63, 10)], ); } @@ -113,13 +95,7 @@ sealed class Foo {} import 'foo.dart'; class Bar implements Foo {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 40, - 3, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 40, 3)], ); } @@ -133,13 +109,7 @@ sealed class Foo {} import 'foo.dart'; mixin Bar implements Foo {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 40, - 3, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 40, 3)], ); } @@ -154,13 +124,7 @@ typedef FooTypedef = Foo; import 'foo.dart'; class Bar implements FooTypedef {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 40, - 10, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 40, 10)], ); } @@ -175,13 +139,7 @@ import 'foo.dart'; typedef FooTypedef = Foo; class Bar implements FooTypedef {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 66, - 10, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 66, 10)], ); } @@ -208,13 +166,7 @@ sealed class B extends Foo {} import 'foo.dart'; base class Bar extends B {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 42, - 1, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 42, 1)], ); } @@ -229,13 +181,7 @@ sealed class B extends Foo {} import 'foo.dart'; final class Bar extends B {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 43, - 1, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 43, 1)], ); } @@ -250,13 +196,7 @@ sealed class B extends Foo {} import 'foo.dart'; final class Bar implements B {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 46, - 1, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 46, 1)], ); } @@ -271,13 +211,7 @@ sealed class B extends Foo {} import 'foo.dart'; class Bar extends B {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 37, - 1, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 37, 1)], ); } @@ -306,13 +240,7 @@ sealed class A {} import 'a.dart'; mixin B on A {} ''', - [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 28, - 1, - ), - ], + [error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 28, 1)], ); } @@ -328,16 +256,8 @@ import 'a.dart'; mixin C on A, B {} ''', [ - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 28, - 1, - ), - error( - CompileTimeErrorCode.SEALED_CLASS_SUBTYPE_OUTSIDE_OF_LIBRARY, - 31, - 1, - ), + error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 28, 1), + error(CompileTimeErrorCode.sealedClassSubtypeOutsideOfLibrary, 31, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/set_element_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/set_element_from_deferred_library_test.dart index 065f52f0104..b0027f5009c 100644 --- a/pkg/analyzer/test/src/diagnostics/set_element_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/set_element_from_deferred_library_test.dart @@ -29,7 +29,7 @@ import 'lib1.dart' deferred as a; const cond = true; var v = const {if (cond) null else a.c}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY, 88, 3)], + [error(CompileTimeErrorCode.setElementFromDeferredLibrary, 88, 3)], ); } @@ -42,7 +42,7 @@ import 'lib1.dart' deferred as a; const cond = true; var v = const {if (cond) a.c}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY, 80, 1)], + [error(CompileTimeErrorCode.setElementFromDeferredLibrary, 80, 1)], ); } @@ -54,7 +54,7 @@ const int c = 1;'''); import 'lib1.dart' deferred as a; var v = const {a.c}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY, 51, 1)], + [error(CompileTimeErrorCode.setElementFromDeferredLibrary, 51, 1)], ); } @@ -66,7 +66,7 @@ const int c = 1;'''); import 'lib1.dart' deferred as a; var v = const {a.c + 1}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_FROM_DEFERRED_LIBRARY, 51, 1)], + [error(CompileTimeErrorCode.setElementFromDeferredLibrary, 51, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/set_element_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/set_element_type_not_assignable_test.dart index f7d948cc150..ecdb92168ec 100644 --- a/pkg/analyzer/test/src/diagnostics/set_element_type_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/set_element_type_not_assignable_test.dart @@ -31,7 +31,7 @@ const dynamic a = 0; const dynamic b = 'b'; var v = const {if (1 < 0) a else b}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 82, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 82, 1)], ); } @@ -40,7 +40,7 @@ var v = const {if (1 < 0) a else b}; ''' var v = const {if (1 < 0) 'a'}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 31, 3)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 31, 3)], ); } @@ -64,7 +64,7 @@ var v = const {if (true) a}; const dynamic a = 'a'; var v = const {if (true) a}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 53, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 53, 1)], ); } @@ -89,7 +89,7 @@ var v = const {a}; ''', [ error( - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.setElementTypeNotAssignableNullability, 36, 1, ), @@ -104,7 +104,7 @@ var v = const {null}; ''', [ error( - CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.setElementTypeNotAssignableNullability, 20, 4, ), @@ -118,7 +118,7 @@ var v = const {null}; const dynamic x = 'abc'; var v = const {x}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 45, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 45, 1)], ); } @@ -127,7 +127,7 @@ var v = const {x}; ''' var v = const {'abc'}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 20, 5)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 20, 5)], ); } @@ -171,7 +171,7 @@ var v = {if (1 < 0) a else b}; ''' var v = [if (1 < 0) 'a']; ''', - [error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 25, 3)], + [error(CompileTimeErrorCode.listElementTypeNotAssignable, 25, 3)], ); } @@ -207,7 +207,7 @@ var v = {x}; ''' var v = {'abc'}; ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 14, 5)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 14, 5)], ); } } @@ -223,7 +223,7 @@ void f(bool c, dynamic a) { {if (c) 0 else a}; } ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 50, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 50, 1)], ); } @@ -234,7 +234,7 @@ void f(bool c, dynamic a) { {if (c) a}; } ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 43, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 43, 1)], ); } @@ -245,7 +245,7 @@ void f(Iterable a) { {...a}; } ''', - [error(CompileTimeErrorCode.SET_ELEMENT_TYPE_NOT_ASSIGNABLE, 41, 1)], + [error(CompileTimeErrorCode.setElementTypeNotAssignable, 41, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/shared_deferred_prefix_test.dart b/pkg/analyzer/test/src/diagnostics/shared_deferred_prefix_test.dart index 314629d1431..d768cf8b31f 100644 --- a/pkg/analyzer/test/src/diagnostics/shared_deferred_prefix_test.dart +++ b/pkg/analyzer/test/src/diagnostics/shared_deferred_prefix_test.dart @@ -31,7 +31,7 @@ import 'lib1.dart' deferred as lib; import 'lib2.dart' as lib; main() { lib.f1(); lib.f2(); } ''', - [error(CompileTimeErrorCode.SHARED_DEFERRED_PREFIX, 33, 8)], + [error(CompileTimeErrorCode.sharedDeferredPrefix, 33, 8)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart b/pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart index 72c9c115d5d..81b1da6f2a5 100644 --- a/pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart +++ b/pkg/analyzer/test/src/diagnostics/size_annotation_dimensions_test.dart @@ -25,7 +25,7 @@ final class C extends Struct { external Array>> a0; } ''', - [error(FfiCode.SIZE_ANNOTATION_DIMENSIONS, 53, 12)], + [error(FfiCode.sizeAnnotationDimensions, 53, 12)], ); } @@ -39,7 +39,7 @@ final class C extends Struct { external Array> a0; } ''', - [error(FfiCode.SIZE_ANNOTATION_DIMENSIONS, 53, 15)], + [error(FfiCode.sizeAnnotationDimensions, 53, 15)], ); } @@ -53,7 +53,7 @@ final class C extends Struct { external Array>> a0; } ''', - [error(FfiCode.SIZE_ANNOTATION_DIMENSIONS, 53, 20)], + [error(FfiCode.sizeAnnotationDimensions, 53, 20)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/spread_expression_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/spread_expression_from_deferred_library_test.dart index 981fe1b023d..79362480026 100644 --- a/pkg/analyzer/test/src/diagnostics/spread_expression_from_deferred_library_test.dart +++ b/pkg/analyzer/test/src/diagnostics/spread_expression_from_deferred_library_test.dart @@ -27,13 +27,7 @@ import 'lib1.dart' deferred as a; f() { return const [...a.c]; }''', - [ - error( - CompileTimeErrorCode.SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY, - 61, - 1, - ), - ], + [error(CompileTimeErrorCode.spreadExpressionFromDeferredLibrary, 61, 1)], ); } @@ -66,13 +60,7 @@ import 'lib1.dart' deferred as a; f() { return const {...a.c}; }''', - [ - error( - CompileTimeErrorCode.SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY, - 61, - 1, - ), - ], + [error(CompileTimeErrorCode.spreadExpressionFromDeferredLibrary, 61, 1)], ); } @@ -105,13 +93,7 @@ import 'lib1.dart' deferred as a; f() { return const {...a.c}; }''', - [ - error( - CompileTimeErrorCode.SPREAD_EXPRESSION_FROM_DEFERRED_LIBRARY, - 61, - 1, - ), - ], + [error(CompileTimeErrorCode.spreadExpressionFromDeferredLibrary, 61, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/static_access_to_instance_member_test.dart b/pkg/analyzer/test/src/diagnostics/static_access_to_instance_member_test.dart index cb3a81d2908..26e130263bd 100644 --- a/pkg/analyzer/test/src/diagnostics/static_access_to_instance_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/static_access_to_instance_member_test.dart @@ -36,7 +36,7 @@ f() { E.g; } ''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 51, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 51, 1)], ); } @@ -50,7 +50,7 @@ f() { E.m(); } ''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 47, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 47, 1)], ); } @@ -64,7 +64,7 @@ f() { E.s = 2; } ''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 56, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 56, 1)], ); } @@ -77,7 +77,7 @@ class A { main() { A.m(); }''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 34, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 34, 1)], ); } @@ -90,7 +90,7 @@ class A { main() { A.m; }''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 34, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 34, 1)], ); } @@ -103,7 +103,7 @@ class A { main() { A.f; }''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 34, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 34, 1)], ); } @@ -115,7 +115,7 @@ class C { } var x = C.t; ''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 43, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 43, 1)], ); } @@ -128,7 +128,7 @@ class A { main() { A.f; }''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 40, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 40, 1)], ); } @@ -141,7 +141,7 @@ class A { main() { A.f = 42; }''', - [error(CompileTimeErrorCode.STATIC_ACCESS_TO_INSTANCE_MEMBER, 39, 1)], + [error(CompileTimeErrorCode.staticAccessToInstanceMember, 39, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/strict_raw_type_test.dart b/pkg/analyzer/test/src/diagnostics/strict_raw_type_test.dart index db70fe2d368..4364fbe256b 100644 --- a/pkg/analyzer/test/src/diagnostics/strict_raw_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/strict_raw_type_test.dart @@ -92,7 +92,7 @@ void f() { >[]; } ''', - [error(WarningCode.STRICT_RAW_TYPE, 50, 1)], + [error(WarningCode.strictRawType, 50, 1)], ); } @@ -111,7 +111,7 @@ void f() { r''' extension type E(List i) implements Iterable {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 41, 8)], + [error(WarningCode.strictRawType, 41, 8)], ); } @@ -123,7 +123,7 @@ extension type E(Iterable i) {} extension type F(List j) implements E {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 81, 1)], + [error(WarningCode.strictRawType, 81, 1)], ); } @@ -132,7 +132,7 @@ extension type F(List j) implements E {} r''' extension type E(List i) {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 17, 4)], + [error(WarningCode.strictRawType, 17, 4)], ); } @@ -144,8 +144,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(WarningCode.STRICT_RAW_TYPE, 22, 4), + error(WarningCode.unusedLocalVariable, 17, 1), + error(WarningCode.strictRawType, 22, 4), ], ); } @@ -157,7 +157,7 @@ void f() { var a = >[]; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1)], + [error(WarningCode.unusedLocalVariable, 17, 1)], ); } @@ -189,8 +189,8 @@ void f() { } ''', [ - error(WarningCode.STRICT_RAW_TYPE, 48, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 50, 1), + error(WarningCode.strictRawType, 48, 1), + error(WarningCode.unusedLocalVariable, 50, 1), ], ); } @@ -204,7 +204,7 @@ void f() { E e = E(1); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 55, 1)], + [error(WarningCode.unusedLocalVariable, 55, 1)], ); } @@ -216,8 +216,8 @@ void f() { } ''', [ - error(WarningCode.STRICT_RAW_TYPE, 13, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), + error(WarningCode.strictRawType, 13, 4), + error(WarningCode.unusedLocalVariable, 18, 1), ], ); } @@ -237,7 +237,7 @@ void f() { mixin class C {} class D = Object with C; ''', - [error(WarningCode.STRICT_RAW_TYPE, 42, 1)], + [error(WarningCode.strictRawType, 42, 1)], ); } @@ -263,7 +263,7 @@ void f(List2 a) {} typedef List2 = List; void f(List2 a) {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 35, 5)], + [error(WarningCode.strictRawType, 35, 5)], ); } @@ -294,7 +294,7 @@ void f(Object o) { r''' void f(List a) {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 7, 4)], + [error(WarningCode.strictRawType, 7, 4)], ); } @@ -303,7 +303,7 @@ void f(List a) {} r''' List f(int a) => [1, 2, 3]; ''', - [error(WarningCode.STRICT_RAW_TYPE, 0, 4)], + [error(WarningCode.strictRawType, 0, 4)], ); } @@ -313,7 +313,7 @@ List f(int a) => [1, 2, 3]; mixin class C {} class D extends Object with C {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 48, 1)], + [error(WarningCode.strictRawType, 48, 1)], ); } @@ -329,7 +329,7 @@ class D extends Object with C {} r''' List a = []; ''', - [error(WarningCode.STRICT_RAW_TYPE, 0, 4)], + [error(WarningCode.strictRawType, 0, 4)], ); } @@ -358,7 +358,7 @@ void set s(List a) {} r''' List get g => []; ''', - [error(WarningCode.STRICT_RAW_TYPE, 0, 4)], + [error(WarningCode.strictRawType, 0, 4)], ); } @@ -367,7 +367,7 @@ List get g => []; r''' void set s(List a) {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 11, 4)], + [error(WarningCode.strictRawType, 11, 4)], ); } @@ -377,7 +377,7 @@ void set s(List a) {} typedef T F1(T _); F1 func = (a) => a; ''', - [error(WarningCode.STRICT_RAW_TYPE, 22, 2)], + [error(WarningCode.strictRawType, 22, 2)], ); } @@ -387,7 +387,7 @@ F1 func = (a) => a; typedef F1 = T Function(T); F1 func = (a) => a; ''', - [error(WarningCode.STRICT_RAW_TYPE, 31, 2)], + [error(WarningCode.strictRawType, 31, 2)], ); } @@ -445,7 +445,7 @@ var d = C.named(); r''' extension on List {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 13, 4)], + [error(WarningCode.strictRawType, 13, 4)], ); } @@ -454,7 +454,7 @@ extension on List {} r''' extension E on List {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 15, 4)], + [error(WarningCode.strictRawType, 15, 4)], ); } @@ -482,7 +482,7 @@ extension F on List {} class C {} class D implements C {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 33, 1)], + [error(WarningCode.strictRawType, 33, 1)], ); } @@ -499,7 +499,7 @@ class D implements C {} class C {} class D extends C {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 30, 1)], + [error(WarningCode.strictRawType, 30, 1)], ); } @@ -516,7 +516,7 @@ class D extends C {} class C {} class D {} ''', - [error(WarningCode.STRICT_RAW_TYPE, 32, 1)], + [error(WarningCode.strictRawType, 32, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/subtype_of_base_is_not_base_final_or_sealed_test.dart b/pkg/analyzer/test/src/diagnostics/subtype_of_base_is_not_base_final_or_sealed_test.dart index aa3e2d6565d..59d0591fa24 100644 --- a/pkg/analyzer/test/src/diagnostics/subtype_of_base_is_not_base_final_or_sealed_test.dart +++ b/pkg/analyzer/test/src/diagnostics/subtype_of_base_is_not_base_final_or_sealed_test.dart @@ -24,7 +24,7 @@ class B extends A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 22, 1, text: @@ -43,7 +43,7 @@ class C extends A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 48, 1, text: @@ -65,7 +65,7 @@ class B extends A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 23, 1, text: @@ -92,7 +92,7 @@ abstract class B extends A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 32, 1, text: @@ -110,7 +110,7 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 22, 1, text: @@ -132,17 +132,13 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 23, 1, text: "The type 'B' must be 'base', 'final' or 'sealed' because the supertype 'A' is 'base'.", ), - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 36, - 1, - ), + error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 36, 1), ], ); } @@ -164,17 +160,13 @@ abstract class B implements A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 32, 1, text: "The type 'B' must be 'base', 'final' or 'sealed' because the supertype 'LinkedListEntry' is 'base'.", ), - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 45, - 1, - ), + error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 45, 1), ], ); } @@ -188,7 +180,7 @@ class C extends B {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 50, 1, text: @@ -217,7 +209,7 @@ class D extends C {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 84, 1, text: @@ -246,7 +238,7 @@ class D extends C {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 78, 1, text: @@ -275,7 +267,7 @@ class D extends C {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 78, 1, text: @@ -307,7 +299,7 @@ class C extends B {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 51, 1, text: @@ -335,7 +327,7 @@ base class A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 6, 1, text: @@ -363,7 +355,7 @@ class C implements B {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 53, 1, text: @@ -391,7 +383,7 @@ class C = Object with B implements A; ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 33, 1, text: @@ -410,7 +402,7 @@ interface class C = Object with B implements A; ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 43, 1, text: @@ -430,7 +422,7 @@ class C = Object with B implements AA; ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 62, 1, text: @@ -459,7 +451,7 @@ interface class C = Object with B implements AA; ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 72, 1, text: @@ -487,7 +479,7 @@ class C extends B {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 53, 1, text: @@ -519,7 +511,7 @@ class C extends B {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 48, 1, text: @@ -546,7 +538,7 @@ class B with A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 28, 1, text: @@ -568,7 +560,7 @@ class B with A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 23, 1, text: diff --git a/pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart b/pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart index c1760257953..2300d5b8ee6 100644 --- a/pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/subtype_of_ffi_class_test.dart @@ -23,13 +23,7 @@ class SubtypeOfFfiClassInExtendsTest extends PubPackageResolutionTest { import 'dart:ffi'; final class C extends Double {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 41, - 6, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 41, 6)], ); } @@ -40,13 +34,7 @@ final class C extends Double {} import 'dart:ffi'; class C extends Double {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 49, - 6, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 49, 6)], ); } @@ -58,7 +46,7 @@ class C extends Finalizable {} ''', [ error( - CompileTimeErrorCode.NO_GENERATIVE_CONSTRUCTORS_IN_SUPERCLASS, + CompileTimeErrorCode.noGenerativeConstructorsInSuperclass, 35, 11, ), @@ -72,13 +60,7 @@ class C extends Finalizable {} import 'dart:ffi'; class C extends Float {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 5, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 5)], ); } @@ -88,13 +70,7 @@ class C extends Float {} import 'dart:ffi'; class C extends Int16 {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 5, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 5)], ); } @@ -104,13 +80,7 @@ class C extends Int16 {} import 'dart:ffi'; class C extends Int32 {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 5, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 5)], ); } @@ -120,13 +90,7 @@ class C extends Int32 {} import 'dart:ffi'; class C extends Int64 {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 5, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 5)], ); } @@ -136,13 +100,7 @@ class C extends Int64 {} import 'dart:ffi'; class C extends Int8 {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 4, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 4)], ); } @@ -154,13 +112,7 @@ class C extends Pointer { external factory C(); } ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 7, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 7)], ); } @@ -179,13 +131,7 @@ final class C extends Struct { import 'dart:ffi'; class C extends Uint16 {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 6, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 6)], ); } @@ -195,13 +141,7 @@ class C extends Uint16 {} import 'dart:ffi'; class C extends Uint32 {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 6, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 6)], ); } @@ -211,13 +151,7 @@ class C extends Uint32 {} import 'dart:ffi'; class C extends Uint64 {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 6, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 6)], ); } @@ -227,13 +161,7 @@ class C extends Uint64 {} import 'dart:ffi'; class C extends Uint8 {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 5, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 5)], ); } @@ -252,13 +180,7 @@ final class C extends Union { import 'dart:ffi'; class C extends Void {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 35, - 4, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 35, 4)], ); } } @@ -273,7 +195,7 @@ class C implements Double {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 6, ), @@ -290,7 +212,7 @@ class C implements Double {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 52, 6, ), @@ -306,7 +228,7 @@ class C implements ffi.Double {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 45, 10, ), @@ -329,7 +251,7 @@ class C implements Float {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 5, ), @@ -345,7 +267,7 @@ class C implements Int16 {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 5, ), @@ -361,7 +283,7 @@ class C implements Int32 {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 5, ), @@ -377,7 +299,7 @@ class C implements Int64 {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 5, ), @@ -393,7 +315,7 @@ class C implements Int8 {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 4, ), @@ -409,12 +331,12 @@ class C implements Pointer {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 7, ), error( - CompileTimeErrorCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, + CompileTimeErrorCode.nonAbstractClassInheritsAbstractMemberOne, 25, 1, ), @@ -428,13 +350,7 @@ class C implements Pointer {} import 'dart:ffi'; final class C implements Struct {} ''', - [ - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 44, - 6, - ), - ], + [error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 44, 6)], ); } @@ -446,7 +362,7 @@ class C implements Uint16 {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 6, ), @@ -462,7 +378,7 @@ class C implements Uint32 {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 6, ), @@ -478,7 +394,7 @@ class C implements Uint64 {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 6, ), @@ -494,7 +410,7 @@ class C implements Uint8 {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 5, ), @@ -508,13 +424,7 @@ class C implements Uint8 {} import 'dart:ffi'; final class C implements Union {} ''', - [ - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 44, - 5, - ), - ], + [error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 44, 5)], ); } @@ -526,7 +436,7 @@ class C implements Void {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 38, 4, ), @@ -543,7 +453,7 @@ class SubtypeOfFfiClassInWithTest extends PubPackageResolutionTest { import 'dart:ffi'; class C with Double {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 6)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 6)], ); } @@ -554,7 +464,7 @@ class C with Double {} import 'dart:ffi'; class C with Double {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 46, 6)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 46, 6)], ); } @@ -564,7 +474,7 @@ class C with Double {} import 'dart:ffi' as ffi; class C with ffi.Double {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 39, 10)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 39, 10)], ); } @@ -574,7 +484,7 @@ class C with ffi.Double {} import 'dart:ffi'; class C with Float {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 5)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 5)], ); } @@ -584,7 +494,7 @@ class C with Float {} import 'dart:ffi'; class C with Int16 {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 5)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 5)], ); } @@ -594,7 +504,7 @@ class C with Int16 {} import 'dart:ffi'; class C with Int32 {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 5)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 5)], ); } @@ -604,7 +514,7 @@ class C with Int32 {} import 'dart:ffi'; class C with Int64 {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 5)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 5)], ); } @@ -614,7 +524,7 @@ class C with Int64 {} import 'dart:ffi'; class C with Int8 {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 4)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 4)], ); } @@ -624,7 +534,7 @@ class C with Int8 {} import 'dart:ffi'; class C with Pointer {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 32, 7)], + [error(CompileTimeErrorCode.classUsedAsMixin, 32, 7)], ); } @@ -634,7 +544,7 @@ class C with Pointer {} import 'dart:ffi'; final class C with Struct {} ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 38, 6)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 38, 6)], ); } @@ -644,7 +554,7 @@ final class C with Struct {} import 'dart:ffi'; class C with Uint16 {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 6)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 6)], ); } @@ -654,7 +564,7 @@ class C with Uint16 {} import 'dart:ffi'; class C with Uint32 {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 6)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 6)], ); } @@ -664,7 +574,7 @@ class C with Uint32 {} import 'dart:ffi'; class C with Uint64 {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 6)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 6)], ); } @@ -674,7 +584,7 @@ class C with Uint64 {} import 'dart:ffi'; class C with Uint8 {} ''', - [error(CompileTimeErrorCode.MIXIN_CLASS_DECLARES_CONSTRUCTOR, 32, 5)], + [error(CompileTimeErrorCode.mixinClassDeclaresConstructor, 32, 5)], ); } @@ -684,7 +594,7 @@ class C with Uint8 {} import 'dart:ffi'; final class C with Union {} ''', - [error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 38, 5)], + [error(CompileTimeErrorCode.mixinInheritsFromNotObject, 38, 5)], ); } @@ -694,7 +604,7 @@ final class C with Union {} import 'dart:ffi'; class C with Void {} ''', - [error(CompileTimeErrorCode.CLASS_USED_AS_MIXIN, 32, 4)], + [error(CompileTimeErrorCode.classUsedAsMixin, 32, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/subtype_of_final_is_not_base_final_or_sealed_test.dart b/pkg/analyzer/test/src/diagnostics/subtype_of_final_is_not_base_final_or_sealed_test.dart index 9ab9c0827d1..dbbe70c5d92 100644 --- a/pkg/analyzer/test/src/diagnostics/subtype_of_final_is_not_base_final_or_sealed_test.dart +++ b/pkg/analyzer/test/src/diagnostics/subtype_of_final_is_not_base_final_or_sealed_test.dart @@ -25,7 +25,7 @@ class B extends A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 23, 1, text: @@ -50,7 +50,7 @@ class B {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 38, 1, text: @@ -72,13 +72,7 @@ final class A {} import 'a.dart'; class B extends A {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 33, - 1, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 33, 1)], ); } @@ -105,7 +99,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 23, 1, text: @@ -123,7 +117,7 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 23, 1, text: @@ -147,7 +141,7 @@ class B implements A {} ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 36, 1, ), @@ -181,7 +175,7 @@ class B implements A { ''', [ error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 36, 1, ), @@ -203,8 +197,7 @@ mixin B on A {} ''', [ error( - CompileTimeErrorCode - .FINAL_CLASS_USED_AS_MIXIN_CONSTRAINT_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassUsedAsMixinConstraintOutsideOfLibrary, 28, 1, ), @@ -221,7 +214,7 @@ class C extends B {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 51, 1, text: @@ -250,7 +243,7 @@ class D extends C {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 79, 1, text: @@ -282,13 +275,7 @@ import 'a.dart'; sealed class B extends A {} class C extends B {} ''', - [ - error( - CompileTimeErrorCode.FINAL_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, - 40, - 1, - ), - ], + [error(CompileTimeErrorCode.finalClassExtendedOutsideOfLibrary, 40, 1)], ); } @@ -301,7 +288,7 @@ final class A {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 6, 1, text: @@ -329,7 +316,7 @@ class C implements B {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 54, 1, text: @@ -358,7 +345,7 @@ class D extends C {} ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 69, 1, text: @@ -386,7 +373,7 @@ class C = Object with B implements A; ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 34, 1, text: @@ -405,7 +392,7 @@ interface class C = Object with B implements A; ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 44, 1, text: @@ -425,7 +412,7 @@ class C = Object with B implements AA; ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 63, 1, text: @@ -454,7 +441,7 @@ interface class C = Object with B implements AA; ''', [ error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, + CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 73, 1, text: diff --git a/pkg/analyzer/test/src/diagnostics/subtype_of_sealed_class_test.dart b/pkg/analyzer/test/src/diagnostics/subtype_of_sealed_class_test.dart index 273d8dcf2ea..a2294e79786 100644 --- a/pkg/analyzer/test/src/diagnostics/subtype_of_sealed_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/subtype_of_sealed_class_test.dart @@ -39,7 +39,7 @@ import 'package:meta/meta.dart'; import 'package:foo/foo.dart'; class Bar extends Foo {} ''', - [error(WarningCode.SUBTYPE_OF_SEALED_CLASS, 31, 24)], + [error(WarningCode.subtypeOfSealedClass, 31, 24)], ); } @@ -60,7 +60,7 @@ import 'package:meta/meta.dart'; import 'package:foo/foo.dart'; class Bar implements Foo {} ''', - [error(WarningCode.SUBTYPE_OF_SEALED_CLASS, 31, 27)], + [error(WarningCode.subtypeOfSealedClass, 31, 27)], ); } @@ -83,7 +83,7 @@ import 'package:foo/foo.dart'; class Bar1 {} class Bar2 = Bar1 with Foo; ''', - [error(WarningCode.SUBTYPE_OF_SEALED_CLASS, 45, 27)], + [error(WarningCode.subtypeOfSealedClass, 45, 27)], ); } @@ -105,7 +105,7 @@ import 'package:foo/foo.dart'; class Bar1 {} class Bar2 = Bar1 with Foo; ''', - [error(WarningCode.SUBTYPE_OF_SEALED_CLASS, 45, 27)], + [error(WarningCode.subtypeOfSealedClass, 45, 27)], ); } @@ -126,7 +126,7 @@ import 'package:meta/meta.dart'; import 'package:foo/foo.dart'; class Bar extends Object with Foo {} ''', - [error(WarningCode.SUBTYPE_OF_SEALED_CLASS, 31, 36)], + [error(WarningCode.subtypeOfSealedClass, 31, 36)], ); } @@ -147,7 +147,7 @@ import 'package:meta/meta.dart'; import 'package:foo/foo.dart'; mixin Bar implements Foo {} ''', - [error(WarningCode.SUBTYPE_OF_SEALED_CLASS, 31, 27)], + [error(WarningCode.subtypeOfSealedClass, 31, 27)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/subtype_of_struct_class_test.dart b/pkg/analyzer/test/src/diagnostics/subtype_of_struct_class_test.dart index 67188902ea4..61a4972bc06 100644 --- a/pkg/analyzer/test/src/diagnostics/subtype_of_struct_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/subtype_of_struct_class_test.dart @@ -27,7 +27,7 @@ final class S extends Struct { } final class C extends S {} ''', - [error(FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS, 103, 1)], + [error(FfiCode.subtypeOfStructClassInExtends, 103, 1)], ); } @@ -40,7 +40,7 @@ final class S extends Union { } final class C extends S {} ''', - [error(FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_EXTENDS, 102, 1)], + [error(FfiCode.subtypeOfStructClassInExtends, 102, 1)], ); } } @@ -63,11 +63,11 @@ final class AbiSpecificInteger4 implements AbiSpecificInteger1 { ''', [ error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 216, 19, ), - error(FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS, 216, 19), + error(FfiCode.subtypeOfStructClassInImplements, 216, 19), ], ); } @@ -80,13 +80,9 @@ final class S extends Struct {} final class C implements S {} ''', [ - error(FfiCode.EMPTY_STRUCT, 31, 1), - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 76, - 1, - ), - error(FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS, 76, 1), + error(FfiCode.emptyStruct, 31, 1), + error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 76, 1), + error(FfiCode.subtypeOfStructClassInImplements, 76, 1), ], ); } @@ -102,17 +98,13 @@ import 'lib1.dart' as lib1; class C implements lib1.S {} ''', [ + error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 47, 6), error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.finalClassImplementedOutsideOfLibrary, 47, 6, ), - error( - CompileTimeErrorCode.FINAL_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 47, - 6, - ), - error(FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS, 47, 6), + error(FfiCode.subtypeOfStructClassInImplements, 47, 6), ], ); } @@ -125,13 +117,9 @@ final class S extends Union {} final class C implements S {} ''', [ - error(FfiCode.EMPTY_STRUCT, 31, 1), - error( - CompileTimeErrorCode.BASE_CLASS_IMPLEMENTED_OUTSIDE_OF_LIBRARY, - 75, - 1, - ), - error(FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_IMPLEMENTS, 75, 1), + error(FfiCode.emptyStruct, 31, 1), + error(CompileTimeErrorCode.baseClassImplementedOutsideOfLibrary, 75, 1), + error(FfiCode.subtypeOfStructClassInImplements, 75, 1), ], ); } @@ -147,10 +135,10 @@ final class S extends Struct {} final class C with S {} ''', [ - error(FfiCode.EMPTY_STRUCT, 31, 1), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 70, 1), + error(FfiCode.emptyStruct, 31, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 70, 1), error( - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH, + FfiCode.subtypeOfStructClassInWith, 70, 1, messageContains: ["class 'C'", "mix in 'S'"], @@ -171,9 +159,9 @@ import 'lib1.dart' as lib1; class C with lib1.S {} ''', [ - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 42, 6), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 42, 6), error( - FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH, + FfiCode.subtypeOfStructClassInWith, 42, 6, messageContains: ["class 'C'", "mix in 'S'"], @@ -190,9 +178,9 @@ final class S extends Union {} final class C with S {} ''', [ - error(FfiCode.EMPTY_STRUCT, 31, 1), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 69, 1), - error(FfiCode.SUBTYPE_OF_STRUCT_CLASS_IN_WITH, 69, 1), + error(FfiCode.emptyStruct, 31, 1), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 69, 1), + error(FfiCode.subtypeOfStructClassInWith, 69, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/super_formal_parameter_type_is_not_subtype_of_associated_test.dart b/pkg/analyzer/test/src/diagnostics/super_formal_parameter_type_is_not_subtype_of_associated_test.dart index 5e526f3412f..f2ec6b12610 100644 --- a/pkg/analyzer/test/src/diagnostics/super_formal_parameter_type_is_not_subtype_of_associated_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_formal_parameter_type_is_not_subtype_of_associated_test.dart @@ -29,8 +29,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED, + CompileTimeErrorCode.superFormalParameterTypeIsNotSubtypeOfAssociated, 65, 1, ), @@ -75,8 +74,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED, + CompileTimeErrorCode.superFormalParameterTypeIsNotSubtypeOfAssociated, 80, 1, ), @@ -133,8 +131,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED, + CompileTimeErrorCode.superFormalParameterTypeIsNotSubtypeOfAssociated, 59, 1, ), @@ -156,8 +153,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_TYPE_IS_NOT_SUBTYPE_OF_ASSOCIATED, + CompileTimeErrorCode.superFormalParameterTypeIsNotSubtypeOfAssociated, 63, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/super_formal_parameter_without_associated_named_test.dart b/pkg/analyzer/test/src/diagnostics/super_formal_parameter_without_associated_named_test.dart index e7172bd22dc..24dc4c4f6b8 100644 --- a/pkg/analyzer/test/src/diagnostics/super_formal_parameter_without_associated_named_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_formal_parameter_without_associated_named_test.dart @@ -27,7 +27,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedNamed, 43, 1, ), @@ -46,7 +46,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedNamed, 52, 1, ), @@ -65,7 +65,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedNamed, 43, 1, ), @@ -84,7 +84,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_NAMED, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedNamed, 52, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/super_formal_parameter_without_associated_positional_test.dart b/pkg/analyzer/test/src/diagnostics/super_formal_parameter_without_associated_positional_test.dart index c3a94363d2d..b3d247ec706 100644 --- a/pkg/analyzer/test/src/diagnostics/super_formal_parameter_without_associated_positional_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_formal_parameter_without_associated_positional_test.dart @@ -27,8 +27,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedPositional, 43, 1, ), @@ -47,8 +46,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedPositional, 42, 1, ), @@ -67,8 +65,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedPositional, 43, 1, ), @@ -87,8 +84,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedPositional, 42, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/super_in_enum_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/super_in_enum_constructor_test.dart index 9739bce7b64..f387d8abfea 100644 --- a/pkg/analyzer/test/src/diagnostics/super_in_enum_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_in_enum_constructor_test.dart @@ -24,7 +24,7 @@ enum E { const E() : this.named(), super(); } ''', - [error(CompileTimeErrorCode.SUPER_IN_ENUM_CONSTRUCTOR, 61, 5)], + [error(CompileTimeErrorCode.superInEnumConstructor, 61, 5)], ); } @@ -36,7 +36,7 @@ enum E { const E() : super(); } ''', - [error(CompileTimeErrorCode.SUPER_IN_ENUM_CONSTRUCTOR, 28, 5)], + [error(CompileTimeErrorCode.superInEnumConstructor, 28, 5)], ); } @@ -49,8 +49,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.SUPER_IN_ENUM_CONSTRUCTOR, 28, 5), - error(CompileTimeErrorCode.SUPER_IN_ENUM_CONSTRUCTOR, 37, 5), + error(CompileTimeErrorCode.superInEnumConstructor, 28, 5), + error(CompileTimeErrorCode.superInEnumConstructor, 37, 5), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/super_in_extension_test.dart b/pkg/analyzer/test/src/diagnostics/super_in_extension_test.dart index 55861f98c89..d3c165fa1e1 100644 --- a/pkg/analyzer/test/src/diagnostics/super_in_extension_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_in_extension_test.dart @@ -22,7 +22,7 @@ extension E on int { int plusOne() => super + 1; } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION, 40, 5)], + [error(CompileTimeErrorCode.superInExtension, 40, 5)], ); } @@ -36,8 +36,8 @@ extension on T { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 23, 1), - error(CompileTimeErrorCode.SUPER_IN_EXTENSION, 33, 5), + error(WarningCode.unusedElement, 23, 1), + error(CompileTimeErrorCode.superInExtension, 33, 5), ], ); } @@ -55,7 +55,7 @@ extension E on C { } } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION, 117, 5)], + [error(CompileTimeErrorCode.superInExtension, 117, 5)], ); } @@ -69,7 +69,7 @@ extension E on C { int at(int i) => super[i]; } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION, 80, 5)], + [error(CompileTimeErrorCode.superInExtension, 80, 5)], ); } @@ -80,7 +80,7 @@ extension E on int { String get displayText => super.toString(); } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION, 49, 5)], + [error(CompileTimeErrorCode.superInExtension, 49, 5)], ); } @@ -92,8 +92,8 @@ extension E on int { } ''', [ - error(CompileTimeErrorCode.EXTENSION_DECLARES_INSTANCE_FIELD, 34, 1), - error(CompileTimeErrorCode.SUPER_IN_EXTENSION, 38, 5), + error(CompileTimeErrorCode.extensionDeclaresInstanceField, 34, 1), + error(CompileTimeErrorCode.superInExtension, 38, 5), ], ); } @@ -107,7 +107,7 @@ extension E on int { } } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION, 40, 5)], + [error(CompileTimeErrorCode.superInExtension, 40, 5)], ); } @@ -121,7 +121,7 @@ extension E on C { C get negated => -super; } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION, 76, 5)], + [error(CompileTimeErrorCode.superInExtension, 76, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/super_in_extension_type_test.dart b/pkg/analyzer/test/src/diagnostics/super_in_extension_type_test.dart index 33c7ccfa2b0..44cda5f5d6f 100644 --- a/pkg/analyzer/test/src/diagnostics/super_in_extension_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_in_extension_type_test.dart @@ -24,7 +24,7 @@ extension type A(int it) { } } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION_TYPE, 44, 5)], + [error(CompileTimeErrorCode.superInExtensionType, 44, 5)], ); var node = findNode.singleBinaryExpression; @@ -53,7 +53,7 @@ extension type A(int it) { } } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION_TYPE, 44, 5)], + [error(CompileTimeErrorCode.superInExtensionType, 44, 5)], ); var node = findNode.singleMethodInvocation; @@ -84,7 +84,7 @@ extension type A(int it) { } } ''', - [error(CompileTimeErrorCode.SUPER_IN_EXTENSION_TYPE, 44, 5)], + [error(CompileTimeErrorCode.superInExtensionType, 44, 5)], ); var node = findNode.singlePropertyAccess; diff --git a/pkg/analyzer/test/src/diagnostics/super_in_invalid_context_test.dart b/pkg/analyzer/test/src/diagnostics/super_in_invalid_context_test.dart index b5b5ad53055..e77a6cdecd3 100644 --- a/pkg/analyzer/test/src/diagnostics/super_in_invalid_context_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_in_invalid_context_test.dart @@ -20,7 +20,7 @@ class SuperInInvalidContextTest extends PubPackageResolutionTest { ''' var v = super + 0; ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 8, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 8, 5)], ); } @@ -35,7 +35,7 @@ class B extends A { var f = super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 63, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 63, 5)], ); } @@ -62,7 +62,7 @@ class B extends A { static var f = super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 70, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 70, 5)], ); } @@ -77,7 +77,7 @@ class B extends A { static late var f = super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 75, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 75, 5)], ); } @@ -92,7 +92,7 @@ class B extends A { B() : f = super.m(); } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 62, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 62, 5)], ); } @@ -108,7 +108,7 @@ class C extends S { C() : super(super.f); } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 75, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 75, 5)], ); } @@ -125,7 +125,7 @@ class C extends S { C.other(int a) : super(a); } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 80, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 80, 5)], ); } @@ -143,7 +143,7 @@ class B extends A { B._(); } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 61, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 61, 5)], ); } @@ -157,7 +157,7 @@ class B extends A { var b = super.a; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 50, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 50, 5)], ); } @@ -168,7 +168,7 @@ extension E on int { static final v = super.foo(); } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 40, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 40, 5)], ); } @@ -181,7 +181,7 @@ extension E on int { } } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 47, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 47, 5)], ); } @@ -196,7 +196,7 @@ mixin M on A { var f = super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 58, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 58, 5)], ); } @@ -223,7 +223,7 @@ mixin M on A { static var f = super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 65, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 65, 5)], ); } @@ -238,7 +238,7 @@ mixin M on A { static late var f = super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 70, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 70, 5)], ); } @@ -253,7 +253,7 @@ extension E on int { static var f = super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 71, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 71, 5)], ); } @@ -268,7 +268,7 @@ extension E on int { static late var f = super.foo; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 76, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 76, 5)], ); } @@ -282,7 +282,7 @@ class B extends A { static n() { return super.m(); } } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 70, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 70, 5)], ); var node = findNode.methodInvocation('super.m()'); @@ -314,7 +314,7 @@ class B extends A { static int b = super.a; } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 69, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 69, 5)], ); var node = findNode.singlePropertyAccess; @@ -339,7 +339,7 @@ f() { super.f(); } ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 8, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 8, 5)], ); } @@ -348,7 +348,7 @@ f() { ''' var v = super.y; ''', - [error(CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, 8, 5)], + [error(CompileTimeErrorCode.superInInvalidContext, 8, 5)], ); } @@ -368,8 +368,8 @@ class B extends A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 57, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 92, 1), + error(WarningCode.unusedLocalVariable, 57, 1), + error(WarningCode.unusedLocalVariable, 92, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/super_in_redirecting_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/super_in_redirecting_constructor_test.dart index a713f938d2e..8efa6cd186f 100644 --- a/pkg/analyzer/test/src/diagnostics/super_in_redirecting_constructor_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_in_redirecting_constructor_test.dart @@ -23,7 +23,7 @@ class A { A.name() {} } ''', - [error(CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR, 31, 7)], + [error(CompileTimeErrorCode.superInRedirectingConstructor, 31, 7)], ); } @@ -35,7 +35,7 @@ class A { A.name() {} } ''', - [error(CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR, 18, 7)], + [error(CompileTimeErrorCode.superInRedirectingConstructor, 18, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/super_initializer_in_object_test.dart b/pkg/analyzer/test/src/diagnostics/super_initializer_in_object_test.dart index 268e0e76759..accd6df8ca4 100644 --- a/pkg/analyzer/test/src/diagnostics/super_initializer_in_object_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_initializer_in_object_test.dart @@ -23,7 +23,7 @@ class Object { Object() : super(); } ''', - [error(CompileTimeErrorCode.SUPER_INITIALIZER_IN_OBJECT, 0, 0)], + [error(CompileTimeErrorCode.superInitializerInObject, 0, 0)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/super_invocation_not_last_test.dart b/pkg/analyzer/test/src/diagnostics/super_invocation_not_last_test.dart index 79a8aad474f..71e6e058437 100644 --- a/pkg/analyzer/test/src/diagnostics/super_invocation_not_last_test.dart +++ b/pkg/analyzer/test/src/diagnostics/super_invocation_not_last_test.dart @@ -22,7 +22,7 @@ class A { A(int? x) : super(), assert(x != null); } ''', - [error(CompileTimeErrorCode.SUPER_INVOCATION_NOT_LAST, 24, 5)], + [error(CompileTimeErrorCode.superInvocationNotLast, 24, 5)], ); } @@ -34,7 +34,7 @@ class A { A() : super(), x = 1; } ''', - [error(CompileTimeErrorCode.SUPER_INVOCATION_NOT_LAST, 33, 5)], + [error(CompileTimeErrorCode.superInvocationNotLast, 33, 5)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/switch_case_completes_normally_test.dart b/pkg/analyzer/test/src/diagnostics/switch_case_completes_normally_test.dart index 78fc021651b..839b8c0258c 100644 --- a/pkg/analyzer/test/src/diagnostics/switch_case_completes_normally_test.dart +++ b/pkg/analyzer/test/src/diagnostics/switch_case_completes_normally_test.dart @@ -58,7 +58,7 @@ void f(int a) { }''', [ if (!_patternsEnabled) - error(CompileTimeErrorCode.SWITCH_CASE_COMPLETES_NORMALLY, 35, 4), + error(CompileTimeErrorCode.switchCaseCompletesNormally, 35, 4), ], ); } @@ -135,7 +135,7 @@ void f(int a) { }''', [ if (!_patternsEnabled) - error(CompileTimeErrorCode.SWITCH_CASE_COMPLETES_NORMALLY, 35, 4), + error(CompileTimeErrorCode.switchCaseCompletesNormally, 35, 4), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/tearoff_of_generative_constructor_of_abstract_class_test.dart b/pkg/analyzer/test/src/diagnostics/tearoff_of_generative_constructor_of_abstract_class_test.dart index 2a14259f88f..ede25455b94 100644 --- a/pkg/analyzer/test/src/diagnostics/tearoff_of_generative_constructor_of_abstract_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/tearoff_of_generative_constructor_of_abstract_class_test.dart @@ -57,8 +57,7 @@ void foo() { ''', [ error( - CompileTimeErrorCode - .TEAROFF_OF_GENERATIVE_CONSTRUCTOR_OF_ABSTRACT_CLASS, + CompileTimeErrorCode.tearoffOfGenerativeConstructorOfAbstractClass, 44, 5, ), diff --git a/pkg/analyzer/test/src/diagnostics/text_direction_code_point_test.dart b/pkg/analyzer/test/src/diagnostics/text_direction_code_point_test.dart index b238d12a2d1..cbd07ac04b7 100644 --- a/pkg/analyzer/test/src/diagnostics/text_direction_code_point_test.dart +++ b/pkg/analyzer/test/src/diagnostics/text_direction_code_point_test.dart @@ -25,10 +25,10 @@ void f() { // \u2066 } ''', [ - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_COMMENT, 3, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_COMMENT, 9, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_COMMENT, 25, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_COMMENT, 32, 1), + error(WarningCode.textDirectionCodePointInComment, 3, 1), + error(WarningCode.textDirectionCodePointInComment, 9, 1), + error(WarningCode.textDirectionCodePointInComment, 25, 1), + error(WarningCode.textDirectionCodePointInComment, 32, 1), ], ); } @@ -48,7 +48,7 @@ var u202a = '\u202A'; ''', [ error( - WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, + WarningCode.textDirectionCodePointInLiteral, 13, 1, messageContains: ['U+202A'], @@ -64,7 +64,7 @@ var s = """ \u202a Multiline! """; ''', - [error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 12, 1)], + [error(WarningCode.textDirectionCodePointInLiteral, 12, 1)], ); } @@ -82,15 +82,15 @@ var u2068 = '\u2068'; var u2069 = '\u2069'; ''', [ - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 13, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 30, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 47, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 64, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 81, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 98, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 115, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 132, 1), - error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 149, 1), + error(WarningCode.textDirectionCodePointInLiteral, 13, 1), + error(WarningCode.textDirectionCodePointInLiteral, 30, 1), + error(WarningCode.textDirectionCodePointInLiteral, 47, 1), + error(WarningCode.textDirectionCodePointInLiteral, 64, 1), + error(WarningCode.textDirectionCodePointInLiteral, 81, 1), + error(WarningCode.textDirectionCodePointInLiteral, 98, 1), + error(WarningCode.textDirectionCodePointInLiteral, 115, 1), + error(WarningCode.textDirectionCodePointInLiteral, 132, 1), + error(WarningCode.textDirectionCodePointInLiteral, 149, 1), ], ); } @@ -101,7 +101,7 @@ var u2069 = '\u2069'; var x = 'x'; var u202a = '\u202A\$x'; ''', - [error(WarningCode.TEXT_DIRECTION_CODE_POINT_IN_LITERAL, 26, 1)], + [error(WarningCode.textDirectionCodePointInLiteral, 26, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/throw_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/throw_of_invalid_type_test.dart index 5a30b5de884..6f7a7e3f2d4 100644 --- a/pkg/analyzer/test/src/diagnostics/throw_of_invalid_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/throw_of_invalid_type_test.dart @@ -38,7 +38,7 @@ f(int? a) { throw a; } ''', - [error(CompileTimeErrorCode.THROW_OF_INVALID_TYPE, 20, 1)], + [error(CompileTimeErrorCode.throwOfInvalidType, 20, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/todo_test.dart b/pkg/analyzer/test/src/diagnostics/todo_test.dart index 8137d9a1385..4adb956a82d 100644 --- a/pkg/analyzer/test/src/diagnostics/todo_test.dart +++ b/pkg/analyzer/test/src/diagnostics/todo_test.dart @@ -22,7 +22,7 @@ main() { // FIXME: Implement } ''', - [error(TodoCode.FIXME, 14, 16, text: 'FIXME: Implement')], + [error(TodoCode.fixme, 14, 16, text: 'FIXME: Implement')], ); } @@ -33,7 +33,7 @@ main() { // HACK: This is a hack } ''', - [error(TodoCode.HACK, 14, 20, text: 'HACK: This is a hack')], + [error(TodoCode.hack, 14, 20, text: 'HACK: This is a hack')], ); } @@ -46,8 +46,8 @@ main() { } ''', [ - error(TodoCode.TODO, 14, 15, text: 'TODO: Implement'), - error(TodoCode.TODO, 38, 15, text: 'TODO: Implement'), + error(TodoCode.todo, 14, 15, text: 'TODO: Implement'), + error(TodoCode.todo, 38, 15, text: 'TODO: Implement'), ], ); } @@ -78,25 +78,25 @@ main() { ''', [ error( - TodoCode.TODO, + TodoCode.todo, 14, 64, text: 'TODO(a): Implement something that is too long for one line', ), error( - TodoCode.TODO, + TodoCode.todo, 129, 61, text: 'TODO: Implement something that is too long for one line', ), error( - TodoCode.TODO, + TodoCode.todo, 241, 64, text: 'TODO(a): Implement something that is too long for one line', ), error( - TodoCode.TODO, + TodoCode.todo, 362, 61, text: 'TODO: Implement something that is too long for one line', @@ -112,7 +112,7 @@ main() { // TODO: Implement } ''', - [error(TodoCode.TODO, 14, 15, text: 'TODO: Implement')], + [error(TodoCode.todo, 14, 15, text: 'TODO: Implement')], ); } @@ -136,13 +136,13 @@ main() { ''', [ error( - TodoCode.TODO, + TodoCode.todo, 20, 67, text: 'TODO: Implement something that is too long for one line', ), - error(TodoCode.TODO, 117, 25, text: 'TODO: Implement something'), - error(TodoCode.TODO, 202, 25, text: 'TODO: Implement something'), + error(TodoCode.todo, 117, 25, text: 'TODO: Implement something'), + error(TodoCode.todo, 202, 25, text: 'TODO: Implement something'), ], ); } @@ -154,7 +154,7 @@ main() { /// This is the function documentation void f() {} ''', - [error(TodoCode.TODO, 3, 25, text: 'TODO: Implement something')], + [error(TodoCode.todo, 3, 25, text: 'TODO: Implement something')], ); } @@ -169,7 +169,7 @@ main() { ''', [ error( - TodoCode.TODO, + TodoCode.todo, 14, 61, text: 'TODO: Implement something that is too long for one line', @@ -189,7 +189,7 @@ main() { ''', [ error( - TodoCode.TODO, + TodoCode.todo, 14, 61, text: 'TODO: Implement something that is too long for one line', @@ -209,13 +209,13 @@ main() { ''', [ error( - TodoCode.TODO, + TodoCode.todo, 14, 61, text: 'TODO: Implement something that is too long for one line', ), error( - TodoCode.TODO, + TodoCode.todo, 82, 59, text: 'TODO: This is a separate todo that is accidentally indented', @@ -245,19 +245,19 @@ main() { ''', [ error( - TodoCode.TODO, + TodoCode.todo, 14, 61, text: 'TODO: Implement something that is too long for one line', ), error( - TodoCode.TODO, + TodoCode.todo, 116, 61, text: 'TODO: Implement something that is too long for one line', ), error( - TodoCode.TODO, + TodoCode.todo, 220, 61, text: 'TODO: Implement something that is too long for one line', @@ -273,7 +273,7 @@ main() { // UNDONE: This was undone } ''', - [error(TodoCode.UNDONE, 14, 23, text: 'UNDONE: This was undone')], + [error(TodoCode.undone, 14, 23, text: 'UNDONE: This was undone')], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/top_level_cycle_test.dart b/pkg/analyzer/test/src/diagnostics/top_level_cycle_test.dart index 675f314d8c5..de7f6a5bbac 100644 --- a/pkg/analyzer/test/src/diagnostics/top_level_cycle_test.dart +++ b/pkg/analyzer/test/src/diagnostics/top_level_cycle_test.dart @@ -24,8 +24,8 @@ class A { } ''', [ - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 25, 1), - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 51, 1), + error(CompileTimeErrorCode.topLevelCycle, 25, 1), + error(CompileTimeErrorCode.topLevelCycle, 51, 1), ], ); } @@ -40,8 +40,8 @@ class A { } ''', [ - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 25, 1), - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 66, 1), + error(CompileTimeErrorCode.topLevelCycle, 25, 1), + error(CompileTimeErrorCode.topLevelCycle, 66, 1), ], ); } @@ -53,8 +53,8 @@ var x = y + 1; var y = x + 1; ''', [ - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 4, 1), - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 19, 1), + error(CompileTimeErrorCode.topLevelCycle, 4, 1), + error(CompileTimeErrorCode.topLevelCycle, 19, 1), ], ); } @@ -64,7 +64,7 @@ var y = x + 1; r''' var x = x; ''', - [error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 4, 1)], + [error(CompileTimeErrorCode.topLevelCycle, 4, 1)], ); } @@ -77,7 +77,7 @@ var elems = [ ], ]; ''', - [error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 4, 5)], + [error(CompileTimeErrorCode.topLevelCycle, 4, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_alias_cannot_reference_itself_test.dart b/pkg/analyzer/test/src/diagnostics/type_alias_cannot_reference_itself_test.dart index 657fb0c1f0c..331497d0652 100644 --- a/pkg/analyzer/test/src/diagnostics/type_alias_cannot_reference_itself_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_alias_cannot_reference_itself_test.dart @@ -20,7 +20,7 @@ class TypeAliasCannotReferenceItselfTest extends PubPackageResolutionTest { ''' typedef A>(); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -29,7 +29,7 @@ typedef A>(); ''' typedef A(A b()); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -44,8 +44,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1), - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 46, 1), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 46, 1), ], ); } @@ -55,7 +55,7 @@ main() { ''' typedef A> = void Function(); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -64,7 +64,7 @@ typedef A> = void Function(); r''' typedef F> = F Function(); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -79,8 +79,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 13, 1), - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 40, 1), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 13, 1), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 40, 1), ], ); } @@ -105,8 +105,8 @@ typedef T1 = T2; typedef T2 = T1; ''', [ - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 2), - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 25, 2), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 2), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 25, 2), ], ); } @@ -116,7 +116,7 @@ typedef T2 = T1; ''' typedef T = void Function(T); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -125,7 +125,7 @@ typedef T = void Function(T); ''' typedef T = T; ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -134,7 +134,7 @@ typedef T = T; ''' typedef T = T?; ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -143,7 +143,7 @@ typedef T = T?; ''' typedef T = List; ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -152,7 +152,7 @@ typedef T = List; ''' typedef T> = List; ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -161,7 +161,7 @@ typedef T> = List; ''' typedef A({A a}); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -170,7 +170,7 @@ typedef A({A a}); ''' typedef A([A a]); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -179,7 +179,7 @@ typedef A([A a]); ''' typedef A(A a); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -188,7 +188,7 @@ typedef A(A a); ''' typedef A(List a); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } @@ -217,7 +217,7 @@ class C { ''' typedef A A(); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 10, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 10, 1)], ); } @@ -228,8 +228,8 @@ typedef B A(); typedef A B(); ''', [ - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 10, 1), - error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 25, 1), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 10, 1), + error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 25, 1), ], ); } @@ -239,7 +239,7 @@ typedef A B(); r''' typedef F = (F, int) Function(); ''', - [error(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, 8, 1)], + [error(CompileTimeErrorCode.typeAliasCannotReferenceItself, 8, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_annotation_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/type_annotation_deferred_class_test.dart index 106ac1891c3..8c95dc141fe 100644 --- a/pkg/analyzer/test/src/diagnostics/type_annotation_deferred_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_annotation_deferred_class_test.dart @@ -28,7 +28,7 @@ class C { const C(); } ''', [ error( - CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, + CompileTimeErrorCode.typeAnnotationDeferredClass, 77, 3, messageContains: ["'a.D'"], @@ -48,7 +48,7 @@ import 'lib1.dart' deferred as a; f(var v) { v as a.A; }''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 66, 3)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 66, 3)], ); } @@ -65,7 +65,7 @@ f(var v) { } on a.A { } }''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 74, 3)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 74, 3)], ); } @@ -81,7 +81,7 @@ class C { var v; C(a.A this.v); }''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 71, 3)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 71, 3)], ); } @@ -95,7 +95,7 @@ library root; import 'lib1.dart' deferred as a; a.A? f() { return null; } ''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 48, 4)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 48, 4)], ); } @@ -108,7 +108,7 @@ class A {}'''); library root; import 'lib1.dart' deferred as a; f(a.A g()) {}''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 50, 3)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 50, 3)], ); } @@ -124,8 +124,8 @@ f(var v) { bool b = v is a.A; }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 66, 1), - error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 75, 3), + error(WarningCode.unusedLocalVariable, 66, 1), + error(CompileTimeErrorCode.typeAnnotationDeferredClass, 75, 3), ], ); } @@ -141,7 +141,7 @@ import 'lib1.dart' deferred as a; class C { a.A? m() { return null; } }''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 60, 4)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 60, 4)], ); } @@ -154,7 +154,7 @@ class A {}'''); library root; import 'lib1.dart' deferred as a; f(a.A v) {}''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 50, 3)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 50, 3)], ); } @@ -169,7 +169,7 @@ import 'lib1.dart' deferred as a; class C {} C c = C(); ''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 64, 3)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 64, 3)], ); } @@ -185,8 +185,8 @@ class C {} C c = C(); ''', [ - error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 67, 3), - error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 72, 3), + error(CompileTimeErrorCode.typeAnnotationDeferredClass, 67, 3), + error(CompileTimeErrorCode.typeAnnotationDeferredClass, 72, 3), ], ); } @@ -200,7 +200,7 @@ class A {}'''); library root; import 'lib1.dart' deferred as a; class C {}''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 66, 3)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 66, 3)], ); } @@ -214,7 +214,7 @@ library root; import 'lib1.dart' deferred as a; a.A v = a.A(); ''', - [error(CompileTimeErrorCode.TYPE_ANNOTATION_DEFERRED_CLASS, 48, 3)], + [error(CompileTimeErrorCode.typeAnnotationDeferredClass, 48, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_argument_not_matching_bounds_test.dart b/pkg/analyzer/test/src/diagnostics/type_argument_not_matching_bounds_test.dart index cffd8b645af..178faa87b73 100644 --- a/pkg/analyzer/test/src/diagnostics/type_argument_not_matching_bounds_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_argument_not_matching_bounds_test.dart @@ -24,7 +24,7 @@ mixin C {} class G {} class D = G with C; ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 69, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 69, 1)], ); } @@ -38,7 +38,7 @@ class G { } f() { return const G(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 81, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 81, 1)], ); } @@ -62,12 +62,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 28, 2), - error( - CompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, - 28, - 2, - ), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 28, 2), + error(CompileTimeErrorCode.constConstructorParamTypeMismatch, 28, 2), ], ); } @@ -87,7 +83,7 @@ enum E { v() } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 28, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 28, 6)], ); } @@ -99,7 +95,7 @@ class B {} class G {} class C extends G{} ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 64, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 64, 1)], ); } @@ -110,7 +106,7 @@ class C extends G{} class X {} class Y extends X {} ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 48, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 48, 1)], ); } @@ -125,7 +121,7 @@ void f() { E(0).foo(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 70, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 70, 6)], ); } @@ -140,7 +136,7 @@ void f() { E(0)(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 71, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 71, 6)], ); } @@ -153,7 +149,7 @@ void f(A a) {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 52, 1, contextMessages: [message(testFile, 52, 1)], @@ -169,7 +165,7 @@ extension type A(int it) {} void f(A a) {} ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 53, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 53, 6)], ); } @@ -186,7 +182,7 @@ class C { ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 71, 1, contextMessages: [message(testFile, 69, 4)], @@ -202,7 +198,7 @@ void f() { (() {})(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 36, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 36, 6)], ); } @@ -217,7 +213,7 @@ void f(C c) { c(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 63, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 63, 6)], ); } @@ -229,7 +225,7 @@ void bar() { foo; } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 51, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 51, 6)], ); } @@ -261,7 +257,7 @@ G f() => throw 0; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 48, 1, contextMessages: [message(testFile, 46, 4)], @@ -280,7 +276,7 @@ typedef G f(); ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 56, 1, contextMessages: [message(testFile, 54, 4)], @@ -299,7 +295,7 @@ f(G h()) {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 50, 1, contextMessages: [message(testFile, 48, 4)], @@ -318,7 +314,7 @@ void f(CB> a) {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 119, 5, contextMessages: [message(testFile, 116, 9)], @@ -344,7 +340,7 @@ class B {} class G {} class C implements G{} ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 67, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 67, 1)], ); } @@ -358,7 +354,7 @@ var b = 1 is G; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 61, 1, contextMessages: [message(testFile, 59, 4)], @@ -388,7 +384,7 @@ class A { @A() void f() {} ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 44, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 44, 6)], ); } @@ -404,7 +400,7 @@ typedef B = A; @B() void f() {} ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 66, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 66, 6)], ); } @@ -429,7 +425,7 @@ void g() { f(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 131, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 131, 1)], ); } @@ -447,7 +443,7 @@ main() { print(f('hello', 'world')); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 145, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 145, 6)], ); } @@ -468,7 +464,7 @@ f(PointFactory factory) { print(factory.point('hello', 'world')); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 202, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 202, 6)], ); } @@ -487,7 +483,7 @@ main() { print(f('hello', 'world')); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 140, 6)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 140, 6)], ); } @@ -503,7 +499,7 @@ class C { ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 60, 1, contextMessages: [message(testFile, 58, 4)], @@ -520,7 +516,7 @@ class B {} class G {} f() { return new G(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 65, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 65, 1)], ); } @@ -542,7 +538,7 @@ class C extends B {} class G {} f() { return new G(); } ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 96, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 96, 1)], ); } @@ -554,7 +550,7 @@ class B {} class G {} typedef X = G; ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 60, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 60, 1)], ); } @@ -582,7 +578,7 @@ class B {} class G {} typedef X = G; ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 60, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 60, 1)], ); } @@ -601,7 +597,7 @@ typedef X = A; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 42, 1, contextMessages: [message(testFile, 42, 1)], @@ -619,7 +615,7 @@ void f(X a) {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 58, 6, contextMessages: [message(testFile, 56, 9)], @@ -649,8 +645,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 94, 1), - error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 104, 1), + error(WarningCode.unusedLocalVariable, 94, 1), + error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 104, 1), ], ); } @@ -667,7 +663,7 @@ void main() {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 65, 3, contextMessages: [message(testFile, 65, 3)], @@ -687,7 +683,7 @@ foo(G g) {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 92, 1, contextMessages: [message(testFile, 92, 1), message(testFile, 92, 1)], @@ -706,7 +702,7 @@ F fff = (throw 42); ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 50, 1, contextMessages: [message(testFile, 48, 4)], @@ -753,7 +749,7 @@ f(G g) {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 50, 1, contextMessages: [message(testFile, 48, 4)], @@ -773,8 +769,8 @@ class X { } ''', [ - error(CompileTimeErrorCode.REDIRECT_TO_INVALID_RETURN_TYPE, 99, 4), - error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 101, 1), + error(CompileTimeErrorCode.redirectToInvalidReturnType, 99, 4), + error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 101, 1), ], ); } @@ -837,7 +833,7 @@ C> c = (throw 0); ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 64, 1, contextMessages: [message(testFile, 62, 4)], @@ -854,7 +850,7 @@ var t = C; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 36, 6, contextMessages: [message(testFile, 34, 9)], @@ -871,7 +867,7 @@ var t = Cb; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 56, 6, contextMessages: [message(testFile, 53, 10)], @@ -889,7 +885,7 @@ var t = D; ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 51, 6, contextMessages: [message(testFile, 49, 9)], @@ -909,7 +905,7 @@ class D> {} ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 77, 1, contextMessages: [message(testFile, 75, 4)], @@ -928,7 +924,7 @@ G g = (throw 0); ''', [ error( - CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, + CompileTimeErrorCode.typeArgumentNotMatchingBounds, 48, 1, contextMessages: [message(testFile, 46, 4)], @@ -945,7 +941,7 @@ class B {} mixin G {} class C extends Object with G{} ''', - [error(CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, 76, 1)], + [error(CompileTimeErrorCode.typeArgumentNotMatchingBounds, 76, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_check_is_not_null_test.dart b/pkg/analyzer/test/src/diagnostics/type_check_is_not_null_test.dart index 226c12d140a..ef62d7b9e9e 100644 --- a/pkg/analyzer/test/src/diagnostics/type_check_is_not_null_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_check_is_not_null_test.dart @@ -22,7 +22,7 @@ bool m(i) { return i is! Null; } ''', - [error(WarningCode.TYPE_CHECK_IS_NOT_NULL, 21, 10)], + [error(WarningCode.typeCheckIsNotNull, 21, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_check_is_null_test.dart b/pkg/analyzer/test/src/diagnostics/type_check_is_null_test.dart index 1d5a8fe98f5..3467f603ff7 100644 --- a/pkg/analyzer/test/src/diagnostics/type_check_is_null_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_check_is_null_test.dart @@ -22,7 +22,7 @@ bool m(i) { return i is Null; } ''', - [error(WarningCode.TYPE_CHECK_IS_NULL, 21, 9)], + [error(WarningCode.typeCheckIsNull, 21, 9)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_parameter_referenced_by_static_test.dart b/pkg/analyzer/test/src/diagnostics/type_parameter_referenced_by_static_test.dart index 24d9ec2ff09..4a443ba2983 100644 --- a/pkg/analyzer/test/src/diagnostics/type_parameter_referenced_by_static_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_parameter_referenced_by_static_test.dart @@ -22,7 +22,7 @@ class A { static T? foo; } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 22, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 22, 1)], ); } @@ -33,7 +33,7 @@ class A { static T? get foo => null; } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 22, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 22, 1)], ); } @@ -47,7 +47,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 70, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 70, 1)], ); } @@ -60,7 +60,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 49, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 49, 1)], ); } @@ -71,7 +71,7 @@ class A { static foo(T a) {} } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 26, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 26, 1)], ); } @@ -84,7 +84,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 22, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 22, 1)], ); } @@ -95,7 +95,7 @@ class A { static set foo(T _) {} } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 30, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 30, 1)], ); } @@ -108,7 +108,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 34, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 34, 1)], ); } @@ -119,7 +119,7 @@ extension E on int { static T? foo; } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 33, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 33, 1)], ); } @@ -130,7 +130,7 @@ extension E on int { static T foo() => throw 0; } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 33, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 33, 1)], ); } @@ -141,7 +141,7 @@ mixin A { static T? foo; } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_REFERENCED_BY_STATIC, 22, 1)], + [error(CompileTimeErrorCode.typeParameterReferencedByStatic, 22, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_parameter_supertype_of_its_bound_test.dart b/pkg/analyzer/test/src/diagnostics/type_parameter_supertype_of_its_bound_test.dart index 719e592df34..f7d257cc401 100644 --- a/pkg/analyzer/test/src/diagnostics/type_parameter_supertype_of_its_bound_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_parameter_supertype_of_its_bound_test.dart @@ -21,7 +21,7 @@ class TypeParameterSupertypeOfItsBoundTest extends PubPackageResolutionTest { class A { } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 1)], + [error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 8, 1)], ); } @@ -33,13 +33,7 @@ void m() { local; } ''', - [ - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 24, - 1, - ), - ], + [error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 24, 1)], ); } @@ -53,13 +47,7 @@ void m() { local; } ''', - [ - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 54, - 1, - ), - ], + [error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 54, 1)], ); } @@ -72,7 +60,7 @@ class A { } } ''', - [error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 1)], + [error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 8, 1)], ); } @@ -83,13 +71,7 @@ extension type A(T it) {} class B> {} ''', - [ - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 38, - 1, - ), - ], + [error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 38, 1)], ); } @@ -104,16 +86,8 @@ void m() { } ''', [ - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 54, - 2, - ), - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 72, - 2, - ), + error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 54, 2), + error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 72, 2), ], ); } @@ -126,16 +100,8 @@ extension type A(T it) {} class B, T2 extends T1> {} ''', [ - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 38, - 2, - ), - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 56, - 2, - ), + error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 38, 2), + error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 56, 2), ], ); } @@ -147,12 +113,8 @@ class A { } ''', [ - error(CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, 8, 2), - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 27, - 2, - ), + error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 8, 2), + error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 27, 2), ], ); } @@ -166,16 +128,8 @@ void m() { } ''', [ - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 24, - 2, - ), - error( - CompileTimeErrorCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, - 43, - 2, - ), + error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 24, 2), + error(CompileTimeErrorCode.typeParameterSupertypeOfItsBound, 43, 2), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/type_test_with_non_type_test.dart b/pkg/analyzer/test/src/diagnostics/type_test_with_non_type_test.dart index f31a0ff8435..f0c5ef8cb93 100644 --- a/pkg/analyzer/test/src/diagnostics/type_test_with_non_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_test_with_non_type_test.dart @@ -23,7 +23,7 @@ f(var p) { if (p is A) { } }''', - [error(CompileTimeErrorCode.TYPE_TEST_WITH_NON_TYPE, 33, 1)], + [error(CompileTimeErrorCode.typeTestWithNonType, 33, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/type_test_with_undefined_name_test.dart b/pkg/analyzer/test/src/diagnostics/type_test_with_undefined_name_test.dart index 4e911fce3ce..c43714e5bfa 100644 --- a/pkg/analyzer/test/src/diagnostics/type_test_with_undefined_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/type_test_with_undefined_name_test.dart @@ -22,7 +22,7 @@ f(var p) { if (p is A) { } }''', - [error(CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME, 22, 1)], + [error(CompileTimeErrorCode.typeTestWithUndefinedName, 22, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_annotation_test.dart index 449aa22ca9f..77335f96121 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_annotation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_annotation_test.dart @@ -32,7 +32,7 @@ main() { main() { } ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 0, 11)], + [error(CompileTimeErrorCode.undefinedAnnotation, 0, 11)], ); } @@ -43,7 +43,7 @@ main() { main() { } ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 0, 13)], + [error(CompileTimeErrorCode.undefinedAnnotation, 0, 13)], ); } @@ -53,7 +53,7 @@ main() { @p.A(0) class B {} ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 0, 7)], + [error(CompileTimeErrorCode.undefinedAnnotation, 0, 7)], ); } @@ -65,7 +65,7 @@ import 'dart:math' as p; @p.A(0) class B {} ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 26, 7)], + [error(CompileTimeErrorCode.undefinedAnnotation, 26, 7)], ); } @@ -77,7 +77,7 @@ import 'dart:math' as p; main() { } ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 25, 13)], + [error(CompileTimeErrorCode.undefinedAnnotation, 25, 13)], ); } @@ -89,7 +89,7 @@ class A { static const foo = null; } ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 0, 4)], + [error(CompileTimeErrorCode.undefinedAnnotation, 0, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_class_boolean_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_class_boolean_test.dart index 14d45357529..3c4e15b8579 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_class_boolean_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_class_boolean_test.dart @@ -21,8 +21,8 @@ class UndefinedClassBooleanTest extends PubPackageResolutionTest { f() { boolean v; } ''', [ - error(CompileTimeErrorCode.UNDEFINED_CLASS_BOOLEAN, 6, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 14, 1), + error(CompileTimeErrorCode.undefinedClassBoolean, 6, 7), + error(WarningCode.unusedLocalVariable, 14, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_class_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_class_test.dart index a44c939a9b0..0e6b33838c3 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_class_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_class_test.dart @@ -22,7 +22,7 @@ f() { return const A(); } ''', - [error(CompileTimeErrorCode.CONST_WITH_NON_TYPE, 21, 1)], + [error(CompileTimeErrorCode.constWithNonType, 21, 1)], ); } @@ -33,7 +33,7 @@ import 'dart:core' as core; dynamic x; ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 29, 7)], + [error(CompileTimeErrorCode.undefinedClass, 29, 7)], ); } @@ -44,7 +44,7 @@ import 'a.dart' as p; p.A a; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 8)], ); } @@ -55,7 +55,7 @@ import 'a.dart' show A; A a; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 8)], ); } @@ -67,8 +67,8 @@ import 'a.dart' show B; A a; ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 8), - error(CompileTimeErrorCode.UNDEFINED_CLASS, 25, 1), + error(CompileTimeErrorCode.uriDoesNotExist, 7, 8), + error(CompileTimeErrorCode.undefinedClass, 25, 1), ], ); } @@ -84,7 +84,7 @@ part 'a.g.dart'; _$A a; ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 18, 3)], + [error(CompileTimeErrorCode.undefinedClass, 18, 3)], ); } @@ -95,7 +95,7 @@ part 'a.template.dart'; _$A a; ''', - [error(CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, 5, 17)], + [error(CompileTimeErrorCode.uriHasNotBeenGenerated, 5, 17)], ); } @@ -106,7 +106,7 @@ part 'a.g.dart'; _$A a; ''', - [error(CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, 5, 10)], + [error(CompileTimeErrorCode.uriHasNotBeenGenerated, 5, 10)], ); } @@ -118,8 +118,8 @@ part 'a.g.dart'; A a; ''', [ - error(CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED, 5, 10), - error(CompileTimeErrorCode.UNDEFINED_CLASS, 18, 1), + error(CompileTimeErrorCode.uriHasNotBeenGenerated, 5, 10), + error(CompileTimeErrorCode.undefinedClass, 18, 1), ], ); } @@ -132,8 +132,8 @@ part 'a.dart'; _$A a; ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 8), - error(CompileTimeErrorCode.UNDEFINED_CLASS, 16, 3), + error(CompileTimeErrorCode.uriDoesNotExist, 5, 8), + error(CompileTimeErrorCode.undefinedClass, 16, 3), ], ); } @@ -146,8 +146,8 @@ part 'a.dart'; A a; ''', [ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 8), - error(CompileTimeErrorCode.UNDEFINED_CLASS, 16, 1), + error(CompileTimeErrorCode.uriDoesNotExist, 5, 8), + error(CompileTimeErrorCode.undefinedClass, 16, 1), ], ); } @@ -159,7 +159,7 @@ import 'dart:math' as p; p.A a; ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 26, 3)], + [error(CompileTimeErrorCode.undefinedClass, 26, 3)], ); } @@ -168,7 +168,7 @@ p.A a; ''' f() { new C(); } ''', - [error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 10, 1)], + [error(CompileTimeErrorCode.newWithNonType, 10, 1)], ); } @@ -184,7 +184,7 @@ void f(Record r) {} // @dart = 2.19 void f(Record r) {} ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 23, 6)], + [error(CompileTimeErrorCode.undefinedClass, 23, 6)], ); } @@ -206,8 +206,8 @@ void f(Record r) {} f() { C c; } ''', [ - error(CompileTimeErrorCode.UNDEFINED_CLASS, 6, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 8, 1), + error(CompileTimeErrorCode.undefinedClass, 6, 1), + error(WarningCode.unusedLocalVariable, 8, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_constructor_in_initializer_default_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_constructor_in_initializer_default_test.dart index e18ea688a7c..3c02bbe36c0 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_constructor_in_initializer_default_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_constructor_in_initializer_default_test.dart @@ -39,7 +39,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, + CompileTimeErrorCode.undefinedConstructorInInitializerDefault, 49, 1, ), @@ -70,7 +70,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, + CompileTimeErrorCode.undefinedConstructorInInitializerDefault, 55, 7, ), diff --git a/pkg/analyzer/test/src/diagnostics/undefined_constructor_in_initializer_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_constructor_in_initializer_test.dart index b66e4594d4d..ac946ce5ef8 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_constructor_in_initializer_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_constructor_in_initializer_test.dart @@ -25,7 +25,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, + CompileTimeErrorCode.undefinedConstructorInInitializer, 39, 13, messageContains: ["class 'A'", "named 'named'"], diff --git a/pkg/analyzer/test/src/diagnostics/undefined_enum_constant_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_enum_constant_test.dart index e04451411b0..362c3eac6dc 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_enum_constant_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_enum_constant_test.dart @@ -32,7 +32,7 @@ E e() { return E.TWO; } ''', - [error(CompileTimeErrorCode.UNDEFINED_ENUM_CONSTANT, 34, 3)], + [error(CompileTimeErrorCode.undefinedEnumConstant, 34, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_enum_constructor_named_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_enum_constructor_named_test.dart index dcb0d8f37ab..dfc323b2901 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_enum_constructor_named_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_enum_constructor_named_test.dart @@ -22,7 +22,7 @@ enum E { v.named() } ''', - [error(CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_NAMED, 13, 5)], + [error(CompileTimeErrorCode.undefinedEnumConstructorNamed, 13, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_enum_constructor_unnamed_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_enum_constructor_unnamed_test.dart index 00958f01327..e2560298362 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_enum_constructor_unnamed_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_enum_constructor_unnamed_test.dart @@ -23,7 +23,7 @@ enum E { const E.named(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_UNNAMED, 11, 1)], + [error(CompileTimeErrorCode.undefinedEnumConstructorUnnamed, 11, 1)], ); } @@ -35,7 +35,7 @@ enum E { const E.named(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_ENUM_CONSTRUCTOR_UNNAMED, 11, 1)], + [error(CompileTimeErrorCode.undefinedEnumConstructorUnnamed, 11, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_extension_getter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_extension_getter_test.dart index 51c92690e4d..2d11134b31f 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_extension_getter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_extension_getter_test.dart @@ -34,7 +34,7 @@ f() { E('a').g; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, 40, 1)], + [error(CompileTimeErrorCode.undefinedExtensionGetter, 40, 1)], ); } @@ -48,7 +48,7 @@ f() { E(0).foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, 56, 3)], + [error(CompileTimeErrorCode.undefinedExtensionGetter, 56, 3)], ); } @@ -62,7 +62,7 @@ f() { E(0).foo += 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, 56, 3)], + [error(CompileTimeErrorCode.undefinedExtensionGetter, 56, 3)], ); } @@ -72,7 +72,7 @@ f() { extension E on Object {} var a = E.v; ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, 35, 1)], + [error(CompileTimeErrorCode.undefinedExtensionGetter, 35, 1)], ); } @@ -84,7 +84,7 @@ void f() { E.v; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_GETTER, 40, 1)], + [error(CompileTimeErrorCode.undefinedExtensionGetter, 40, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_extension_method_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_extension_method_test.dart index 961c1c14e76..e4b2b69925f 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_extension_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_extension_method_test.dart @@ -34,7 +34,7 @@ f() { E('a').m(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD, 40, 1)], + [error(CompileTimeErrorCode.undefinedExtensionMethod, 40, 1)], ); var node = findNode.methodInvocation('m();'); @@ -70,7 +70,7 @@ MethodInvocation extension E on Object {} var a = E.m(); ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD, 35, 1)], + [error(CompileTimeErrorCode.undefinedExtensionMethod, 35, 1)], ); } @@ -82,7 +82,7 @@ void f() { E.m(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_METHOD, 40, 1)], + [error(CompileTimeErrorCode.undefinedExtensionMethod, 40, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_extension_operator_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_extension_operator_test.dart index 1790b9b2383..79ec1014156 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_extension_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_extension_operator_test.dart @@ -34,7 +34,7 @@ f() { E('a') + 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 40, 1)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 40, 1)], ); var node = findNode.binary('+ 1'); @@ -87,7 +87,7 @@ f(A a) { E(a)[0]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 48, 3)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 48, 3)], ); } @@ -104,7 +104,7 @@ f(A a) { E(a)[0]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 93, 3)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 93, 3)], ); } @@ -136,7 +136,7 @@ f(A a) { E(a)[0] += 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 83, 3)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 83, 3)], ); } @@ -152,8 +152,8 @@ f(A a) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 48, 3), - error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 48, 3), + error(CompileTimeErrorCode.undefinedExtensionOperator, 48, 3), + error(CompileTimeErrorCode.undefinedExtensionOperator, 48, 3), ], ); } @@ -171,7 +171,7 @@ f(A a) { E(a)[0] += 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 93, 3)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 93, 3)], ); } @@ -188,7 +188,7 @@ f(A a) { E(a)[0] = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 83, 3)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 83, 3)], ); } @@ -203,7 +203,7 @@ f(A a) { E(a)[0] = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 48, 3)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 48, 3)], ); } @@ -240,7 +240,7 @@ f() { -E('a'); } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_OPERATOR, 33, 1)], + [error(CompileTimeErrorCode.undefinedExtensionOperator, 33, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_extension_setter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_extension_setter_test.dart index 83063f60e73..ba9a5409b21 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_extension_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_extension_setter_test.dart @@ -34,7 +34,7 @@ f() { E(0).foo = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, 35, 3)], + [error(CompileTimeErrorCode.undefinedExtensionSetter, 35, 3)], ); } @@ -48,7 +48,7 @@ f() { E(0).foo = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, 56, 3)], + [error(CompileTimeErrorCode.undefinedExtensionSetter, 56, 3)], ); } @@ -62,7 +62,7 @@ f() { E(0).foo += 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, 56, 3)], + [error(CompileTimeErrorCode.undefinedExtensionSetter, 56, 3)], ); } @@ -82,7 +82,7 @@ f(C c) { Ext(c).id++; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, 117, 2)], + [error(CompileTimeErrorCode.undefinedExtensionSetter, 117, 2)], ); } @@ -94,7 +94,7 @@ void f() { E.foo = 3; } ''', - [error(CompileTimeErrorCode.UNDEFINED_EXTENSION_SETTER, 37, 3)], + [error(CompileTimeErrorCode.undefinedExtensionSetter, 37, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart index 14f4c4752d8..b2c5cbcaf3b 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart @@ -27,7 +27,7 @@ f(C c) { c.foo += 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 46, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 46, 3)], ); } @@ -42,7 +42,7 @@ f() { C.foo += 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 50, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 50, 3)], ); } @@ -55,7 +55,7 @@ main() { print(A().); } ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 33, 1)], + [error(ParserErrorCode.missingIdentifier, 33, 1)], ); } @@ -74,7 +74,7 @@ extension E on C { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 95, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 95, 3)], ); } @@ -88,7 +88,7 @@ f() { 0.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 58, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 58, 3)], ); } @@ -98,7 +98,7 @@ f() { extension E on int {} var a = 3.v; ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 32, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 32, 1)], ); } @@ -113,7 +113,7 @@ f(C c) { c.a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 46, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 46, 1)], ); } @@ -132,7 +132,7 @@ f(C c) { c.foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 93, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 93, 3)], ); } @@ -149,7 +149,7 @@ extension E on Type { int get foo => 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER_ON_FUNCTION_TYPE, 58, 3)], + [error(CompileTimeErrorCode.undefinedGetterOnFunctionType, 58, 3)], ); } @@ -239,7 +239,7 @@ f(int x) { return [if (x is String) x.length]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 40, 6)], ); } @@ -258,7 +258,7 @@ f(int x) { return {if (x is String) x : x.length}; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 44, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 44, 6)], ); } @@ -277,7 +277,7 @@ f(int x) { return {if (x is String) x.length}; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 40, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 40, 6)], ); } @@ -298,7 +298,7 @@ f(int x) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 38, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 38, 6)], ); } @@ -318,7 +318,7 @@ f(Object x) { class T {} f(T e) { return e.m; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 29, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 29, 1)], ); } @@ -329,7 +329,7 @@ mixin M { f() { return this.m; } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 30, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 30, 1)], ); } @@ -342,7 +342,7 @@ f(C? c) { c..new; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 27, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 27, 3)], ); } @@ -353,7 +353,7 @@ f(dynamic d) { d.new; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 19, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 19, 3)], ); } @@ -366,7 +366,7 @@ f(C? c1, C c2) { (c1 ?? c2).new; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 42, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 42, 3)], ); } @@ -379,7 +379,7 @@ f(C? c) { c?.new; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 27, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 27, 3)], ); } @@ -396,7 +396,7 @@ f(D d) { d.c.new; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 60, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 60, 3)], ); } @@ -409,7 +409,7 @@ f(C c) { c.new; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 25, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 25, 3)], ); } @@ -420,7 +420,7 @@ f(T t) { t.new; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 16, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 16, 3)], ); } @@ -432,7 +432,7 @@ m() { _null.foo; } ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 28, 3)], + [error(CompileTimeErrorCode.invalidUseOfNullValue, 28, 3)], ); } @@ -443,7 +443,7 @@ f(Object o) { return o.call; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 25, 4)], + [error(CompileTimeErrorCode.undefinedGetter, 25, 4)], ); } @@ -456,7 +456,7 @@ void f(Y y) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 66, 6)], + [error(CompileTimeErrorCode.undefinedGetter, 66, 6)], ); } @@ -467,7 +467,7 @@ void f(Function a) { return (a).call; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 30, 8)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 30, 8)], ); } @@ -491,7 +491,7 @@ class A { } var a = A?.x; ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 37, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 37, 2)], ); } @@ -505,7 +505,7 @@ class C extends S {} f(var p) { f(C.g); }''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 75, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 75, 1)], ); } @@ -523,7 +523,7 @@ f(C c) { g(c).a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 92, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 92, 1)], ); } @@ -534,7 +534,7 @@ class C {} f(var p) { f(C.m); }''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 28, 1)], + [error(CompileTimeErrorCode.undefinedGetter, 28, 1)], ); } @@ -548,7 +548,7 @@ main() { T..foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_GETTER, 54, 3)], + [error(CompileTimeErrorCode.undefinedGetter, 54, 3)], ); } @@ -559,8 +559,8 @@ class A {} f() => A?.hashCode; ''', [ - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 19, 2), - error(CompileTimeErrorCode.UNDEFINED_GETTER, 21, 8), + error(StaticWarningCode.invalidNullAwareOperator, 19, 2), + error(CompileTimeErrorCode.undefinedGetter, 21, 8), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_hidden_name_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_hidden_name_test.dart index 6596e5b7ff2..3f03abe8df0 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_hidden_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_hidden_name_test.dart @@ -21,7 +21,7 @@ class UndefinedHiddenNameTest extends PubPackageResolutionTest { r''' export 'lib1.dart' hide a; ''', - [error(WarningCode.UNDEFINED_HIDDEN_NAME, 24, 1)], + [error(WarningCode.undefinedHiddenName, 24, 1)], ); } @@ -32,8 +32,8 @@ export 'lib1.dart' hide a; import 'lib1.dart' hide a; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), - error(WarningCode.UNDEFINED_HIDDEN_NAME, 24, 1), + error(WarningCode.unusedImport, 7, 11), + error(WarningCode.undefinedHiddenName, 24, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_identifier_await_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_identifier_await_test.dart index f7ec537078c..20e400a622a 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_identifier_await_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_identifier_await_test.dart @@ -20,7 +20,7 @@ class UndefinedIdentifierAwaitTest extends PubPackageResolutionTest { ''' void a() { await; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER_AWAIT, 11, 5)], + [error(CompileTimeErrorCode.undefinedIdentifierAwait, 11, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart index 4cb5dab314c..c8905161595 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart @@ -28,8 +28,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 12, 3), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 12, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 12, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 12, 3), ], ); } @@ -47,8 +47,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 20, 3), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 20, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 20, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 20, 3), ], ); } @@ -65,8 +65,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 12, 3), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 12, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 12, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 12, 3), ], ); } @@ -84,8 +84,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 24, 3), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 24, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 24, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 24, 3), ], ); } @@ -102,8 +102,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 12, 3), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 12, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 12, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 12, 3), ], ); } @@ -121,8 +121,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 20, 3), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 20, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 20, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 20, 3), ], ); } @@ -144,8 +144,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 29, 3), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 29, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 29, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 29, 3), ], ); } @@ -168,8 +168,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 33, 3), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 33, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 33, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 33, 3), ], ); } @@ -191,8 +191,8 @@ class Annotation { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 29, 3), - error(CompileTimeErrorCode.CONST_WITH_NON_CONSTANT_ARGUMENT, 29, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 29, 3), + error(CompileTimeErrorCode.constWithNonConstantArgument, 29, 3), ], ); } @@ -204,7 +204,7 @@ void f() { (x) = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 14, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 14, 1)], ); } @@ -216,8 +216,8 @@ void f() { class A { }''', [ - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 5, 1), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 17, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 5, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 17, 1), ], ); } @@ -231,7 +231,7 @@ void f() { foo += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 32, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 32, 3)], ); } @@ -242,7 +242,7 @@ void f() { foo += 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 13, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 13, 3)], ); } @@ -253,7 +253,7 @@ f(var l) { for (e in l) { } }''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 18, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 18, 1)], ); } @@ -273,8 +273,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 25, 1), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 40, 1), + error(WarningCode.unusedLocalVariable, 25, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 40, 1), ], ); } @@ -288,7 +288,7 @@ void f() { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 26, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 26, 1)], ); } @@ -311,8 +311,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 17, 1), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 31, 1), + error(WarningCode.unusedLocalVariable, 17, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 31, 1), ], ); } @@ -322,7 +322,7 @@ f() { ''' int a() => b; ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 11, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 11, 1)], ); } @@ -348,7 +348,7 @@ main() { List; String; }''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 49, 6)], + [error(CompileTimeErrorCode.undefinedIdentifier, 49, 6)], ); } @@ -367,7 +367,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 96, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 96, 3)], ); } @@ -376,7 +376,7 @@ class B extends A { ''' var a = b; ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 8, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 8, 1)], ); } @@ -385,7 +385,7 @@ var a = b; ''' f() { C.m(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 6, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 6, 1)], ); } @@ -398,7 +398,7 @@ void f() { foo++; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 32, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 32, 3)], ); } @@ -411,7 +411,7 @@ void f() { ++foo; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 34, 3)], + [error(CompileTimeErrorCode.undefinedIdentifier, 34, 3)], ); } @@ -430,8 +430,8 @@ class B extends A { } }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 58, 1), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 62, 4), + error(WarningCode.unusedLocalVariable, 58, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 62, 4), ], ); } @@ -450,7 +450,7 @@ class B extends A { _foo = 42; } }''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 54, 4)], + [error(CompileTimeErrorCode.undefinedIdentifier, 54, 4)], ); } @@ -471,7 +471,7 @@ main() { print(is String); } ''', - [error(ParserErrorCode.MISSING_IDENTIFIER, 29, 2)], + [error(ParserErrorCode.missingIdentifier, 29, 2)], ); } @@ -484,8 +484,8 @@ void f(int p) { } ''', [ - error(ParserErrorCode.MISSING_IDENTIFIER, 32, 1), - error(CompileTimeErrorCode.UNDEFINED_GETTER, 32, 1), + error(ParserErrorCode.missingIdentifier, 32, 1), + error(CompileTimeErrorCode.undefinedGetter, 32, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart index cec6c03e1a9..0f5183f5664 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart @@ -26,7 +26,7 @@ main() { ''', [ error( - CompileTimeErrorCode.UNDEFINED_METHOD, + CompileTimeErrorCode.undefinedMethod, 76, 8, messageContains: ["type 'bool'"], @@ -60,7 +60,7 @@ f(B b) { b.a(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 33, 1)], + [error(CompileTimeErrorCode.undefinedMethod, 33, 1)], ); } @@ -80,7 +80,7 @@ f(C c) { c.a(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 33, 1)], + [error(CompileTimeErrorCode.undefinedMethod, 33, 1)], ); } @@ -99,7 +99,7 @@ extension E on C { } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 27, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 27, 3)], ); } @@ -118,7 +118,7 @@ extension E on C { set foo(int x) {} ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 27, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 27, 3)], ); } @@ -149,7 +149,7 @@ extension E on Type { void foo() {} } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD_ON_FUNCTION_TYPE, 58, 3)], + [error(CompileTimeErrorCode.undefinedMethodOnFunctionType, 58, 3)], ); } @@ -197,7 +197,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 85, 1)], + [error(CompileTimeErrorCode.undefinedMethod, 85, 1)], ); } @@ -218,7 +218,7 @@ extension E2 on C { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 123, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 123, 3)], ); } @@ -231,7 +231,7 @@ class C { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 22, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 22, 3)], ); } @@ -243,7 +243,7 @@ f(C c) { c..abs(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 25, 3)], ); } @@ -253,7 +253,7 @@ f(C c) { enum E { A } f() => E.abs(); ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 22, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 22, 3)], ); } @@ -265,7 +265,7 @@ f(M m) { m.abs(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 24, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 24, 3)], ); } @@ -277,7 +277,7 @@ f(M m) { m..abs(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 25, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 25, 3)], ); } @@ -289,7 +289,7 @@ class A { } f() { A?.m(); } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 40, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 40, 2)], ); } @@ -306,7 +306,7 @@ f(C c) { c.a(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 68, 1)], + [error(CompileTimeErrorCode.undefinedMethod, 68, 1)], ); } @@ -326,7 +326,7 @@ void main() { B.named(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 96, 5)], + [error(CompileTimeErrorCode.undefinedMethod, 96, 5)], ); } @@ -339,7 +339,7 @@ void f() { A.foo(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 45, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 45, 3)], ); } @@ -352,7 +352,7 @@ void f() { A.foo(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 39, 3)], + [error(CompileTimeErrorCode.undefinedMethod, 39, 3)], ); } @@ -369,7 +369,7 @@ f(C c) { c.c(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_METHOD, 61, 1)], + [error(CompileTimeErrorCode.undefinedMethod, 61, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_named_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_named_parameter_test.dart index 3a2e800ff9f..da743f9e8e6 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_named_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_named_parameter_test.dart @@ -25,7 +25,7 @@ main() { const A(p: 0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, 44, 1)], + [error(CompileTimeErrorCode.undefinedNamedParameter, 44, 1)], ); } @@ -39,7 +39,7 @@ main() { A(p: 0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, 32, 1)], + [error(CompileTimeErrorCode.undefinedNamedParameter, 32, 1)], ); } @@ -51,7 +51,7 @@ enum E { const E(); } ''', - [error(CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, 13, 1)], + [error(CompileTimeErrorCode.undefinedNamedParameter, 13, 1)], ); } @@ -62,7 +62,7 @@ f({a, b}) {} main() { f(c: 1); }''', - [error(CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, 26, 1)], + [error(CompileTimeErrorCode.undefinedNamedParameter, 26, 1)], ); } @@ -76,7 +76,7 @@ main() { A().m(p: 0); } ''', - [error(CompileTimeErrorCode.UNDEFINED_NAMED_PARAMETER, 38, 1)], + [error(CompileTimeErrorCode.undefinedNamedParameter, 38, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_operator_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_operator_test.dart index 4ed49f0739d..44140c41a8e 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_operator_test.dart @@ -26,7 +26,7 @@ class B { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 58, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 58, 2)], ); } @@ -40,7 +40,7 @@ f(var a) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 44, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 44, 1)], ); } @@ -50,7 +50,7 @@ f(var a) { enum E { A } f(E e) => e + 1; ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 25, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 25, 1)], ); } @@ -67,7 +67,7 @@ f(var a) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 87, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 87, 1)], ); } @@ -77,7 +77,7 @@ f(var a) { mixin M {} f(M m) => m + 1; ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 23, 1)], ); } @@ -91,8 +91,8 @@ f(A a) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 3), - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 3), + error(CompileTimeErrorCode.undefinedOperator, 24, 3), + error(CompileTimeErrorCode.undefinedOperator, 24, 3), ], ); } @@ -118,7 +118,7 @@ f(E e) { e[0]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 25, 3)], + [error(CompileTimeErrorCode.undefinedOperator, 25, 3)], ); } @@ -151,7 +151,7 @@ f(A a) { a[0]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 125, 3)], + [error(CompileTimeErrorCode.undefinedOperator, 125, 3)], ); } @@ -164,7 +164,7 @@ f(A a) { a[0]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 3)], + [error(CompileTimeErrorCode.undefinedOperator, 24, 3)], ); } @@ -176,7 +176,7 @@ f(M m) { m[0]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3)], + [error(CompileTimeErrorCode.undefinedOperator, 23, 3)], ); } @@ -187,7 +187,7 @@ f(Null x) { x[0]; } ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 15, 1)], + [error(CompileTimeErrorCode.invalidUseOfNullValue, 15, 1)], ); } @@ -206,7 +206,7 @@ f(A a) { a[0] = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 125, 3)], + [error(CompileTimeErrorCode.undefinedOperator, 125, 3)], ); } @@ -233,7 +233,7 @@ f(A a) { a[0] = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 3)], + [error(CompileTimeErrorCode.undefinedOperator, 24, 3)], ); } @@ -246,8 +246,8 @@ f(A a) { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3), - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3), + error(CompileTimeErrorCode.undefinedOperator, 23, 3), + error(CompileTimeErrorCode.undefinedOperator, 23, 3), ], ); } @@ -260,7 +260,7 @@ f(A a) { a[0]; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3)], + [error(CompileTimeErrorCode.undefinedOperator, 23, 3)], ); } @@ -272,7 +272,7 @@ f(A a) { a[0] = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 3)], + [error(CompileTimeErrorCode.undefinedOperator, 23, 3)], ); } @@ -284,7 +284,7 @@ m() { x - 3; } ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 20, 1)], + [error(CompileTimeErrorCode.invalidUseOfNullValue, 20, 1)], ); } @@ -297,8 +297,8 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 20, 2), + error(WarningCode.unusedLocalVariable, 13, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 20, 2), ], ); } @@ -311,7 +311,7 @@ m() { x + 3; } ''', - [error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 20, 1)], + [error(CompileTimeErrorCode.invalidUseOfNullValue, 20, 1)], ); } @@ -323,7 +323,7 @@ f(A a) { a + 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 24, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 24, 1)], ); } @@ -336,8 +336,8 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 20, 2), + error(WarningCode.unusedLocalVariable, 13, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 20, 2), ], ); } @@ -351,8 +351,8 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 19, 2), + error(WarningCode.unusedLocalVariable, 13, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 19, 2), ], ); } @@ -367,7 +367,7 @@ f(var a) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 43, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 43, 2)], ); } @@ -384,7 +384,7 @@ f(var a) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 101, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 101, 2)], ); } @@ -396,7 +396,7 @@ f(M m) { m++; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 23, 2)], ); } @@ -408,7 +408,7 @@ f(A a) { a++; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 23, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 23, 2)], ); } @@ -421,8 +421,8 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 19, 2), + error(WarningCode.unusedLocalVariable, 13, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 19, 2), ], ); } @@ -436,8 +436,8 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 18, 2), + error(WarningCode.unusedLocalVariable, 13, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 18, 2), ], ); } @@ -452,7 +452,7 @@ f(var a) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 42, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 42, 2)], ); } @@ -469,7 +469,7 @@ f(var a) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 100, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 100, 2)], ); } @@ -481,7 +481,7 @@ f(M m) { -m; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 22, 1)], + [error(CompileTimeErrorCode.undefinedOperator, 22, 1)], ); } @@ -493,7 +493,7 @@ f(A a) { ++a; } ''', - [error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 22, 2)], + [error(CompileTimeErrorCode.undefinedOperator, 22, 2)], ); } @@ -506,8 +506,8 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 18, 2), + error(WarningCode.unusedLocalVariable, 13, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 18, 2), ], ); } @@ -528,8 +528,8 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 18, 1), + error(WarningCode.unusedLocalVariable, 13, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 18, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart index 1a109f1deed..d9953f0c421 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart @@ -22,7 +22,7 @@ class UndefinedPrefixedNameTest extends PubPackageResolutionTest { import 'lib.dart' as p; f() => p.c; ''', - [error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 33, 1)], + [error(CompileTimeErrorCode.undefinedPrefixedName, 33, 1)], ); } @@ -35,7 +35,7 @@ void f() { p.new; } ''', - [error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 39, 3)], + [error(CompileTimeErrorCode.undefinedPrefixedName, 39, 3)], ); } @@ -48,7 +48,7 @@ f() { p.c = 0; } ''', - [error(CompileTimeErrorCode.UNDEFINED_PREFIXED_NAME, 34, 1)], + [error(CompileTimeErrorCode.undefinedPrefixedName, 34, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_referenced_parameter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_referenced_parameter_test.dart index f0f9366ed84..afc4421e7d9 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_referenced_parameter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_referenced_parameter_test.dart @@ -31,7 +31,7 @@ class Foo { int foo([int? value]) => value ?? 0; } ''', - [error(WarningCode.UNDEFINED_REFERENCED_PARAMETER, 84, 7)], + [error(WarningCode.undefinedReferencedParameter, 84, 7)], ); } @@ -54,7 +54,7 @@ import 'package:meta/meta.dart'; @UseResult.unless(parameterDefined: 'undef') int foo([int? value]) => value ?? 0; ''', - [error(WarningCode.UNDEFINED_REFERENCED_PARAMETER, 70, 7)], + [error(WarningCode.undefinedReferencedParameter, 70, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart index f500d895c03..db8a3ae9d7c 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart @@ -28,7 +28,7 @@ extension E on Type { set foo(int value) {} } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER_ON_FUNCTION_TYPE, 58, 3)], + [error(CompileTimeErrorCode.undefinedSetterOnFunctionType, 58, 3)], ); } @@ -66,7 +66,7 @@ f(T e1) { e1.m = 0; } ''', [ error( - CompileTimeErrorCode.UNDEFINED_SETTER, + CompileTimeErrorCode.undefinedSetter, 24, 1, messageContains: ["the type 'T'"], @@ -82,7 +82,7 @@ mixin M { f() { this.m = 0; } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 23, 1)], + [error(CompileTimeErrorCode.undefinedSetter, 23, 1)], ); } @@ -99,7 +99,7 @@ f(var a) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 80, 1)], + [error(CompileTimeErrorCode.undefinedSetter, 80, 1)], ); } @@ -113,7 +113,7 @@ f(var a) { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 43, 1)], + [error(CompileTimeErrorCode.undefinedSetter, 43, 1)], ); } @@ -126,7 +126,7 @@ f(C? c) { c..new = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 27, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 27, 3)], ); } @@ -137,7 +137,7 @@ f(dynamic d) { d.new = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 19, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 19, 3)], ); } @@ -150,7 +150,7 @@ f(C c) { c.new = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 25, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 25, 3)], ); } @@ -163,7 +163,7 @@ f() { C.new = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 22, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 22, 3)], ); } @@ -176,7 +176,7 @@ f(C? c) { c?.new = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 27, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 27, 3)], ); } @@ -187,7 +187,7 @@ f(T t) { t.new = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 16, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 16, 3)], ); } @@ -232,7 +232,7 @@ class A { } f() { A?.x = 1; } ''', - [error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 35, 2)], + [error(StaticWarningCode.invalidNullAwareOperator, 35, 2)], ); } @@ -248,7 +248,7 @@ f(var p) { }''', [ error( - CompileTimeErrorCode.UNDEFINED_SETTER, + CompileTimeErrorCode.undefinedSetter, 75, 1, messageContains: ["type 'C'"], @@ -270,7 +270,7 @@ f(C c) { c.a = 2; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 72, 1)], + [error(CompileTimeErrorCode.undefinedSetter, 72, 1)], ); assertResolvedNodeText(findNode.assignment('a ='), r''' @@ -307,7 +307,7 @@ AssignmentExpression class A {} f() { A.B = 0;} ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 19, 1)], + [error(CompileTimeErrorCode.undefinedSetter, 19, 1)], ); } @@ -321,7 +321,7 @@ main() { T..foo = 42; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 54, 3)], + [error(CompileTimeErrorCode.undefinedSetter, 54, 3)], ); } @@ -336,7 +336,7 @@ f(C c) { c.a = 1; } ''', - [error(CompileTimeErrorCode.UNDEFINED_SETTER, 46, 1)], + [error(CompileTimeErrorCode.undefinedSetter, 46, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_shown_name_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_shown_name_test.dart index 9a2f92b08ae..bed3f1bc2cc 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_shown_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_shown_name_test.dart @@ -21,7 +21,7 @@ class UndefinedShownNameTest extends PubPackageResolutionTest { r''' export 'lib1.dart' show a; ''', - [error(WarningCode.UNDEFINED_SHOWN_NAME, 24, 1)], + [error(WarningCode.undefinedShownName, 24, 1)], ); } @@ -32,8 +32,8 @@ export 'lib1.dart' show a; import 'lib1.dart' show a; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 11), - error(WarningCode.UNDEFINED_SHOWN_NAME, 24, 1), + error(WarningCode.unusedImport, 7, 11), + error(WarningCode.undefinedShownName, 24, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_super_getter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_super_getter_test.dart index 4e15731126c..98bd44d5b4f 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_super_getter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_super_getter_test.dart @@ -25,7 +25,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, 58, 1)], + [error(CompileTimeErrorCode.undefinedSuperGetter, 58, 1)], ); } @@ -39,7 +39,7 @@ enum E { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_GETTER, 37, 3)], + [error(CompileTimeErrorCode.undefinedSuperGetter, 37, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_super_operator_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_super_operator_test.dart index e46f70aab63..bdc75d5c7df 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_super_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_super_operator_test.dart @@ -25,7 +25,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 70, 1)], + [error(CompileTimeErrorCode.undefinedSuperOperator, 70, 1)], ); } @@ -40,8 +40,8 @@ class B extends A { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 70, 7), - error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 70, 7), + error(CompileTimeErrorCode.undefinedSuperOperator, 70, 7), + error(CompileTimeErrorCode.undefinedSuperOperator, 70, 7), ], ); } @@ -56,7 +56,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 70, 11)], + [error(CompileTimeErrorCode.undefinedSuperOperator, 70, 11)], ); } @@ -70,7 +70,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 71, 7)], + [error(CompileTimeErrorCode.undefinedSuperOperator, 71, 7)], ); } @@ -84,7 +84,7 @@ enum E { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 37, 1)], + [error(CompileTimeErrorCode.undefinedSuperOperator, 37, 1)], ); } @@ -114,8 +114,8 @@ enum E { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 36, 3), - error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 36, 3), + error(CompileTimeErrorCode.undefinedSuperOperator, 36, 3), + error(CompileTimeErrorCode.undefinedSuperOperator, 36, 3), ], ); } @@ -146,7 +146,7 @@ enum E { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 36, 3)], + [error(CompileTimeErrorCode.undefinedSuperOperator, 36, 3)], ); } @@ -160,7 +160,7 @@ enum E { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_OPERATOR, 36, 3)], + [error(CompileTimeErrorCode.undefinedSuperOperator, 36, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/undefined_super_setter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_super_setter_test.dart index 7cda48d51a9..74a32b2ba8e 100644 --- a/pkg/analyzer/test/src/diagnostics/undefined_super_setter_test.dart +++ b/pkg/analyzer/test/src/diagnostics/undefined_super_setter_test.dart @@ -25,7 +25,7 @@ class B extends A { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_SETTER, 49, 1)], + [error(CompileTimeErrorCode.undefinedSuperSetter, 49, 1)], ); } @@ -39,7 +39,7 @@ enum E { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_SUPER_SETTER, 37, 3)], + [error(CompileTimeErrorCode.undefinedSuperSetter, 37, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unignorable_ignore_test.dart b/pkg/analyzer/test/src/diagnostics/unignorable_ignore_test.dart index 216bc02960f..ede3261f78a 100644 --- a/pkg/analyzer/test/src/diagnostics/unignorable_ignore_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unignorable_ignore_test.dart @@ -39,7 +39,7 @@ class UnignorableIgnoreTest extends PubPackageResolutionTest // ignore_for_file: undefined_annotation @x int a = 0; ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 41, 2)], + [error(CompileTimeErrorCode.undefinedAnnotation, 41, 2)], ); } @@ -52,7 +52,7 @@ class UnignorableIgnoreTest extends PubPackageResolutionTest // ignore_for_file: UNDEFINED_ANNOTATION @x int a = 0; ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 41, 2)], + [error(CompileTimeErrorCode.undefinedAnnotation, 41, 2)], ); } @@ -65,7 +65,7 @@ class UnignorableIgnoreTest extends PubPackageResolutionTest // ignore: undefined_annotation @x int a = 0; ''', - [error(CompileTimeErrorCode.UNDEFINED_ANNOTATION, 32, 2)], + [error(CompileTimeErrorCode.undefinedAnnotation, 32, 2)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_cast_pattern_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_cast_pattern_test.dart index 5688ef8b8b1..1d5ac90a2b9 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_cast_pattern_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_cast_pattern_test.dart @@ -23,8 +23,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(WarningCode.UNNECESSARY_CAST_PATTERN, 35, 2), + error(WarningCode.unusedLocalVariable, 33, 1), + error(WarningCode.unnecessaryCastPattern, 35, 2), ], ); } @@ -37,8 +37,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(WarningCode.UNNECESSARY_CAST_PATTERN, 35, 2), + error(WarningCode.unusedLocalVariable, 33, 1), + error(WarningCode.unnecessaryCastPattern, 35, 2), ], ); } @@ -50,7 +50,7 @@ void f(num x) { if (x case var z as int) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1)], + [error(WarningCode.unusedLocalVariable, 33, 1)], ); } @@ -64,7 +64,7 @@ void f(A x) { if (x case var z as B) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1)], + [error(WarningCode.unusedLocalVariable, 54, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart index 82d18baa30a..ffa0661ad70 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart @@ -45,7 +45,7 @@ dynamic f(bool c, int a, int b) { return c ? a : b as int; } ''', - [error(WarningCode.UNNECESSARY_CAST, 51, 8)], + [error(WarningCode.unnecessaryCast, 51, 8)], ); } @@ -56,7 +56,7 @@ dynamic f(bool c, int a, int b) { return c ? a as int : b; } ''', - [error(WarningCode.UNNECESSARY_CAST, 47, 8)], + [error(WarningCode.unnecessaryCast, 47, 8)], ); } @@ -67,7 +67,7 @@ dynamic f(bool c, int a, dynamic b) { return c ? a as int : b; } ''', - [error(WarningCode.UNNECESSARY_CAST, 51, 8)], + [error(WarningCode.unnecessaryCast, 51, 8)], ); } @@ -79,8 +79,8 @@ dynamic f(bool c, int a, int b) { } ''', [ - error(WarningCode.UNNECESSARY_CAST, 47, 8), - error(WarningCode.UNNECESSARY_CAST, 58, 8), + error(WarningCode.unnecessaryCast, 47, 8), + error(WarningCode.unnecessaryCast, 58, 8), ], ); } @@ -92,7 +92,7 @@ dynamic f(bool c, int a, int b) { return c ? a : b as int; } ''', - [error(WarningCode.UNNECESSARY_CAST, 51, 8)], + [error(WarningCode.unnecessaryCast, 51, 8)], ); } @@ -111,7 +111,7 @@ void f() { x as int; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 13, 1)], + [error(CompileTimeErrorCode.undefinedIdentifier, 13, 1)], ); } @@ -194,7 +194,7 @@ void f(num a) { a as num; } ''', - [error(WarningCode.UNNECESSARY_CAST, 18, 8)], + [error(WarningCode.unnecessaryCast, 18, 8)], ); } @@ -206,7 +206,7 @@ void f(num a) { a as N; } ''', - [error(WarningCode.UNNECESSARY_CAST, 35, 6)], + [error(WarningCode.unnecessaryCast, 35, 6)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_final_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_final_test.dart index 2eb8363bbcf..b52d517bb96 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_final_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_final_test.dart @@ -31,7 +31,7 @@ class C { int value; } ''', - [error(WarningCode.UNNECESSARY_FINAL, 15, 5)], + [error(WarningCode.unnecessaryFinal, 15, 5)], ); } @@ -47,7 +47,7 @@ class B extends A { B(final super.value); } ''', - [error(WarningCode.UNNECESSARY_FINAL, 67, 5)], + [error(WarningCode.unnecessaryFinal, 67, 5)], ); } @@ -59,7 +59,7 @@ class C { int value; } ''', - [error(WarningCode.UNNECESSARY_FINAL, 14, 5)], + [error(WarningCode.unnecessaryFinal, 14, 5)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_import_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_import_test.dart index b417b76420e..b058e19693c 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_import_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_import_test.dart @@ -168,7 +168,7 @@ import 'lib1.dart' as p; import 'lib2.dart' as p; f(p.A a, p.B b) {} ''', - [error(HintCode.UNNECESSARY_IMPORT, 7, 11)], + [error(HintCode.unnecessaryImport, 7, 11)], ); } @@ -205,7 +205,7 @@ void f() { 0.bar(); } ''', - [error(HintCode.UNNECESSARY_IMPORT, 7, 11)], + [error(HintCode.unnecessaryImport, 7, 11)], ); } @@ -251,7 +251,7 @@ void f() { 0.bar(); } ''', - [error(HintCode.UNNECESSARY_IMPORT, 7, 11)], + [error(HintCode.unnecessaryImport, 7, 11)], ); } @@ -309,7 +309,7 @@ import 'c.dart'; void f(A _, B _) {} ''', - [error(HintCode.UNNECESSARY_IMPORT, 41, 8)], + [error(HintCode.unnecessaryImport, 41, 8)], ); } @@ -338,7 +338,7 @@ import 'c.dart'; void f(A _, B _) {} ''', - [error(WarningCode.DEPRECATED_EXPORT_USE, 47, 1)], + [error(WarningCode.deprecatedExportUse, 47, 1)], ); } @@ -384,7 +384,7 @@ import 'a.dart'; import 'b.dart'; void f(A _, B _, C _) {} ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 51, 1)], + [error(CompileTimeErrorCode.undefinedClass, 51, 1)], ); } @@ -402,7 +402,7 @@ import 'lib1.dart'; import 'lib2.dart'; f(A a, B b) {} ''', - [error(HintCode.UNNECESSARY_IMPORT, 7, 11)], + [error(HintCode.unnecessaryImport, 7, 11)], ); } @@ -420,7 +420,7 @@ import 'dart:async'; import 'dart:async' show Completer; f(FutureOr a, Completer b) {} ''', - [error(HintCode.UNNECESSARY_IMPORT, 28, 12)], + [error(HintCode.unnecessaryImport, 28, 12)], ); } @@ -435,7 +435,7 @@ import 'a.dart'; import 'b.dart'; void f(A _) {} ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 24, 8)], + [error(CompileTimeErrorCode.uriDoesNotExist, 24, 8)], ); } @@ -458,7 +458,7 @@ void f(A _, B _) {} await assertErrorsInFile2(a, []); - await assertErrorsInFile2(b, [error(HintCode.UNNECESSARY_IMPORT, 25, 8)]); + await assertErrorsInFile2(b, [error(HintCode.unnecessaryImport, 25, 8)]); } test_part_inside_unnecessary_prefixed() async { @@ -480,6 +480,6 @@ void f(prefix.A _, prefix.B _) {} await assertErrorsInFile2(a, []); - await assertErrorsInFile2(b, [error(HintCode.UNNECESSARY_IMPORT, 25, 8)]); + await assertErrorsInFile2(b, [error(HintCode.unnecessaryImport, 25, 8)]); } } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_nan_comparison_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_nan_comparison_test.dart index 3eb0469b0ac..ce9da271d28 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_nan_comparison_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_nan_comparison_test.dart @@ -24,7 +24,7 @@ void f(List list) { } } ''', - [error(WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE, 56, 10)], + [error(WarningCode.unnecessaryNanComparisonFalse, 56, 10)], ); } @@ -35,7 +35,7 @@ void f(double d) { d == double.nan; } ''', - [error(WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE, 23, 13)], + [error(WarningCode.unnecessaryNanComparisonFalse, 23, 13)], ); } @@ -46,7 +46,7 @@ void f(double d) { double.nan == d; } ''', - [error(WarningCode.UNNECESSARY_NAN_COMPARISON_FALSE, 21, 13)], + [error(WarningCode.unnecessaryNanComparisonFalse, 21, 13)], ); } @@ -57,7 +57,7 @@ void f(double d) { d != double.nan; } ''', - [error(WarningCode.UNNECESSARY_NAN_COMPARISON_TRUE, 23, 13)], + [error(WarningCode.unnecessaryNanComparisonTrue, 23, 13)], ); } @@ -68,7 +68,7 @@ void f(double d) { double.nan != d; } ''', - [error(WarningCode.UNNECESSARY_NAN_COMPARISON_TRUE, 21, 13)], + [error(WarningCode.unnecessaryNanComparisonTrue, 21, 13)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_no_such_method_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_no_such_method_test.dart index 07a07ca2b83..003aa3ef3ff 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_no_such_method_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_no_such_method_test.dart @@ -28,7 +28,7 @@ class B extends A { } } ''', - [error(WarningCode.UNNECESSARY_NO_SUCH_METHOD, 87, 12)], + [error(WarningCode.unnecessaryNoSuchMethod, 87, 12)], ); } @@ -72,7 +72,7 @@ class B extends A { noSuchMethod(y) => super.noSuchMethod(y); } ''', - [error(WarningCode.UNNECESSARY_NO_SUCH_METHOD, 87, 12)], + [error(WarningCode.unnecessaryNoSuchMethod, 87, 12)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_non_null_assertion_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_non_null_assertion_test.dart index fecd6eada47..b1f28800c58 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_non_null_assertion_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_non_null_assertion_test.dart @@ -24,7 +24,7 @@ void f() { g!(); } ''', - [error(StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION, 27, 1)], + [error(StaticWarningCode.unnecessaryNonNullAssertion, 27, 1)], ); } @@ -39,7 +39,7 @@ void f() { A.foo!(); } ''', - [error(StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION, 54, 1)], + [error(StaticWarningCode.unnecessaryNonNullAssertion, 54, 1)], ); } @@ -50,7 +50,7 @@ f(int x) { x!; } ''', - [error(StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION, 14, 1)], + [error(StaticWarningCode.unnecessaryNonNullAssertion, 14, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_null_assert_pattern_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_null_assert_pattern_test.dart index 514ed9dd3c6..e04c2c395ff 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_null_assert_pattern_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_null_assert_pattern_test.dart @@ -23,8 +23,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(StaticWarningCode.UNNECESSARY_NULL_ASSERT_PATTERN, 34, 1), + error(WarningCode.unusedLocalVariable, 33, 1), + error(StaticWarningCode.unnecessaryNullAssertPattern, 34, 1), ], ); } @@ -36,7 +36,7 @@ void f(int? x) { if (x case var a!) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1)], + [error(WarningCode.unusedLocalVariable, 34, 1)], ); } @@ -51,8 +51,8 @@ void f() { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_CLASS, 0, 11), - error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 26, 11), + error(CompileTimeErrorCode.undefinedClass, 0, 11), + error(CompileTimeErrorCode.undefinedFunction, 26, 11), ], ); } @@ -67,7 +67,7 @@ void f() { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 0, 11)], + [error(CompileTimeErrorCode.undefinedClass, 0, 11)], ); } @@ -81,8 +81,8 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 60, 1), - error(StaticWarningCode.UNNECESSARY_NULL_ASSERT_PATTERN, 61, 1), + error(WarningCode.unusedLocalVariable, 60, 1), + error(StaticWarningCode.unnecessaryNullAssertPattern, 61, 1), ], ); } @@ -96,7 +96,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 48, 1)], + [error(WarningCode.unusedLocalVariable, 48, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_null_check_pattern_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_null_check_pattern_test.dart index f9f4591ce70..e47dabfb923 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_null_check_pattern_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_null_check_pattern_test.dart @@ -23,8 +23,8 @@ void f(int x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1), - error(StaticWarningCode.UNNECESSARY_NULL_CHECK_PATTERN, 34, 1), + error(WarningCode.unusedLocalVariable, 33, 1), + error(StaticWarningCode.unnecessaryNullCheckPattern, 34, 1), ], ); } @@ -36,7 +36,7 @@ void f(int? x) { if (x case var a?) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 34, 1)], + [error(WarningCode.unusedLocalVariable, 34, 1)], ); } @@ -51,8 +51,8 @@ void f() { } ''', [ - error(CompileTimeErrorCode.UNDEFINED_CLASS, 0, 11), - error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 26, 11), + error(CompileTimeErrorCode.undefinedClass, 0, 11), + error(CompileTimeErrorCode.undefinedFunction, 26, 11), ], ); } @@ -67,7 +67,7 @@ void f() { } } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 0, 11)], + [error(CompileTimeErrorCode.undefinedClass, 0, 11)], ); } @@ -81,8 +81,8 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 60, 1), - error(StaticWarningCode.UNNECESSARY_NULL_CHECK_PATTERN, 61, 1), + error(WarningCode.unusedLocalVariable, 60, 1), + error(StaticWarningCode.unnecessaryNullCheckPattern, 61, 1), ], ); } @@ -96,7 +96,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 48, 1)], + [error(WarningCode.unusedLocalVariable, 48, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_null_comparison_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_null_comparison_test.dart index 7c539db8c8f..82361143216 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_null_comparison_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_null_comparison_test.dart @@ -36,8 +36,8 @@ f(int a) { } ''', [ - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE, 15, 7), - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE, 26, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullFalse, 15, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullFalse, 26, 7), ], ); } @@ -61,8 +61,8 @@ f() { } ''', [ - error(WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE, 18, 4), - error(WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE, 36, 4), + error(WarningCode.unnecessaryNullComparisonAlwaysNullFalse, 18, 4), + error(WarningCode.unnecessaryNullComparisonAlwaysNullFalse, 36, 4), ], ); } @@ -77,8 +77,8 @@ f() { } ''', [ - error(WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE, 18, 4), - error(WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE, 36, 4), + error(WarningCode.unnecessaryNullComparisonAlwaysNullTrue, 18, 4), + error(WarningCode.unnecessaryNullComparisonAlwaysNullTrue, 36, 4), ], ); } @@ -95,7 +95,7 @@ f(Unresolved o) { null == i; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 2, 10)], + [error(CompileTimeErrorCode.undefinedClass, 2, 10)], ); } @@ -108,7 +108,7 @@ f(Unresolved o) { null == i; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 2, 10)], + [error(CompileTimeErrorCode.undefinedClass, 2, 10)], ); } @@ -132,7 +132,7 @@ f(Unresolved o) { null != i; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 2, 10)], + [error(CompileTimeErrorCode.undefinedClass, 2, 10)], ); } @@ -145,7 +145,7 @@ f(Unresolved o) { null != i; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 2, 10)], + [error(CompileTimeErrorCode.undefinedClass, 2, 10)], ); } @@ -158,8 +158,8 @@ f(int a) { } ''', [ - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE, 15, 7), - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE, 26, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullTrue, 15, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullTrue, 26, 7), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_question_mark_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_question_mark_test.dart index 746d0681e5b..8917801cbcb 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_question_mark_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_question_mark_test.dart @@ -26,7 +26,7 @@ dynamic a; ''' dynamic? a; ''', - [error(WarningCode.UNNECESSARY_QUESTION_MARK, 7, 1)], + [error(WarningCode.unnecessaryQuestionMark, 7, 1)], ); } @@ -37,7 +37,7 @@ void f(List a) { var [dynamic? _] = a; } ''', - [error(WarningCode.UNNECESSARY_QUESTION_MARK, 39, 1)], + [error(WarningCode.unnecessaryQuestionMark, 39, 1)], ); } @@ -52,7 +52,7 @@ Null a; ''' Null? a; ''', - [error(WarningCode.UNNECESSARY_QUESTION_MARK, 4, 1)], + [error(WarningCode.unnecessaryQuestionMark, 4, 1)], ); } @@ -66,8 +66,8 @@ void f(Object a) { } ''', [ - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 52, 5), - error(WarningCode.UNNECESSARY_QUESTION_MARK, 56, 1), + error(WarningCode.patternNeverMatchesValueType, 52, 5), + error(WarningCode.unnecessaryQuestionMark, 56, 1), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_set_literal_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_set_literal_test.dart index c933b53443b..841295b857c 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_set_literal_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_set_literal_test.dart @@ -64,7 +64,7 @@ void f() { g(() async => {1}); } ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 67, 3)], + [error(WarningCode.unnecessarySetLiteral, 67, 3)], ); } @@ -103,7 +103,7 @@ void f() { g(() async => {1}); } ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 91, 3)], + [error(WarningCode.unnecessarySetLiteral, 91, 3)], ); } @@ -126,7 +126,7 @@ void f() { g(() => {1, 2}); } ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 53, 6)], + [error(WarningCode.unnecessarySetLiteral, 53, 6)], ); } @@ -139,7 +139,7 @@ void f(bool b) { g(() => {1, if (b) 2 else 3, 4, for (;;) 5},); } ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 59, 35)], + [error(WarningCode.unnecessarySetLiteral, 59, 35)], ); } @@ -162,7 +162,7 @@ void f() { g((value) => {if (value) print('')}); } ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 62, 22)], + [error(WarningCode.unnecessarySetLiteral, 62, 22)], ); } @@ -175,7 +175,7 @@ void f() { g(() => {1}); } ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 53, 3)], + [error(WarningCode.unnecessarySetLiteral, 53, 3)], ); } @@ -212,7 +212,7 @@ Future f() async => {1}; r''' Future f() async => {1}; ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 26, 3)], + [error(WarningCode.unnecessarySetLiteral, 26, 3)], ); } @@ -239,7 +239,7 @@ import 'dart:async'; FutureOr f() async => {1}; ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 50, 3)], + [error(WarningCode.unnecessarySetLiteral, 50, 3)], ); } @@ -254,7 +254,7 @@ void f() => {1: 2}; r''' void f() => {1, 2}; ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 12, 6)], + [error(WarningCode.unnecessarySetLiteral, 12, 6)], ); } @@ -263,7 +263,7 @@ void f() => {1, 2}; r''' void f(bool b) => {1, if (b) 2 else 3, 4, for (;;) 5}; ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 18, 35)], + [error(WarningCode.unnecessarySetLiteral, 18, 35)], ); } @@ -278,7 +278,7 @@ Object f() => {1}; r''' void f(bool value) => {if (value) print('')}; ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 22, 22)], + [error(WarningCode.unnecessarySetLiteral, 22, 22)], ); } @@ -287,7 +287,7 @@ void f(bool value) => {if (value) print('')}; r''' void f() => {1}; ''', - [error(WarningCode.UNNECESSARY_SET_LITERAL, 12, 3)], + [error(WarningCode.unnecessarySetLiteral, 12, 3)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_type_check_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_type_check_test.dart index 193b3f5c71b..21f0ed4ad26 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_type_check_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_type_check_test.dart @@ -21,7 +21,7 @@ class UnnecessaryTypeCheckFalseTest extends PubPackageResolutionTest { r''' var b = null is! Null; ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 8, 13)], + [error(WarningCode.unnecessaryTypeCheckFalse, 8, 13)], ); } @@ -32,7 +32,7 @@ void f(int a) { a is! int; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 18, 9)], + [error(WarningCode.unnecessaryTypeCheckFalse, 18, 9)], ); } @@ -51,7 +51,7 @@ void f(int a) { a is! num; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 18, 9)], + [error(WarningCode.unnecessaryTypeCheckFalse, 18, 9)], ); } @@ -62,7 +62,7 @@ void f(int? a) { a is! int?; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 19, 10)], + [error(WarningCode.unnecessaryTypeCheckFalse, 19, 10)], ); } @@ -97,7 +97,7 @@ void f(int? a) { a is! num?; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 19, 10)], + [error(WarningCode.unnecessaryTypeCheckFalse, 19, 10)], ); } @@ -116,7 +116,7 @@ void f(T a) { a is! dynamic; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 19, 13)], + [error(WarningCode.unnecessaryTypeCheckFalse, 19, 13)], ); } @@ -135,7 +135,7 @@ void f(T a) { a is! Object?; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 19, 13)], + [error(WarningCode.unnecessaryTypeCheckFalse, 19, 13)], ); } } @@ -149,7 +149,7 @@ void f(A a) { a is num; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 7, 1)], + [error(CompileTimeErrorCode.undefinedClass, 7, 1)], ); } @@ -158,7 +158,7 @@ void f(A a) { r''' var b = null is Null; ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 8, 12)], + [error(WarningCode.unnecessaryTypeCheckTrue, 8, 12)], ); } @@ -169,7 +169,7 @@ void f(int a) { a is dynamic; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 18, 12)], + [error(WarningCode.unnecessaryTypeCheckTrue, 18, 12)], ); } @@ -180,7 +180,7 @@ void f(int a) { a is Unresolved; } ''', - [error(CompileTimeErrorCode.TYPE_TEST_WITH_UNDEFINED_NAME, 23, 10)], + [error(CompileTimeErrorCode.typeTestWithUndefinedName, 23, 10)], ); } @@ -191,7 +191,7 @@ void f(int a) { a is int; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 18, 8)], + [error(WarningCode.unnecessaryTypeCheckTrue, 18, 8)], ); } @@ -210,7 +210,7 @@ void f(int a) { a is num; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 18, 8)], + [error(WarningCode.unnecessaryTypeCheckTrue, 18, 8)], ); } @@ -221,7 +221,7 @@ void f(int? a) { a is int?; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 19, 9)], + [error(WarningCode.unnecessaryTypeCheckTrue, 19, 9)], ); } @@ -256,7 +256,7 @@ void f(int? a) { a is num?; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 19, 9)], + [error(WarningCode.unnecessaryTypeCheckTrue, 19, 9)], ); } @@ -275,7 +275,7 @@ void f(T a) { a is dynamic; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 19, 12)], + [error(WarningCode.unnecessaryTypeCheckTrue, 19, 12)], ); } @@ -294,7 +294,7 @@ void f(T a) { a is Object?; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 19, 12)], + [error(WarningCode.unnecessaryTypeCheckTrue, 19, 12)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_wildcard_pattern_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_wildcard_pattern_test.dart index 1c74399e786..b9cbc0a85e8 100644 --- a/pkg/analyzer/test/src/diagnostics/unnecessary_wildcard_pattern_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unnecessary_wildcard_pattern_test.dart @@ -30,7 +30,7 @@ void f(Object? x) { if (x case _ && 0) {} } ''', - [error(WarningCode.UNNECESSARY_WILDCARD_PATTERN, 33, 1)], + [error(WarningCode.unnecessaryWildcardPattern, 33, 1)], ); } @@ -41,7 +41,7 @@ void f(Object? x) { if (x case 0 && _) {} } ''', - [error(WarningCode.UNNECESSARY_WILDCARD_PATTERN, 38, 1)], + [error(WarningCode.unnecessaryWildcardPattern, 38, 1)], ); } @@ -52,7 +52,7 @@ void f(Object? x) { if (x case (_) && 0) {} } ''', - [error(WarningCode.UNNECESSARY_WILDCARD_PATTERN, 34, 1)], + [error(WarningCode.unnecessaryWildcardPattern, 34, 1)], ); } @@ -71,7 +71,7 @@ void f(int x) { if (x case int _ && > 0) {} } ''', - [error(WarningCode.UNNECESSARY_WILDCARD_PATTERN, 29, 5)], + [error(WarningCode.unnecessaryWildcardPattern, 29, 5)], ); } @@ -98,7 +98,7 @@ void f(Object? x) { if (x case _ || 0) {} } ''', - [error(WarningCode.DEAD_CODE, 35, 4)], + [error(WarningCode.deadCode, 35, 4)], ); } @@ -167,7 +167,7 @@ void f(Object? x) { }); } ''', - [error(WarningCode.UNNECESSARY_WILDCARD_PATTERN, 45, 1)], + [error(WarningCode.unnecessaryWildcardPattern, 45, 1)], ); } @@ -191,7 +191,7 @@ void f(Object? x) { } } ''', - [error(WarningCode.UNNECESSARY_WILDCARD_PATTERN, 49, 1)], + [error(WarningCode.unnecessaryWildcardPattern, 49, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_non_local_static_member_test.dart b/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_non_local_static_member_test.dart index 27526b0cb9a..56ae215bd3d 100644 --- a/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_non_local_static_member_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_non_local_static_member_test.dart @@ -17,7 +17,7 @@ main() { class UnqualifiedReferenceToNonLocalStaticMemberTest extends PubPackageResolutionTest { CompileTimeErrorCode get _errorCode => - CompileTimeErrorCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER; + CompileTimeErrorCode.unqualifiedReferenceToNonLocalStaticMember; test_getter() async { await assertErrorsInCode( diff --git a/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_static_member_of_extended_type_test.dart b/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_static_member_of_extended_type_test.dart index dee0f605d03..010d1d90033 100644 --- a/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_static_member_of_extended_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unqualified_reference_to_static_member_of_extended_type_test.dart @@ -18,7 +18,7 @@ class UnqualifiedReferenceToStaticMemberOfExtendedTypeTest extends PubPackageResolutionTest { CompileTimeErrorCode get _errorCode { return CompileTimeErrorCode - .UNQUALIFIED_REFERENCE_TO_STATIC_MEMBER_OF_EXTENDED_TYPE; + .unqualifiedReferenceToStaticMemberOfExtendedType; } test_getter() async { diff --git a/pkg/analyzer/test/src/diagnostics/unreachable_switch_case_test.dart b/pkg/analyzer/test/src/diagnostics/unreachable_switch_case_test.dart index 7518e6198b8..6b059d534d4 100644 --- a/pkg/analyzer/test/src/diagnostics/unreachable_switch_case_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unreachable_switch_case_test.dart @@ -28,7 +28,7 @@ Object f(bool x) { }; } ''', - [error(WarningCode.UNREACHABLE_SWITCH_CASE, 82, 2)], + [error(WarningCode.unreachableSwitchCase, 82, 2)], ); } @@ -44,10 +44,10 @@ Object f(bool x) { } ''', [ - error(WarningCode.DEAD_CODE, 57, 9), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 62, 2), - error(WarningCode.DEAD_CODE, 72, 10), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 78, 2), + error(WarningCode.deadCode, 57, 9), + error(WarningCode.unreachableSwitchCase, 62, 2), + error(WarningCode.deadCode, 72, 10), + error(WarningCode.unreachableSwitchCase, 78, 2), ], ); } @@ -73,7 +73,7 @@ Object f(E e, bool b) => switch (e) { E.e1 when b => 2, }; ''', - [error(WarningCode.UNREACHABLE_SWITCH_CASE, 96, 2)], + [error(WarningCode.unreachableSwitchCase, 96, 2)], ); } @@ -87,7 +87,7 @@ int f(Object? x) { }; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 45, 10)], + [error(CompileTimeErrorCode.undefinedClass, 45, 10)], ); } } @@ -107,7 +107,7 @@ void f(bool x) { } } ''', - [error(WarningCode.UNREACHABLE_SWITCH_CASE, 67, 4)], + [error(WarningCode.unreachableSwitchCase, 67, 4)], ); } @@ -125,7 +125,7 @@ void f(Object? x) { }; } ''', - [error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 69, 10)], + [error(CompileTimeErrorCode.undefinedIdentifier, 69, 10)], ); } @@ -143,7 +143,7 @@ void f(Object? x) { }; } ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 69, 10)], + [error(CompileTimeErrorCode.undefinedClass, 69, 10)], ); } @@ -178,7 +178,7 @@ void f(E e, bool b) { } } ''', - [error(WarningCode.UNREACHABLE_SWITCH_CASE, 115, 4)], + [error(WarningCode.unreachableSwitchCase, 115, 4)], ); } @@ -196,11 +196,11 @@ void f(int x) { } ''', [ - error(WarningCode.DEAD_CODE, 64, 4), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 64, 4), - error(WarningCode.DEAD_CODE, 80, 4), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 80, 4), - error(WarningCode.DEAD_CODE, 98, 6), + error(WarningCode.deadCode, 64, 4), + error(WarningCode.unreachableSwitchCase, 64, 4), + error(WarningCode.deadCode, 80, 4), + error(WarningCode.unreachableSwitchCase, 80, 4), + error(WarningCode.deadCode, 98, 6), ], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unreachable_switch_default_test.dart b/pkg/analyzer/test/src/diagnostics/unreachable_switch_default_test.dart index 42e531f3883..79fb1590c22 100644 --- a/pkg/analyzer/test/src/diagnostics/unreachable_switch_default_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unreachable_switch_default_test.dart @@ -27,7 +27,7 @@ void f(bool x) { } } ''', - [error(WarningCode.UNREACHABLE_SWITCH_DEFAULT, 67, 7)], + [error(WarningCode.unreachableSwitchDefault, 67, 7)], ); } @@ -47,7 +47,7 @@ String f(E e) { } } ''', - [error(WarningCode.UNREACHABLE_SWITCH_DEFAULT, 122, 7)], + [error(WarningCode.unreachableSwitchDefault, 122, 7)], ); } @@ -88,7 +88,7 @@ String f(A x) { } } ''', - [error(WarningCode.UNREACHABLE_SWITCH_DEFAULT, 160, 7)], + [error(WarningCode.unreachableSwitchDefault, 160, 7)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unused_catch_clause_test.dart b/pkg/analyzer/test/src/diagnostics/unused_catch_clause_test.dart index d52062ced33..7d425278a80 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_catch_clause_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_catch_clause_test.dart @@ -24,7 +24,7 @@ f() { } } ''', - [error(WarningCode.UNUSED_CATCH_CLAUSE, 35, 9)], + [error(WarningCode.unusedCatchClause, 35, 9)], ); } @@ -37,7 +37,7 @@ f() { } } ''', - [error(WarningCode.UNUSED_CATCH_STACK, 46, 2)], + [error(WarningCode.unusedCatchStack, 46, 2)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unused_catch_stack_test.dart b/pkg/analyzer/test/src/diagnostics/unused_catch_stack_test.dart index 328519ae179..68d4c6fa818 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_catch_stack_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_catch_stack_test.dart @@ -24,7 +24,7 @@ main() { } } ''', - [error(WarningCode.UNUSED_CATCH_STACK, 49, 10)], + [error(WarningCode.unusedCatchStack, 49, 10)], ); } @@ -48,7 +48,7 @@ main() { } } ''', - [error(WarningCode.UNUSED_CATCH_STACK, 39, 10)], + [error(WarningCode.unusedCatchStack, 39, 10)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unused_element_test.dart b/pkg/analyzer/test/src/diagnostics/unused_element_test.dart index 68903601a0b..7847f98296f 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_element_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_element_test.dart @@ -198,8 +198,8 @@ class _A { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 6, 2), - error(WarningCode.UNUSED_ELEMENT, 20, 12), + error(WarningCode.unusedElement, 6, 2), + error(WarningCode.unusedElement, 20, 12), ], ); } @@ -213,8 +213,8 @@ class _A { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 6, 2), - error(WarningCode.UNUSED_ELEMENT, 26, 5), + error(WarningCode.unusedElement, 6, 2), + error(WarningCode.unusedElement, 26, 5), ], ); } @@ -228,7 +228,7 @@ main(p) { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 6, 2)], + [error(WarningCode.unusedElement, 6, 2)], ); } @@ -241,7 +241,7 @@ void f(Object p) { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 6, 2)], + [error(WarningCode.unusedElement, 6, 2)], ); } @@ -254,7 +254,7 @@ void f(Object p) { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 6, 2)], + [error(WarningCode.unusedElement, 6, 2)], ); } @@ -267,7 +267,7 @@ void f(Object p) { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 6, 2)], + [error(WarningCode.unusedElement, 6, 2)], ); } @@ -278,7 +278,7 @@ class _A {} main() { } ''', - [error(WarningCode.UNUSED_ELEMENT, 6, 2)], + [error(WarningCode.unusedElement, 6, 2)], ); } @@ -292,7 +292,7 @@ void f() { } print(x) {} ''', - [error(WarningCode.UNUSED_ELEMENT, 6, 2)], + [error(WarningCode.unusedElement, 6, 2)], ); } @@ -306,7 +306,7 @@ main() { } print(x) {} ''', - [error(WarningCode.UNUSED_ELEMENT, 6, 2)], + [error(WarningCode.unusedElement, 6, 2)], ); } @@ -382,7 +382,7 @@ class A { A(); } ''', - [error(WarningCode.UNUSED_ELEMENT, 14, 12)], + [error(WarningCode.unusedElement, 14, 12)], ); } @@ -406,7 +406,7 @@ class B extends A { B._named() : super._constructor(); } ''', - [error(WarningCode.UNUSED_ELEMENT, 87, 6)], + [error(WarningCode.unusedElement, 87, 6)], ); } @@ -428,7 +428,7 @@ class _A { } var a = _A(); ''', - [error(WarningCode.UNUSED_ELEMENT, 16, 5)], + [error(WarningCode.unusedElement, 16, 5)], ); } @@ -449,7 +449,7 @@ enum E { const E({int? a}); } ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 37, 1)], + [error(WarningCode.unusedElementParameter, 37, 1)], ); } @@ -470,7 +470,7 @@ enum E { const E([int? a]); } ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 37, 1)], + [error(WarningCode.unusedElementParameter, 37, 1)], ); } @@ -492,7 +492,7 @@ void f(d) { d.B; } ''', - [error(WarningCode.UNUSED_ELEMENT, 5, 7)], + [error(WarningCode.unusedElement, 5, 7)], ); } @@ -553,7 +553,7 @@ extension type E(int i) { void _f() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 33, 2)], + [error(WarningCode.unusedElement, 33, 2)], ); } @@ -562,7 +562,7 @@ extension type E(int i) { r''' extension type _E(int i) {} ''', - [error(WarningCode.UNUSED_ELEMENT, 15, 2)], + [error(WarningCode.unusedElement, 15, 2)], ); } @@ -576,7 +576,7 @@ void f() { print(v); } ''', - [error(WarningCode.UNUSED_ELEMENT, 15, 2)], + [error(WarningCode.unusedElement, 15, 2)], ); } @@ -590,7 +590,7 @@ void f() { print(v); } ''', - [error(WarningCode.UNUSED_ELEMENT, 15, 2)], + [error(WarningCode.unusedElement, 15, 2)], ); } @@ -601,7 +601,7 @@ extension type E(int i) { E._named(this.i); } ''', - [error(WarningCode.UNUSED_ELEMENT, 30, 6)], + [error(WarningCode.unusedElement, 30, 6)], ); } @@ -613,7 +613,7 @@ extension type E(int i) { } typedef A = E; ''', - [error(WarningCode.UNUSED_ELEMENT, 30, 6)], + [error(WarningCode.unusedElement, 30, 6)], ); } @@ -624,7 +624,7 @@ extension type _E(int i) { _E.named(this.i); } ''', - [error(WarningCode.UNUSED_ELEMENT, 32, 5)], + [error(WarningCode.unusedElement, 32, 5)], ); } @@ -655,7 +655,7 @@ class A { A(); } ''', - [error(WarningCode.UNUSED_ELEMENT, 22, 8)], + [error(WarningCode.unusedElement, 22, 8)], ); } @@ -681,7 +681,7 @@ class A { r''' _(){} ''', - [error(WarningCode.UNUSED_ELEMENT, 0, 1)], + [error(WarningCode.unusedElement, 0, 1)], ); } @@ -690,7 +690,7 @@ _(){} r''' __(){} ''', - [error(WarningCode.UNUSED_ELEMENT, 0, 2)], + [error(WarningCode.unusedElement, 0, 2)], ); } @@ -729,7 +729,7 @@ main() { f() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 11, 1)], + [error(WarningCode.unusedElement, 11, 1)], ); } @@ -742,7 +742,7 @@ main() { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 11, 2)], + [error(WarningCode.unusedElement, 11, 2)], ); } @@ -791,7 +791,7 @@ typedef _F(a, b); main() { } ''', - [error(WarningCode.UNUSED_ELEMENT, 8, 2)], + [error(WarningCode.unusedElement, 8, 2)], ); } @@ -826,7 +826,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 52, 1)], + [error(WarningCode.unusedLocalVariable, 52, 1)], ); } @@ -876,7 +876,7 @@ void f(A a) { var v = a._g; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 50, 1)], + [error(WarningCode.unusedLocalVariable, 50, 1)], ); } @@ -890,7 +890,7 @@ main() { var v = new A()._g; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1)], + [error(WarningCode.unusedLocalVariable, 45, 1)], ); } @@ -928,8 +928,8 @@ class B extends A { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 35, 2), - error(WarningCode.UNUSED_ELEMENT, 155, 2), + error(WarningCode.unusedElement, 35, 2), + error(WarningCode.unusedElement, 155, 2), ], ); } @@ -941,7 +941,7 @@ class A { get _g => null; } ''', - [error(WarningCode.UNUSED_ELEMENT, 16, 2)], + [error(WarningCode.unusedElement, 16, 2)], ); } @@ -954,7 +954,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 16, 2)], + [error(WarningCode.unusedElement, 16, 2)], ); } @@ -967,7 +967,7 @@ m() { ''', [ // Code is dead but not unused. - error(WarningCode.DEAD_CODE, 8, 5), + error(WarningCode.deadCode, 8, 5), ], ); } @@ -982,7 +982,7 @@ main() { _(){} } ''', - [error(WarningCode.UNUSED_ELEMENT, 55, 1)], + [error(WarningCode.unusedElement, 55, 1)], ); } @@ -995,7 +995,7 @@ class C { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 22, 2)], + [error(WarningCode.unusedElement, 22, 2)], ); } @@ -1010,7 +1010,7 @@ class C { ''', [ // Code is dead but not unused. - error(WarningCode.DEAD_CODE, 22, 5), + error(WarningCode.deadCode, 22, 5), ], ); } @@ -1027,7 +1027,7 @@ class C { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 66, 1)], + [error(WarningCode.unusedElement, 66, 1)], ); } @@ -1038,7 +1038,7 @@ main() { __(){} } ''', - [error(WarningCode.UNUSED_ELEMENT, 11, 2)], + [error(WarningCode.unusedElement, 11, 2)], ); } @@ -1436,7 +1436,7 @@ extension on T { void call() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 27, 4)], + [error(WarningCode.unusedElement, 27, 4)], ); } @@ -1451,7 +1451,7 @@ class B { void _m1() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 17, 3)], + [error(WarningCode.unusedElement, 17, 3)], ); } @@ -1462,7 +1462,7 @@ class A { static _m() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 19, 2)], + [error(WarningCode.unusedElement, 19, 2)], ); } @@ -1473,7 +1473,7 @@ extension _A on String { void m() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 32, 1)], + [error(WarningCode.unusedElement, 32, 1)], ); } @@ -1486,7 +1486,7 @@ extension _A on bool { operator []=(int index, int value) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 34, 3)], + [error(WarningCode.unusedElement, 34, 3)], ); } @@ -1497,7 +1497,7 @@ extension _A on bool { int operator [](int index) => 7; } ''', - [error(WarningCode.UNUSED_ELEMENT, 38, 2)], + [error(WarningCode.unusedElement, 38, 2)], ); } @@ -1508,7 +1508,7 @@ extension _E on int { void call() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 29, 4)], + [error(WarningCode.unusedElement, 29, 4)], ); } @@ -1521,7 +1521,7 @@ extension _A on String { int operator -(int other) => other; } ''', - [error(WarningCode.UNUSED_ELEMENT, 40, 1)], + [error(WarningCode.unusedElement, 40, 1)], ); } @@ -1532,7 +1532,7 @@ extension _A on String { int operator ~() => 7; } ''', - [error(WarningCode.UNUSED_ELEMENT, 40, 1)], + [error(WarningCode.unusedElement, 40, 1)], ); } @@ -1545,7 +1545,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 19, 2)], + [error(WarningCode.unusedElement, 19, 2)], ); } @@ -1557,7 +1557,7 @@ class A { int _f(int p) => 7; } ''', - [error(WarningCode.UNUSED_ELEMENT, 44, 2)], + [error(WarningCode.unusedElement, 44, 2)], ); } @@ -1570,7 +1570,7 @@ class A { /// This is similar to [A._f]. int g() => 7; ''', - [error(WarningCode.UNUSED_ELEMENT, 16, 2)], + [error(WarningCode.unusedElement, 16, 2)], ); } @@ -1581,7 +1581,7 @@ extension on String { void m() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 29, 1)], + [error(WarningCode.unusedElement, 29, 1)], ); } @@ -1592,7 +1592,7 @@ extension on String { int operator -(int other) => other; } ''', - [error(WarningCode.UNUSED_ELEMENT, 37, 1)], + [error(WarningCode.unusedElement, 37, 1)], ); } @@ -1608,7 +1608,7 @@ class C with _M {} r''' mixin _M {} ''', - [error(WarningCode.UNUSED_ELEMENT, 6, 2)], + [error(WarningCode.unusedElement, 6, 2)], ); } @@ -1702,7 +1702,7 @@ f() { B()._m(0); } ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 26, 1)], + [error(WarningCode.unusedElementParameter, 26, 1)], ); } @@ -1827,7 +1827,7 @@ class A { } f() => A._(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 22, 1)], + [error(WarningCode.unusedElementParameter, 22, 1)], ); } @@ -1839,7 +1839,7 @@ class _A { } f() => _A(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 22, 1)], + [error(WarningCode.unusedElementParameter, 22, 1)], ); } @@ -1851,7 +1851,7 @@ extension E on String { } f() => "hello"._m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 40, 1)], + [error(WarningCode.unusedElementParameter, 40, 1)], ); } @@ -1906,7 +1906,7 @@ class A { } f() => A()._m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 26, 1)], + [error(WarningCode.unusedElementParameter, 26, 1)], ); } @@ -1921,7 +1921,7 @@ class B implements A { } f() => A()._m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 66, 1)], + [error(WarningCode.unusedElementParameter, 66, 1)], ); } @@ -1957,7 +1957,7 @@ class A { } f() => A()._m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 26, 1)], + [error(WarningCode.unusedElementParameter, 26, 1)], ); } @@ -1969,7 +1969,7 @@ extension _E on String { } f() => "hello".m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 40, 1)], + [error(WarningCode.unusedElementParameter, 40, 1)], ); } @@ -1981,7 +1981,7 @@ extension on String { } f() => "hello".m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 37, 1)], + [error(WarningCode.unusedElementParameter, 37, 1)], ); } @@ -1993,7 +1993,7 @@ class A { } f() => A._m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 33, 1)], + [error(WarningCode.unusedElementParameter, 33, 1)], ); } @@ -2005,7 +2005,7 @@ class _A { } f() => _A.m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 33, 1)], + [error(WarningCode.unusedElementParameter, 33, 1)], ); } @@ -2022,7 +2022,7 @@ f() => _m(1); void _m([int? a]) {} f() => _m(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 14, 1)], + [error(WarningCode.unusedElementParameter, 14, 1)], ); } @@ -2087,7 +2087,7 @@ class _A { } f() => _A(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 38, 1)], + [error(WarningCode.unusedElementParameter, 38, 1)], ); } @@ -2101,7 +2101,7 @@ class _A { } f() => _A.named(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 38, 1)], + [error(WarningCode.unusedElementParameter, 38, 1)], ); } @@ -2161,7 +2161,7 @@ class _A { } f() => _A(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 38, 1)], + [error(WarningCode.unusedElementParameter, 38, 1)], ); } @@ -2175,7 +2175,7 @@ class _A { } f() => _A.named(); ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 38, 1)], + [error(WarningCode.unusedElementParameter, 38, 1)], ); } @@ -2218,7 +2218,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 52, 4)], + [error(WarningCode.unusedElement, 52, 4)], ); } @@ -2247,7 +2247,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 25, 4)], + [error(WarningCode.unusedElement, 25, 4)], ); } @@ -2276,7 +2276,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 22, 4)], + [error(WarningCode.unusedElement, 22, 4)], ); } @@ -2305,7 +2305,7 @@ void f() { _E.v._foo(); } ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 33, 1)], + [error(WarningCode.unusedElementParameter, 33, 1)], ); } @@ -2334,7 +2334,7 @@ void f() { _E.v._foo(); } ''', - [error(WarningCode.UNUSED_ELEMENT_PARAMETER, 33, 1)], + [error(WarningCode.unusedElementParameter, 33, 1)], ); } @@ -2363,7 +2363,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 21, 4)], + [error(WarningCode.unusedElement, 21, 4)], ); } @@ -2393,7 +2393,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 32, 4)], + [error(WarningCode.unusedElement, 32, 4)], ); } @@ -2423,7 +2423,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 29, 4)], + [error(WarningCode.unusedElement, 29, 4)], ); } @@ -2453,7 +2453,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 28, 4)], + [error(WarningCode.unusedElement, 28, 4)], ); } @@ -2470,7 +2470,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 50, 3)], + [error(WarningCode.unusedElement, 50, 3)], ); } @@ -2565,7 +2565,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 32, 3)], + [error(WarningCode.unusedElement, 32, 3)], ); } @@ -2595,7 +2595,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 29, 3)], + [error(WarningCode.unusedElement, 29, 3)], ); } @@ -2625,7 +2625,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_ELEMENT, 28, 3)], + [error(WarningCode.unusedElement, 28, 3)], ); } @@ -2663,7 +2663,7 @@ enum E { const E._bar(); } ''', - [error(WarningCode.UNUSED_ELEMENT, 49, 4)], + [error(WarningCode.unusedElement, 49, 4)], ); } @@ -2688,7 +2688,7 @@ enum E { static int get _foo => 0; } ''', - [error(WarningCode.UNUSED_ELEMENT, 31, 4)], + [error(WarningCode.unusedElement, 31, 4)], ); } @@ -2713,7 +2713,7 @@ enum E { static void _foo() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 28, 4)], + [error(WarningCode.unusedElement, 28, 4)], ); } @@ -2738,7 +2738,7 @@ enum E { static set _foo(int _) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 27, 4)], + [error(WarningCode.unusedElement, 27, 4)], ); } @@ -2773,7 +2773,7 @@ enum E { const E.bar(); } ''', - [error(WarningCode.UNUSED_ELEMENT, 47, 3)], + [error(WarningCode.unusedElement, 47, 3)], ); } @@ -2823,7 +2823,7 @@ class _A { } void f(_A a) {} ''', - [error(WarningCode.UNUSED_ELEMENT, 25, 1)], + [error(WarningCode.unusedElement, 25, 1)], ); } @@ -2845,7 +2845,7 @@ extension _A on String { static void m() {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 39, 1)], + [error(WarningCode.unusedElement, 39, 1)], ); } @@ -2870,7 +2870,7 @@ void main() { _A; } ''', - [error(WarningCode.UNUSED_ELEMENT, 25, 1)], + [error(WarningCode.unusedElement, 25, 1)], ); } @@ -2920,7 +2920,7 @@ class A { set _s(x) {} } ''', - [error(WarningCode.UNUSED_ELEMENT, 16, 2)], + [error(WarningCode.unusedElement, 16, 2)], ); } @@ -2935,7 +2935,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_ELEMENT, 16, 2)], + [error(WarningCode.unusedElement, 16, 2)], ); } @@ -2982,7 +2982,7 @@ _f() {} main() { } ''', - [error(WarningCode.UNUSED_ELEMENT, 0, 2)], + [error(WarningCode.unusedElement, 0, 2)], ); } @@ -2995,7 +2995,7 @@ _f(int p) { main() { } ''', - [error(WarningCode.UNUSED_ELEMENT, 0, 2)], + [error(WarningCode.unusedElement, 0, 2)], ); } @@ -3005,7 +3005,7 @@ main() { /// [_f] is a great function. _f(int p) => 7; ''', - [error(WarningCode.UNUSED_ELEMENT, 30, 2)], + [error(WarningCode.unusedElement, 30, 2)], ); } @@ -3057,7 +3057,7 @@ void f() { r''' set _foo(int _) {} ''', - [error(WarningCode.UNUSED_ELEMENT, 4, 4)], + [error(WarningCode.unusedElement, 4, 4)], ); } @@ -3097,7 +3097,7 @@ main() { _a = 2; } ''', - [error(WarningCode.UNUSED_ELEMENT, 4, 2)], + [error(WarningCode.unusedElement, 4, 2)], ); } @@ -3109,7 +3109,7 @@ f() { _a += 1; } ''', - [error(WarningCode.UNUSED_ELEMENT, 4, 2)], + [error(WarningCode.unusedElement, 4, 2)], ); } @@ -3119,7 +3119,7 @@ f() { /// [_a] is a great variable. int _a = 7; ''', - [error(WarningCode.UNUSED_ELEMENT, 34, 2)], + [error(WarningCode.unusedElement, 34, 2)], ); } @@ -3168,7 +3168,7 @@ typedef _F = void Function(); main() { } ''', - [error(WarningCode.UNUSED_ELEMENT, 8, 2)], + [error(WarningCode.unusedElement, 8, 2)], ); } @@ -3205,7 +3205,7 @@ void f() { r''' typedef _A = List; ''', - [error(WarningCode.UNUSED_ELEMENT, 8, 2)], + [error(WarningCode.unusedElement, 8, 2)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unused_field_test.dart b/pkg/analyzer/test/src/diagnostics/unused_field_test.dart index e3531c4240f..0ca57c57f5d 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_field_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_field_test.dart @@ -220,7 +220,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_FIELD, 16, 2)], + [error(WarningCode.unusedField, 16, 2)], ); } @@ -232,7 +232,7 @@ class A { A() : _f = 0; } ''', - [error(WarningCode.UNUSED_FIELD, 16, 2)], + [error(WarningCode.unusedField, 16, 2)], ); } @@ -244,7 +244,7 @@ extension Bar on Foo { static final _baz = 7; } ''', - [error(WarningCode.UNUSED_FIELD, 51, 4)], + [error(WarningCode.unusedField, 51, 4)], ); } @@ -256,7 +256,7 @@ class A { A(this._f); } ''', - [error(WarningCode.UNUSED_FIELD, 16, 2)], + [error(WarningCode.unusedField, 16, 2)], ); } @@ -268,7 +268,7 @@ mixin M { } class Bar with M {} ''', - [error(WarningCode.UNUSED_FIELD, 16, 2)], + [error(WarningCode.unusedField, 16, 2)], ); } @@ -280,7 +280,7 @@ class Foo { } mixin M on Foo {} ''', - [error(WarningCode.UNUSED_FIELD, 18, 2)], + [error(WarningCode.unusedField, 18, 2)], ); } @@ -291,7 +291,7 @@ class A { int _f = 0; } ''', - [error(WarningCode.UNUSED_FIELD, 16, 2)], + [error(WarningCode.unusedField, 16, 2)], ); } @@ -302,7 +302,7 @@ class A { int _ = 0; } ''', - [error(WarningCode.UNUSED_FIELD, 16, 1)], + [error(WarningCode.unusedField, 16, 1)], ); } @@ -316,7 +316,7 @@ class A { int _ = 0; } ''', - [error(WarningCode.UNUSED_FIELD, 60, 1)], + [error(WarningCode.unusedField, 60, 1)], ); } @@ -342,7 +342,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_FIELD, 16, 2)], + [error(WarningCode.unusedField, 16, 2)], ); } @@ -356,7 +356,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_FIELD, 16, 2)], + [error(WarningCode.unusedField, 16, 2)], ); } @@ -368,7 +368,7 @@ class _A { } void main() => print(_A); ''', - [error(WarningCode.UNUSED_FIELD, 27, 2)], + [error(WarningCode.unusedField, 27, 2)], ); } @@ -379,7 +379,7 @@ extension _A on String { static String f1 = "x"; } ''', - [error(WarningCode.UNUSED_FIELD, 41, 2)], + [error(WarningCode.unusedField, 41, 2)], ); } @@ -391,7 +391,7 @@ mixin _A { } void main() => print(_A); ''', - [error(WarningCode.UNUSED_FIELD, 27, 2)], + [error(WarningCode.unusedField, 27, 2)], ); } @@ -403,7 +403,7 @@ class A { int _f = 0; } ''', - [error(WarningCode.UNUSED_FIELD, 37, 2)], + [error(WarningCode.unusedField, 37, 2)], ); } @@ -420,7 +420,7 @@ f(A a) { a._f = 2; } ''', - [error(WarningCode.UNUSED_FIELD, 16, 2)], + [error(WarningCode.unusedField, 16, 2)], ); } @@ -447,7 +447,7 @@ void f() { _E; } ''', - [error(WarningCode.UNUSED_FIELD, 12, 1)], + [error(WarningCode.unusedField, 12, 1)], ); } @@ -490,7 +490,7 @@ void f() { _E.v; } ''', - [error(WarningCode.UNUSED_FIELD, 34, 3)], + [error(WarningCode.unusedField, 34, 3)], ); } @@ -538,7 +538,7 @@ enum E { _v } ''', - [error(WarningCode.UNUSED_FIELD, 11, 2)], + [error(WarningCode.unusedField, 11, 2)], ); } @@ -563,7 +563,7 @@ enum E { final int _foo = 0; } ''', - [error(WarningCode.UNUSED_FIELD, 26, 4)], + [error(WarningCode.unusedField, 26, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/unused_import_test.dart b/pkg/analyzer/test/src/diagnostics/unused_import_test.dart index 2ddc2f710b5..521ad1e245d 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_import_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_import_test.dart @@ -300,7 +300,7 @@ extension E on String { ''' import 'lib1.dart' as lib1; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); } @@ -329,7 +329,7 @@ import 'lib1.dart'; import 'lib1.dart' hide A; A? a; ''', - [error(WarningCode.UNUSED_IMPORT, 27, 11)], + [error(WarningCode.unusedImport, 27, 11)], ); } @@ -374,7 +374,7 @@ f() { ''.b(); } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); } @@ -391,7 +391,7 @@ void f() { A.foo(); } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 12)], + [error(WarningCode.unusedImport, 7, 12)], ); } @@ -404,7 +404,7 @@ void f() { Duration(seconds: 0); } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); } @@ -418,7 +418,7 @@ import 'lib1.dart'; import 'lib1.dart' as one; one.A a = one.A(); ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); } @@ -453,7 +453,7 @@ import 'lib1.dart' as one; import 'lib2.dart' as one; one.A a = one.A(); ''', - [error(WarningCode.UNUSED_IMPORT, 34, 11)], + [error(WarningCode.unusedImport, 34, 11)], ); } @@ -518,7 +518,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 129, 1)], + [error(WarningCode.unusedLocalVariable, 129, 1)], ); } @@ -550,7 +550,7 @@ import 'dart:io' as prefix; import 'a.dart' as prefix; prefix.File? f; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 9)], + [error(WarningCode.unusedImport, 7, 9)], ); } @@ -565,7 +565,7 @@ import 'lib1.dart' show A; import 'lib1.dart' show B; A a = A(); ''', - [error(WarningCode.UNUSED_IMPORT, 34, 11)], + [error(WarningCode.unusedImport, 34, 11)], ); } @@ -579,7 +579,7 @@ import 'dart:io'; import 'lib1.dart'; File? f; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 9)], + [error(WarningCode.unusedImport, 7, 9)], ); } @@ -589,7 +589,7 @@ File? f; r''' import 'lib1.dart'; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 11)], + [error(WarningCode.unusedImport, 7, 11)], ); } @@ -680,7 +680,7 @@ import 'dart:math'; await assertErrorsInFile2(a, []); - await assertErrorsInFile2(b, [error(WarningCode.UNUSED_IMPORT, 25, 11)]); + await assertErrorsInFile2(b, [error(WarningCode.unusedImport, 25, 11)]); } test_part_usedLibraryImport() async { @@ -762,7 +762,7 @@ import 'dart:math'; void f(Random _) {} '''); - await assertErrorsInFile2(a, [error(WarningCode.UNUSED_IMPORT, 7, 11)]); + await assertErrorsInFile2(a, [error(WarningCode.unusedImport, 7, 11)]); await assertErrorsInFile2(b, []); } diff --git a/pkg/analyzer/test/src/diagnostics/unused_label_test.dart b/pkg/analyzer/test/src/diagnostics/unused_label_test.dart index dc67a5a67db..e4a34a2f986 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_label_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_label_test.dart @@ -35,7 +35,7 @@ f(x) { } } ''', - [error(WarningCode.UNUSED_LABEL, 26, 6)], + [error(WarningCode.unusedLabel, 26, 6)], ); } @@ -48,7 +48,7 @@ f(condition()) { } } ''', - [error(WarningCode.UNUSED_LABEL, 19, 6)], + [error(WarningCode.unusedLabel, 19, 6)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unused_local_variable_test.dart b/pkg/analyzer/test/src/diagnostics/unused_local_variable_test.dart index d3733e79632..142366ab511 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_local_variable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_local_variable_test.dart @@ -22,7 +22,7 @@ void f(List<(int,)> x) { for (var (a,) in x) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 37, 1)], + [error(WarningCode.unusedLocalVariable, 37, 1)], ); } @@ -51,7 +51,7 @@ void f() { for (var (a,) = (0,);;) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 23, 1)], + [error(WarningCode.unusedLocalVariable, 23, 1)], ); } @@ -81,8 +81,8 @@ void f(Object? x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 37, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1), + error(WarningCode.unusedLocalVariable, 37, 1), + error(WarningCode.unusedLocalVariable, 47, 1), ], ); } @@ -104,7 +104,7 @@ void f(Object? x) { if (x case int a) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 37, 1)], + [error(WarningCode.unusedLocalVariable, 37, 1)], ); } @@ -145,7 +145,7 @@ f() { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 2)], + [error(WarningCode.unusedLocalVariable, 46, 2)], ); } @@ -172,7 +172,7 @@ f() { ]; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 27, 2)], + [error(WarningCode.unusedLocalVariable, 27, 2)], ); } @@ -185,8 +185,8 @@ f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 26, 3), + error(WarningCode.unusedLocalVariable, 12, 2), + error(WarningCode.unusedLocalVariable, 26, 3), ], ); } @@ -206,7 +206,7 @@ f() { var [__] = [1]; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 2)], + [error(WarningCode.unusedLocalVariable, 13, 2)], ); } @@ -225,7 +225,7 @@ f() { var (__) = (1); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 2)], + [error(WarningCode.unusedLocalVariable, 13, 2)], ); } @@ -246,7 +246,7 @@ void f(Object o) { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 2)], + [error(WarningCode.unusedLocalVariable, 47, 2)], ); } @@ -268,8 +268,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 21, 1), + error(WarningCode.unusedLocalVariable, 18, 1), + error(WarningCode.unusedLocalVariable, 21, 1), ], ); } @@ -282,8 +282,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 22, 1), + error(WarningCode.unusedLocalVariable, 18, 1), + error(WarningCode.unusedLocalVariable, 22, 1), ], ); } @@ -299,8 +299,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 21, 1), + error(WarningCode.unusedLocalVariable, 18, 1), + error(WarningCode.unusedLocalVariable, 21, 1), ], ); } @@ -312,7 +312,7 @@ void f() { var (a,) = (0,); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 18, 1)], + [error(WarningCode.unusedLocalVariable, 18, 1)], ); } @@ -362,7 +362,7 @@ Object? f(Object? x) { }; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 54, 1)], + [error(WarningCode.unusedLocalVariable, 54, 1)], ); } @@ -398,7 +398,7 @@ void f(Object? x) { }; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 49, 1)], + [error(WarningCode.unusedLocalVariable, 49, 1)], ); } @@ -436,8 +436,8 @@ void f(Object? x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 49, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 68, 1), + error(WarningCode.unusedLocalVariable, 49, 1), + error(WarningCode.unusedLocalVariable, 68, 1), ], ); } @@ -465,7 +465,7 @@ void f(Object? x) { }; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 61, 1)], + [error(WarningCode.unusedLocalVariable, 61, 1)], ); } @@ -482,7 +482,7 @@ void f(Object? x) { ''', [ error( - CompileTimeErrorCode.PATTERN_VARIABLE_SHARED_CASE_SCOPE_NOT_ALL_CASES, + CompileTimeErrorCode.patternVariableSharedCaseScopeNotAllCases, 71, 1, ), @@ -501,7 +501,7 @@ void f(Object? x) { }; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 49, 1)], + [error(WarningCode.unusedLocalVariable, 49, 1)], ); } @@ -528,7 +528,7 @@ void f(Object? x) { }; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 79, 1)], + [error(WarningCode.unusedLocalVariable, 79, 1)], ); } @@ -552,7 +552,7 @@ main() { v = 2; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); } @@ -566,7 +566,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 28, 1)], + [error(WarningCode.unusedLocalVariable, 28, 1)], ); } @@ -599,7 +599,7 @@ main() { v += 2; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); } @@ -611,7 +611,7 @@ main() { v++; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); } @@ -623,7 +623,7 @@ main() { ++v; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unused_result_test.dart b/pkg/analyzer/test/src/diagnostics/unused_result_test.dart index 09b4c3ff458..d2d0a568ae3 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_result_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_result_test.dart @@ -56,7 +56,7 @@ A createA() { return B(); } ''', - [error(WarningCode.UNUSED_RESULT, 83, 7)], + [error(WarningCode.unusedResult, 83, 7)], ); } @@ -77,7 +77,7 @@ void f(A a) { ''', [ error( - WarningCode.UNUSED_RESULT, + WarningCode.unusedResult, 96, 1, text: "The value of 'a' should be used.", @@ -105,7 +105,7 @@ void f(A a) { ''', [ error( - WarningCode.UNUSED_RESULT, + WarningCode.unusedResult, 130, 1, text: "The value of 'b' should be used.", @@ -133,7 +133,7 @@ void f(A a) { ''', [ error( - WarningCode.UNUSED_RESULT, + WarningCode.unusedResult, 127, 1, text: "The value of 'b' should be used.", @@ -163,7 +163,7 @@ void f(A a) { ''', [ error( - WarningCode.UNUSED_RESULT, + WarningCode.unusedResult, 170, 1, text: "The value of 'a' should be used.", @@ -202,7 +202,7 @@ void f() { A(); } ''', - [error(WarningCode.UNUSED_RESULT, 80, 3)], + [error(WarningCode.unusedResult, 80, 3)], ); } @@ -300,7 +300,7 @@ void main() { A().foo; } ''', - [error(WarningCode.UNUSED_RESULT, 104, 3)], + [error(WarningCode.unusedResult, 104, 3)], ); } @@ -394,7 +394,7 @@ void main() { A().foo; } ''', - [error(WarningCode.UNUSED_RESULT, 95, 3)], + [error(WarningCode.unusedResult, 95, 3)], ); } @@ -412,7 +412,7 @@ void f(bool b) { b ? A().foo : 0; } ''', - [error(WarningCode.UNUSED_RESULT, 102, 3)], + [error(WarningCode.unusedResult, 102, 3)], ); } @@ -430,7 +430,7 @@ void f(bool b) { b ? (A().foo) : 0; } ''', - [error(WarningCode.UNUSED_RESULT, 103, 3)], + [error(WarningCode.unusedResult, 103, 3)], ); } @@ -452,7 +452,7 @@ void main() { }); } ''', - [error(WarningCode.UNUSED_RESULT, 130, 3)], + [error(WarningCode.unusedResult, 130, 3)], ); } @@ -550,7 +550,7 @@ void main() { A.foo; } ''', - [error(WarningCode.UNUSED_RESULT, 100, 3)], + [error(WarningCode.unusedResult, 100, 3)], ); } @@ -581,7 +581,7 @@ void f() { foo; } ''', - [error(WarningCode.UNUSED_RESULT, 77, 3)], + [error(WarningCode.unusedResult, 77, 3)], ); } @@ -686,7 +686,7 @@ void main() { A().foo; } ''', - [error(WarningCode.UNUSED_RESULT, 100, 3)], + [error(WarningCode.unusedResult, 100, 3)], ); } @@ -927,7 +927,7 @@ void f(A a) { for (var i = 1; i < 7; a.foo()) {} } ''', - [error(WarningCode.UNUSED_RESULT, 119, 3)], + [error(WarningCode.unusedResult, 119, 3)], ); } @@ -1071,7 +1071,7 @@ void f(A a) { a.foo()!; } ''', - [error(WarningCode.UNUSED_RESULT, 97, 3)], + [error(WarningCode.unusedResult, 97, 3)], ); } @@ -1120,7 +1120,7 @@ f() { @useResult (int, int) g() => (0, 0); ''', - [error(WarningCode.UNUSED_RESULT, 42, 1)], + [error(WarningCode.unusedResult, 42, 1)], ); } @@ -1282,7 +1282,7 @@ void main() { ''', [ error( - WarningCode.UNUSED_RESULT, + WarningCode.unusedResult, 98, 3, text: "The value of 'foo' should be used.", @@ -1309,7 +1309,7 @@ class C { ''', [ error( - WarningCode.UNUSED_RESULT, + WarningCode.unusedResult, 127, 2, text: "The value of 'm1' should be used.", @@ -1654,7 +1654,7 @@ void main() { baz(); // OK } ''', - [error(WarningCode.UNUSED_RESULT, 108, 3)], + [error(WarningCode.unusedResult, 108, 3)], ); } @@ -1683,7 +1683,7 @@ void main() { foo(); } ''', - [error(WarningCode.UNUSED_RESULT, 133, 3)], + [error(WarningCode.unusedResult, 133, 3)], ); } @@ -1699,7 +1699,7 @@ void main() { foo('none'); } ''', - [error(WarningCode.UNUSED_RESULT, 146, 3)], + [error(WarningCode.unusedResult, 146, 3)], ); } @@ -1782,7 +1782,7 @@ void main() { foo; } ''', - [error(WarningCode.UNUSED_RESULT, 75, 3)], + [error(WarningCode.unusedResult, 75, 3)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart b/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart index a47b3fc28e1..b5a40351924 100644 --- a/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart +++ b/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart @@ -36,7 +36,7 @@ f() { s.length; } ''', - [error(WarningCode.UNUSED_SHOWN_NAME, 24, 1)], + [error(WarningCode.unusedShownName, 24, 1)], ); } @@ -149,7 +149,7 @@ class B {} import 'lib1.dart' show A, B; A a = A(); ''', - [error(WarningCode.UNUSED_SHOWN_NAME, 27, 1)], + [error(WarningCode.unusedShownName, 27, 1)], ); } @@ -161,7 +161,7 @@ main() { print(max(1, 2)); } ''', - [error(WarningCode.UNDEFINED_SHOWN_NAME, 29, 6)], + [error(WarningCode.undefinedShownName, 29, 6)], ); } @@ -175,7 +175,7 @@ class B {} import 'lib1.dart' as p show A, B; p.A a = p.A(); ''', - [error(WarningCode.UNUSED_SHOWN_NAME, 32, 1)], + [error(WarningCode.unusedShownName, 32, 1)], ); } @@ -194,8 +194,8 @@ A a = A(); C c = C(); ''', [ - error(WarningCode.UNUSED_SHOWN_NAME, 27, 1), - error(WarningCode.UNUSED_SHOWN_NAME, 57, 1), + error(WarningCode.unusedShownName, 27, 1), + error(WarningCode.unusedShownName, 57, 1), ], ); } @@ -215,7 +215,7 @@ int a = var1; int b = var2; int c = var3; ''', - [error(WarningCode.UNUSED_SHOWN_NAME, 66, 4)], + [error(WarningCode.unusedShownName, 66, 4)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_in_doc_import_test.dart b/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_in_doc_import_test.dart index 66d6ffe64cc..a2c32b50c82 100644 --- a/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_in_doc_import_test.dart +++ b/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_in_doc_import_test.dart @@ -21,7 +21,7 @@ class UriDoesNotExistInDocImportTest extends PubPackageResolutionTest { /// @docImport 'dart:foo'; library; ''', - [error(WarningCode.URI_DOES_NOT_EXIST_IN_DOC_IMPORT, 15, 10)], + [error(WarningCode.uriDoesNotExistInDocImport, 15, 10)], ); } @@ -31,7 +31,7 @@ library; /// @docImport 'foo.dart'; library; ''', - [error(WarningCode.URI_DOES_NOT_EXIST_IN_DOC_IMPORT, 15, 10)], + [error(WarningCode.uriDoesNotExistInDocImport, 15, 10)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_test.dart b/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_test.dart index 1bb50ca15c8..7d31d7ad774 100644 --- a/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_test.dart +++ b/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_test.dart @@ -34,7 +34,7 @@ void f() { g(D()); } ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 24, 11)], + [error(CompileTimeErrorCode.uriDoesNotExist, 24, 11)], ); } @@ -43,7 +43,7 @@ void f() { ''' export 'unknown.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 14)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 14)], ); } @@ -52,7 +52,7 @@ export 'unknown.dart'; r''' export 'dart:foo'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 10)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 10)], ); } @@ -61,7 +61,7 @@ export 'dart:foo'; ''' export 'dart:math/bar.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 20)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 20)], ); } @@ -70,7 +70,7 @@ export 'dart:math/bar.dart'; ''' import 'unknown.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 14)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 14)], ); } @@ -81,7 +81,7 @@ import 'unknown.dart'; ''' import 'target.dart'; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 13)], + [error(WarningCode.unusedImport, 7, 13)], ); // Remove the overlay in the same way as AnalysisServer. @@ -92,9 +92,7 @@ import 'target.dart'; await analysisDriver.applyPendingFileChanges(); await resolveTestFile(); - assertErrorsInResult([ - error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 13), - ]); + assertErrorsInResult([error(CompileTimeErrorCode.uriDoesNotExist, 7, 13)]); } test_libraryImport_cannotResolve() async { @@ -102,7 +100,7 @@ import 'target.dart'; r''' import 'dart:foo'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 10)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 10)], ); } @@ -111,7 +109,7 @@ import 'dart:foo'; ''' import 'dart:math/bar.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 20)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 20)], ); } @@ -123,7 +121,7 @@ main() { p.loadLibrary(); } ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 15)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 15)], ); } @@ -133,7 +131,7 @@ main() { ''' import 'target.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 13)], + [error(CompileTimeErrorCode.uriDoesNotExist, 7, 13)], ); newFile('$testPackageLibPath/target.dart', ''); @@ -142,7 +140,7 @@ import 'target.dart'; // TODO(brianwilkerson): The error does not go away, possibly because the // file is not being reanalyzed. await resolveTestFile(); - assertErrorsInResult([error(WarningCode.UNUSED_IMPORT, 0, 0)]); + assertErrorsInResult([error(WarningCode.unusedImport, 0, 0)]); } test_part() async { @@ -151,7 +149,7 @@ import 'target.dart'; library lib; part 'unknown.dart'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 18, 14)], + [error(CompileTimeErrorCode.uriDoesNotExist, 18, 14)], ); } @@ -160,7 +158,7 @@ part 'unknown.dart'; r''' part 'dart:foo'; ''', - [error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 5, 10)], + [error(CompileTimeErrorCode.uriDoesNotExist, 5, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/uri_with_interpolation_test.dart b/pkg/analyzer/test/src/diagnostics/uri_with_interpolation_test.dart index c8a395a1e7a..d7cbf0fa754 100644 --- a/pkg/analyzer/test/src/diagnostics/uri_with_interpolation_test.dart +++ b/pkg/analyzer/test/src/diagnostics/uri_with_interpolation_test.dart @@ -21,7 +21,7 @@ class UriWithInterpolationTest extends PubPackageResolutionTest { /// @docImport '${'foo'}.dart'; library; ''', - [error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 15, 15)], + [error(CompileTimeErrorCode.uriWithInterpolation, 15, 15)], ); } @@ -30,7 +30,7 @@ library; r''' export '${'foo'}.dart'; ''', - [error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 7, 15)], + [error(CompileTimeErrorCode.uriWithInterpolation, 7, 15)], ); } @@ -39,7 +39,7 @@ export '${'foo'}.dart'; r''' import '${'foo'}.dart'; ''', - [error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 7, 15)], + [error(CompileTimeErrorCode.uriWithInterpolation, 7, 15)], ); } @@ -48,7 +48,7 @@ import '${'foo'}.dart'; r''' part '${'foo'}.dart'; ''', - [error(CompileTimeErrorCode.URI_WITH_INTERPOLATION, 5, 15)], + [error(CompileTimeErrorCode.uriWithInterpolation, 5, 15)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/use_of_native_extension_test.dart b/pkg/analyzer/test/src/diagnostics/use_of_native_extension_test.dart index ade2c22e1ef..3b12b67658a 100644 --- a/pkg/analyzer/test/src/diagnostics/use_of_native_extension_test.dart +++ b/pkg/analyzer/test/src/diagnostics/use_of_native_extension_test.dart @@ -21,7 +21,7 @@ class UseOfNativeExtensionTest extends PubPackageResolutionTest { /// @docImport 'dart-ext:x'; library; ''', - [error(CompileTimeErrorCode.USE_OF_NATIVE_EXTENSION, 15, 12)], + [error(CompileTimeErrorCode.useOfNativeExtension, 15, 12)], ); } @@ -30,7 +30,7 @@ library; r''' export 'dart-ext:x'; ''', - [error(CompileTimeErrorCode.USE_OF_NATIVE_EXTENSION, 7, 12)], + [error(CompileTimeErrorCode.useOfNativeExtension, 7, 12)], ); } @@ -39,7 +39,7 @@ export 'dart-ext:x'; r''' import 'dart-ext:x'; ''', - [error(CompileTimeErrorCode.USE_OF_NATIVE_EXTENSION, 7, 12)], + [error(CompileTimeErrorCode.useOfNativeExtension, 7, 12)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/use_of_nullable_value_test.dart b/pkg/analyzer/test/src/diagnostics/use_of_nullable_value_test.dart index e2e94f54ccb..025028cfc29 100644 --- a/pkg/analyzer/test/src/diagnostics/use_of_nullable_value_test.dart +++ b/pkg/analyzer/test/src/diagnostics/use_of_nullable_value_test.dart @@ -26,7 +26,7 @@ m() { x as int; } ''', - [error(WarningCode.CAST_FROM_NULL_ALWAYS_FAILS, 18, 8)], + [error(WarningCode.castFromNullAlwaysFails, 18, 8)], ); } @@ -56,7 +56,7 @@ m() { x == null; } ''', - [error(WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE, 18, 4)], + [error(WarningCode.unnecessaryNullComparisonAlwaysNullTrue, 18, 4)], ); } @@ -69,8 +69,8 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 27, 1), - error(CompileTimeErrorCode.INVALID_USE_OF_NULL_VALUE, 32, 1), + error(WarningCode.unusedLocalVariable, 27, 1), + error(CompileTimeErrorCode.invalidUseOfNullValue, 32, 1), ], ); } @@ -110,7 +110,7 @@ m() { x != null; } ''', - [error(WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE, 18, 4)], + [error(WarningCode.unnecessaryNullComparisonAlwaysNullFalse, 18, 4)], ); } @@ -175,12 +175,12 @@ extension E on A? { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 130, 1, ), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 158, 1, ), @@ -227,12 +227,12 @@ extension E on A? { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 68, 3, ), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 84, 3, ), @@ -281,7 +281,7 @@ extension E on A? { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 77, 1, ), @@ -332,12 +332,12 @@ extension E on A? { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 93, 3, ), error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 107, 3, ), @@ -388,12 +388,12 @@ extension E on A? { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 93, 3, ), error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 111, 3, ), @@ -423,7 +423,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, 22, 1, ), @@ -439,7 +439,7 @@ void f() { x as int; } ''', - [error(WarningCode.CAST_FROM_NULLABLE_ALWAYS_FAILS, 23, 1)], + [error(WarningCode.castFromNullableAlwaysFails, 23, 1)], ); } @@ -471,7 +471,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, 26, 1, ), @@ -499,7 +499,7 @@ m(B b) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 104, 1, ), @@ -643,7 +643,7 @@ m(B b) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 115, 2, ), @@ -739,7 +739,7 @@ m(B b) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 105, 1, ), @@ -825,7 +825,7 @@ m(int x, int? y) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 33, 2, ), @@ -907,7 +907,7 @@ f(List? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 23, 1, ), @@ -933,7 +933,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 21, 3, ), @@ -958,7 +958,7 @@ f(int? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 17, 6, ), @@ -982,7 +982,7 @@ m() { x == null; } ''', - [error(WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_TRUE, 18, 4)], + [error(WarningCode.unnecessaryNullComparisonAlwaysNullTrue, 18, 4)], ); } @@ -994,7 +994,7 @@ m() { for (var y in x) {} } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1)], + [error(WarningCode.unusedLocalVariable, 32, 1)], ); } @@ -1007,9 +1007,9 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 28, 1), + error(WarningCode.unusedLocalVariable, 28, 1), error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsIterator, 33, 1, ), @@ -1026,9 +1026,9 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1), + error(WarningCode.unusedLocalVariable, 29, 1), error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsIterator, 35, 1, ), @@ -1049,7 +1049,7 @@ m(int? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 60, 3, ), @@ -1076,7 +1076,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, 23, 1, ), @@ -1103,7 +1103,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 20, 1, ), @@ -1128,13 +1128,7 @@ m() { x(); } ''', - [ - error( - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, - 23, - 1, - ), - ], + [error(CompileTimeErrorCode.uncheckedInvocationOfNullableValue, 23, 1)], ); } @@ -1145,13 +1139,7 @@ void f(List funcList) { funcList[0](); } ''', - [ - error( - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, - 50, - 11, - ), - ], + [error(CompileTimeErrorCode.uncheckedInvocationOfNullableValue, 50, 11)], ); } @@ -1172,13 +1160,7 @@ m() { x(); } ''', - [ - error( - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, - 25, - 1, - ), - ], + [error(CompileTimeErrorCode.uncheckedInvocationOfNullableValue, 25, 1)], ); } @@ -1237,7 +1219,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 20, 6, ), @@ -1272,7 +1254,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 22, 6, ), @@ -1298,7 +1280,7 @@ m(T x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 29, 6, ), @@ -1313,13 +1295,7 @@ m(List x) { x.first(); } ''', - [ - error( - CompileTimeErrorCode.UNCHECKED_INVOCATION_OF_NULLABLE_VALUE, - 38, - 7, - ), - ], + [error(CompileTimeErrorCode.uncheckedInvocationOfNullableValue, 38, 7)], ); } @@ -1367,7 +1343,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 20, 5, ), @@ -1388,7 +1364,7 @@ m(int? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 56, 3, ), @@ -1429,7 +1405,7 @@ m(Function? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 21, 4, ), @@ -1445,7 +1421,7 @@ m() { x -= 1; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -1458,9 +1434,9 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), + error(WarningCode.unusedLocalVariable, 13, 1), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 20, 2, ), @@ -1476,7 +1452,7 @@ m() { if(!x) {} } ''', - [error(WarningCode.DEAD_CODE, 32, 2)], + [error(WarningCode.deadCode, 32, 2)], ); } @@ -1490,7 +1466,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, 23, 1, ), @@ -1506,7 +1482,7 @@ m() { x != null; } ''', - [error(WarningCode.UNNECESSARY_NULL_COMPARISON_ALWAYS_NULL_FALSE, 18, 4)], + [error(WarningCode.unnecessaryNullComparisonAlwaysNullFalse, 18, 4)], ); } @@ -1557,7 +1533,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue, 20, 1, ), @@ -1584,7 +1560,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue, 20, 1, ), @@ -1600,7 +1576,7 @@ m() { x--; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -1613,9 +1589,9 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), + error(WarningCode.unusedLocalVariable, 13, 1), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 19, 2, ), @@ -1640,7 +1616,7 @@ m(int? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 15, 2, ), @@ -1663,7 +1639,7 @@ m(A? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 78, 2, ), @@ -1679,7 +1655,7 @@ m() { --x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -1692,9 +1668,9 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), + error(WarningCode.unusedLocalVariable, 13, 1), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 18, 2, ), @@ -1719,7 +1695,7 @@ m(int? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 14, 2, ), @@ -1735,7 +1711,7 @@ m() { -x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 12, 1)], + [error(WarningCode.unusedLocalVariable, 12, 1)], ); } @@ -1748,9 +1724,9 @@ m() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 13, 1), + error(WarningCode.unusedLocalVariable, 13, 1), error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 18, 1, ), @@ -1773,7 +1749,7 @@ m(A? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 72, 1, ), @@ -1789,7 +1765,7 @@ m() { if(x || false) {} } ''', - [error(WarningCode.DEAD_CODE, 30, 8)], + [error(WarningCode.deadCode, 30, 8)], ); } @@ -1803,7 +1779,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, 22, 1, ), @@ -1828,7 +1804,7 @@ m(int? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 16, 2, ), @@ -1851,7 +1827,7 @@ m(A? a) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 68, 1, ), @@ -1889,7 +1865,7 @@ m(B b) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 105, 1, ), @@ -1927,7 +1903,7 @@ m(B? b) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 103, 1, ), @@ -1970,7 +1946,7 @@ m(C c) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 148, 1, ), @@ -2013,7 +1989,7 @@ m(C c) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_PROPERTY_ACCESS_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedPropertyAccessOfNullableValue, 152, 1, ), @@ -2052,13 +2028,7 @@ m() { [...list]; } ''', - [ - error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_SPREAD, - 26, - 4, - ), - ], + [error(CompileTimeErrorCode.uncheckedUseOfNullableValueInSpread, 26, 4)], ); } @@ -2081,7 +2051,7 @@ m() { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_CONDITION, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsCondition, 19, 1, ), @@ -2116,7 +2086,7 @@ m(String? s) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue, 27, 3, ), @@ -2133,7 +2103,7 @@ void f(int? x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_OPERATOR_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedOperatorInvocationOfNullableValue, 30, 1, ), @@ -2171,9 +2141,9 @@ m() sync* { } ''', [ - error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 37, 1), + error(CompileTimeErrorCode.yieldEachOfInvalidType, 37, 1), error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH, + CompileTimeErrorCode.uncheckedUseOfNullableValueInYieldEach, 37, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart b/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart index c99d572103d..8fc8808f250 100644 --- a/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart +++ b/pkg/analyzer/test/src/diagnostics/use_of_void_result_test.dart @@ -23,7 +23,7 @@ void f(void x) { x && true; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 19, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 19, 1)], ); } @@ -34,7 +34,7 @@ void f(void x) { true && x; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 27, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 27, 1)], ); } @@ -46,7 +46,7 @@ void f(void x) { dynamic v = x; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 65, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 65, 1)], ); } @@ -70,8 +70,8 @@ class A { } }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 38, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 49, 1), + error(WarningCode.unusedLocalVariable, 38, 1), + error(CompileTimeErrorCode.useOfVoidResult, 49, 1), ], ); } @@ -87,8 +87,8 @@ class A { } }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 40, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 51, 1), + error(WarningCode.unusedLocalVariable, 40, 1), + error(CompileTimeErrorCode.useOfVoidResult, 51, 1), ], ); } @@ -109,7 +109,7 @@ void f(void x) async { await x; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 31, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 31, 1)], ); } @@ -121,7 +121,7 @@ class A { A(void x) : f = x; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 41, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 41, 1)], ); } @@ -147,7 +147,7 @@ void h() { E(f()).g; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 73, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 73, 3)], ); } @@ -161,7 +161,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 1)], + [error(WarningCode.unusedLocalVariable, 33, 1)], ); } @@ -175,8 +175,8 @@ class A { } }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 51, 1), + error(WarningCode.unusedLocalVariable, 47, 1), + error(CompileTimeErrorCode.useOfVoidResult, 51, 1), ], ); } @@ -191,7 +191,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1)], + [error(WarningCode.unusedLocalVariable, 45, 1)], ); } @@ -202,7 +202,7 @@ void f(void x) { "$x"; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 21, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 21, 1)], ); } @@ -213,7 +213,7 @@ void f(void x) { !x; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 20, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 20, 1)], ); } @@ -225,7 +225,7 @@ g() { var a = f(); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 26, 1)], + [error(WarningCode.unusedLocalVariable, 26, 1)], ); } @@ -236,7 +236,7 @@ f(void x) { x!; } ''', - [ExpectedError(CompileTimeErrorCode.USE_OF_VOID_RESULT, 14, 2)], + [ExpectedError(CompileTimeErrorCode.useOfVoidResult, 14, 2)], ); assertType(findNode.postfix('x!'), 'void'); @@ -249,7 +249,7 @@ void f(void x) { x || true; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 19, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 19, 1)], ); } @@ -260,7 +260,7 @@ void f(void x) { false || x; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 28, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 28, 1)], ); } @@ -271,7 +271,7 @@ void f(void x) { (one: x,); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 20, 6)], + [error(CompileTimeErrorCode.useOfVoidResult, 20, 6)], ); } @@ -282,7 +282,7 @@ void f(void x) { (x,); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 20, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 20, 1)], ); } @@ -293,7 +293,7 @@ void f(void x) { switch(x) {} } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 26, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 26, 1)], ); } @@ -305,8 +305,8 @@ void f(void x) { } ''', [ - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 25, 1), - error(CompileTimeErrorCode.THROW_OF_INVALID_TYPE, 25, 1), + error(CompileTimeErrorCode.useOfVoidResult, 25, 1), + error(CompileTimeErrorCode.throwOfInvalidType, 25, 1), ], ); } @@ -320,11 +320,11 @@ void test(void f()) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 24, 1, ), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 25, 3), + error(CompileTimeErrorCode.useOfVoidResult, 25, 3), ], ); } @@ -338,11 +338,11 @@ void f(void x) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_METHOD_INVOCATION_OF_NULLABLE_VALUE, + CompileTimeErrorCode.uncheckedMethodInvocationOfNullableValue, 19, 1, ), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 20, 1), + error(CompileTimeErrorCode.useOfVoidResult, 20, 1), ], ); } @@ -354,7 +354,7 @@ void f(List list, void x) { list[x] = null; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 35, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 35, 1)], ); } @@ -365,7 +365,7 @@ void f(List list, void x) { list[x]; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 35, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 35, 1)], ); } @@ -377,8 +377,8 @@ void f(void x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 27, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 31, 1), + error(WarningCode.unusedLocalVariable, 27, 1), + error(CompileTimeErrorCode.useOfVoidResult, 31, 1), ], ); } @@ -390,7 +390,7 @@ void f(void x) { x[0]; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 20, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 20, 3)], ); } @@ -401,7 +401,7 @@ void f(void x) { x.foo = null; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 21, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 21, 3)], ); } @@ -422,7 +422,7 @@ void f(void x) { x ? null : null; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 19, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 19, 1)], ); } @@ -451,7 +451,7 @@ void f(void x) { do {} while (x); } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 32, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 32, 1)], ); } @@ -472,11 +472,11 @@ void f(void x, var y) { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsIterator, 36, 1, ), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 36, 1), + error(CompileTimeErrorCode.useOfVoidResult, 36, 1), ], ); } @@ -489,13 +489,13 @@ void f(void x) { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 28, 1), + error(WarningCode.unusedLocalVariable, 28, 1), error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_AS_ITERATOR, + CompileTimeErrorCode.uncheckedUseOfNullableValueAsIterator, 33, 1, ), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 33, 1), + error(CompileTimeErrorCode.useOfVoidResult, 33, 1), ], ); } @@ -508,7 +508,7 @@ void f(void x) { for (x in [1, 2]) {} } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 24, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 24, 1)], ); } @@ -527,7 +527,7 @@ void f(void x) { x is int; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 19, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 19, 1)], ); } @@ -538,7 +538,7 @@ void f(void x) { [x]; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 29, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 29, 1)], ); } @@ -557,7 +557,7 @@ void f(void x) { {x : 4}; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 34, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 34, 1)], ); } @@ -576,7 +576,7 @@ void f(void x) { {4: x}; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 37, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 37, 1)], ); } @@ -595,7 +595,7 @@ void f(void x) { x ?? 1; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 19, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 19, 1)], ); } @@ -614,7 +614,7 @@ void f(void x) { x += 1; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 21, 2)], + [error(CompileTimeErrorCode.useOfVoidResult, 21, 2)], ); } @@ -625,7 +625,7 @@ void f(void x) { while (x) {}; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 26, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 26, 1)], ); } @@ -636,7 +636,7 @@ void f(void x) { x?.foo; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 22, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 22, 3)], ); } @@ -647,7 +647,7 @@ void f(void x) { x.foo; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 21, 3)], + [error(CompileTimeErrorCode.useOfVoidResult, 21, 3)], ); } @@ -662,8 +662,8 @@ extension on void { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 22, 8), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 96, 4), + error(WarningCode.unusedElement, 22, 8), + error(CompileTimeErrorCode.useOfVoidResult, 96, 4), ], ); } @@ -677,7 +677,7 @@ dynamic f(void x) { return x; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 36, 1)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 36, 1)], ); } @@ -697,7 +697,7 @@ void f(void x) { } void g(dynamic x) { } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 21, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 21, 1)], ); } @@ -708,7 +708,7 @@ void f(void x) { void y = x; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 24, 1)], + [error(WarningCode.unusedLocalVariable, 24, 1)], ); } @@ -722,8 +722,8 @@ class A { } }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 45, 1), + error(WarningCode.unusedLocalVariable, 41, 1), + error(CompileTimeErrorCode.useOfVoidResult, 45, 1), ], ); } @@ -738,7 +738,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 39, 1)], + [error(WarningCode.unusedLocalVariable, 39, 1)], ); } @@ -752,10 +752,10 @@ class A { } }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 43, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 47, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 52, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 56, 1), + error(WarningCode.unusedLocalVariable, 43, 1), + error(CompileTimeErrorCode.useOfVoidResult, 47, 1), + error(WarningCode.unusedLocalVariable, 52, 1), + error(CompileTimeErrorCode.useOfVoidResult, 56, 1), ], ); } @@ -770,8 +770,8 @@ class A { } }''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 43, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 47, 1), + error(WarningCode.unusedLocalVariable, 43, 1), + error(CompileTimeErrorCode.useOfVoidResult, 47, 1), ], ); } @@ -786,7 +786,7 @@ class A { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 1)], + [error(WarningCode.unusedLocalVariable, 41, 1)], ); } @@ -799,12 +799,12 @@ Object? f(void x) async* { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH, + CompileTimeErrorCode.uncheckedUseOfNullableValueInYieldEach, 36, 1, ), - error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 36, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 36, 1), + error(CompileTimeErrorCode.yieldEachOfInvalidType, 36, 1), + error(CompileTimeErrorCode.useOfVoidResult, 36, 1), ], ); } @@ -818,12 +818,12 @@ Object? f(void x) sync* { ''', [ error( - CompileTimeErrorCode.UNCHECKED_USE_OF_NULLABLE_VALUE_IN_YIELD_EACH, + CompileTimeErrorCode.uncheckedUseOfNullableValueInYieldEach, 35, 1, ), - error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 35, 1), - error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 35, 1), + error(CompileTimeErrorCode.yieldEachOfInvalidType, 35, 1), + error(CompileTimeErrorCode.useOfVoidResult, 35, 1), ], ); } @@ -835,7 +835,7 @@ dynamic f(void x) async* { yield x; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 35, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 35, 1)], ); } @@ -846,7 +846,7 @@ dynamic f(void x) sync* { yield x; } ''', - [error(CompileTimeErrorCode.USE_OF_VOID_RESULT, 34, 1)], + [error(CompileTimeErrorCode.useOfVoidResult, 34, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/values_declaration_in_enum_test.dart b/pkg/analyzer/test/src/diagnostics/values_declaration_in_enum_test.dart index 8b9609e792d..b1bbb790d74 100644 --- a/pkg/analyzer/test/src/diagnostics/values_declaration_in_enum_test.dart +++ b/pkg/analyzer/test/src/diagnostics/values_declaration_in_enum_test.dart @@ -22,7 +22,7 @@ enum E { values } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 11, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 11, 6)], ); } @@ -34,7 +34,7 @@ enum E { final int values = 0; } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 26, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 26, 6)], ); } @@ -46,7 +46,7 @@ enum E { static int values = 0; } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 27, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 27, 6)], ); } @@ -59,7 +59,7 @@ enum E { const E(); } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 22, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 22, 6)], ); } @@ -71,7 +71,7 @@ enum E { int get values => 0; } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 24, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 24, 6)], ); } @@ -83,7 +83,7 @@ enum E { static int get values => 0; } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 31, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 31, 6)], ); } @@ -95,7 +95,7 @@ enum E { void values() {} } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 21, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 21, 6)], ); } @@ -107,7 +107,7 @@ enum E { static void values() {} } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 28, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 28, 6)], ); } @@ -119,7 +119,7 @@ enum E { set values(_) {} } ''', - [error(CompileTimeErrorCode.VALUES_DECLARATION_IN_ENUM, 20, 6)], + [error(CompileTimeErrorCode.valuesDeclarationInEnum, 20, 6)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/variable_type_mismatch_test.dart b/pkg/analyzer/test/src/diagnostics/variable_type_mismatch_test.dart index c2138363176..adf02db7e47 100644 --- a/pkg/analyzer/test/src/diagnostics/variable_type_mismatch_test.dart +++ b/pkg/analyzer/test/src/diagnostics/variable_type_mismatch_test.dart @@ -26,7 +26,7 @@ const int? x = null; ''' const Unresolved x = null; ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 6, 10)], + [error(CompileTimeErrorCode.undefinedClass, 6, 10)], ); } @@ -35,7 +35,7 @@ const Unresolved x = null; ''' const int x = 'foo'; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 14, 5)], + [error(CompileTimeErrorCode.invalidAssignment, 14, 5)], ); } @@ -44,7 +44,7 @@ const int x = 'foo'; ''' const Unresolved x = 'foo'; ''', - [error(CompileTimeErrorCode.UNDEFINED_CLASS, 6, 10)], + [error(CompileTimeErrorCode.undefinedClass, 6, 10)], ); } @@ -57,7 +57,7 @@ const Unresolved x = 'foo'; const dynamic x = 0; const double y = x; ''', - [error(CompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, 38, 1)], + [error(CompileTimeErrorCode.variableTypeMismatch, 38, 1)], ); } @@ -67,7 +67,7 @@ const double y = x; const dynamic x = [1]; const List y = x; ''', - [error(CompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, 46, 1)], + [error(CompileTimeErrorCode.variableTypeMismatch, 46, 1)], ); } @@ -77,7 +77,7 @@ const List y = x; const dynamic x = {1: 1}; const Map y = x; ''', - [error(CompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, 57, 1)], + [error(CompileTimeErrorCode.variableTypeMismatch, 57, 1)], ); } @@ -87,7 +87,7 @@ const Map y = x; const dynamic x = {1: 1}; const Map y = x; ''', - [error(CompileTimeErrorCode.VARIABLE_TYPE_MISMATCH, 57, 1)], + [error(CompileTimeErrorCode.variableTypeMismatch, 57, 1)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/void_with_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/void_with_type_arguments_test.dart index d5f0ca7e915..166211ba37a 100644 --- a/pkg/analyzer/test/src/diagnostics/void_with_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/void_with_type_arguments_test.dart @@ -26,7 +26,7 @@ void f() {} ''' void f() {} ''', - [error(ParserErrorCode.VOID_WITH_TYPE_ARGUMENTS, 4, 1)], + [error(ParserErrorCode.voidWithTypeArguments, 4, 1)], ); var node = findNode.namedType('void'); diff --git a/pkg/analyzer/test/src/diagnostics/wrong_number_of_parameters_for_operator_test.dart b/pkg/analyzer/test/src/diagnostics/wrong_number_of_parameters_for_operator_test.dart index c6ff8adf1d2..ed2fc294bb1 100644 --- a/pkg/analyzer/test/src/diagnostics/wrong_number_of_parameters_for_operator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/wrong_number_of_parameters_for_operator_test.dart @@ -75,7 +75,7 @@ class A { ''', [ error( - CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, + CompileTimeErrorCode.wrongNumberOfParametersForOperatorMinus, 21, 1, ), @@ -97,13 +97,7 @@ class A { operator $name($parameters) {} } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, - 21, - 1, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfParametersForOperator, 21, 1)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_enum_test.dart b/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_enum_test.dart index 7328e4fa525..4655bb8fad4 100644 --- a/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_enum_test.dart +++ b/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_enum_test.dart @@ -22,7 +22,7 @@ enum E { v() } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_ENUM, 18, 5)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsEnum, 18, 5)], ); } @@ -33,7 +33,7 @@ enum E { v() } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_ENUM, 15, 10)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsEnum, 15, 10)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_extension_test.dart b/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_extension_test.dart index b963cd619c4..6658e252f01 100644 --- a/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_extension_test.dart +++ b/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_extension_test.dart @@ -26,13 +26,7 @@ void f() { E(0).foo(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION, - 54, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsExtension, 54, 5)], ); var node = findNode.extensionOverride('E'); @@ -72,13 +66,7 @@ void f() { E(0).foo(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION, - 60, - 6, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsExtension, 60, 6)], ); var node = findNode.extensionOverride('E'); @@ -121,13 +109,7 @@ void f() { E(0).foo(); } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION, - 57, - 11, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsExtension, 57, 11)], ); var node = findNode.extensionOverride('E'); diff --git a/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_test.dart b/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_test.dart index 96ea371e1f1..36b4735bb7a 100644 --- a/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_test.dart +++ b/pkg/analyzer/test/src/diagnostics/wrong_number_of_type_arguments_test.dart @@ -22,7 +22,7 @@ class WrongNumberOfTypeArgumentsTest extends PubPackageResolutionTest { class A {} A? a; ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 17, 5)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 17, 5)], ); } @@ -32,7 +32,7 @@ A? a; class A {} A? a; ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 14, 8)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 14, 8)], ); } @@ -43,7 +43,7 @@ class A {} mixin M {} class B = A with M; ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 47, 4)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 47, 4)], ); } @@ -58,7 +58,7 @@ f() { return const C(); } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 47, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 47, 6)], ); } @@ -73,7 +73,7 @@ f() { return const C(); } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 53, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 53, 6)], ); } @@ -88,7 +88,7 @@ f() { return const C(); } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 50, 11)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 50, 11)], ); } @@ -97,7 +97,7 @@ f() { r''' dynamic v; ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 0, 12)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 0, 12)], ); } @@ -109,13 +109,7 @@ void f() { } void g() {} ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - 14, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, 14, 5)], ); } @@ -127,13 +121,7 @@ void f() { } void g() {} ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - 14, - 13, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, 14, 13)], ); } @@ -147,13 +135,7 @@ class C { void call() {} } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 12, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 12, 5)], ); } @@ -167,13 +149,7 @@ class C { void call() {} } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 12, - 13, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 12, 13)], ); } @@ -185,13 +161,7 @@ f() { foo; } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 33, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 33, 5)], ); } @@ -203,13 +173,7 @@ f() { foo; } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_FUNCTION, - 30, - 10, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsFunction, 30, 10)], ); } @@ -222,8 +186,7 @@ f(void Function() foo, void Function() bar) { ''', [ error( - CompileTimeErrorCode - .WRONG_NUMBER_OF_TYPE_ARGUMENTS_ANONYMOUS_FUNCTION, + CompileTimeErrorCode.wrongNumberOfTypeArgumentsAnonymousFunction, 80, 5, ), @@ -240,7 +203,7 @@ f(void Function() foo, void Function() bar) { ''', [ error( - CompileTimeErrorCode.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION, + CompileTimeErrorCode.disallowedTypeInstantiationExpression, 57, 20, ), @@ -258,7 +221,7 @@ class A { @A() void f() {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 28, 5)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 28, 5)], ); } @@ -274,7 +237,7 @@ typedef B = A; @B() void f() {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 44, 5)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 44, 5)], ); } @@ -288,7 +251,7 @@ class A { @A() void f() {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 34, 5)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 34, 5)], ); } @@ -304,7 +267,7 @@ typedef B = A; @B() void f() {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 50, 5)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 50, 5)], ); } @@ -318,7 +281,7 @@ class A { @A() void f() {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 31, 13)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 31, 13)], ); } @@ -334,7 +297,7 @@ typedef B = A; @B() void f() {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 47, 13)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 47, 13)], ); } @@ -348,13 +311,7 @@ class C { void g() {} } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - 19, - 5, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, 19, 5)], ); } @@ -368,13 +325,7 @@ class C { void g() {} } ''', - [ - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - 19, - 13, - ), - ], + [error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, 19, 13)], ); } @@ -387,7 +338,7 @@ f() { return new C(); } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 31, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 31, 6)], ); } @@ -400,7 +351,7 @@ f() { return new C(); } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 37, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 37, 6)], ); } @@ -413,7 +364,7 @@ f() { return new C(); } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 34, 11)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 34, 11)], ); } @@ -431,7 +382,7 @@ void f(x) { } } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 79, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 79, 6)], ); } @@ -449,7 +400,7 @@ void f(x) { } } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 73, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 73, 6)], ); } @@ -463,7 +414,7 @@ f(A a) { a.element.anyGetterExistsInDynamic; } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 38, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 38, 6)], ); } @@ -477,7 +428,7 @@ f(A a) { a.element.anyGetterExistsInDynamic; } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 35, 11)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 35, 11)], ); } @@ -488,7 +439,7 @@ class C { late T f; } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 20, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 20, 6)], ); } @@ -501,7 +452,7 @@ f(p) { return p is C; } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 49, 4)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 49, 4)], ); } @@ -514,7 +465,7 @@ f(p) { return p is C; } ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 46, 7)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 46, 7)], ); } } @@ -529,7 +480,7 @@ extension type A(int it) {} void f(A a) {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 36, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 36, 6)], ); var node = findNode.namedType('A'); @@ -556,7 +507,7 @@ extension type A(int it) {} void f(A a) {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 42, 6)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 42, 6)], ); var node = findNode.namedType('A'); @@ -583,7 +534,7 @@ extension type A(int it) {} void f(A a) {} ''', - [error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 39, 14)], + [error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 39, 14)], ); var node = findNode.namedType('A'); diff --git a/pkg/analyzer/test/src/diagnostics/wrong_type_parameter_variance_in_superinterface_test.dart b/pkg/analyzer/test/src/diagnostics/wrong_type_parameter_variance_in_superinterface_test.dart index e113bcc90c8..4f45830542f 100644 --- a/pkg/analyzer/test/src/diagnostics/wrong_type_parameter_variance_in_superinterface_test.dart +++ b/pkg/analyzer/test/src/diagnostics/wrong_type_parameter_variance_in_superinterface_test.dart @@ -25,7 +25,7 @@ class B extends A> {} ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 55, 1, ), @@ -52,7 +52,7 @@ class B extends A> {} ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 90, 1, ), @@ -78,7 +78,7 @@ class B extends A> {} ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 90, 1, ), @@ -102,7 +102,7 @@ class B implements A> {} ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 55, 1, ), @@ -134,7 +134,7 @@ class B extends Object with A> {} ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 55, 1, ), @@ -167,7 +167,7 @@ class B = A> with M; ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 63, 1, ), @@ -185,7 +185,7 @@ class B = A> with M; ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 66, 1, ), @@ -220,7 +220,7 @@ class B = Object with M implements A>; ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 66, 1, ), @@ -254,7 +254,7 @@ class B = Object with M>; ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 55, 1, ), @@ -288,7 +288,7 @@ enum E implements A> { ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 54, 1, ), @@ -326,7 +326,7 @@ enum E with A> { ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 54, 1, ), @@ -362,7 +362,7 @@ extension type B(A it) ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 31, 1, ), @@ -387,7 +387,7 @@ extension type B(A it) ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 31, 1, ), @@ -404,7 +404,7 @@ mixin B implements A> {} ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 55, 1, ), @@ -436,7 +436,7 @@ mixin B on A> {} ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 55, 1, ), @@ -467,7 +467,7 @@ class B extends A()> {} ''', [ error( - CompileTimeErrorCode.WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE, + CompileTimeErrorCode.wrongTypeParameterVarianceInSuperinterface, 22, 1, ), diff --git a/pkg/analyzer/test/src/diagnostics/yield_each_in_non_generator_test.dart b/pkg/analyzer/test/src/diagnostics/yield_each_in_non_generator_test.dart index a81e0ed8705..84974af4333 100644 --- a/pkg/analyzer/test/src/diagnostics/yield_each_in_non_generator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/yield_each_in_non_generator_test.dart @@ -22,7 +22,7 @@ f() async { yield* 0; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR, 14, 9)], + [error(CompileTimeErrorCode.yieldEachInNonGenerator, 14, 9)], ); } @@ -38,7 +38,7 @@ f() { yield* 0; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_IN_NON_GENERATOR, 0, 0)], + [error(CompileTimeErrorCode.yieldEachInNonGenerator, 0, 0)], ); } } diff --git a/pkg/analyzer/test/src/diagnostics/yield_in_non_generator_test.dart b/pkg/analyzer/test/src/diagnostics/yield_in_non_generator_test.dart index 0473bdb1f0a..eac09df7841 100644 --- a/pkg/analyzer/test/src/diagnostics/yield_in_non_generator_test.dart +++ b/pkg/analyzer/test/src/diagnostics/yield_in_non_generator_test.dart @@ -22,7 +22,7 @@ f() async { yield 0; } ''', - [error(CompileTimeErrorCode.YIELD_IN_NON_GENERATOR, 14, 8)], + [error(CompileTimeErrorCode.yieldInNonGenerator, 14, 8)], ); } @@ -46,7 +46,7 @@ f() { yield 0; } ''', - [error(CompileTimeErrorCode.YIELD_IN_NON_GENERATOR, 0, 0)], + [error(CompileTimeErrorCode.yieldInNonGenerator, 0, 0)], ); } diff --git a/pkg/analyzer/test/src/diagnostics/yield_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/yield_of_invalid_type_test.dart index fb6f1f0428d..cfeeb7fdcb5 100644 --- a/pkg/analyzer/test/src/diagnostics/yield_of_invalid_type_test.dart +++ b/pkg/analyzer/test/src/diagnostics/yield_of_invalid_type_test.dart @@ -31,7 +31,7 @@ int f() async* { yield 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 0, 3)], + [error(CompileTimeErrorCode.illegalAsyncGeneratorReturnType, 0, 3)], ); } @@ -50,7 +50,7 @@ Iterable f() async* { yield 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE, 0, 13)], + [error(CompileTimeErrorCode.illegalAsyncGeneratorReturnType, 0, 13)], ); } @@ -77,7 +77,7 @@ Stream f() async* { yield 0; } ''', - [error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 36, 1)], + [error(CompileTimeErrorCode.yieldOfInvalidType, 36, 1)], ); } @@ -91,7 +91,7 @@ void f() { }; } ''', - [error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 99, 1)], + [error(CompileTimeErrorCode.yieldOfInvalidType, 99, 1)], ); } @@ -110,7 +110,7 @@ Stream f() async* { yield null; } ''', - [error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 33, 4)], + [error(CompileTimeErrorCode.yieldOfInvalidType, 33, 4)], ); } @@ -129,7 +129,7 @@ int f() sync* { yield 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 0, 3)], + [error(CompileTimeErrorCode.illegalSyncGeneratorReturnType, 0, 3)], ); } @@ -164,7 +164,7 @@ Iterable f() sync* { yield 0; } ''', - [error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 37, 1)], + [error(CompileTimeErrorCode.yieldOfInvalidType, 37, 1)], ); } @@ -178,7 +178,7 @@ void f() { }; } ''', - [error(CompileTimeErrorCode.YIELD_OF_INVALID_TYPE, 100, 1)], + [error(CompileTimeErrorCode.yieldOfInvalidType, 100, 1)], ); } @@ -189,7 +189,7 @@ Stream f() sync* { yield 0; } ''', - [error(CompileTimeErrorCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE, 0, 11)], + [error(CompileTimeErrorCode.illegalSyncGeneratorReturnType, 0, 11)], ); } @@ -238,7 +238,7 @@ f() async* { yield* 0; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 22, 1)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 22, 1)], ); } @@ -250,7 +250,7 @@ f() async* { yield* a; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 41, 1)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 41, 1)], ); } @@ -262,7 +262,7 @@ Stream f() async* { yield* a; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 53, 1)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 53, 1)], ); } @@ -274,7 +274,7 @@ Stream f() async* { yield* a; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 56, 1)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 56, 1)], ); } @@ -297,7 +297,7 @@ Stream f() async* { Stream g() => throw 0; ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 34, 3)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 34, 3)], ); } @@ -330,7 +330,7 @@ Stream f() async* { Stream g() => throw 0; ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 34, 3)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 34, 3)], ); } @@ -371,7 +371,7 @@ f() sync* { yield* 0; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 21, 1)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 21, 1)], ); } @@ -385,7 +385,7 @@ main() { f; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 41, 1)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 41, 1)], ); } @@ -408,7 +408,7 @@ Iterable f() sync* { Iterable g() => throw 0; ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 35, 3)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 35, 3)], ); } @@ -441,7 +441,7 @@ Iterable f() sync* { Iterable g() => throw 0; ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 35, 3)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 35, 3)], ); } } @@ -456,7 +456,7 @@ f(dynamic a) async* { yield* a; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 31, 1)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 31, 1)], ); } @@ -467,7 +467,7 @@ f(dynamic a) sync* { yield* a; } ''', - [error(CompileTimeErrorCode.YIELD_EACH_OF_INVALID_TYPE, 30, 1)], + [error(CompileTimeErrorCode.yieldEachOfInvalidType, 30, 1)], ); } } diff --git a/pkg/analyzer/test/src/fasta/ast_builder_test.dart b/pkg/analyzer/test/src/fasta/ast_builder_test.dart index 9cc2ff1bad9..62cbe5f92ad 100644 --- a/pkg/analyzer/test/src/fasta/ast_builder_test.dart +++ b/pkg/analyzer/test/src/fasta/ast_builder_test.dart @@ -23,7 +23,7 @@ class AstBuilderTest extends ParserDiagnosticsTest { abstract final base class A {} '''); parseResult.assertErrors([ - error(ParserErrorCode.ABSTRACT_FINAL_BASE_CLASS, 18, 10), + error(ParserErrorCode.abstractFinalBaseClass, 18, 10), ]); var node = parseResult.findNode.classDeclaration('class A {}'); @@ -48,7 +48,7 @@ ClassDeclaration abstract final interface class A {} '''); parseResult.assertErrors([ - error(ParserErrorCode.ABSTRACT_FINAL_INTERFACE_CLASS, 18, 15), + error(ParserErrorCode.abstractFinalInterfaceClass, 18, 15), ]); var node = parseResult.findNode.classDeclaration('class A {}'); @@ -73,7 +73,7 @@ ClassDeclaration abstract sealed class A {} '''); parseResult.assertErrors([ - error(ParserErrorCode.ABSTRACT_SEALED_CLASS, 18, 6), + error(ParserErrorCode.abstractSealedClass, 18, 6), ]); var node = parseResult.findNode.classDeclaration('class A {}'); @@ -299,7 +299,7 @@ ConstructorDeclaration class C extends (int, int) {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_NAMED_TYPE_EXTENDS, 16, 10), + error(ParserErrorCode.expectedNamedTypeExtends, 16, 10), ]); var node = parseResult.findNode.classDeclaration('class C'); @@ -337,7 +337,7 @@ ClassDeclaration var parseResult = parseStringWithErrors(r''' final mixin class A {} '''); - parseResult.assertErrors([error(ParserErrorCode.FINAL_MIXIN_CLASS, 0, 5)]); + parseResult.assertErrors([error(ParserErrorCode.finalMixinClass, 0, 5)]); var node = parseResult.findNode.classDeclaration('class A {}'); assertParsedNodeText(node, r''' @@ -356,7 +356,7 @@ ClassDeclaration class C implements A, (int, int), B {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_NAMED_TYPE_IMPLEMENTS, 22, 10), + error(ParserErrorCode.expectedNamedTypeImplements, 22, 10), ]); var node = parseResult.findNode.classDeclaration('class C'); @@ -402,7 +402,7 @@ ClassDeclaration interface mixin class A {} '''); parseResult.assertErrors([ - error(ParserErrorCode.INTERFACE_MIXIN_CLASS, 0, 9), + error(ParserErrorCode.interfaceMixinClass, 0, 9), ]); var node = parseResult.findNode.classDeclaration('class A {}'); @@ -465,7 +465,7 @@ ClassDeclaration sealed abstract class A {} '''); parseResult.assertErrors([ - error(ParserErrorCode.ABSTRACT_SEALED_CLASS, 9, 6), + error(ParserErrorCode.abstractSealedClass, 9, 6), ]); var node = parseResult.findNode.classDeclaration('class A {}'); @@ -487,7 +487,7 @@ ClassDeclaration var parseResult = parseStringWithErrors(r''' sealed mixin class A {} '''); - parseResult.assertErrors([error(ParserErrorCode.SEALED_MIXIN_CLASS, 0, 6)]); + parseResult.assertErrors([error(ParserErrorCode.sealedMixinClass, 0, 6)]); var node = parseResult.findNode.classDeclaration('class A {}'); assertParsedNodeText(node, r''' @@ -506,7 +506,7 @@ ClassDeclaration class C with A, (int, int), B {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_NAMED_TYPE_WITH, 16, 10), + error(ParserErrorCode.expectedNamedTypeWith, 16, 10), ]); var node = parseResult.findNode.classDeclaration('class C'); @@ -560,7 +560,7 @@ ClassTypeAlias class C = A Function() with M; '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_NAMED_TYPE_EXTENDS, 10, 12), + error(ParserErrorCode.expectedNamedTypeExtends, 10, 12), ]); var node = parseResult.findNode.classTypeAlias('class'); assertParsedNodeText(node, r''' @@ -643,7 +643,7 @@ class C = Object with M implements A, (int, int), B; mixin M {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_NAMED_TYPE_IMPLEMENTS, 38, 10), + error(ParserErrorCode.expectedNamedTypeImplements, 38, 10), ]); var node = parseResult.findNode.classTypeAlias('class C'); @@ -733,7 +733,7 @@ ClassTypeAlias class C = Object with A, (int, int), B; '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_NAMED_TYPE_WITH, 25, 10), + error(ParserErrorCode.expectedNamedTypeWith, 25, 10), ]); var node = parseResult.findNode.classTypeAlias('class C'); @@ -787,8 +787,8 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 18, 7), - error(ParserErrorCode.INVALID_INITIALIZER, 18, 11), + error(ParserErrorCode.missingAssignableSelector, 18, 7), + error(ParserErrorCode.invalidInitializer, 18, 11), ]); var node = parseResult.findNode.constructor('A()'); @@ -856,7 +856,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.INVALID_CONSTRUCTOR_NAME, 12, 1), + error(ParserErrorCode.invalidConstructorName, 12, 1), ]); var node = parseResult.findNode.constructor('B()'); @@ -926,7 +926,7 @@ DotShorthandPropertyAccess var parseResult = parseStringWithErrors(r''' base enum E { v } '''); - parseResult.assertErrors([error(ParserErrorCode.BASE_ENUM, 0, 4)]); + parseResult.assertErrors([error(ParserErrorCode.baseEnum, 0, 4)]); var node = parseResult.findNode.enumDeclaration('enum E'); assertParsedNodeText(node, r''' @@ -948,8 +948,8 @@ enum E { } '''); parseResult.assertErrors([ - error(ParserErrorCode.MISSING_IDENTIFIER, 14, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 14, 1), + error(ParserErrorCode.missingIdentifier, 14, 1), + error(ParserErrorCode.expectedToken, 14, 1), ]); var node = parseResult.findNode.enumConstantDeclaration('v.'); @@ -973,7 +973,7 @@ enum E { v.named; } '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 13, 5)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 13, 5)]); var node = parseResult.findNode.enumConstantDeclaration('v.'); assertParsedNodeText(node, r''' @@ -997,8 +997,8 @@ enum E { } '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_TOKEN, 13, 1), - error(ParserErrorCode.MISSING_IDENTIFIER, 13, 1), + error(ParserErrorCode.expectedToken, 13, 1), + error(ParserErrorCode.missingIdentifier, 13, 1), ]); var node = parseResult.findNode.enumConstantDeclaration('v.'); @@ -1023,8 +1023,8 @@ enum E { } '''); parseResult.assertErrors([ - error(ParserErrorCode.MISSING_IDENTIFIER, 19, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 19, 1), + error(ParserErrorCode.missingIdentifier, 19, 1), + error(ParserErrorCode.expectedToken, 19, 1), ]); var node = parseResult.findNode.enumConstantDeclaration('v.'); @@ -1055,8 +1055,8 @@ enum E { } '''); parseResult.assertErrors([ - error(ParserErrorCode.MISSING_IDENTIFIER, 18, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 18, 1), + error(ParserErrorCode.missingIdentifier, 18, 1), + error(ParserErrorCode.expectedToken, 18, 1), ]); var node = parseResult.findNode.enumConstantDeclaration('v'); @@ -1086,7 +1086,7 @@ enum E { v; } '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 19, 1)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 19, 1)]); var node = parseResult.findNode.enumConstantDeclaration('v'); assertParsedNodeText(node, r''' @@ -1109,7 +1109,7 @@ EnumConstantDeclaration var parseResult = parseStringWithErrors(r''' final enum E { v } '''); - parseResult.assertErrors([error(ParserErrorCode.FINAL_ENUM, 0, 5)]); + parseResult.assertErrors([error(ParserErrorCode.finalEnum, 0, 5)]); var node = parseResult.findNode.enumDeclaration('enum E'); assertParsedNodeText(node, r''' @@ -1128,7 +1128,7 @@ EnumDeclaration var parseResult = parseStringWithErrors(r''' interface enum E { v } '''); - parseResult.assertErrors([error(ParserErrorCode.INTERFACE_ENUM, 0, 9)]); + parseResult.assertErrors([error(ParserErrorCode.interfaceEnum, 0, 9)]); var node = parseResult.findNode.enumDeclaration('enum E'); assertParsedNodeText(node, r''' @@ -1147,7 +1147,7 @@ EnumDeclaration var parseResult = parseStringWithErrors(r''' sealed enum E { v } '''); - parseResult.assertErrors([error(ParserErrorCode.SEALED_ENUM, 0, 6)]); + parseResult.assertErrors([error(ParserErrorCode.sealedEnum, 0, 6)]); var node = parseResult.findNode.enumDeclaration('enum E'); assertParsedNodeText(node, r''' @@ -1240,7 +1240,7 @@ class A { } '''); parseResult.assertErrors([ - error(ParserErrorCode.MEMBER_WITH_CLASS_NAME, 16, 1), + error(ParserErrorCode.memberWithClassName, 16, 1), ]); var node = parseResult.findNode.methodDeclaration('get A'); @@ -1317,7 +1317,7 @@ MixinDeclaration var parseResult = parseStringWithErrors(r''' final mixin M {} '''); - parseResult.assertErrors([error(ParserErrorCode.FINAL_MIXIN, 0, 5)]); + parseResult.assertErrors([error(ParserErrorCode.finalMixin, 0, 5)]); var node = parseResult.findNode.mixinDeclaration('mixin M'); assertParsedNodeText(node, r''' @@ -1335,7 +1335,7 @@ class C {} mixin M on C implements A, (int, int), B {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_NAMED_TYPE_IMPLEMENTS, 38, 10), + error(ParserErrorCode.expectedNamedTypeImplements, 38, 10), ]); var node = parseResult.findNode.mixinDeclaration('mixin M'); @@ -1364,7 +1364,7 @@ MixinDeclaration var parseResult = parseStringWithErrors(r''' interface mixin M {} '''); - parseResult.assertErrors([error(ParserErrorCode.INTERFACE_MIXIN, 0, 9)]); + parseResult.assertErrors([error(ParserErrorCode.interfaceMixin, 0, 9)]); var node = parseResult.findNode.mixinDeclaration('mixin M'); assertParsedNodeText(node, r''' @@ -1381,7 +1381,7 @@ MixinDeclaration mixin M on A, (int, int), B {} '''); parseResult.assertErrors([ - error(ParserErrorCode.EXPECTED_NAMED_TYPE_ON, 14, 10), + error(ParserErrorCode.expectedNamedTypeOn, 14, 10), ]); var node = parseResult.findNode.mixinDeclaration('mixin M'); @@ -1405,7 +1405,7 @@ MixinDeclaration var parseResult = parseStringWithErrors(r''' sealed mixin M {} '''); - parseResult.assertErrors([error(ParserErrorCode.SEALED_MIXIN, 0, 6)]); + parseResult.assertErrors([error(ParserErrorCode.sealedMixin, 0, 6)]); var node = parseResult.findNode.mixinDeclaration('mixin M'); assertParsedNodeText(node, r''' @@ -1648,11 +1648,7 @@ RecordTypeAnnotation void f((int) r) {} '''); parseResult.assertErrors([ - error( - ParserErrorCode.RECORD_TYPE_ONE_POSITIONAL_NO_TRAILING_COMMA, - 11, - 1, - ), + error(ParserErrorCode.recordTypeOnePositionalNoTrailingComma, 11, 1), ]); var node = parseResult.findNode.recordTypeAnnotation('(int'); @@ -1753,7 +1749,7 @@ void f(Object value) { } } '''); - parseResult.assertErrors([error(ParserErrorCode.EXPECTED_TOKEN, 72, 1)]); + parseResult.assertErrors([error(ParserErrorCode.expectedToken, 72, 1)]); var node = parseResult.findNode.switchCase('case'); assertParsedNodeText(node, r''' diff --git a/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart b/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart index 34ad6d12e1d..bfb1ab7aba4 100644 --- a/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart @@ -28,7 +28,7 @@ class ClassDeclarationTest extends AbstractRecoveryTest { ''' class A implements B extends C {} ''', - [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS], + [ParserErrorCode.implementsBeforeExtends], ''' class A extends C implements B {} ''', @@ -40,7 +40,7 @@ class A extends C implements B {} ''' class A extends B implements C with D {} ''', - [ParserErrorCode.IMPLEMENTS_BEFORE_WITH], + [ParserErrorCode.implementsBeforeWith], ''' class A extends B with D implements C {} ''', @@ -52,10 +52,7 @@ class A extends B with D implements C {} ''' class A implements B with C extends D {} ''', - [ - ParserErrorCode.IMPLEMENTS_BEFORE_WITH, - ParserErrorCode.WITH_BEFORE_EXTENDS, - ], + [ParserErrorCode.implementsBeforeWith, ParserErrorCode.withBeforeExtends], ''' class A extends D with C implements B {} ''', @@ -67,7 +64,7 @@ class A extends D with C implements B {} ''' class A extends B extends C {} ''', - [ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES], + [ParserErrorCode.multipleExtendsClauses], ''' class A extends B {} ''', @@ -79,7 +76,7 @@ class A extends B {} ''' class A implements B implements C, D {} ''', - [ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES], + [ParserErrorCode.multipleImplementsClauses], ''' class A implements B, C, D {} ''', @@ -91,7 +88,7 @@ class A implements B, C, D {} ''' class A extends B with C, D with E {} ''', - [ParserErrorCode.MULTIPLE_WITH_CLAUSES], + [ParserErrorCode.multipleWithClauses], ''' class A extends B with C, D, E {} ''', @@ -105,7 +102,7 @@ class A extends B with C, D, E {} class Foo exte class UnrelatedClass extends Bar {} ''', - [ParserErrorCode.MULTIPLE_WITH_CLAUSES], + [ParserErrorCode.multipleWithClauses], ''' class Foo {} class UnrelatedClass extends Bar {} @@ -119,7 +116,7 @@ class UnrelatedClass extends Bar {} class Foo extends CurrentlyTypingHere class UnrelatedClass extends Bar {} ''', - [ParserErrorCode.EXPECTED_CLASS_BODY], + [ParserErrorCode.expectedClassBody], ''' class Foo extends CurrentlyTypingHere {} class UnrelatedClass extends Bar {} @@ -132,7 +129,7 @@ class UnrelatedClass extends Bar {} ''' class A with B extends C {} ''', - [ParserErrorCode.WITH_BEFORE_EXTENDS], + [ParserErrorCode.withBeforeExtends], ''' class A extends C with B {} ''', @@ -150,7 +147,7 @@ class CompilationUnitMemberTest extends AbstractRecoveryTest { class C { } export 'bar.dart'; ''', - [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], + [ParserErrorCode.directiveAfterDeclaration], ''' export 'bar.dart'; class C { } @@ -164,7 +161,7 @@ class C { } class C { } import 'bar.dart'; ''', - [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], + [ParserErrorCode.directiveAfterDeclaration], ''' import 'bar.dart'; class C { } @@ -178,7 +175,7 @@ class C { } class C { } part 'bar.dart'; ''', - [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], + [ParserErrorCode.directiveAfterDeclaration], ''' part 'bar.dart'; class C { } @@ -192,7 +189,7 @@ class C { } class C { } part of foo; ''', - [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION], + [ParserErrorCode.directiveAfterDeclaration], ''' part of foo; class C { } @@ -206,7 +203,7 @@ class C { } export 'bar.dart'; library l; ''', - [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST], + [ParserErrorCode.libraryDirectiveNotFirst], ''' library l; export 'bar.dart'; @@ -221,7 +218,7 @@ export 'bar.dart'; import 'bar.dart'; library l; ''', - [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST], + [ParserErrorCode.libraryDirectiveNotFirst], ''' library l; import 'bar.dart'; @@ -236,7 +233,7 @@ import 'bar.dart'; part 'foo.dart'; library l; ''', - [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST], + [ParserErrorCode.libraryDirectiveNotFirst], ''' library l; part 'foo.dart'; @@ -269,7 +266,7 @@ class ImportDirectiveTest extends AbstractRecoveryTest { ''' import 'bar.dart' show A as p show B; ''', - [ParserErrorCode.PREFIX_AFTER_COMBINATOR], + [ParserErrorCode.prefixAfterCombinator], ''' import 'bar.dart' as p show A show B; ''', @@ -281,7 +278,7 @@ import 'bar.dart' as p show A show B; ''' import 'bar.dart' show A as p; ''', - [ParserErrorCode.PREFIX_AFTER_COMBINATOR], + [ParserErrorCode.prefixAfterCombinator], ''' import 'bar.dart' as p show A; ''', @@ -293,7 +290,7 @@ import 'bar.dart' as p show A; ''' import 'bar.dart' deferred show A as p; ''', - [ParserErrorCode.PREFIX_AFTER_COMBINATOR], + [ParserErrorCode.prefixAfterCombinator], ''' import 'bar.dart' deferred as p show A; ''', @@ -305,7 +302,7 @@ import 'bar.dart' deferred as p show A; ''' import 'bar.dart' as p deferred; ''', - [ParserErrorCode.DEFERRED_AFTER_PREFIX], + [ParserErrorCode.deferredAfterPrefix], ''' import 'bar.dart' deferred as p; ''', @@ -317,7 +314,7 @@ import 'bar.dart' deferred as p; ''' import 'bar.dart' as p as q; ''', - [ParserErrorCode.DUPLICATE_PREFIX], + [ParserErrorCode.duplicatePrefix], ''' import 'bar.dart' as p; ''', @@ -329,7 +326,7 @@ import 'bar.dart' as p; ''' import 'bar.dart' as p sh; ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' import 'bar.dart' as p; ''', @@ -341,7 +338,7 @@ import 'bar.dart' as p; ''' import 'bar.dart' d as p; ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' import 'bar.dart' as p; ''', @@ -355,9 +352,9 @@ import 'bar.dart' d show A as p import 'b.dart'; ''', [ - ParserErrorCode.UNEXPECTED_TOKEN, - ParserErrorCode.PREFIX_AFTER_COMBINATOR, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.unexpectedToken, + ParserErrorCode.prefixAfterCombinator, + ParserErrorCode.expectedToken, ], ''' import 'bar.dart' as p show A; @@ -371,7 +368,7 @@ import 'b.dart'; ''' import 'bar.dart' deferred s as p; ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' import 'bar.dart' deferred as p; ''', @@ -396,7 +393,7 @@ class B { dynamic @A(const A()) x; } ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' class A { const A([x]); @@ -418,7 +415,7 @@ class MixinDeclarationTest extends AbstractRecoveryTest { ''' mixin A implements B on C {} ''', - [ParserErrorCode.IMPLEMENTS_BEFORE_ON], + [ParserErrorCode.implementsBeforeOn], ''' mixin A on C implements B {} ''', @@ -430,7 +427,7 @@ mixin A on C implements B {} ''' mixin A implements B implements C, D {} ''', - [ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES], + [ParserErrorCode.multipleImplementsClauses], ''' mixin A implements B, C, D {} ''', @@ -442,7 +439,7 @@ mixin A implements B, C, D {} ''' mixin A on B on C {} ''', - [ParserErrorCode.MULTIPLE_ON_CLAUSES], + [ParserErrorCode.multipleOnClauses], ''' mixin A on B, C {} ''', @@ -456,7 +453,7 @@ mixin A on B, C {} mixin Foo imple mixin UnrelatedMixin on Bar {} ''', - [ParserErrorCode.MULTIPLE_WITH_CLAUSES], + [ParserErrorCode.multipleWithClauses], ''' mixin Foo {} mixin UnrelatedMixin on Bar {} @@ -470,7 +467,7 @@ mixin UnrelatedMixin on Bar {} mixin Foo implements CurrentlyTypingHere mixin UnrelatedMixin on Bar {} ''', - [ParserErrorCode.EXPECTED_MIXIN_BODY], + [ParserErrorCode.expectedMixinBody], ''' mixin Foo implements CurrentlyTypingHere {} mixin UnrelatedMixin on Bar {} diff --git a/pkg/analyzer/test/src/fasta/recovery/extra_code_test.dart b/pkg/analyzer/test/src/fasta/recovery/extra_code_test.dart index 0703d949fa2..ed14bc28a32 100644 --- a/pkg/analyzer/test/src/fasta/recovery/extra_code_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/extra_code_test.dart @@ -35,7 +35,7 @@ class C { m() => new A<@annotation C>(); } ''', - [ParserErrorCode.ANNOTATION_ON_TYPE_ARGUMENT], + [ParserErrorCode.annotationOnTypeArgument], ''' const annotation = null; class A {} @@ -56,7 +56,7 @@ class MiscellaneousTest extends AbstractRecoveryTest { class B = Object with A {} ''', // TODO(danrubel): Consolidate and improve error message. - [ParserErrorCode.EXPECTED_EXECUTABLE, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedExecutable, ParserErrorCode.expectedToken], ''' class B = Object with A; ''', @@ -69,7 +69,7 @@ int get g(x) => 0; '''; var unit = parseCompilationUnit( content, - codes: [ParserErrorCode.GETTER_WITH_PARAMETERS], + codes: [ParserErrorCode.getterWithParameters], ); validateTokenStream(unit.beginToken); @@ -103,7 +103,7 @@ f(x) { while (1 < x < 3) {} } ''', - codes: [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND], + codes: [ParserErrorCode.equalityCannotBeEqualityOperand], ); } @@ -141,7 +141,7 @@ Map map = {}; mixin M {} mixin N with M {} ''', - [ParserErrorCode.MIXIN_WITH_CLAUSE], + [ParserErrorCode.mixinWithClause], ''' mixin M {} mixin N {} @@ -181,7 +181,7 @@ final Map v = { 'c': () => new C(), }; ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' class C {} final Map v = { @@ -202,7 +202,7 @@ class ModifiersTest extends AbstractRecoveryTest { ''' static class A {} ''', - [ParserErrorCode.EXTRANEOUS_MODIFIER], + [ParserErrorCode.extraneousModifier], ''' class A {} ''', @@ -215,7 +215,7 @@ class A {} main() {} const int get foo => 499; ''', - [ParserErrorCode.EXTRANEOUS_MODIFIER], + [ParserErrorCode.extraneousModifier], ''' main() {} int get foo => 499; @@ -229,7 +229,7 @@ int get foo => 499; main() {} const int foo() => 499; ''', - [ParserErrorCode.EXTRANEOUS_MODIFIER], + [ParserErrorCode.extraneousModifier], ''' main() {} int foo() => 499; @@ -243,7 +243,7 @@ int foo() => 499; main() {} const set foo(v) => 499; ''', - [ParserErrorCode.EXTRANEOUS_MODIFIER], + [ParserErrorCode.extraneousModifier], ''' main() {} set foo(v) => 499; @@ -265,7 +265,7 @@ class MultipleTypeTest extends AbstractRecoveryTest { ''' String void bar() { } ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' String bar() { } ''', @@ -287,7 +287,7 @@ class Foo extends A, B { Foo() { } } ''', - [ParserErrorCode.UNEXPECTED_TOKEN, ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken, ParserErrorCode.unexpectedToken], ''' class A { } class B { } @@ -305,7 +305,7 @@ class C { foo() {}; } ''', - [ParserErrorCode.EXPECTED_CLASS_MEMBER], + [ParserErrorCode.expectedClassMember], ''' class C { foo() {} @@ -319,7 +319,7 @@ class C { ''' foo() {}; ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' foo() {} ''', @@ -333,7 +333,7 @@ class C { ;foo() {} } ''', - [ParserErrorCode.EXPECTED_CLASS_MEMBER], + [ParserErrorCode.expectedClassMember], ''' class C { foo() {} @@ -350,7 +350,7 @@ class C { ''' ;foo() {} ''', - [ParserErrorCode.EXPECTED_EXECUTABLE], + [ParserErrorCode.expectedExecutable], ''' foo() {} ''', @@ -365,7 +365,7 @@ class C { bar() {} } ''', - [ParserErrorCode.EXPECTED_CLASS_MEMBER], + [ParserErrorCode.expectedClassMember], ''' class C { foo() {} @@ -381,7 +381,7 @@ class C { foo() {}; bar() {} ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' foo() {} bar() {} @@ -398,7 +398,7 @@ class VarianceModifierTest extends AbstractRecoveryTest { ''' class A {} ''', - [ParserErrorCode.MULTIPLE_VARIANCE_MODIFIERS], + [ParserErrorCode.multipleVarianceModifiers], ''' class A {} ''', diff --git a/pkg/analyzer/test/src/fasta/recovery/invalid_code_test.dart b/pkg/analyzer/test/src/fasta/recovery/invalid_code_test.dart index c9a83c94d8b..cd6cff503e6 100644 --- a/pkg/analyzer/test/src/fasta/recovery/invalid_code_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/invalid_code_test.dart @@ -35,12 +35,12 @@ List fruits = const ['apples', 'bananas', 'pears']; ''' const default = const Object(); ''', - [ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD], + [ParserErrorCode.expectedIdentifierButGotKeyword], ''' const default = const Object(); ''', expectedDiagnosticsInValidCode: [ - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, + ParserErrorCode.expectedIdentifierButGotKeyword, ], ); } @@ -53,7 +53,7 @@ f() { return [0, 1, 2]; } ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f() { return [0, 1, 2]; @@ -70,7 +70,7 @@ f() { return [0, 1, 2]; } ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f() { return [0, 1, 2]; @@ -90,7 +90,7 @@ f() { return [0, 1, 2]; } ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' f() { return _s_ < test('', (){}); _s_ > [0, 1, 2]; @@ -107,7 +107,7 @@ g() { f(with: 3); } ''', - [ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD], + [ParserErrorCode.expectedIdentifierButGotKeyword], ''' f() {} g() { @@ -115,7 +115,7 @@ g() { } ''', expectedDiagnosticsInValidCode: [ - ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, + ParserErrorCode.expectedIdentifierButGotKeyword, ], ); } diff --git a/pkg/analyzer/test/src/fasta/recovery/missing_code_test.dart b/pkg/analyzer/test/src/fasta/recovery/missing_code_test.dart index 57ed8d03742..99e9bc67fe1 100644 --- a/pkg/analyzer/test/src/fasta/recovery/missing_code_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/missing_code_test.dart @@ -25,7 +25,7 @@ class ListLiteralTest extends AbstractRecoveryTest { ''' f() => [a, , b]; ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f() => [a, _s_, b]; ''', @@ -37,7 +37,7 @@ f() => [a, _s_, b]; ''' f() => [a, b c]; ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f() => [a, b, c]; ''', @@ -49,7 +49,7 @@ f() => [a, b, c]; ''' f() => [a, if (x) b c]; ''', - [ParserErrorCode.EXPECTED_ELSE_OR_COMMA], + [ParserErrorCode.expectedElseOrComma], ''' f() => [a, if (x) b, c]; ''', @@ -61,7 +61,7 @@ f() => [a, if (x) b, c]; ''' f() => [a, if (x) b else y c]; ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f() => [a, if (x) b else y, c]; ''', @@ -77,7 +77,7 @@ class MapLiteralTest extends AbstractRecoveryTest { ''' f() => {a: b, c: d e: f}; ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f() => {a: b, c: d, e: f}; ''', @@ -89,7 +89,7 @@ f() => {a: b, c: d, e: f}; ''' f() => {a: b, if (x) c: d e: f}; ''', - [ParserErrorCode.EXPECTED_ELSE_OR_COMMA], + [ParserErrorCode.expectedElseOrComma], ''' f() => {a: b, if (x) c: d, e: f}; ''', @@ -101,7 +101,7 @@ f() => {a: b, if (x) c: d, e: f}; ''' f() => {a: b, if (x) c: d else y: z e: f}; ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f() => {a: b, if (x) c: d else y: z, e: f}; ''', @@ -113,7 +113,7 @@ f() => {a: b, if (x) c: d else y: z, e: f}; ''' f() => {: b}; ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f() => {_s_: b}; ''', @@ -125,7 +125,7 @@ f() => {_s_: b}; ''' f() => {a: }; ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f() => {a: _s_}; ''', @@ -137,7 +137,7 @@ f() => {a: _s_}; ''' f() => {a: , b: c}; ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f() => {a: _s_, b: c}; ''', @@ -162,7 +162,7 @@ class MissingCodeTest extends AbstractRecoveryTest { ''' convert(x) => as T; ''', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], ''' convert(x) => _s_ as T; ''', @@ -174,7 +174,7 @@ convert(x) => _s_ as T; ''' convert(x) => x as ; ''', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], ''' convert(x) => x as _s_; ''', @@ -189,7 +189,7 @@ f() { x = } ''', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ''' f() { var x; @@ -214,7 +214,7 @@ f(x) { x.. } ''', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ''' f(x) { x.. _s_; @@ -228,7 +228,7 @@ f(x) { ''' class {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' class _s_ {} ''', @@ -242,7 +242,7 @@ class _s_ {} ''' import 'bar.dart' deferred; ''', - [ParserErrorCode.MISSING_PREFIX_IN_DEFERRED_IMPORT], + [ParserErrorCode.missingPrefixInDeferredImport], ''' import 'bar.dart' deferred as _s_; ''', @@ -254,7 +254,7 @@ import 'bar.dart' deferred as _s_; ''' f(int a int b) { } ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f(int a, int b) { } ''', @@ -266,7 +266,7 @@ f(int a, int b) { } ''' f() => x ? y : ''', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ''' f() => x ? y : _s_; ''', @@ -278,7 +278,7 @@ f() => x ? y : _s_; ''' f() => x ? : z ''', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ''' f() => x ? _s_ : z; ''', @@ -298,7 +298,7 @@ f() => x ? _s_ : z; ''' f(x) = x; ''', - [ParserErrorCode.MISSING_FUNCTION_BODY], + [ParserErrorCode.missingFunctionBody], ''' f(x) => x; ''', @@ -310,7 +310,7 @@ f(x) => x; ''' f(x) return x; ''', - [ParserErrorCode.MISSING_FUNCTION_BODY], + [ParserErrorCode.missingFunctionBody], ''' f(x) => x; ''', @@ -359,7 +359,7 @@ class Test { assert(true); } ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' class Test { Test() @@ -380,7 +380,7 @@ class Test { x = 2; } ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' class Test { Test() @@ -401,7 +401,7 @@ class Test { this.x = 2; } ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' class Test { Test() @@ -420,7 +420,7 @@ f() { } } ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f() { if (_s_ is String) { @@ -437,7 +437,7 @@ f(x) { if (x is ) {} } ''', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], ''' f(x) { if (x is _s_) {} @@ -486,7 +486,7 @@ class Bar { int foo => 0; } ''', - [ParserErrorCode.MISSING_GET], + [ParserErrorCode.missingGet], ''' class Bar { int get foo => 0; @@ -502,7 +502,7 @@ class Bar { ''' int f int x, int y) {} ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' int f (int x, int y) {} ''', @@ -516,7 +516,7 @@ int f (int x, int y) {} ''' f(x) => x ?? throw 0; ''', - [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken, ParserErrorCode.expectedToken], ''' f(x) => x ?? (throw 0); ''', @@ -547,7 +547,7 @@ f() { v. } ''', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ''' f() { var v = 'String'; @@ -589,12 +589,12 @@ f() { } ''', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, - ScannerErrorCode.UNTERMINATED_STRING_LITERAL, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ScannerErrorCode.unterminatedStringLiteral, + ScannerErrorCode.unterminatedStringLiteral, ], r''' f() { @@ -617,7 +617,7 @@ f() { ''' f() => x $operator ''', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ''' f() => x $operator _s_; ''', @@ -631,7 +631,7 @@ class C { int operator $operator(x) => super $operator } ''', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], ''' class C { int operator $operator(x) => super $operator _s_; @@ -651,7 +651,7 @@ class ParameterListTest extends AbstractRecoveryTest { ''' f({a, }) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f({a, _s_}) {} ''', @@ -663,7 +663,7 @@ f({a, _s_}) {} ''' f({a, , b}) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f({a, _s_, b}) {} ''', @@ -676,7 +676,7 @@ f({a, _s_, b}) {} ''' f([a, ]) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f([a, _s_]) {} ''', @@ -688,7 +688,7 @@ f([a, _s_]) {} ''' f([a, , b]) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f([a, _s_, b]) {} ''', @@ -701,7 +701,7 @@ f([a, _s_, b]) {} ''' f(a, ) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f(a, _s_) {} ''', @@ -713,7 +713,7 @@ f(a, _s_) {} ''' f(a, , b) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f(a, _s_, b) {} ''', @@ -728,7 +728,7 @@ class C { C(this); } ''', - [ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD], + [ParserErrorCode.expectedIdentifierButGotKeyword], ''' class C { int f; @@ -746,7 +746,7 @@ class C { C(this, p); } ''', - [ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD], + [ParserErrorCode.expectedIdentifierButGotKeyword], ''' class C { int f; @@ -764,7 +764,7 @@ class C { C(this.); } ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' class C { int f; @@ -782,7 +782,7 @@ class C { C(this., p); } ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' class C { int f; @@ -797,7 +797,7 @@ class C { ''' f({a: 0) {} ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f({a: 0}) {} ''', @@ -809,7 +809,7 @@ f({a: 0}) {} ''' f({a: 0]) {} ''', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken, ParserErrorCode.expectedToken], ''' f({a: 0}) {} ''', @@ -821,7 +821,7 @@ f({a: 0}) {} ''' f(a}) {} ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f(a) {} ''', @@ -833,7 +833,7 @@ f(a) {} ''' f(a]) {} ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f(a) {} ''', @@ -845,7 +845,7 @@ f(a) {} ''' f([a = 0}) {} ''', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken, ParserErrorCode.expectedToken], ''' f([a = 0]) {} ''', @@ -858,7 +858,7 @@ f([a = 0]) {} ''' f([a = 0) {} ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f([a = 0]) {} ''', @@ -874,7 +874,7 @@ h(v1, v2, v) { g(v1 == v2 || v1 == v 3, true); } ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' g(a, b, c) {} h(v1, v2, v) { @@ -889,7 +889,7 @@ h(v1, v2, v) { ''' f({a: }) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f({a: _s_}) {} ''', @@ -901,7 +901,7 @@ f({a: _s_}) {} ''' f({a: , b}) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f({a: _s_, b}) {} ''', @@ -913,7 +913,7 @@ f({a: _s_, b}) {} ''' f([a = ]) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f([a = _s_]) {} ''', @@ -925,7 +925,7 @@ f([a = _s_]) {} ''' f([a = , b]) {} ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' f([a = _s_, b]) {} ''', @@ -938,7 +938,7 @@ f([a = _s_, b]) {} ''' f([a = 0], {b: 1}) {} ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' f([a = 0]) {} ''', @@ -952,7 +952,7 @@ f([a = 0]) {} ''' f([a = 0], {b: 1}, [c = 2]) {} ''', - [ParserErrorCode.MIXED_PARAMETER_GROUPS], + [ParserErrorCode.mixedParameterGroups], ''' f([a = 0, c = 2]) {} ''', @@ -965,7 +965,7 @@ f([a = 0, c = 2]) {} ''' f({a: 0}, {b: 1}) {} ''', - [ParserErrorCode.MULTIPLE_NAMED_PARAMETER_GROUPS], + [ParserErrorCode.multipleNamedParameterGroups], ''' f({a: 0, b: 1}) {} ''', @@ -978,7 +978,7 @@ f({a: 0, b: 1}) {} ''' f([a = 0], [b = 1]) {} ''', - [ParserErrorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS], + [ParserErrorCode.multiplePositionalParameterGroups], ''' f([a = 0, b = 1]) {} ''', @@ -991,7 +991,7 @@ f([a = 0, b = 1]) {} ''' f(a: 0) {} ''', - [ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP], + [ParserErrorCode.namedParameterOutsideGroup], ''' f({a: 0}) {} ''', @@ -1004,7 +1004,7 @@ f({a: 0}) {} ''' f(a = 0) {} ''', - [ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP], + [ParserErrorCode.positionalParameterOutsideGroup], ''' f([a = 0]) {} ''', @@ -1021,7 +1021,7 @@ class TypedefTest extends AbstractRecoveryTest { ''' typedef Predicate = bool (E element); ''', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], ''' typedef Predicate = bool Function(E element); ''', diff --git a/pkg/analyzer/test/src/fasta/recovery/paired_tokens_test.dart b/pkg/analyzer/test/src/fasta/recovery/paired_tokens_test.dart index c83d217012c..6f1430d7683 100644 --- a/pkg/analyzer/test/src/fasta/recovery/paired_tokens_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/paired_tokens_test.dart @@ -26,7 +26,7 @@ class AngleBracketsTest extends AbstractRecoveryTest { ''' List ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' List> _s_; ''', @@ -38,7 +38,7 @@ List> _s_; ''' List f; ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' List> f; ''', @@ -51,7 +51,7 @@ List> f; ''' Map> ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' Map, List> _s_; ''', @@ -64,7 +64,7 @@ Map, List> _s_; ''' Map> f; ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' Map>> f; ''', @@ -76,7 +76,7 @@ Map>> f; ''' List f; ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' List f; ''', @@ -89,7 +89,7 @@ List f; ''' List _s_; ''', @@ -101,7 +101,7 @@ List _s_; ''' List f; ''', @@ -114,17 +114,17 @@ List f; f>() => null; ''', [ - ParserErrorCode.TOP_LEVEL_OPERATOR, - ParserErrorCode.MISSING_FUNCTION_PARAMETERS, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.topLevelOperator, + ParserErrorCode.missingFunctionParameters, + ParserErrorCode.missingFunctionBody, ], ''' f > () => null; ''', expectedDiagnosticsInValidCode: [ - ParserErrorCode.TOP_LEVEL_OPERATOR, - ParserErrorCode.MISSING_FUNCTION_PARAMETERS, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.topLevelOperator, + ParserErrorCode.missingFunctionParameters, + ParserErrorCode.missingFunctionBody, ], ); } @@ -135,8 +135,8 @@ f > () => null; f null; ''', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_PARAMETERS, + ParserErrorCode.expectedToken, + ParserErrorCode.missingFunctionParameters, ], ''' f() => null; @@ -150,8 +150,8 @@ f() => null; f()() => null; ''', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_PARAMETERS, + ParserErrorCode.expectedToken, + ParserErrorCode.missingFunctionParameters, ], ''' f()>() => null; @@ -164,7 +164,7 @@ f()>() => null; ''' f=() => null; ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' f() => null; ''', @@ -176,7 +176,7 @@ f() => null; ''' f>=() => null; ''', - [ParserErrorCode.UNEXPECTED_TOKEN], + [ParserErrorCode.unexpectedToken], ''' f>() => null; ''', @@ -189,8 +189,8 @@ f>() => null; f null; ''', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_PARAMETERS, + ParserErrorCode.expectedToken, + ParserErrorCode.missingFunctionParameters, ], ''' f() => null; @@ -204,8 +204,8 @@ f() => null; f() => null; ''', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_PARAMETERS, + ParserErrorCode.expectedToken, + ParserErrorCode.missingFunctionParameters, ], ''' f>() => null; @@ -224,7 +224,7 @@ f(x) { if (x != null) { } ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f(x) { if (x != null) {} @@ -243,7 +243,7 @@ f(x) { while (x == null) {} } ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f(x) { if (x != null) {} @@ -261,7 +261,7 @@ f(x) { f(x) { class C {} ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f(x) {} class C {} @@ -277,7 +277,7 @@ class C {} f(x) { g(y) => y; ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f(x) {} g(y) => y; @@ -290,7 +290,7 @@ g(y) => y; ''' f(x) { ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f(x) {} ''', @@ -305,7 +305,7 @@ f(x) {} f(x) { int y = 0; ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f(x) {} int y = 0; @@ -322,7 +322,7 @@ class BracketsTest extends AbstractRecoveryTest { ''' f(x) => l[x ''', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken, ParserErrorCode.expectedToken], ''' f(x) => l[x]; ''', @@ -334,7 +334,7 @@ f(x) => l[x]; ''' f(x) => l?[x ''', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken, ParserErrorCode.expectedToken], ''' f(x) => l?[x]; ''', @@ -346,7 +346,7 @@ f(x) => l?[x]; ''' var x = [[0], [1]; ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' var x = [[0], [1]]; ''', @@ -358,7 +358,7 @@ var x = [[0], [1]]; ''' var x = [[0], [1, [2]]; ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' var x = [[0], [1, [2]]]; ''', @@ -370,7 +370,7 @@ var x = [[0], [1, [2]]]; ''' var x = [0 1]; ''', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], ''' var x = [0, 1]; ''', @@ -382,7 +382,7 @@ var x = [0, 1]; ''' var x = [0, 1 ''', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken, ParserErrorCode.expectedToken], ''' var x = [0, 1]; ''', @@ -402,7 +402,7 @@ f(x) { if (x } ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f(x) { if (x); @@ -421,7 +421,7 @@ f(x) { while(x != null) {} } ''', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], ''' f(x) { if (x); @@ -438,7 +438,7 @@ f(x) { f(x class C {} ''', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_FUNCTION_BODY], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], ''' f(x) {} class C {} @@ -451,7 +451,7 @@ class C {} ''' f(x ''', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_FUNCTION_BODY], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], ''' f(x) {} ''', diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/annotation_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/annotation_test.dart index 78d0518e268..407d051d015 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/annotation_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/annotation_test.dart @@ -16,19 +16,16 @@ class AnnotationTest extends PartialCodeTest { TestDescriptor( 'ampersand', '@', - [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_EXECUTABLE, - ], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedExecutable], '@_s_', - expectedDiagnosticsInValidCode: [ParserErrorCode.EXPECTED_EXECUTABLE], + expectedDiagnosticsInValidCode: [ParserErrorCode.expectedExecutable], ), TestDescriptor( 'leftParen', '@a(', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_EXECUTABLE], + [ScannerErrorCode.expectedToken, ParserErrorCode.expectedExecutable], '@a()', - expectedDiagnosticsInValidCode: [ParserErrorCode.EXPECTED_EXECUTABLE], + expectedDiagnosticsInValidCode: [ParserErrorCode.expectedExecutable], ), ], []); buildTests( @@ -37,14 +34,14 @@ class AnnotationTest extends PartialCodeTest { TestDescriptor( 'ampersand', '@', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], '@_s_', failing: ['typedef', 'functionNonVoid', 'getter', 'mixin', 'setter'], ), TestDescriptor( 'leftParen', '@a(', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], '@a()', allFailing: true, ), @@ -60,25 +57,18 @@ class AnnotationTest extends PartialCodeTest { 'ampersand', '@', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_CLASS_MEMBER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedClassMember, ], '@_s_', - expectedDiagnosticsInValidCode: [ - ParserErrorCode.EXPECTED_CLASS_MEMBER, - ], + expectedDiagnosticsInValidCode: [ParserErrorCode.expectedClassMember], ), TestDescriptor( 'leftParen', '@a(', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_CLASS_MEMBER, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.expectedClassMember], '@a()', - expectedDiagnosticsInValidCode: [ - ParserErrorCode.EXPECTED_CLASS_MEMBER, - ], + expectedDiagnosticsInValidCode: [ParserErrorCode.expectedClassMember], ), ], [], @@ -91,14 +81,14 @@ class AnnotationTest extends PartialCodeTest { TestDescriptor( 'ampersand', '@', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], '@_s_', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor( 'leftParen', '@a(', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], '@a()', allFailing: true, ), @@ -116,28 +106,28 @@ class AnnotationTest extends PartialCodeTest { 'ampersand', '@', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, ], '@_s_', expectedDiagnosticsInValidCode: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], ), TestDescriptor( 'leftParen', '@a(', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, ], '@a()', expectedDiagnosticsInValidCode: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], ), ], @@ -168,14 +158,14 @@ class AnnotationTest extends PartialCodeTest { TestDescriptor( 'ampersand', '@', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], '@_s_', failing: ['localFunctionNonVoid'], ), TestDescriptor( 'leftParen', '@a(', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], '@a()', allFailing: true, ), @@ -192,14 +182,14 @@ class AnnotationTest extends PartialCodeTest { 'ampersand', '@', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, ], '@_s_', expectedDiagnosticsInValidCode: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], failing: ['labeled'], ), @@ -207,14 +197,14 @@ class AnnotationTest extends PartialCodeTest { 'leftParen', '@a(', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, ], '@a()', expectedDiagnosticsInValidCode: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], allFailing: true, ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/assert_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/assert_statement_test.dart index a5070e93fb4..7badd3c0e62 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/assert_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/assert_statement_test.dart @@ -18,16 +18,16 @@ class AssertStatementTest extends PartialCodeTest { 'assert_statement', [ TestDescriptor('keyword', 'assert', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "assert (_s_);"), TestDescriptor( 'leftParen', 'assert (', [ - ParserErrorCode.MISSING_IDENTIFIER, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "assert (_s_);", failing: [ @@ -41,26 +41,26 @@ class AssertStatementTest extends PartialCodeTest { ], ), TestDescriptor('condition', 'assert (a', [ - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, ], "assert (a);"), TestDescriptor( 'comma', 'assert (a,', - [ScannerErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken, ParserErrorCode.expectedToken], "assert (a,);", failing: allExceptEof, ), TestDescriptor('message', 'assert (a, b', [ - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, ], "assert (a, b);"), TestDescriptor('trailingComma', 'assert (a, b,', [ - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, ], "assert (a, b,);"), TestDescriptor('rightParen', 'assert (a, b)', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "assert (a, b);"), ], PartialCodeTest.statementSuffixes, diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/break_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/break_statement_test.dart index 4c280a25a90..b2e21d92fb7 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/break_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/break_statement_test.dart @@ -18,18 +18,13 @@ class BreakStatementTest extends PartialCodeTest { TestDescriptor( 'keyword', 'break', - [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, - ], + [ParserErrorCode.expectedToken, ParserErrorCode.breakOutsideOfLoop], "break;", - expectedDiagnosticsInValidCode: [ - ParserErrorCode.BREAK_OUTSIDE_OF_LOOP, - ], + expectedDiagnosticsInValidCode: [ParserErrorCode.breakOutsideOfLoop], failing: ['labeled', 'localFunctionNonVoid'], ), TestDescriptor('label', 'break a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "break a;"), ], PartialCodeTest.statementSuffixes, diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/class_declaration_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/class_declaration_test.dart index 7377e379c86..9bc8ec44556 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/class_declaration_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/class_declaration_test.dart @@ -16,35 +16,29 @@ class ClassDeclarationTest extends PartialCodeTest { TestDescriptor( 'keyword', 'class', - [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_CLASS_BODY, - ], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedClassBody], 'class _s_ {}', failing: ['functionNonVoid', 'getter'], ), TestDescriptor('named', 'class A', [ - ParserErrorCode.EXPECTED_CLASS_BODY, + ParserErrorCode.expectedClassBody, ], 'class A {}'), TestDescriptor( 'extend', 'class A extend', [ - ParserErrorCode.EXPECTED_INSTEAD, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CLASS_BODY, + ParserErrorCode.expectedInstead, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedClassBody, ], 'class A extend _s_ {}', - expectedDiagnosticsInValidCode: [ParserErrorCode.EXPECTED_INSTEAD], + expectedDiagnosticsInValidCode: [ParserErrorCode.expectedInstead], failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor( 'extends', 'class A extends', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CLASS_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedClassBody], 'class A extends _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), @@ -52,114 +46,99 @@ class ClassDeclarationTest extends PartialCodeTest { 'on', 'class A on', [ - ParserErrorCode.EXPECTED_INSTEAD, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CLASS_BODY, + ParserErrorCode.expectedInstead, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedClassBody, ], 'class A on _s_ {}', - expectedDiagnosticsInValidCode: [ParserErrorCode.EXPECTED_INSTEAD], + expectedDiagnosticsInValidCode: [ParserErrorCode.expectedInstead], failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor('extendsBody', 'class A extends {}', [ - ParserErrorCode.EXPECTED_TYPE_NAME, + ParserErrorCode.expectedTypeName, ], 'class A extends _s_ {}'), TestDescriptor( 'extendsWithNameBody', 'class A extends with B {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'class A extends _s_ with B {}', ), TestDescriptor( 'extendsImplementsNameBody', 'class A extends implements B {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'class A extends _s_ implements B {}', allFailing: true, ), TestDescriptor( 'extendsNameWith', 'class A extends B with', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CLASS_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedClassBody], 'class A extends B with _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor( 'extendsNameWithBody', 'class A extends B with {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'class A extends B with _s_ {}', ), TestDescriptor( 'extendsNameImplements', 'class A extends B implements', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CLASS_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedClassBody], 'class A extends B implements _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor( 'extendsNameImplementsBody', 'class A extends B implements {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'class A extends B implements _s_ {}', ), TestDescriptor( 'extendsNameWithNameImplements', 'class A extends B with C implements', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CLASS_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedClassBody], 'class A extends B with C implements _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor( 'extendsNameWithNameImplementsBody', 'class A extends B with C implements {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'class A extends B with C implements _s_ {}', ), TestDescriptor( 'implements', 'class A implements', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CLASS_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedClassBody], 'class A implements _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor('implementsBody', 'class A implements {}', [ - ParserErrorCode.EXPECTED_TYPE_NAME, + ParserErrorCode.expectedTypeName, ], 'class A implements _s_ {}'), TestDescriptor( 'implementsNameComma', 'class A implements B,', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CLASS_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedClassBody], 'class A implements B, _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor( 'implementsNameCommaBody', 'class A implements B, {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'class A implements B, _s_ {}', ), TestDescriptor( 'equals', 'class A =', [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], 'class A = _s_ with _s_;', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], @@ -167,20 +146,20 @@ class ClassDeclarationTest extends PartialCodeTest { TestDescriptor( 'equalsName', 'class A = B', - [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken, ParserErrorCode.expectedToken], 'class A = B with _s_;', failing: ['functionVoid', 'functionNonVoid', 'getter'], ), TestDescriptor( 'equalsNameWith', 'class A = B with', - [ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedToken], 'class A = B with _s_;', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor('equalsNameName', 'class A = B C', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], 'class A = B with C;'), ], PartialCodeTest.declarationSuffixes); } diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/constructor_declaration_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/constructor_declaration_test.dart index 892cdbae999..9eea2d3f0b4 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/constructor_declaration_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/constructor_declaration_test.dart @@ -21,8 +21,8 @@ class ConstructorTest extends PartialCodeTest { 'colon', 'C() :', [ - ParserErrorCode.MISSING_INITIALIZER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingInitializer, + ParserErrorCode.missingFunctionBody, ], 'C() : _s_ = _s_ {}', adjustValidUnitBeforeComparison: setSeparator, @@ -32,8 +32,8 @@ class ConstructorTest extends PartialCodeTest { 'colon_field', 'C() : f', [ - ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingAssignmentInInitializer, + ParserErrorCode.missingFunctionBody, ], 'C() : f = _s_ {}', adjustValidUnitBeforeComparison: setSeparator, @@ -42,8 +42,8 @@ class ConstructorTest extends PartialCodeTest { 'colon_field_increment', 'C() : f++', [ - ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingAssignmentInInitializer, + ParserErrorCode.missingFunctionBody, ], 'C() : _s_ = f++ {}', adjustValidUnitBeforeComparison: setSeparator, @@ -52,8 +52,8 @@ class ConstructorTest extends PartialCodeTest { 'colon_field_comma', 'C() : f = 0,', [ - ParserErrorCode.MISSING_INITIALIZER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingInitializer, + ParserErrorCode.missingFunctionBody, ], 'C() : f = 0, _s_ = _s_ {}', adjustValidUnitBeforeComparison: setSeparator, @@ -62,28 +62,28 @@ class ConstructorTest extends PartialCodeTest { TestDescriptor( 'colon_block', 'C() : {}', - [ParserErrorCode.MISSING_INITIALIZER], + [ParserErrorCode.missingInitializer], 'C() : _s_ = _s_ {}', adjustValidUnitBeforeComparison: setSeparator, ), TestDescriptor( 'colon_semicolon', 'C() : ;', - [ParserErrorCode.MISSING_INITIALIZER], + [ParserErrorCode.missingInitializer], 'C() : _s_ = _s_ ;', adjustValidUnitBeforeComparison: setSeparator, ), TestDescriptor('super', 'C() : super', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.expectedToken, + ParserErrorCode.missingFunctionBody, ], 'C() : super() {}'), TestDescriptor( 'super_dot', 'C() : super.', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'C() : super._s_() {}', failing: ['fieldConst', 'methodNonVoid', 'getter', 'setter'], @@ -92,13 +92,13 @@ class ConstructorTest extends PartialCodeTest { 'super_qdot', 'C() : super?.', [ - ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.invalidOperatorQuestionmarkPeriodForSuper, + ParserErrorCode.expectedToken, + ParserErrorCode.missingFunctionBody, ], 'C() : super?._s_() {}', expectedDiagnosticsInValidCode: [ - ParserErrorCode.INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER, + ParserErrorCode.invalidOperatorQuestionmarkPeriodForSuper, ], failing: ['methodNonVoid', 'getter', 'setter'], ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/continue_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/continue_statement_test.dart index 8e49315edfe..db24b98d296 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/continue_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/continue_statement_test.dart @@ -19,12 +19,12 @@ class ContinueStatementTest extends PartialCodeTest { 'keyword', 'continue', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, + ParserErrorCode.expectedToken, + ParserErrorCode.continueOutsideOfLoop, ], "continue;", expectedDiagnosticsInValidCode: [ - ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, + ParserErrorCode.continueOutsideOfLoop, ], failing: ['labeled', 'localFunctionNonVoid'], ), @@ -32,12 +32,12 @@ class ContinueStatementTest extends PartialCodeTest { 'label', 'continue a', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, + ParserErrorCode.expectedToken, + ParserErrorCode.continueOutsideOfLoop, ], "continue a;", expectedDiagnosticsInValidCode: [ - ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, + ParserErrorCode.continueOutsideOfLoop, ], ), ], diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/do_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/do_statement_test.dart index 496bab59adc..f13163562f0 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/do_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/do_statement_test.dart @@ -21,13 +21,13 @@ class DoStatementTest extends PartialCodeTest { 'keyword', 'do', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "do {} while (_s_);", allFailing: true, @@ -36,11 +36,11 @@ class DoStatementTest extends PartialCodeTest { 'leftBrace', 'do {', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "do {} while (_s_);", failing: allExceptEof, @@ -49,26 +49,26 @@ class DoStatementTest extends PartialCodeTest { 'rightBrace', 'do {}', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "do {} while (_s_);", failing: ['while'], ), TestDescriptor('while', 'do {} while', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "do {} while (_s_);"), TestDescriptor( 'leftParen', 'do {} while (', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, ], "do {} while (_s_);", failing: [ @@ -82,11 +82,11 @@ class DoStatementTest extends PartialCodeTest { ], ), TestDescriptor('condition', 'do {} while (a', [ - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, ], "do {} while (a);"), TestDescriptor('rightParen', 'do {} while (a)', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "do {} while (a);"), ], PartialCodeTest.statementSuffixes, diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/enum_declaration_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/enum_declaration_test.dart index 39766ac3074..edff8e8fdfb 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/enum_declaration_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/enum_declaration_test.dart @@ -16,7 +16,7 @@ class EnumDeclarationTest extends PartialCodeTest { TestDescriptor( 'keyword', 'enum', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_ENUM_BODY], + [ParserErrorCode.missingIdentifier, ParserErrorCode.missingEnumBody], 'enum _s_ {}', expectedDiagnosticsInValidCode: [], failing: ['functionNonVoid', 'getter'], @@ -24,21 +24,21 @@ class EnumDeclarationTest extends PartialCodeTest { TestDescriptor( 'name', 'enum E', - [ParserErrorCode.MISSING_ENUM_BODY], + [ParserErrorCode.missingEnumBody], 'enum E {}', expectedDiagnosticsInValidCode: [], ), TestDescriptor( 'missingName', 'enum {}', - [ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.missingIdentifier], 'enum _s_ {}', expectedDiagnosticsInValidCode: [], ), TestDescriptor( 'leftBrace', 'enum E {', - [ParserErrorCode.MISSING_IDENTIFIER, ScannerErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ScannerErrorCode.expectedToken], 'enum E {_s_}', failing: [ 'eof' /* tested separately below */, @@ -53,9 +53,9 @@ class EnumDeclarationTest extends PartialCodeTest { 'comma', 'enum E {,', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ScannerErrorCode.expectedToken, ], 'enum E {_s_,_s_}', failing: [ @@ -68,30 +68,30 @@ class EnumDeclarationTest extends PartialCodeTest { ], ), TestDescriptor('value', 'enum E {a', [ - ScannerErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, ], 'enum E {a}'), TestDescriptor('commaValue', 'enum E {,a', [ - ParserErrorCode.MISSING_IDENTIFIER, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ScannerErrorCode.expectedToken, ], 'enum E {_s_, a}'), TestDescriptor('commaRightBrace', 'enum E {,}', [ - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, ], 'enum E {_s_}'), TestDescriptor('commaValueRightBrace', 'enum E {, a}', [ - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, ], 'enum E {_s_, a}'), ], PartialCodeTest.declarationSuffixes); buildTests('enum_eof', [ TestDescriptor( 'leftBrace', 'enum E {', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], 'enum E {}', expectedDiagnosticsInValidCode: [], ), TestDescriptor('comma', 'enum E {,', [ - ParserErrorCode.MISSING_IDENTIFIER, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ScannerErrorCode.expectedToken, ], 'enum E {_s_}'), ], []); } diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/export_directive_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/export_directive_test.dart index 06846305dbe..d7985e946ee 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/export_directive_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/export_directive_test.dart @@ -16,66 +16,66 @@ class ExportDirectivesTest extends PartialCodeTest { TestDescriptor('keyword', 'export', [ // TODO(danrubel): Consider an improved error message // ParserErrorCode.MISSING_URI, - ParserErrorCode.EXPECTED_STRING_LITERAL, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedStringLiteral, + ParserErrorCode.expectedToken, ], "export '';"), TestDescriptor('emptyUri', "export ''", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "export '';"), TestDescriptor('uri', "export 'a.dart'", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "export 'a.dart';"), TestDescriptor( 'hide', "export 'a.dart' hide", - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "export 'a.dart' hide _s_;", failing: ['functionNonVoid', 'getter'], ), TestDescriptor('hideName', "export 'a.dart' hide A", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "export 'a.dart' hide A;"), TestDescriptor( 'hideComma', "export 'a.dart' hide A,", - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "export 'a.dart' hide A, _s_;", failing: ['functionNonVoid', 'getter'], ), TestDescriptor('hideCommaName', "export 'a.dart' hide A, B", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "export 'a.dart' hide A, B;"), TestDescriptor( 'hideShow', "export 'a.dart' hide A show", - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "export 'a.dart' hide A show _s_;", failing: ['functionNonVoid', 'getter'], ), TestDescriptor( 'show', "export 'a.dart' show", - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "export 'a.dart' show _s_;", failing: ['functionNonVoid', 'getter'], ), TestDescriptor('showName', "export 'a.dart' show A", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "export 'a.dart' show A;"), TestDescriptor( 'showComma', "export 'a.dart' show A,", - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "export 'a.dart' show A, _s_;", failing: ['functionNonVoid', 'getter'], ), TestDescriptor('showCommaName', "export 'a.dart' show A, B", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "export 'a.dart' show A, B;"), TestDescriptor( 'showHide', "export 'a.dart' show A hide", - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "export 'a.dart' show A hide _s_;", failing: ['functionNonVoid', 'getter'], ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/extension_declaration_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/extension_declaration_test.dart index 17fc67e6256..cd793ea094f 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/extension_declaration_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/extension_declaration_test.dart @@ -17,9 +17,9 @@ class ExtensionDeclarationTest extends PartialCodeTest { 'keyword', 'extension', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_EXTENSION_BODY, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedExtensionBody, ], 'extension on _s_ {}', failing: [ @@ -35,9 +35,9 @@ class ExtensionDeclarationTest extends PartialCodeTest { 'named', 'extension E', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_EXTENSION_BODY, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedExtensionBody, ], 'extension E on _s_ {}', failing: ['getter', 'functionNonVoid', 'functionVoid', 'mixin'], @@ -46,14 +46,14 @@ class ExtensionDeclarationTest extends PartialCodeTest { 'on', 'extension E on', [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_EXTENSION_BODY, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedExtensionBody, ], 'extension E on _s_ {}', failing: ['getter', 'functionNonVoid', 'functionVoid', 'mixin'], ), TestDescriptor('extendedType', 'extension E on String', [ - ParserErrorCode.EXPECTED_EXTENSION_BODY, + ParserErrorCode.expectedExtensionBody, ], 'extension E on String {}'), // Most of the failing tests are because the following text could be // a member of the class, so the parser adds the closing brace _after_ @@ -63,7 +63,7 @@ class ExtensionDeclarationTest extends PartialCodeTest { TestDescriptor( 'partialBody', 'extension E on String {', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], 'extension E on String {}', failing: [ 'class', diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/field_declaration_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/field_declaration_test.dart index b96e329707e..94db48f9e2f 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/field_declaration_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/field_declaration_test.dart @@ -31,30 +31,30 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'const_noName', 'const', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'const _s_;', failing: allExceptAnnotationAndEof, expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'const_name', 'const f', [ - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.constNotInitialized, ], 'const f;', failing: ['methodNonVoid', 'getter', 'setter'], expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'const_equals', 'const f =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'const f = _s_;', failing: [ 'fieldConst', @@ -65,7 +65,7 @@ class MethodTest extends PartialCodeTest { ], ), TestDescriptor('const_initializer', 'const f = 0', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'const f = 0;'), // // Instance field, final. @@ -73,21 +73,21 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'final_noName', 'final', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'final _s_;', failing: allExceptAnnotationAndEof, ), TestDescriptor( 'final_name', 'final f', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], 'final f;', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor( 'final_equals', 'final f =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'final f = _s_;', failing: [ 'fieldConst', @@ -98,7 +98,7 @@ class MethodTest extends PartialCodeTest { ], ), TestDescriptor('final_initializer', 'final f = 0', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'final f = 0;'), // // Instance field, var. @@ -106,28 +106,28 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'var_noName', 'var', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'var _s_;', failing: allExceptAnnotationAndEof, ), TestDescriptor( 'var_name', 'var f', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], 'var f;', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor( 'var_name_comma', 'var f,', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'var f, _s_;', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor( 'var_equals', 'var f =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'var f = _s_;', failing: [ 'fieldConst', @@ -138,7 +138,7 @@ class MethodTest extends PartialCodeTest { ], ), TestDescriptor('var_initializer', 'var f = 0', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'var f = 0;'), // // Instance field, type. @@ -147,26 +147,26 @@ class MethodTest extends PartialCodeTest { 'type_noName', 'A', [ - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingConstFinalVarOrType, + ParserErrorCode.expectedToken, ], 'A _s_;', allFailing: true, ), TestDescriptor('type_name', 'A f', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'A f;'), TestDescriptor( 'type_name_comma', 'A f,', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'A f, _s_;', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor( 'type_equals', 'A f =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'A f = _s_;', failing: [ 'fieldConst', @@ -177,7 +177,7 @@ class MethodTest extends PartialCodeTest { ], ), TestDescriptor('type_initializer', 'A f = 0', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'A f = 0;'), // // Static field, const. @@ -185,30 +185,30 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'static_const_noName', 'static const', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'static const _s_;', failing: allExceptAnnotationAndEof, expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'static_const_name', 'static const f', [ - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.constNotInitialized, ], 'static const f;', failing: ['methodNonVoid', 'getter', 'setter'], expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'static_const_equals', 'static const f =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'static const f = _s_;', failing: [ 'fieldConst', @@ -219,7 +219,7 @@ class MethodTest extends PartialCodeTest { ], ), TestDescriptor('static_const_initializer', 'static const f = 0', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'static const f = 0;'), // // Static field, final. @@ -227,21 +227,21 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'static_final_noName', 'static final', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'static final _s_;', failing: allExceptAnnotationAndEof, ), TestDescriptor( 'static_final_name', 'static final f', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], 'static final f;', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor( 'static_final_equals', 'static final f =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'static final f = _s_;', failing: [ 'fieldConst', @@ -252,7 +252,7 @@ class MethodTest extends PartialCodeTest { ], ), TestDescriptor('static_final_initializer', 'static final f = 0', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'static final f = 0;'), // // Static field, var. @@ -260,21 +260,21 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'static_var_noName', 'static var', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'static var _s_;', failing: allExceptAnnotationAndEof, ), TestDescriptor( 'static_var_name', 'static var f', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], 'static var f;', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor( 'static_var_equals', 'static var f =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'static var f = _s_;', failing: [ 'fieldConst', @@ -285,7 +285,7 @@ class MethodTest extends PartialCodeTest { ], ), TestDescriptor('static_var_initializer', 'static var f = 0', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'static var f = 0;'), // // Static field, type. @@ -294,19 +294,19 @@ class MethodTest extends PartialCodeTest { 'static_type_noName', 'static A', [ - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingConstFinalVarOrType, + ParserErrorCode.expectedToken, ], 'static A _s_;', allFailing: true, ), TestDescriptor('static_type_name', 'static A f', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'static A f;'), TestDescriptor( 'static_type_equals', 'static A f =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'static A f = _s_;', failing: [ 'fieldConst', @@ -317,7 +317,7 @@ class MethodTest extends PartialCodeTest { ], ), TestDescriptor('static_type_initializer', 'static A f = 0', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'static A f = 0;'), ], PartialCodeTest.classMemberSuffixes, diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/for_each_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/for_each_statement_test.dart index 58042dbdd16..4be0434b295 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/for_each_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/for_each_statement_test.dart @@ -25,10 +25,10 @@ class ForEachStatementTest extends PartialCodeTest { 'in', 'for (var a in', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ScannerErrorCode.expectedToken, ], 'for (var a in _s_) _s_;', failing: allExceptEof, @@ -37,9 +37,9 @@ class ForEachStatementTest extends PartialCodeTest { 'iterator', 'for (var a in b', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], 'for (var a in b) _s_;', failing: allExceptEof, @@ -57,20 +57,20 @@ class ForEachStatementTest extends PartialCodeTest { 'forEach_statement', [ TestDescriptor('await_keyword', 'await for', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'await for (_s_ in _s_) _s_;'), TestDescriptor( 'await_leftParen', 'await for (', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, // TODO(danrubel): investigate why 4 missing identifier errors - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "await for (_s_ in _s_) _s_;", failing: allExceptEof, @@ -79,11 +79,11 @@ class ForEachStatementTest extends PartialCodeTest { 'await_variableName', 'await for (a', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "await for (a in _s_) _s_;", failing: allExceptEof, @@ -92,11 +92,11 @@ class ForEachStatementTest extends PartialCodeTest { 'await_typeAndVariableName', 'await for (A a', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "await for (A a in _s_) _s_;", failing: allExceptEof, @@ -105,10 +105,10 @@ class ForEachStatementTest extends PartialCodeTest { 'await_in', 'await for (A a in', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "await for (A a in _s_) _s_;", failing: allExceptEof, @@ -117,9 +117,9 @@ class ForEachStatementTest extends PartialCodeTest { 'await_stream', 'await for (A a in b', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "await for (A a in b) _s_;", failing: allExceptEof, diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/for_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/for_statement_test.dart index cf56b6c55bc..299ff3acec5 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/for_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/for_statement_test.dart @@ -18,18 +18,18 @@ class ForStatementTest extends PartialCodeTest { 'for_statement', [ TestDescriptor('keyword', 'for', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'for (;;) _s_;'), TestDescriptor( 'emptyParen', 'for ()', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "for (_s_;_s_;) _s_;", failing: allExceptEof, @@ -38,13 +38,13 @@ class ForStatementTest extends PartialCodeTest { 'leftParen', 'for (', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "for (_s_;_s_;) _s_;", failing: allExceptEof, @@ -53,11 +53,11 @@ class ForStatementTest extends PartialCodeTest { 'var', 'for (var', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], "for (var _s_;;) _s_;", allFailing: true, @@ -66,12 +66,12 @@ class ForStatementTest extends PartialCodeTest { 'varAndIdentifier', 'for (var i', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "for (var i;_s_;) _s_;", failing: allExceptEof, @@ -80,13 +80,13 @@ class ForStatementTest extends PartialCodeTest { 'equals', 'for (var i =', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "for (var i = _s_;_s_;) _s_;", failing: allExceptEof, @@ -95,12 +95,12 @@ class ForStatementTest extends PartialCodeTest { 'initializer', 'for (var i = 0', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "for (var i = 0;_s_;) _s_;", failing: allExceptEof, @@ -109,11 +109,11 @@ class ForStatementTest extends PartialCodeTest { 'firstSemicolon', 'for (var i = 0;', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "for (var i = 0;_s_;) _s_;", failing: allExceptEof, @@ -122,9 +122,9 @@ class ForStatementTest extends PartialCodeTest { 'secondSemicolon', 'for (var i = 0;;', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "for (var i = 0;;) _s_;", failing: allExceptEof, @@ -132,7 +132,7 @@ class ForStatementTest extends PartialCodeTest { TestDescriptor( 'rightParen', 'for (var i = 0;;)', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "for (var i = 0;;) _s_;", failing: allExceptEof, ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/if_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/if_statement_test.dart index bbb6846b251..323d314e4d3 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/if_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/if_statement_test.dart @@ -16,13 +16,13 @@ class IfStatementTest extends PartialCodeTest { 'if_statement', [ TestDescriptor('keyword', 'if', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "if (_s_)"), TestDescriptor( 'leftParen', 'if (', - [ParserErrorCode.MISSING_IDENTIFIER, ScannerErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ScannerErrorCode.expectedToken], "if (_s_)", failing: [ 'assert', @@ -35,7 +35,7 @@ class IfStatementTest extends PartialCodeTest { ], ), TestDescriptor('condition', 'if (a', [ - ScannerErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, ], "if (a)"), ], PartialCodeTest.statementSuffixes, @@ -50,9 +50,9 @@ class IfStatementTest extends PartialCodeTest { 'keyword', 'if', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "if (_s_);", allFailing: true, @@ -60,14 +60,14 @@ class IfStatementTest extends PartialCodeTest { TestDescriptor( 'leftParen', 'if (', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "if (_s_);", allFailing: true, ), TestDescriptor( 'condition', 'if (a', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], "if (a);", allFailing: true, ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/import_directive_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/import_directive_test.dart index d6eebe22608..c03c177a54f 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/import_directive_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/import_directive_test.dart @@ -16,58 +16,58 @@ class ImportDirectivesTest extends PartialCodeTest { TestDescriptor('keyword', 'import', [ // TODO(danrubel): Consider an improved error message // ParserErrorCode.MISSING_URI, - ParserErrorCode.EXPECTED_STRING_LITERAL, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedStringLiteral, + ParserErrorCode.expectedToken, ], "import '';"), TestDescriptor('emptyUri', "import ''", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "import '';"), TestDescriptor('fullUri', "import 'a.dart'", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "import 'a.dart';"), TestDescriptor('if', "import 'a.dart' if", [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_STRING_LITERAL, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedStringLiteral, ], "import 'a.dart' if (_s_) '';"), TestDescriptor( 'ifParen', "import 'a.dart' if (", [ - ParserErrorCode.MISSING_IDENTIFIER, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_STRING_LITERAL, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedStringLiteral, + ParserErrorCode.expectedToken, ], "import 'a.dart' if (_s_) '';", failing: ['functionNonVoid', 'getter', 'setter'], ), TestDescriptor('ifId', "import 'a.dart' if (b", [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_STRING_LITERAL, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedStringLiteral, ], "import 'a.dart' if (b) '';"), TestDescriptor('ifEquals', "import 'a.dart' if (b ==", [ - ParserErrorCode.EXPECTED_STRING_LITERAL, - ParserErrorCode.EXPECTED_TOKEN, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_STRING_LITERAL, + ParserErrorCode.expectedStringLiteral, + ParserErrorCode.expectedToken, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedStringLiteral, ], "import 'a.dart' if (b == '') '';"), TestDescriptor('ifCondition', "import 'a.dart' if (b)", [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_STRING_LITERAL, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedStringLiteral, ], "import 'a.dart' if (b) '';"), TestDescriptor( 'as', "import 'a.dart' as", - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "import 'a.dart' as _s_;", failing: ['functionNonVoid', 'getter'], ), TestDescriptor( 'show', "import 'a.dart' show", - [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_IDENTIFIER], + [ParserErrorCode.expectedToken, ParserErrorCode.missingIdentifier], "import 'a.dart' show _s_;", failing: ['functionNonVoid', 'getter'], ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/index_expression_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/index_expression_test.dart index 398aa44f034..d5458fa50c1 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/index_expression_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/index_expression_test.dart @@ -16,19 +16,19 @@ class IndexStatementTest extends PartialCodeTest { 'index_assignment', [ TestDescriptor('missing_index_no_space', 'intList[] = 0;', [ - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, ], 'intList[_s_] = 0;'), TestDescriptor('missing_index_with_space', 'intList[ ] = 0;', [ - ParserErrorCode.MISSING_IDENTIFIER, + ParserErrorCode.missingIdentifier, ], 'intList[_s_] = 0;'), TestDescriptor('trailing_comma', 'intList[x,] = 0;', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'intList[x] = 0;'), TestDescriptor('trailing_comma_and_identifier', 'intList[x,y] = 0;', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'intList[x] = 0;'), TestDescriptor('trailing_identifier_no_comma', 'intList[x y] = 0;', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'intList[x] = 0;'), ], [], //PartialCodeTest.statementSuffixes, @@ -42,10 +42,10 @@ class IndexStatementTest extends PartialCodeTest { 'open', 'intList[', [ - ParserErrorCode.MISSING_IDENTIFIER, - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], 'intList[_s_];', failing: [ @@ -63,9 +63,9 @@ class IndexStatementTest extends PartialCodeTest { 'identifier', 'intList[x', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.expectedToken, + ParserErrorCode.expectedToken, ], 'intList[x];', failing: ['eof'], diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/instance_creation_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/instance_creation_test.dart index e0d74c5617e..00d5dda27ce 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/instance_creation_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/instance_creation_test.dart @@ -24,30 +24,30 @@ class InstanceCreationTest extends PartialCodeTest { List forKeyword(String keyword) { return [ TestDescriptor('${keyword}_keyword', keyword, [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "$keyword _s_()"), TestDescriptor('${keyword}_name_unnamed', '$keyword A', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "$keyword A()"), TestDescriptor('${keyword}_name_named', '$keyword A.b', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "$keyword A.b()"), TestDescriptor('${keyword}_name_dot', '$keyword A.', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "$keyword A._s_()"), TestDescriptor( '${keyword}_leftParen_unnamed', '$keyword A(', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], "$keyword A()", allFailing: true, ), TestDescriptor( '${keyword}_leftParen_named', '$keyword A.b(', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], "$keyword A.b()", allFailing: true, ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/library_directive_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/library_directive_test.dart index 3f0587e5911..774833d548a 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/library_directive_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/library_directive_test.dart @@ -16,22 +16,22 @@ class LibraryDirectivesTest extends PartialCodeTest { TestDescriptor( 'keyword', 'library', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'library _s_;', failing: ['functionNonVoid', 'getter'], ), TestDescriptor('name', 'library lib', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'library lib;'), TestDescriptor( 'nameDot', 'library lib.', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'library lib._s_;', failing: ['functionNonVoid', 'getter'], ), TestDescriptor('nameDotName', 'library lib.a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'library lib.a;'), ], PartialCodeTest.prePartSuffixes); } diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/local_variable_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/local_variable_test.dart index d089664ee45..f40efedc00e 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/local_variable_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/local_variable_test.dart @@ -18,44 +18,44 @@ class LocalVariableTest extends PartialCodeTest { TestDescriptor( 'const', 'const', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "const _s_;", allFailing: true, ), TestDescriptor( 'constName', 'const a', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], "const a;", failing: ['eof', 'labeled', 'localFunctionNonVoid'], ), TestDescriptor('constTypeName', 'const int a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "const int a;"), TestDescriptor( 'constNameComma', 'const a,', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "const a, _s_;", failing: ['labeled', 'localFunctionNonVoid'], ), TestDescriptor( 'constTypeNameComma', 'const int a,', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "const int a, _s_;", failing: ['labeled', 'localFunctionNonVoid'], ), TestDescriptor('constNameCommaName', 'const a, b', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "const a, b;"), TestDescriptor('constTypeNameCommaName', 'const int a, b', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "const int a, b;"), TestDescriptor( 'final', 'final', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "final _s_;", failing: [ 'labeled', @@ -67,27 +67,27 @@ class LocalVariableTest extends PartialCodeTest { TestDescriptor( 'finalName', 'final a', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], "final a;", failing: ['labeled', 'localFunctionNonVoid'], ), TestDescriptor('finalTypeName', 'final int a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "final int a;"), TestDescriptor( 'type', 'int', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "int _s_;", allFailing: true, ), TestDescriptor('typeName', 'int a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "int a;"), TestDescriptor( 'var', 'var', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "var _s_;", failing: [ 'labeled', @@ -99,14 +99,14 @@ class LocalVariableTest extends PartialCodeTest { TestDescriptor( 'varName', 'var a', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], "var a;", failing: ['labeled', 'localFunctionNonVoid'], ), TestDescriptor( 'varNameEquals', 'var a =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "var a = _s_;", failing: [ 'block', @@ -119,7 +119,7 @@ class LocalVariableTest extends PartialCodeTest { ], ), TestDescriptor('varNameEqualsExpression', 'var a = b', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "var a = b;"), ], PartialCodeTest.statementSuffixes, diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/method_declaration_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/method_declaration_test.dart index 5babcd40223..2c767a4c0ed 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/method_declaration_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/method_declaration_test.dart @@ -31,50 +31,41 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'noType_leftParen', 'm(', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'm() {}', failing: allExceptEof, ), TestDescriptor( 'noType_paramName', 'm(B', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'm(B) {}', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor('noType_paramTypeAndName', 'm(B b', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingFunctionBody, ], 'm(B b) {}'), TestDescriptor( 'noType_paramAndComma', 'm(B b,', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'm(B b) {}', failing: allExceptEof, ), TestDescriptor('noType_noParams', 'm()', [ - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, ], 'm() {}'), TestDescriptor('noType_params', 'm(b, c)', [ - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, ], 'm(b, c) {}'), TestDescriptor('noType_emptyOptional', 'm(B b, [])', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'm(B b, [_s_]){}'), TestDescriptor('noType_emptyNamed', 'm(B b, {})', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'm(B b, {_s_}){}'), // // Instance method, with simple return type. @@ -82,50 +73,41 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'type_leftParen', 'A m(', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'A m() {}', failing: allExceptEof, ), TestDescriptor( 'type_paramName', 'A m(B', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'A m(B) {}', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor('type_paramTypeAndName', 'A m(B b', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingFunctionBody, ], 'A m(B b) {}'), TestDescriptor( 'type_paramAndComma', 'A m(B b,', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'A m(B b) {}', failing: allExceptEof, ), TestDescriptor('type_noParams', 'A m()', [ - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, ], 'A m() {}'), TestDescriptor('type_params', 'A m(b, c)', [ - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, ], 'A m(b, c) {}'), TestDescriptor('type_emptyOptional', 'A m(B b, [])', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'A m(B b, [_s_]){}'), TestDescriptor('type_emptyNamed', 'A m(B b, {})', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'A m(B b, {_s_}){}'), // // Static method, no return type. @@ -133,55 +115,46 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'static_noType_leftParen', 'static m(', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'static m() {}', failing: allExceptEof, ), TestDescriptor( 'static_noType_paramName', 'static m(B', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'static m(B) {}', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor('static_noType_paramTypeAndName', 'static m(B b', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingFunctionBody, ], 'static m(B b) {}'), TestDescriptor( 'static_noType_paramAndComma', 'static m(B b,', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'static m(B b) {}', failing: allExceptEof, ), TestDescriptor('static_noType_noParams', 'static m()', [ - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, ], 'static m() {}'), TestDescriptor('static_noType_params', 'static m(b, c)', [ - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, ], 'static m(b, c) {}'), TestDescriptor( 'static_noType_emptyOptional', 'static m(B b, [])', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'static m(B b, [_s_]){}', ), TestDescriptor('static_noType_emptyNamed', 'static m(B b, {})', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'static m(B b, {_s_}){}'), // // Static method, with simple return type. @@ -189,49 +162,40 @@ class MethodTest extends PartialCodeTest { TestDescriptor( 'static_type_leftParen', 'static A m(', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'static A m() {}', failing: allExceptEof, ), TestDescriptor( 'static_type_paramName', 'static A m(B', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'static A m(B) {}', failing: ['methodNonVoid', 'getter', 'setter'], ), TestDescriptor('static_type_paramTypeAndName', 'static A m(B b', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingFunctionBody, ], 'static A m(B b) {}'), TestDescriptor( 'static_type_paramAndComma', 'static A m(B b,', - [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_FUNCTION_BODY, - ], + [ScannerErrorCode.expectedToken, ParserErrorCode.missingFunctionBody], 'static A m(B b) {}', failing: allExceptEof, ), TestDescriptor('static_type_noParams', 'static A m()', [ - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, ], 'static A m() {}'), TestDescriptor('static_type_params', 'static A m(b, c)', [ - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingFunctionBody, ], 'static A m(b, c) {}'), TestDescriptor( 'static_type_emptyOptional', 'static A m(B b, [])', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'static A m(B b, [_s_]){}', ), @@ -239,8 +203,8 @@ class MethodTest extends PartialCodeTest { 'static_type_emptyNamed', 'static A m(B b, {})', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_FUNCTION_BODY, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingFunctionBody, ], 'static A m(B b, {_s_}){}', ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/mixin_declaration_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/mixin_declaration_test.dart index 3ea83903cba..eb2d7286d2d 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/mixin_declaration_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/mixin_declaration_test.dart @@ -16,23 +16,17 @@ class MixinDeclarationTest extends PartialCodeTest { TestDescriptor( 'keyword', 'mixin', - [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_MIXIN_BODY, - ], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedMixinBody], 'mixin _s_ {}', failing: ['class', 'functionNonVoid', 'getter'], ), TestDescriptor('named', 'mixin A', [ - ParserErrorCode.EXPECTED_MIXIN_BODY, + ParserErrorCode.expectedMixinBody, ], 'mixin A {}'), TestDescriptor( 'on', 'mixin A on', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_MIXIN_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedMixinBody], 'mixin A on _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), @@ -40,92 +34,80 @@ class MixinDeclarationTest extends PartialCodeTest { 'extend', 'mixin A extend', [ - ParserErrorCode.EXPECTED_INSTEAD, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_MIXIN_BODY, + ParserErrorCode.expectedInstead, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedMixinBody, ], 'mixin A extend _s_ {}', - expectedDiagnosticsInValidCode: [ParserErrorCode.EXPECTED_INSTEAD], + expectedDiagnosticsInValidCode: [ParserErrorCode.expectedInstead], failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor( 'extends', 'mixin A extends', [ - ParserErrorCode.EXPECTED_INSTEAD, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_MIXIN_BODY, + ParserErrorCode.expectedInstead, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedMixinBody, ], 'mixin A extends _s_ {}', - expectedDiagnosticsInValidCode: [ParserErrorCode.EXPECTED_INSTEAD], + expectedDiagnosticsInValidCode: [ParserErrorCode.expectedInstead], failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor('onBody', 'mixin A on {}', [ - ParserErrorCode.EXPECTED_TYPE_NAME, + ParserErrorCode.expectedTypeName, ], 'mixin A on _s_ {}'), TestDescriptor( 'onNameComma', 'mixin A on B,', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_MIXIN_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedMixinBody], 'mixin A on B, _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor('onNameCommaBody', 'mixin A on B, {}', [ - ParserErrorCode.EXPECTED_TYPE_NAME, + ParserErrorCode.expectedTypeName, ], 'mixin A on B, _s_ {}'), TestDescriptor( 'onImplementsNameBody', 'mixin A on implements B {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'mixin A on _s_ implements B {}', allFailing: true, ), TestDescriptor( 'onNameImplements', 'mixin A on B implements', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_MIXIN_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedMixinBody], 'mixin A on B implements _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor( 'onNameImplementsBody', 'mixin A on B implements {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'mixin A on B implements _s_ {}', ), TestDescriptor( 'implements', 'mixin A implements', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_MIXIN_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedMixinBody], 'mixin A implements _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor('implementsBody', 'mixin A implements {}', [ - ParserErrorCode.EXPECTED_TYPE_NAME, + ParserErrorCode.expectedTypeName, ], 'mixin A implements _s_ {}'), TestDescriptor( 'implementsNameComma', 'mixin A implements B,', - [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_MIXIN_BODY, - ], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedMixinBody], 'mixin A implements B, _s_ {}', failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), TestDescriptor( 'implementsNameCommaBody', 'mixin A implements B, {}', - [ParserErrorCode.EXPECTED_TYPE_NAME], + [ParserErrorCode.expectedTypeName], 'mixin A implements B, _s_ {}', ), ], PartialCodeTest.declarationSuffixes); diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/parameter_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/parameter_test.dart index a5584d56530..66aeb9dd977 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/parameter_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/parameter_test.dart @@ -16,7 +16,7 @@ class ParameterTest extends PartialCodeTest { TestDescriptor( 'functionType_noIdentifier', 'f(Function(void)) {}', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], 'f(Function(void) _s_) {}', failing: ['eof'], ), @@ -26,7 +26,7 @@ class ParameterTest extends PartialCodeTest { class C {} f(C {} f(C c) {} diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/part_directive_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/part_directive_test.dart index 45d186efe8a..2d2e7faff36 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/part_directive_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/part_directive_test.dart @@ -16,14 +16,14 @@ class PartDirectivesTest extends PartialCodeTest { TestDescriptor('keyword', 'part', [ // TODO(danrubel): Consider an improved error message // ParserErrorCode.MISSING_URI, - ParserErrorCode.EXPECTED_STRING_LITERAL, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedStringLiteral, + ParserErrorCode.expectedToken, ], "part '';"), TestDescriptor('emptyUri', "part ''", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "part '';"), TestDescriptor('uri', "part 'a.dart'", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "part 'a.dart';"), ], PartialCodeTest.postPartSuffixes); } diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/part_of_directive_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/part_of_directive_test.dart index b6cddffc04b..766e65a2043 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/part_of_directive_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/part_of_directive_test.dart @@ -30,10 +30,7 @@ class PartOfDirectivesTest extends PartialCodeTest { TestDescriptor( 'keyword', 'part of', - [ - ParserErrorCode.EXPECTED_STRING_LITERAL, - ParserErrorCode.EXPECTED_TOKEN, - ], + [ParserErrorCode.expectedStringLiteral, ParserErrorCode.expectedToken], 'part of "";', failing: ['mixin'], ), @@ -44,7 +41,7 @@ class PartOfDirectivesTest extends PartialCodeTest { TestDescriptor( 'keyword', 'part of', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'part of _s_;', failing: ['functionNonVoid', 'getter'], ), @@ -56,25 +53,25 @@ class PartOfDirectivesTest extends PartialCodeTest { TestDescriptor( 'name', 'part of lib', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], 'library lib;', allFailing: true, ), TestDescriptor( 'nameDot', 'part of lib.', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], 'part of lib._s_;', failing: ['functionNonVoid', 'getter'], ), TestDescriptor('nameDotName', 'part of lib.a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], 'part of lib.a;'), TestDescriptor('emptyUri', "part of ''", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "part of '';"), TestDescriptor('uri', "part of 'a.dart'", [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "part of 'a.dart';"), ], PartialCodeTest.declarationSuffixes); } 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 ae419a30aae..e13a2fa6314 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 @@ -191,12 +191,11 @@ abstract class PartialCodeTest extends AbstractRecoveryTest { parseCompilationUnit2(base.toString(), listener, featureSet: featureSet); var baseDiagnosticCodes = []; for (var diagnostic in listener.diagnostics) { - if (diagnostic.diagnosticCode == - ParserErrorCode.BREAK_OUTSIDE_OF_LOOP || + if (diagnostic.diagnosticCode == ParserErrorCode.breakOutsideOfLoop || diagnostic.diagnosticCode == - ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP || + ParserErrorCode.continueOutsideOfLoop || diagnostic.diagnosticCode == - ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE) { + ParserErrorCode.continueWithoutLabelInCase) { baseDiagnosticCodes.add(diagnostic.diagnosticCode); } } diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/return_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/return_statement_test.dart index 94ac1b253f9..3cedd659313 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/return_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/return_statement_test.dart @@ -18,12 +18,12 @@ class ReturnStatementTest extends PartialCodeTest { TestDescriptor( 'keyword', 'return', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], "return;", allFailing: true, ), TestDescriptor('expression', 'return a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "return a;"), ], PartialCodeTest.statementSuffixes, diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/switch_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/switch_statement_test.dart index d88ce1b70e9..9877f1ee557 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/switch_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/switch_statement_test.dart @@ -21,9 +21,9 @@ class SwitchStatementTest extends PartialCodeTest { 'keyword', 'switch', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedSwitchStatementBody, + ParserErrorCode.expectedToken, ], "switch (_s_) {}", failing: ['block'], @@ -32,9 +32,9 @@ class SwitchStatementTest extends PartialCodeTest { 'leftParen', 'switch (', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedSwitchStatementBody, + ScannerErrorCode.expectedToken, ], "switch (_s_) {}", failing: [ @@ -51,8 +51,8 @@ class SwitchStatementTest extends PartialCodeTest { 'expression', 'switch (a', [ - ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedSwitchStatementBody, + ScannerErrorCode.expectedToken, ], "switch (a) {}", failing: ['block'], @@ -60,14 +60,14 @@ class SwitchStatementTest extends PartialCodeTest { TestDescriptor( 'rightParen', 'switch (a)', - [ParserErrorCode.EXPECTED_SWITCH_STATEMENT_BODY], + [ParserErrorCode.expectedSwitchStatementBody], "switch (a) {}", failing: ['block'], ), TestDescriptor( 'leftBrace', 'switch (a) {', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], "switch (a) {}", failing: allExceptEof, ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/top_level_variable_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/top_level_variable_test.dart index 96e5c36986e..062491a394d 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/top_level_variable_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/top_level_variable_test.dart @@ -16,7 +16,7 @@ class TopLevelVariableTest extends PartialCodeTest { TestDescriptor( 'const', 'const', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "const _s_;", failing: [ 'class', @@ -26,96 +26,96 @@ class TopLevelVariableTest extends PartialCodeTest { 'setter', ], expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'constName', 'const a', [ - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.constNotInitialized, ], "const a;", failing: ['functionNonVoid', 'getter', 'setter', 'mixin'], expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'constTypeName', 'const int a', [ - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.constNotInitialized, ], "const int a;", expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'constNameComma', 'const a,', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.constNotInitialized, ], "const a, _s_;", failing: ['functionNonVoid', 'getter'], expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'constTypeNameComma', 'const int a,', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.constNotInitialized, ], "const int a, _s_;", failing: ['functionNonVoid', 'getter'], expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'constNameCommaName', 'const a, b', [ - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.constNotInitialized, + CompileTimeErrorCode.constNotInitialized, ], "const a, b;", expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'constTypeNameCommaName', 'const int a, b', [ - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.constNotInitialized, + CompileTimeErrorCode.constNotInitialized, ], "const int a, b;", expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.CONST_NOT_INITIALIZED, - CompileTimeErrorCode.CONST_NOT_INITIALIZED, + CompileTimeErrorCode.constNotInitialized, + CompileTimeErrorCode.constNotInitialized, ], ), TestDescriptor( 'final', 'final', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "final _s_;", failing: [ 'class', @@ -127,65 +127,65 @@ class TopLevelVariableTest extends PartialCodeTest { 'setter', ], expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.FINAL_NOT_INITIALIZED, + CompileTimeErrorCode.finalNotInitialized, ], ), TestDescriptor( 'finalName', 'final a', [ - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.finalNotInitialized, ], "final a;", failing: ['functionNonVoid', 'getter', 'setter', 'mixin'], expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.FINAL_NOT_INITIALIZED, + CompileTimeErrorCode.finalNotInitialized, ], ), TestDescriptor( 'finalTypeName', 'final int a', [ - ParserErrorCode.EXPECTED_TOKEN, - CompileTimeErrorCode.FINAL_NOT_INITIALIZED, + ParserErrorCode.expectedToken, + CompileTimeErrorCode.finalNotInitialized, ], "final int a;", expectedDiagnosticsInValidCode: [ - CompileTimeErrorCode.FINAL_NOT_INITIALIZED, + CompileTimeErrorCode.finalNotInitialized, ], ), TestDescriptor( 'type', 'int', [ - ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingConstFinalVarOrType, + ParserErrorCode.expectedToken, ], "int _s_;", allFailing: true, ), TestDescriptor('typeName', 'int a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "int a;"), TestDescriptor( 'var', 'var', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "var _s_;", failing: ['functionVoid', 'functionNonVoid', 'getter', 'setter'], ), TestDescriptor( 'varName', 'var a', - [ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedToken], "var a;", failing: ['functionNonVoid', 'getter', 'mixin', 'setter'], ), TestDescriptor( 'varNameEquals', 'var a =', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "var a = _s_;", failing: [ 'class', @@ -200,7 +200,7 @@ class TopLevelVariableTest extends PartialCodeTest { ], ), TestDescriptor('varNameEqualsExpression', 'var a = b', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "var a = b;"), ], PartialCodeTest.declarationSuffixes); } diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/try_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/try_statement_test.dart index ef80dd790ad..3dc41dd4c46 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/try_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/try_statement_test.dart @@ -22,8 +22,8 @@ class TryStatementTest extends PartialCodeTest { 'keyword', 'try', [ - ParserErrorCode.EXPECTED_TRY_STATEMENT_BODY, - ParserErrorCode.MISSING_CATCH_OR_FINALLY, + ParserErrorCode.expectedTryStatementBody, + ParserErrorCode.missingCatchOrFinally, ], "try {} finally {}", allFailing: true, @@ -31,7 +31,7 @@ class TryStatementTest extends PartialCodeTest { TestDescriptor( 'noCatchOrFinally', 'try {}', - [ParserErrorCode.MISSING_CATCH_OR_FINALLY], + [ParserErrorCode.missingCatchOrFinally], "try {} finally {}", allFailing: true, ), @@ -42,8 +42,8 @@ class TryStatementTest extends PartialCodeTest { 'on', 'try {} on', [ - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedCatchClauseBody, ], "try {} on _s_ {}", failing: [ @@ -56,7 +56,7 @@ class TryStatementTest extends PartialCodeTest { TestDescriptor( 'on_identifier', 'try {} on A', - [ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY], + [ParserErrorCode.expectedCatchClauseBody], "try {} on A {}", failing: ['block'], ), @@ -67,8 +67,8 @@ class TryStatementTest extends PartialCodeTest { 'catch', 'try {} catch', [ - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, + ParserErrorCode.catchSyntax, + ParserErrorCode.expectedCatchClauseBody, ], "try {} catch (_s_) {}", failing: ['block'], @@ -77,9 +77,9 @@ class TryStatementTest extends PartialCodeTest { 'catch_leftParen', 'try {} catch (', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, + ScannerErrorCode.expectedToken, + ParserErrorCode.catchSyntax, + ParserErrorCode.expectedCatchClauseBody, ], "try {} catch (_s_) {}", failing: ['block', 'labeled', 'localFunctionNonVoid'], @@ -88,9 +88,9 @@ class TryStatementTest extends PartialCodeTest { 'catch_identifier', 'try {} catch (e', [ - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.catchSyntax, + ParserErrorCode.expectedCatchClauseBody, + ScannerErrorCode.expectedToken, ], "try {} catch (e) {}", failing: ['eof', 'block'], @@ -99,9 +99,9 @@ class TryStatementTest extends PartialCodeTest { 'catch_identifierComma', 'try {} catch (e, ', [ - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.catchSyntax, + ParserErrorCode.expectedCatchClauseBody, + ScannerErrorCode.expectedToken, ], "try {} catch (e, _s_) {}", failing: ['block', 'labeled', 'localFunctionNonVoid'], @@ -112,9 +112,9 @@ class TryStatementTest extends PartialCodeTest { [ // TODO(danrubel): Update parser to generate CATCH_SYNTAX // because in this situation there are not any extra parameters. - ParserErrorCode.CATCH_SYNTAX_EXTRA_PARAMETERS, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.catchSyntaxExtraParameters, + ParserErrorCode.expectedCatchClauseBody, + ScannerErrorCode.expectedToken, ], "try {} catch (e, s) {}", failing: ['eof', 'block'], @@ -122,7 +122,7 @@ class TryStatementTest extends PartialCodeTest { TestDescriptor( 'catch_rightParen', 'try {} catch (e, s)', - [ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY], + [ParserErrorCode.expectedCatchClauseBody], "try {} catch (e, s) {}", failing: ['block'], ), @@ -133,8 +133,8 @@ class TryStatementTest extends PartialCodeTest { 'on_catch', 'try {} on A catch', [ - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, + ParserErrorCode.catchSyntax, + ParserErrorCode.expectedCatchClauseBody, ], "try {} on A catch (_s_) {}", failing: ['block'], @@ -143,9 +143,9 @@ class TryStatementTest extends PartialCodeTest { 'on_catch_leftParen', 'try {} on A catch (', [ - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.catchSyntax, + ParserErrorCode.expectedCatchClauseBody, + ScannerErrorCode.expectedToken, ], "try {} on A catch (_s_) {}", failing: ['block', 'labeled', 'localFunctionNonVoid'], @@ -154,9 +154,9 @@ class TryStatementTest extends PartialCodeTest { 'on_catch_identifier', 'try {} on A catch (e', [ - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.catchSyntax, + ParserErrorCode.expectedCatchClauseBody, + ScannerErrorCode.expectedToken, ], "try {} on A catch (e) {}", failing: ['eof', 'block'], @@ -165,9 +165,9 @@ class TryStatementTest extends PartialCodeTest { 'on_catch_identifierComma', 'try {} on A catch (e, ', [ - ParserErrorCode.CATCH_SYNTAX, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.catchSyntax, + ParserErrorCode.expectedCatchClauseBody, + ScannerErrorCode.expectedToken, ], "try {} on A catch (e, _s_) {}", failing: ['block', 'labeled', 'localFunctionNonVoid'], @@ -178,9 +178,9 @@ class TryStatementTest extends PartialCodeTest { [ // TODO(danrubel): Update parser to generate CATCH_SYNTAX // because in this situation there are not any extra parameters. - ParserErrorCode.CATCH_SYNTAX_EXTRA_PARAMETERS, - ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY, - ScannerErrorCode.EXPECTED_TOKEN, + ParserErrorCode.catchSyntaxExtraParameters, + ParserErrorCode.expectedCatchClauseBody, + ScannerErrorCode.expectedToken, ], "try {} on A catch (e, s) {}", failing: ['eof', 'block'], @@ -188,7 +188,7 @@ class TryStatementTest extends PartialCodeTest { TestDescriptor( 'on_catch_rightParen', 'try {} on A catch (e, s)', - [ParserErrorCode.EXPECTED_CATCH_CLAUSE_BODY], + [ParserErrorCode.expectedCatchClauseBody], "try {} on A catch (e, s) {}", failing: ['block'], ), @@ -198,7 +198,7 @@ class TryStatementTest extends PartialCodeTest { TestDescriptor( 'finally_noCatch_noBlock', 'try {} finally', - [ParserErrorCode.EXPECTED_FINALLY_CLAUSE_BODY], + [ParserErrorCode.expectedFinallyClauseBody], "try {} finally {}", failing: ['block'], ), @@ -208,7 +208,7 @@ class TryStatementTest extends PartialCodeTest { TestDescriptor( 'finally_catch_noBlock', 'try {} catch (e) {} finally', - [ParserErrorCode.EXPECTED_FINALLY_CLAUSE_BODY], + [ParserErrorCode.expectedFinallyClauseBody], "try {} catch (e) {} finally {}", failing: ['block'], ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/typedef_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/typedef_test.dart index 7b5cfd02258..0d2c7450338 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/typedef_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/typedef_test.dart @@ -17,9 +17,9 @@ class TypedefTest extends PartialCodeTest { 'keyword', 'typedef', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingTypedefParameters, + ParserErrorCode.expectedToken, ], "typedef _s_();", failing: ['functionVoid', 'functionNonVoid', 'getter'], @@ -28,8 +28,8 @@ class TypedefTest extends PartialCodeTest { 'name', 'typedef T', [ - ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingTypedefParameters, + ParserErrorCode.expectedToken, ], "typedef T();", failing: ['functionNonVoid', 'getter', 'mixin', 'setter'], @@ -38,9 +38,9 @@ class TypedefTest extends PartialCodeTest { 'keywordEquals', 'typedef =', [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TYPE_NAME, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedTypeName, + ParserErrorCode.expectedToken, ], "typedef _s_ = _s_;", failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], @@ -48,7 +48,7 @@ class TypedefTest extends PartialCodeTest { TestDescriptor( 'equals', 'typedef T =', - [ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.expectedTypeName, ParserErrorCode.expectedToken], "typedef T = _s_;", failing: ['functionVoid', 'functionNonVoid', 'getter', 'mixin'], ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/while_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/while_statement_test.dart index 773ad61ef7a..86acb332bf0 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/while_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/while_statement_test.dart @@ -19,44 +19,44 @@ class WhileStatementTest extends PartialCodeTest { 'keyword', 'while', [ - ParserErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "while (_s_)", expectedDiagnosticsInValidCode: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], ), TestDescriptor( 'leftParen', 'while (', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "while (_s_)", expectedDiagnosticsInValidCode: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], ), TestDescriptor( 'condition', 'while (a', [ - ScannerErrorCode.EXPECTED_TOKEN, - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ScannerErrorCode.expectedToken, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], "while (a)", expectedDiagnosticsInValidCode: [ - ParserErrorCode.MISSING_IDENTIFIER, - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.missingIdentifier, + ParserErrorCode.expectedToken, ], ), ], @@ -70,14 +70,14 @@ class WhileStatementTest extends PartialCodeTest { TestDescriptor( 'keyword', 'while', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "while (_s_)", failing: ['break', 'continue'], ), TestDescriptor( 'leftParen', 'while (', - [ParserErrorCode.MISSING_IDENTIFIER, ScannerErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ScannerErrorCode.expectedToken], "while (_s_)", failing: [ 'assert', @@ -94,7 +94,7 @@ class WhileStatementTest extends PartialCodeTest { TestDescriptor( 'condition', 'while (a', - [ScannerErrorCode.EXPECTED_TOKEN], + [ScannerErrorCode.expectedToken], "while (a)", failing: ['break', 'continue'], ), diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/yield_statement_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/yield_statement_test.dart index 3f3d12828fe..dc6ca6d29ed 100644 --- a/pkg/analyzer/test/src/fasta/recovery/partial_code/yield_statement_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/yield_statement_test.dart @@ -18,7 +18,7 @@ class YieldStatementTest extends PartialCodeTest { TestDescriptor( 'keyword', 'yield', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "yield _s_;", failing: [ 'assert', @@ -31,12 +31,12 @@ class YieldStatementTest extends PartialCodeTest { ], ), TestDescriptor('expression', 'yield a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "yield a;"), TestDescriptor( 'star', 'yield *', - [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN], + [ParserErrorCode.missingIdentifier, ParserErrorCode.expectedToken], "yield * _s_;", failing: [ 'assert', @@ -49,7 +49,7 @@ class YieldStatementTest extends PartialCodeTest { ], ), TestDescriptor('star_expression', 'yield * a', [ - ParserErrorCode.EXPECTED_TOKEN, + ParserErrorCode.expectedToken, ], "yield * a;"), ], PartialCodeTest.statementSuffixes, diff --git a/pkg/analyzer/test/src/fasta/recovery/result_comparator_test.dart b/pkg/analyzer/test/src/fasta/recovery/result_comparator_test.dart index 0e2529ab3a3..b3f3331146c 100644 --- a/pkg/analyzer/test/src/fasta/recovery/result_comparator_test.dart +++ b/pkg/analyzer/test/src/fasta/recovery/result_comparator_test.dart @@ -22,7 +22,7 @@ class ResultComparatorTest extends FastaParserTestCase { _assertMismatched( actual: parseExpression( 'f(+x)', - errors: [error(ParserErrorCode.MISSING_IDENTIFIER, 2, 1)], + errors: [error(ParserErrorCode.missingIdentifier, 2, 1)], ), expected: parseExpression('f(foo+x)'), expectedFailureMessage: ''' @@ -54,7 +54,7 @@ But found token "a" _assertMatched( actual: parseExpression( 'f(+x)', - errors: [error(ParserErrorCode.MISSING_IDENTIFIER, 2, 1)], + errors: [error(ParserErrorCode.missingIdentifier, 2, 1)], ), expected: parseExpression('f(_s_+x)'), ); @@ -133,9 +133,7 @@ But found token "C" _assertMatched( actual: parseCompilationUnit( 'class C { C(this); }', - errors: [ - error(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 12, 4), - ], + errors: [error(ParserErrorCode.expectedIdentifierButGotKeyword, 12, 4)], ), expected: parseCompilationUnit('class C { C(_k_); }'), ); @@ -145,9 +143,7 @@ But found token "C" _assertMismatched( actual: parseCompilationUnit( 'class C { C(this); }', - errors: [ - error(ParserErrorCode.EXPECTED_IDENTIFIER_BUT_GOT_KEYWORD, 12, 4), - ], + errors: [error(ParserErrorCode.expectedIdentifierButGotKeyword, 12, 4)], ), expected: parseCompilationUnit('class C { C(foo); }'), expectedFailureMessage: ''' @@ -388,8 +384,8 @@ But found token "C" actual: parseCompilationUnit( 'export', errors: [ - error(ParserErrorCode.EXPECTED_TOKEN, 0, 6), - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 6, 0), + error(ParserErrorCode.expectedToken, 0, 6), + error(ParserErrorCode.expectedStringLiteral, 6, 0), ], ), expected: parseCompilationUnit("export '';"), @@ -398,8 +394,8 @@ But found token "C" actual: parseCompilationUnit( 'export', errors: [ - error(ParserErrorCode.EXPECTED_TOKEN, 0, 6), - error(ParserErrorCode.EXPECTED_STRING_LITERAL, 6, 0), + error(ParserErrorCode.expectedToken, 0, 6), + error(ParserErrorCode.expectedStringLiteral, 6, 0), ], ), expected: parseCompilationUnit('export "";'), @@ -418,9 +414,9 @@ But found token "C" f> () => null; ''', errors: [ - error(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 0, 1), - error(ParserErrorCode.MISSING_FUNCTION_BODY, 4, 1), - error(ParserErrorCode.TOP_LEVEL_OPERATOR, 4, 1), + error(ParserErrorCode.missingFunctionParameters, 0, 1), + error(ParserErrorCode.missingFunctionBody, 4, 1), + error(ParserErrorCode.topLevelOperator, 4, 1), ], ), expected: parseCompilationUnit( @@ -428,9 +424,9 @@ f> () => null; f >() => null; ''', errors: [ - error(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 0, 1), - error(ParserErrorCode.MISSING_FUNCTION_BODY, 5, 1), - error(ParserErrorCode.TOP_LEVEL_OPERATOR, 5, 1), + error(ParserErrorCode.missingFunctionParameters, 0, 1), + error(ParserErrorCode.missingFunctionBody, 5, 1), + error(ParserErrorCode.topLevelOperator, 5, 1), ], ), ); @@ -443,15 +439,15 @@ f >() => null; mixin Foo implements ''', errors: [ - error(ParserErrorCode.EXPECTED_TYPE_NAME, 21, 0), - error(ParserErrorCode.EXPECTED_MIXIN_BODY, 21, 0), + error(ParserErrorCode.expectedTypeName, 21, 0), + error(ParserErrorCode.expectedMixinBody, 21, 0), ], ), expected: parseCompilationUnit( ''' mixin Foo implements {} ''', - errors: [error(ParserErrorCode.EXPECTED_TYPE_NAME, 21, 1)], + errors: [error(ParserErrorCode.expectedTypeName, 21, 1)], ), ); } diff --git a/pkg/analyzer/test/src/ignore_comments/diagnostic_suppression_test.dart b/pkg/analyzer/test/src/ignore_comments/diagnostic_suppression_test.dart index 6e200790f00..ad5c9cdff74 100644 --- a/pkg/analyzer/test/src/ignore_comments/diagnostic_suppression_test.dart +++ b/pkg/analyzer/test/src/ignore_comments/diagnostic_suppression_test.dart @@ -38,8 +38,8 @@ int x = ''; int _y = 0; //INVALID_ASSIGNMENT ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 34, 2), - error(WarningCode.UNUSED_ELEMENT, 42, 2), + error(CompileTimeErrorCode.invalidAssignment, 34, 2), + error(WarningCode.unusedElement, 42, 2), ], ); } @@ -52,7 +52,7 @@ int x = (0 as int); // ... but no ignore here ... var y = x + ''; //ARGUMENT_TYPE_NOT_ASSIGNABLE ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 90, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 90, 2)], ); } @@ -63,7 +63,7 @@ int x = (0 as int); // ignore: unnecessary_cast // ... but no ignore here ... var y = x + ''; //ARGUMENT_TYPE_NOT_ASSIGNABLE ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 90, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 90, 2)], ); } @@ -74,7 +74,7 @@ int x = (0 as int); //UNNECESSARY_CAST var y = x + ''; //ARGUMENT_TYPE_NOT_ASSIGNABLE // ignore_for_file: unnecessary_cast ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 51, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 51, 2)], ); } @@ -116,7 +116,7 @@ void f() { int a = 0; int _x = 1; ''', - [error(WarningCode.UNUSED_ELEMENT, 45, 2)], + [error(WarningCode.unusedElement, 45, 2)], ); } @@ -134,7 +134,7 @@ int x = (0 as int); // ignore: unused_element String _foo = ''; //UNUSED_ELEMENT ''', - [error(WarningCode.UNNECESSARY_CAST, 28, 8)], + [error(WarningCode.unnecessaryCast, 28, 8)], ); } @@ -145,7 +145,7 @@ String _foo = ''; //UNUSED_ELEMENT int x = (0 as int); String _foo = ''; // ignore: $ignoredCode ''', - [error(WarningCode.UNNECESSARY_CAST, 28, 8)], + [error(WarningCode.unnecessaryCast, 28, 8)], ); } @@ -162,7 +162,7 @@ void f(arg1(int)) {} // AVOID_TYPES_AS_PARAMETER_NAMES // ignore: type=lint int _x = 1; ''', - [error(WarningCode.UNUSED_ELEMENT, 25, 2)], + [error(WarningCode.unusedElement, 25, 2)], ); } @@ -208,8 +208,8 @@ int x = ''; var y = x + ''; //ARGUMENT_TYPE_NOT_ASSIGNABLE ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 43, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 59, 2), + error(CompileTimeErrorCode.invalidAssignment, 43, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 59, 2), ], ); } @@ -222,8 +222,8 @@ int x = 3; String y = x + ''; //INVALID_ASSIGNMENT, ARGUMENT_TYPE_NOT_ASSIGNABLE ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 33, 6), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 37, 2), + error(CompileTimeErrorCode.invalidAssignment, 33, 6), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 37, 2), ], ); } @@ -234,7 +234,7 @@ String y = x + ''; //INVALID_ASSIGNMENT, ARGUMENT_TYPE_NOT_ASSIGNABLE // ignore invalid_assignment String y = 3; //INVALID_ASSIGNMENT ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 40, 1)], + [error(CompileTimeErrorCode.invalidAssignment, 40, 1)], ); } @@ -268,7 +268,7 @@ int x = (0 as int); //This is the first comment... // ignore: $ignoredCode String _foo = ''; //UNUSED_ELEMENT ''', - [error(WarningCode.UNNECESSARY_CAST, 9, 8)], + [error(WarningCode.unnecessaryCast, 9, 8)], ); } @@ -279,8 +279,8 @@ int x = ''; //INVALID_ASSIGNMENT var y = x + ''; //ARGUMENT_TYPE_NOT_ASSIGNABLE ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 8, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 45, 2), + error(CompileTimeErrorCode.invalidAssignment, 8, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 45, 2), ], ); } @@ -291,7 +291,7 @@ var y = x + ''; //ARGUMENT_TYPE_NOT_ASSIGNABLE int x = (0 as int); // ignore: unnecessary_cast int y = (0 as int); ''', - [error(WarningCode.UNNECESSARY_CAST, 57, 8)], + [error(WarningCode.unnecessaryCast, 57, 8)], ); } @@ -308,7 +308,7 @@ f() => g(); ''' f() => g(); ''', - [error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 7, 1)], + [error(CompileTimeErrorCode.undefinedFunction, 7, 1)], ); } diff --git a/pkg/analyzer/test/src/manifest/manifest_validator_test.dart b/pkg/analyzer/test/src/manifest/manifest_validator_test.dart index 93bb20d1164..d160b3109dd 100644 --- a/pkg/analyzer/test/src/manifest/manifest_validator_test.dart +++ b/pkg/analyzer/test/src/manifest/manifest_validator_test.dart @@ -467,7 +467,7 @@ class ManifestValidatorTest with ResourceProviderMixin { ''', - [ManifestWarningCode.CAMERA_PERMISSIONS_INCOMPATIBLE], + [ManifestWarningCode.cameraPermissionsIncompatible], ); } @@ -491,7 +491,7 @@ class ManifestValidatorTest with ResourceProviderMixin { ''', - [ManifestWarningCode.UNSUPPORTED_CHROME_OS_HARDWARE], + [ManifestWarningCode.unsupportedChromeOsHardware], ); } @@ -504,7 +504,7 @@ class ManifestValidatorTest with ResourceProviderMixin { ''', - [ManifestWarningCode.UNSUPPORTED_CHROME_OS_HARDWARE], + [ManifestWarningCode.unsupportedChromeOsHardware], ); } @@ -528,7 +528,7 @@ class ManifestValidatorTest with ResourceProviderMixin { xmlns:android="http://schemas.android.com/apk/res/android"> ''', - [ManifestWarningCode.NO_TOUCHSCREEN_FEATURE], + [ManifestWarningCode.noTouchscreenFeature], ); } @@ -546,7 +546,7 @@ class ManifestValidatorTest with ResourceProviderMixin { ''', - [ManifestWarningCode.NON_RESIZABLE_ACTIVITY], + [ManifestWarningCode.nonResizableActivity], ); } @@ -564,7 +564,7 @@ class ManifestValidatorTest with ResourceProviderMixin { ''', - [ManifestWarningCode.SETTING_ORIENTATION_ON_ACTIVITY], + [ManifestWarningCode.settingOrientationOnActivity], ); } @@ -576,7 +576,7 @@ class ManifestValidatorTest with ResourceProviderMixin { ''', - [ManifestWarningCode.UNSUPPORTED_CHROME_OS_FEATURE], + [ManifestWarningCode.unsupportedChromeOsFeature], ); } } diff --git a/pkg/analyzer/test/src/options/analysis_options_test.dart b/pkg/analyzer/test/src/options/analysis_options_test.dart index bcb089fe538..395ff992ca2 100644 --- a/pkg/analyzer/test/src/options/analysis_options_test.dart +++ b/pkg/analyzer/test/src/options/analysis_options_test.dart @@ -117,7 +117,7 @@ analyzer: source: TestSource(), offset: 0, length: 1, - diagnosticCode: WarningCode.RETURN_TYPE_INVALID_FOR_CATCH_ERROR, + diagnosticCode: WarningCode.returnTypeInvalidForCatchError, arguments: [ ['x'], ['y'], @@ -142,7 +142,7 @@ analyzer: source: TestSource(), offset: 0, length: 1, - diagnosticCode: WarningCode.UNUSED_LOCAL_VARIABLE, + diagnosticCode: WarningCode.unusedLocalVariable, arguments: [ ['x'], ], @@ -167,7 +167,7 @@ analyzer: source: TestSource(), offset: 0, length: 1, - diagnosticCode: CompileTimeErrorCode.INVALID_ASSIGNMENT, + diagnosticCode: CompileTimeErrorCode.invalidAssignment, arguments: [ ['x'], ['y'], @@ -193,7 +193,7 @@ analyzer: source: TestSource(), offset: 0, length: 1, - diagnosticCode: WarningCode.RETURN_TYPE_INVALID_FOR_CATCH_ERROR, + diagnosticCode: WarningCode.returnTypeInvalidForCatchError, arguments: [ ['x'], ['y'], diff --git a/pkg/analyzer/test/src/options/options_file_validator_test.dart b/pkg/analyzer/test/src/options/options_file_validator_test.dart index 043a942186b..378c0165aaa 100644 --- a/pkg/analyzer/test/src/options/options_file_validator_test.dart +++ b/pkg/analyzer/test/src/options/options_file_validator_test.dart @@ -91,7 +91,7 @@ analyzer: cannot-ignore: - not_an_error_code ''', - [AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE], + [AnalysisOptionsWarningCode.unrecognizedErrorCode], ); } @@ -119,7 +119,7 @@ analyzer: cannot-ignore: one_error_code: true ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -139,7 +139,7 @@ analyzer: one_error_code: foo: bar ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -150,7 +150,7 @@ analyzer: enable-experiment: - not-an-experiment ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES], + [AnalysisOptionsWarningCode.unsupportedOptionWithoutValues], ); } @@ -161,7 +161,7 @@ analyzer: enable-experiment: experiment: true ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -171,7 +171,7 @@ analyzer: analyzer: enable-experiment: 7 ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -193,7 +193,7 @@ analyzer: errors: unused_local_variable: ftw ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES], + [AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues], ); expect( diagnostics.single.problemMessage.messageText(includeUrl: false), @@ -208,7 +208,7 @@ analyzer: errors: unused_local_variable: null ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES], + [AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues], ); expect( diagnostics.single.problemMessage.messageText(includeUrl: false), @@ -223,7 +223,7 @@ analyzer: errors: not_supported: ignore ''', - [AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE], + [AnalysisOptionsWarningCode.unrecognizedErrorCode], ); expect( diagnostics.single.problemMessage.messageText(includeUrl: false), @@ -238,7 +238,7 @@ analyzer: errors: null: ignore ''', - [AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE], + [AnalysisOptionsWarningCode.unrecognizedErrorCode], ); expect( diagnostics.single.problemMessage.messageText(includeUrl: false), @@ -254,7 +254,7 @@ analyzer: - invalid_annotation - unused_import ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -266,7 +266,7 @@ analyzer: invalid_annotation: ignore unused_import: [1, 2, 3] ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -277,7 +277,7 @@ analyzer: language: - notAnOption: true ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -287,7 +287,7 @@ analyzer: analyzer: language: true ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -305,7 +305,7 @@ analyzer: language: unsupported: true ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES], + [AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues], ); } @@ -323,7 +323,7 @@ analyzer: ''' analyzer: 7 ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -341,7 +341,7 @@ analyzer: analyzer: not_supported: true ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES], + [AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues], ); } @@ -360,7 +360,7 @@ analyzer: optional-checks: chromeos-manifest ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES], + [AnalysisOptionsWarningCode.unsupportedOptionWithLegalValues], ); } @@ -371,7 +371,7 @@ analyzer: optional-checks: - chrome-os-manifest-checks ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -388,7 +388,7 @@ code-style: code-style: format: 80 ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_VALUE], + [AnalysisOptionsWarningCode.unsupportedValue], ); } @@ -404,7 +404,7 @@ code-style: ''' code-style: 7 ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -414,7 +414,7 @@ code-style: 7 code-style: - format ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -423,7 +423,7 @@ code-style: ''' code-style: format ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -433,7 +433,7 @@ code-style: format code-style: not_supported: true ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES], + [AnalysisOptionsWarningCode.unsupportedOptionWithoutValues], ); } @@ -443,7 +443,7 @@ code-style: formatter: wrong: 123 ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES], + [AnalysisOptionsWarningCode.unsupportedOptionWithoutValues], ); } @@ -455,8 +455,8 @@ formatter: wrong2: 123 ''', [ - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES, - AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITHOUT_VALUES, + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues, + AnalysisOptionsWarningCode.unsupportedOptionWithoutValues, ], ); } @@ -467,7 +467,7 @@ formatter: formatter: page_width: 123.45 ''', - [AnalysisOptionsWarningCode.INVALID_OPTION], + [AnalysisOptionsWarningCode.invalidOption], ); } @@ -477,7 +477,7 @@ formatter: formatter: page_width: -123 ''', - [AnalysisOptionsWarningCode.INVALID_OPTION], + [AnalysisOptionsWarningCode.invalidOption], ); } @@ -487,7 +487,7 @@ formatter: formatter: page_width: "123" ''', - [AnalysisOptionsWarningCode.INVALID_OPTION], + [AnalysisOptionsWarningCode.invalidOption], ); } @@ -497,7 +497,7 @@ formatter: formatter: page_width: 0 ''', - [AnalysisOptionsWarningCode.INVALID_OPTION], + [AnalysisOptionsWarningCode.invalidOption], ); } @@ -515,7 +515,7 @@ formatter: trailing_commas: a: b ''', - [AnalysisOptionsWarningCode.INVALID_OPTION], + [AnalysisOptionsWarningCode.invalidOption], ); } @@ -525,7 +525,7 @@ formatter: formatter: trailing_commas: 1 ''', - [AnalysisOptionsWarningCode.INVALID_OPTION], + [AnalysisOptionsWarningCode.invalidOption], ); } @@ -535,7 +535,7 @@ formatter: formatter: trailing_commas: foo ''', - [AnalysisOptionsWarningCode.INVALID_OPTION], + [AnalysisOptionsWarningCode.invalidOption], ); } @@ -567,7 +567,7 @@ linter: linter: unsupported: true ''', - [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE], + [AnalysisOptionsWarningCode.unsupportedOptionWithLegalValue], ); } @@ -599,7 +599,7 @@ plugins: ''' plugins: 7 ''', - [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT], + [AnalysisOptionsWarningCode.invalidSectionFormat], ); } @@ -691,7 +691,7 @@ analyzer: plugins: - plugin_two ''', - [error(AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, 55, 10)], + [error(AnalysisOptionsWarningCode.multiplePlugins, 55, 10)], ); } @@ -709,7 +709,7 @@ analyzer: plugin_two: foo: bar ''', - [error(AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, 53, 10)], + [error(AnalysisOptionsWarningCode.multiplePlugins, 53, 10)], ); } @@ -725,7 +725,7 @@ include: other_options.yaml analyzer: plugins: plugin_two ''', - [error(AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, 49, 10)], + [error(AnalysisOptionsWarningCode.multiplePlugins, 49, 10)], ); } @@ -745,7 +745,7 @@ analyzer: plugins: - plugin_two ''', - [error(AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, 55, 10)], + [error(AnalysisOptionsWarningCode.multiplePlugins, 55, 10)], ); } @@ -765,7 +765,7 @@ analyzer: r''' include: other_options.yaml ''', - [error(AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING, 9, 18)], + [error(AnalysisOptionsWarningCode.includedFileWarning, 9, 18)], ); } @@ -779,8 +779,8 @@ analyzer: - plugin_three ''', [ - error(AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, 44, 10), - error(AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, 61, 12), + error(AnalysisOptionsWarningCode.multiplePlugins, 44, 10), + error(AnalysisOptionsWarningCode.multiplePlugins, 61, 12), ], ); } @@ -811,7 +811,7 @@ analyzer: plugin_one: yes plugin_two: sure ''', - [error(AnalysisOptionsWarningCode.MULTIPLE_PLUGINS, 45, 10)], + [error(AnalysisOptionsWarningCode.multiplePlugins, 45, 10)], ); } @@ -823,7 +823,7 @@ analyzer: plugin_one: yes plugin_one: sure ''', - [error(AnalysisOptionsErrorCode.PARSE_ERROR, 45, 10)], + [error(AnalysisOptionsErrorCode.parseError, 45, 10)], ); } 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 a4696bc069b..c7000cf449d 100644 --- a/pkg/analyzer/test/src/options/options_rule_validator_test.dart +++ b/pkg/analyzer/test/src/options/options_rule_validator_test.dart @@ -82,7 +82,7 @@ linter: rules: - deprecated_lint_with_replacement ''', - [AnalysisOptionsWarningCode.DEPRECATED_LINT_WITH_REPLACEMENT], + [AnalysisOptionsWarningCode.deprecatedLintWithReplacement], ); } @@ -93,7 +93,7 @@ linter: rules: deprecated_lint: false ''', - [AnalysisOptionsWarningCode.DEPRECATED_LINT], + [AnalysisOptionsWarningCode.deprecatedLint], ); } @@ -104,7 +104,7 @@ linter: rules: - deprecated_lint ''', - [AnalysisOptionsWarningCode.DEPRECATED_LINT], + [AnalysisOptionsWarningCode.deprecatedLint], ); } @@ -115,7 +115,7 @@ linter: rules: - deprecated_since_3_lint ''', - [AnalysisOptionsWarningCode.DEPRECATED_LINT], + [AnalysisOptionsWarningCode.deprecatedLint], sdk: dart3, ); } @@ -152,7 +152,7 @@ linter: - stable_lint - stable_lint ''', - [AnalysisOptionsWarningCode.DUPLICATE_RULE], + [AnalysisOptionsWarningCode.duplicateRule], ); } @@ -164,7 +164,7 @@ linter: - rule_pos - rule_neg ''', - [AnalysisOptionsWarningCode.INCOMPATIBLE_LINT], + [AnalysisOptionsWarningCode.incompatibleLint], ); } @@ -176,7 +176,7 @@ linter: rule_pos: true rule_neg: true ''', - [AnalysisOptionsWarningCode.INCOMPATIBLE_LINT], + [AnalysisOptionsWarningCode.incompatibleLint], ); } @@ -196,7 +196,7 @@ linter: rules: - removed_in_2_12_lint ''', - [AnalysisOptionsWarningCode.REMOVED_LINT], + [AnalysisOptionsWarningCode.removedLint], sdk: dart2_12, ); } @@ -220,7 +220,7 @@ linter: rules: - replaced_lint ''', - [AnalysisOptionsWarningCode.REPLACED_LINT], + [AnalysisOptionsWarningCode.replacedLint], sdk: dart3, ); } @@ -248,7 +248,7 @@ linter: rules: - this_rule_does_not_exist ''', - [AnalysisOptionsWarningCode.UNDEFINED_LINT], + [AnalysisOptionsWarningCode.undefinedLint], ); } @@ -259,7 +259,7 @@ linter: rules: this_rule_does_not_exist: false ''', - [AnalysisOptionsWarningCode.UNDEFINED_LINT], + [AnalysisOptionsWarningCode.undefinedLint], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_directory_does_not_exist_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_directory_does_not_exist_test.dart index 664547ff622..d4e65d9156b 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_directory_does_not_exist_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_directory_does_not_exist_test.dart @@ -33,7 +33,7 @@ flutter: assets: - assets/logos/ ''', - [PubspecWarningCode.ASSET_DIRECTORY_DOES_NOT_EXIST], + [PubspecWarningCode.assetDirectoryDoesNotExist], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_does_not_exist_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_does_not_exist_test.dart index db0fa76251b..e0fed4ace39 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_does_not_exist_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_does_not_exist_test.dart @@ -23,7 +23,7 @@ flutter: assets: - assets/my_icon.png ''', - [PubspecWarningCode.ASSET_DOES_NOT_EXIST], + [PubspecWarningCode.assetDoesNotExist], ); } @@ -56,7 +56,7 @@ flutter: assets: - packages/icons/my_icon.png ''', - [PubspecWarningCode.ASSET_DOES_NOT_EXIST], + [PubspecWarningCode.assetDoesNotExist], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_field_not_list_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_field_not_list_test.dart index a3ccdb2cab3..6a658c4a9b6 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_field_not_list_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_field_not_list_test.dart @@ -22,7 +22,7 @@ name: sample flutter: assets: ''', - [PubspecWarningCode.ASSET_FIELD_NOT_LIST], + [PubspecWarningCode.assetFieldNotList], ); } @@ -33,7 +33,7 @@ name: sample flutter: assets: assets/my_icon.png ''', - [PubspecWarningCode.ASSET_FIELD_NOT_LIST], + [PubspecWarningCode.assetFieldNotList], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_missing_path_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_missing_path_test.dart index 0f89606b094..232fa083098 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_missing_path_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_missing_path_test.dart @@ -36,7 +36,7 @@ flutter: - flavors: - premium ''', - [PubspecWarningCode.ASSET_MISSING_PATH], + [PubspecWarningCode.assetMissingPath], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_not_string_or_map_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_not_string_or_map_test.dart index dd313d9cfd8..0745b6c247d 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_not_string_or_map_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_not_string_or_map_test.dart @@ -23,7 +23,7 @@ flutter: assets: - 23 ''', - [PubspecWarningCode.ASSET_NOT_STRING_OR_MAP], + [PubspecWarningCode.assetNotStringOrMap], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_path_not_string_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_path_not_string_test.dart index b1121160d66..cf1ca8a8d20 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_path_not_string_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_path_not_string_test.dart @@ -23,7 +23,7 @@ flutter: assets: - path: [one, two, three] ''', - [PubspecWarningCode.ASSET_PATH_NOT_STRING], + [PubspecWarningCode.assetPathNotString], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/dependencies_field_not_map_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/dependencies_field_not_map_test.dart index 4dfb91cb38a..be6e605f7f5 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/dependencies_field_not_map_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/dependencies_field_not_map_test.dart @@ -28,7 +28,7 @@ dependencies: name: sample dependencies: true ''', - [PubspecWarningCode.DEPENDENCIES_FIELD_NOT_MAP], + [PubspecWarningCode.dependenciesFieldNotMap], ); } @@ -46,7 +46,7 @@ dependencies: name: sample dev_dependencies: true ''', - [PubspecWarningCode.DEPENDENCIES_FIELD_NOT_MAP], + [PubspecWarningCode.dependenciesFieldNotMap], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/deprecated_field_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/deprecated_field_test.dart index eee639355ab..29d3b5c7e9d 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/deprecated_field_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/deprecated_field_test.dart @@ -21,7 +21,7 @@ class DeprecatedFieldTest extends PubspecDiagnosticTest { name: sample author: foo ''', - [PubspecWarningCode.DEPRECATED_FIELD], + [PubspecWarningCode.deprecatedField], ); } @@ -33,7 +33,7 @@ authors: - foo - bar ''', - [PubspecWarningCode.DEPRECATED_FIELD], + [PubspecWarningCode.deprecatedField], ); } @@ -44,7 +44,7 @@ name: sample transformers: - foo ''', - [PubspecWarningCode.DEPRECATED_FIELD], + [PubspecWarningCode.deprecatedField], ); } @@ -54,7 +54,7 @@ transformers: name: sample web: foo ''', - [PubspecWarningCode.DEPRECATED_FIELD], + [PubspecWarningCode.deprecatedField], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/flutter_field_not_map_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/flutter_field_not_map_test.dart index b77ea1dcd8e..507388159dc 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/flutter_field_not_map_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/flutter_field_not_map_test.dart @@ -34,7 +34,7 @@ flutter: name: sample flutter: true ''', - [PubspecWarningCode.FLUTTER_FIELD_NOT_MAP], + [PubspecWarningCode.flutterFieldNotMap], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/ignore_diagnostic_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/ignore_diagnostic_test.dart index 04ae0877328..b676d63285e 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/ignore_diagnostic_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/ignore_diagnostic_test.dart @@ -27,7 +27,7 @@ dependencies: bar: git: git@github.com:foo/bar.git ''', - [PubspecWarningCode.INVALID_DEPENDENCY], + [PubspecWarningCode.invalidDependency], ); } @@ -56,7 +56,7 @@ dependencies: bar: git: git@github.com:foo/bar.git ''', - [PubspecWarningCode.INVALID_DEPENDENCY], + [PubspecWarningCode.invalidDependency], ); } @@ -71,7 +71,7 @@ dependencies: bar: git: git@github.com:foo/bar.git # ignore: invalid_dependency ''', - [PubspecWarningCode.INVALID_DEPENDENCY], + [PubspecWarningCode.invalidDependency], ); } @@ -87,8 +87,8 @@ dependencies: git: git@github.com:foo/bar.git ''', [ - PubspecWarningCode.INVALID_DEPENDENCY, - PubspecWarningCode.INVALID_DEPENDENCY, + PubspecWarningCode.invalidDependency, + PubspecWarningCode.invalidDependency, ], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/invalid_dependency_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/invalid_dependency_test.dart index 3eb987217e9..e8bba9afd20 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/invalid_dependency_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/invalid_dependency_test.dart @@ -68,7 +68,7 @@ dependencies: url: git@github.com:foo/foo.git path: path/to/foo ''', - [PubspecWarningCode.INVALID_DEPENDENCY], + [PubspecWarningCode.invalidDependency], ); } @@ -170,7 +170,7 @@ dependencies: foo: path: /foo ''', - [PubspecWarningCode.INVALID_DEPENDENCY], + [PubspecWarningCode.invalidDependency], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/invalid_platforms_field_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/invalid_platforms_field_test.dart index 9b3841964cc..e76e31a9d80 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/invalid_platforms_field_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/invalid_platforms_field_test.dart @@ -33,7 +33,7 @@ platforms: - ios - web ''', - [PubspecWarningCode.INVALID_PLATFORMS_FIELD], + [PubspecWarningCode.invalidPlatformsField], ); } @@ -44,7 +44,7 @@ name: foo version: 1.0.0 platforms: true ''', - [PubspecWarningCode.INVALID_PLATFORMS_FIELD], + [PubspecWarningCode.invalidPlatformsField], ); } @@ -55,7 +55,7 @@ name: foo version: 1.0.0 platforms: [] ''', - [PubspecWarningCode.INVALID_PLATFORMS_FIELD], + [PubspecWarningCode.invalidPlatformsField], ); } @@ -66,7 +66,7 @@ name: foo version: 1.0.0 platforms: 42 ''', - [PubspecWarningCode.INVALID_PLATFORMS_FIELD], + [PubspecWarningCode.invalidPlatformsField], ); } @@ -103,7 +103,7 @@ version: 1.0.0 platforms: windåse: ''', - [PubspecWarningCode.UNKNOWN_PLATFORM], + [PubspecWarningCode.unknownPlatform], ); } @@ -115,7 +115,7 @@ version: 1.0.0 platforms: Windows: ''', - [PubspecWarningCode.UNKNOWN_PLATFORM], + [PubspecWarningCode.unknownPlatform], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/missing_dependency_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/missing_dependency_test.dart index acae8a9c046..556c56115d2 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/missing_dependency_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/missing_dependency_test.dart @@ -24,7 +24,7 @@ class MissingDependencyTest with ResourceProviderMixin { late Source _source; /// Asserts that when the validator is used on the given [content], a - /// [PubspecWarningCode.MISSING_DEPENDENCY] warning is produced. + /// [PubspecWarningCode.missingDependency] warning is produced. void assertErrors( String content, { required Set usedDeps, @@ -35,7 +35,7 @@ class MissingDependencyTest with ResourceProviderMixin { }) { var error = _runValidator(content, usedDeps, usedDevDeps).first; var data = MissingDependencyData.byDiagnostic[error]!; - expect(error.diagnosticCode, PubspecWarningCode.MISSING_DEPENDENCY); + expect(error.diagnosticCode, PubspecWarningCode.missingDependency); expect(data.addDeps, addDeps); expect(data.addDevDeps, addDevDeps); expect(data.removeDevDeps, removeDevDeps); diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/missing_name_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/missing_name_test.dart index 9879c54b36a..251bd471e24 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/missing_name_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/missing_name_test.dart @@ -16,7 +16,7 @@ main() { @reflectiveTest class MissingNameTest extends PubspecDiagnosticTest { test_missingName_error() { - assertErrors('', [PubspecWarningCode.MISSING_NAME]); + assertErrors('', [PubspecWarningCode.missingName]); } test_missingName_noError() { diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/name_not_string_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/name_not_string_test.dart index 4e5d833afdf..8748e114a09 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/name_not_string_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/name_not_string_test.dart @@ -20,7 +20,7 @@ class NameNotStringTest extends PubspecDiagnosticTest { ''' name: 42 ''', - [PubspecWarningCode.NAME_NOT_STRING], + [PubspecWarningCode.nameNotString], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/path_does_not_exist_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/path_does_not_exist_test.dart index 427c33d1e4b..3f3d03d2c63 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/path_does_not_exist_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/path_does_not_exist_test.dart @@ -23,7 +23,7 @@ dependencies: foo: path: does/not/exist ''', - [PubspecWarningCode.PATH_DOES_NOT_EXIST], + [PubspecWarningCode.pathDoesNotExist], ); } @@ -35,7 +35,7 @@ dev_dependencies: foo: path: does/not/exist ''', - [PubspecWarningCode.PATH_DOES_NOT_EXIST], + [PubspecWarningCode.pathDoesNotExist], ); } @@ -60,7 +60,7 @@ screenshots: - description: '...' path: example/screenshots/no.webp ''', - [PubspecWarningCode.PATH_DOES_NOT_EXIST], + [PubspecWarningCode.pathDoesNotExist], ); } @@ -75,8 +75,8 @@ screenshots: path: example/screenshots/no.webp ''', [ - PubspecWarningCode.PATH_DOES_NOT_EXIST, - PubspecWarningCode.PATH_DOES_NOT_EXIST, + PubspecWarningCode.pathDoesNotExist, + PubspecWarningCode.pathDoesNotExist, ], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/path_not_posix_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/path_not_posix_test.dart index d027030dc16..4930b34e339 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/path_not_posix_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/path_not_posix_test.dart @@ -29,7 +29,7 @@ dependencies: foo: path: \foo ''', - [PubspecWarningCode.PATH_NOT_POSIX], + [PubspecWarningCode.pathNotPosix], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/path_pubspec_does_not_exist_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/path_pubspec_does_not_exist_test.dart index 1791e7853d0..5db3eb5cd72 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/path_pubspec_does_not_exist_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/path_pubspec_does_not_exist_test.dart @@ -24,7 +24,7 @@ dependencies: foo: path: /foo ''', - [PubspecWarningCode.PATH_PUBSPEC_DOES_NOT_EXIST], + [PubspecWarningCode.pathPubspecDoesNotExist], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/platform_value_disallowed_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/platform_value_disallowed_test.dart index 4b388f3c923..fbf4233ff2d 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/platform_value_disallowed_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/platform_value_disallowed_test.dart @@ -36,7 +36,7 @@ platforms: ios: web: "chrome" # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } @@ -50,7 +50,7 @@ platforms: ios: web: [] # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } @@ -64,7 +64,7 @@ platforms: ios: web: {} # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } @@ -78,7 +78,7 @@ platforms: ios: web: False # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } @@ -92,7 +92,7 @@ platforms: ios: web: 42 # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } @@ -106,7 +106,7 @@ platforms: ios: web: [1,2,3] # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } @@ -122,7 +122,7 @@ platforms: - foo - bar # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } @@ -137,7 +137,7 @@ platforms: web: foo: bar # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } @@ -151,7 +151,7 @@ platforms: ios: web: True # <-- this is not allowed ''', - [PubspecWarningCode.PLATFORM_VALUE_DISALLOWED], + [PubspecWarningCode.platformValueDisallowed], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/unknown_platforms_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/unknown_platforms_test.dart index 5f226b58c71..ee950575624 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/unknown_platforms_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/unknown_platforms_test.dart @@ -48,7 +48,7 @@ version: 1.0.0 platforms: True: ''', - [PubspecWarningCode.UNKNOWN_PLATFORM], + [PubspecWarningCode.unknownPlatform], ); } @@ -60,7 +60,7 @@ version: 1.0.0 platforms: browser: # the correct platform is "web" ''', - [PubspecWarningCode.UNKNOWN_PLATFORM], + [PubspecWarningCode.unknownPlatform], ); } @@ -72,7 +72,7 @@ version: 1.0.0 platforms: 33: ''', - [PubspecWarningCode.UNKNOWN_PLATFORM], + [PubspecWarningCode.unknownPlatform], ); } @@ -84,7 +84,7 @@ version: 1.0.0 platforms: [1, 2]: ''', - [PubspecWarningCode.UNKNOWN_PLATFORM], + [PubspecWarningCode.unknownPlatform], ); } @@ -96,7 +96,7 @@ version: 1.0.0 platforms: null: ''', - [PubspecWarningCode.UNKNOWN_PLATFORM], + [PubspecWarningCode.unknownPlatform], ); } @@ -108,7 +108,7 @@ version: 1.0.0 platforms: win32: # the correct platform is "windows" ''', - [PubspecWarningCode.UNKNOWN_PLATFORM], + [PubspecWarningCode.unknownPlatform], ); } } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/unnecessary_dev_dependency_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/unnecessary_dev_dependency_test.dart index ff297ccff00..db0afd89854 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/unnecessary_dev_dependency_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/unnecessary_dev_dependency_test.dart @@ -24,7 +24,7 @@ dependencies: dev_dependencies: a: any ''', - [PubspecWarningCode.UNNECESSARY_DEV_DEPENDENCY], + [PubspecWarningCode.unnecessaryDevDependency], ); } diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/workspace_field_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/workspace_field_test.dart index 16c76439a38..b01f592353f 100644 --- a/pkg/analyzer/test/src/pubspec/diagnostics/workspace_field_test.dart +++ b/pkg/analyzer/test/src/pubspec/diagnostics/workspace_field_test.dart @@ -21,7 +21,7 @@ class WorkspaceFieldTest extends PubspecDiagnosticTest { name: sample workspace: package1 ''', - [PubspecWarningCode.WORKSPACE_FIELD_NOT_LIST], + [PubspecWarningCode.workspaceFieldNotList], ); } @@ -33,7 +33,7 @@ name: sample workspace: - 23 ''', - [PubspecWarningCode.WORKSPACE_VALUE_NOT_STRING], + [PubspecWarningCode.workspaceValueNotString], ); } @@ -45,7 +45,7 @@ name: sample workspace: - /sample2 ''', - [PubspecWarningCode.WORKSPACE_VALUE_NOT_SUBDIRECTORY], + [PubspecWarningCode.workspaceValueNotSubdirectory], ); } diff --git a/pkg/analyzer/test/src/summary/top_level_inference_test.dart b/pkg/analyzer/test/src/summary/top_level_inference_test.dart index 767f7ec8229..a68abf6c23e 100644 --- a/pkg/analyzer/test/src/summary/top_level_inference_test.dart +++ b/pkg/analyzer/test/src/summary/top_level_inference_test.dart @@ -99,8 +99,8 @@ var a = b; var b = a; ''', [ - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 4, 1), - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 15, 1), + error(CompileTimeErrorCode.topLevelCycle, 4, 1), + error(CompileTimeErrorCode.topLevelCycle, 15, 1), ], ); } @@ -314,13 +314,13 @@ class C implements A, B { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 109, 3, contextMessages: [message(testFile, 64, 3)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 109, 3, contextMessages: [message(testFile, 25, 3)], @@ -342,7 +342,7 @@ class C implements A, B { void mmm(a) {} } ''', - [error(CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, 116, 3)], + [error(CompileTimeErrorCode.noCombinedSuperSignature, 116, 3)], ); } diff --git a/pkg/analyzer/test/src/task/strong/dart2_inference_test.dart b/pkg/analyzer/test/src/task/strong/dart2_inference_test.dart index 1cf77663eca..dc5498e6d52 100644 --- a/pkg/analyzer/test/src/task/strong/dart2_inference_test.dart +++ b/pkg/analyzer/test/src/task/strong/dart2_inference_test.dart @@ -183,7 +183,7 @@ main() { var /*@type=B*/ v = topLevel += 1; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 152, 1)], + [error(WarningCode.unusedLocalVariable, 152, 1)], ); _assertTypeAnnotations(); } 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 0e2dae2998d..6b3aed76f63 100644 --- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart +++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart @@ -36,7 +36,7 @@ Future futureInt = null; var f = () => futureInt; var g = () async => futureInt; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 24, 4)], + [error(CompileTimeErrorCode.invalidAssignment, 24, 4)], ); var futureInt = _resultLibraryElement.topLevelVariables[0]; expect(futureInt.name, 'futureInt'); @@ -66,7 +66,7 @@ FutureOr futureOrInt = null; var f = () => futureOrInt; var g = () async => futureOrInt; ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 49, 4)], + [error(CompileTimeErrorCode.invalidAssignment, 49, 4)], ); var futureOrInt = _resultLibraryElement.topLevelVariables[0]; expect(futureOrInt.name, 'futureOrInt'); @@ -96,9 +96,9 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 218, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 241, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 245, 3), + error(WarningCode.unusedLocalVariable, 218, 1), + error(WarningCode.unusedLocalVariable, 241, 1), + error(CompileTimeErrorCode.invalidAssignment, 245, 3), ], ); @@ -123,9 +123,9 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 169, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 192, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 196, 3), + error(WarningCode.unusedLocalVariable, 169, 1), + error(WarningCode.unusedLocalVariable, 192, 1), + error(CompileTimeErrorCode.invalidAssignment, 196, 3), ], ); @@ -150,9 +150,9 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 192, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 215, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 219, 3), + error(WarningCode.unusedLocalVariable, 192, 1), + error(WarningCode.unusedLocalVariable, 215, 1), + error(CompileTimeErrorCode.invalidAssignment, 219, 3), ], ); @@ -175,14 +175,13 @@ main() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 77, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 99, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 122, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 126, 3), + error(WarningCode.unusedLocalVariable, 99, 1), + error(WarningCode.unusedLocalVariable, 122, 1), + error(CompileTimeErrorCode.invalidAssignment, 126, 3), ], ); @@ -201,12 +200,11 @@ test1() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 35, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 81, 1), + error(WarningCode.unusedLocalVariable, 81, 1), ], ); } @@ -221,9 +219,9 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 25, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 37, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 62, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 25, 4), + error(WarningCode.unusedLocalVariable, 37, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 62, 1), ], ); @@ -237,7 +235,7 @@ main() { String f() => null; var g = f; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 14, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 14, 4)], ); var g = _resultLibraryElement.topLevelVariables[0]; _assertTypeStr(g.type, 'String Function()'); @@ -254,11 +252,11 @@ main() async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 61, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 87, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 91, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 105, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 109, 9), + error(WarningCode.unusedLocalVariable, 61, 1), + error(WarningCode.unusedLocalVariable, 87, 1), + error(CompileTimeErrorCode.invalidAssignment, 91, 3), + error(WarningCode.unusedLocalVariable, 105, 1), + error(CompileTimeErrorCode.invalidAssignment, 109, 9), ], ); @@ -277,11 +275,11 @@ main() async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 61, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 87, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 91, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 105, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 109, 15), + error(WarningCode.unusedLocalVariable, 61, 1), + error(WarningCode.unusedLocalVariable, 87, 1), + error(CompileTimeErrorCode.invalidAssignment, 91, 3), + error(WarningCode.unusedLocalVariable, 105, 1), + error(CompileTimeErrorCode.invalidAssignment, 109, 15), ], ); @@ -306,10 +304,10 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 101, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 105, 5), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 126, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 155, 4), + error(WarningCode.unusedLocalVariable, 101, 1), + error(CompileTimeErrorCode.invalidAssignment, 105, 5), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 126, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 155, 4), ], ); @@ -328,11 +326,11 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 84, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 88, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 102, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 106, 9), + error(WarningCode.unusedLocalVariable, 56, 1), + error(WarningCode.unusedLocalVariable, 84, 1), + error(CompileTimeErrorCode.invalidAssignment, 88, 3), + error(WarningCode.unusedLocalVariable, 102, 1), + error(CompileTimeErrorCode.invalidAssignment, 106, 9), ], ); @@ -359,14 +357,13 @@ test2() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 67, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 210, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 233, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 237, 1), + error(WarningCode.unusedLocalVariable, 210, 1), + error(WarningCode.unusedLocalVariable, 233, 1), + error(CompileTimeErrorCode.invalidAssignment, 237, 1), ], ); } @@ -381,7 +378,7 @@ main() { }; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var f = findElement2.localVar('f'); @@ -399,13 +396,12 @@ test1() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 35, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 67, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 71, 1), + error(WarningCode.unusedLocalVariable, 67, 1), + error(CompileTimeErrorCode.invalidAssignment, 71, 1), ], ); @@ -426,9 +422,9 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 85, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 110, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 114, 3), + error(WarningCode.unusedLocalVariable, 85, 1), + error(WarningCode.unusedLocalVariable, 110, 1), + error(CompileTimeErrorCode.invalidAssignment, 114, 3), ], ); @@ -459,8 +455,8 @@ var x = () => y; var y = () => x; ''', [ - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 4, 1), - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 21, 1), + error(CompileTimeErrorCode.topLevelCycle, 4, 1), + error(CompileTimeErrorCode.topLevelCycle, 21, 1), ], ); @@ -481,8 +477,8 @@ var x = () => y; var y = () => x; ''', [ - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 4, 1), - error(CompileTimeErrorCode.TOP_LEVEL_CYCLE, 21, 1), + error(CompileTimeErrorCode.topLevelCycle, 4, 1), + error(CompileTimeErrorCode.topLevelCycle, 21, 1), ], ); @@ -527,40 +523,36 @@ class C2 implements A, B { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 17, 1, ), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 39, 1, ), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 80, 1, ), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 89, 1, ), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 120, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 154, 4), + error(CompileTimeErrorCode.invalidAssignment, 120, 4), + error(CompileTimeErrorCode.invalidAssignment, 154, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 204, 4), error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 204, - 4, - ), - error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 246, 1, contextMessages: [message(testFile, 116, 1)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 246, 1, contextMessages: [message(testFile, 150, 1)], @@ -580,7 +572,7 @@ void main() { Foo foo = new Foo(); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 81, 3)], + [error(WarningCode.unusedLocalVariable, 81, 3)], ); } @@ -609,18 +601,17 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 85, 5), + error(WarningCode.unusedLocalVariable, 85, 5), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 99, 1, ), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 99, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 194, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 223, 6), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 309, 9), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 349, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 99, 1), + error(WarningCode.unusedLocalVariable, 194, 5), + error(WarningCode.unusedLocalVariable, 223, 6), + error(WarningCode.unusedLocalVariable, 309, 9), + error(CompileTimeErrorCode.invalidAssignment, 349, 7), ], ); @@ -642,7 +633,7 @@ main() { var x = const C(42); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 63, 1)], + [error(WarningCode.unusedLocalVariable, 63, 1)], ); var x = findElement2.localVar('x'); @@ -667,8 +658,8 @@ void f() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 143, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 166, 1), + error(WarningCode.unusedLocalVariable, 143, 2), + error(WarningCode.unusedLocalVariable, 166, 1), ], ); } @@ -688,9 +679,9 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 75, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 89, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 151, 1), + error(WarningCode.unusedLocalVariable, 75, 1), + error(WarningCode.unusedLocalVariable, 89, 1), + error(WarningCode.unusedLocalVariable, 151, 1), ], ); } @@ -719,11 +710,11 @@ main() { [ error( CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + .notInitializedNonNullableInstanceFieldConstructor, 23, 1, ), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 149, 7), + error(CompileTimeErrorCode.invalidAssignment, 149, 7), ], ); @@ -759,11 +750,11 @@ main() { [ error( CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + .notInitializedNonNullableInstanceFieldConstructor, 22, 1, ), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 95, 7), + error(CompileTimeErrorCode.invalidAssignment, 95, 7), ], ); @@ -794,11 +785,11 @@ main() { [ error( CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + .notInitializedNonNullableInstanceFieldConstructor, 22, 1, ), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 156, 7), + error(CompileTimeErrorCode.invalidAssignment, 156, 7), ], ); @@ -821,7 +812,7 @@ main() { x.t = 'hello'; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 123, 7)], + [error(CompileTimeErrorCode.invalidAssignment, 123, 7)], ); var x = findElement2.localVar('x'); @@ -848,7 +839,7 @@ main() { x.t = 'hello'; } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 183, 7)], + [error(CompileTimeErrorCode.invalidAssignment, 183, 7)], ); var x = findElement2.localVar('x'); @@ -876,8 +867,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 29, 1), - error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 39, 2), + error(WarningCode.unusedLocalVariable, 29, 1), + error(CompileTimeErrorCode.extraPositionalArguments, 39, 2), ], ); @@ -903,13 +894,13 @@ foo() { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 69, 1, contextMessages: [message(testFile, 22, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 97, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 118, 1), + error(WarningCode.unusedLocalVariable, 97, 1), + error(WarningCode.unusedLocalVariable, 118, 1), ], ); } @@ -937,9 +928,9 @@ test() { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 140, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 168, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 210, 4), + error(CompileTimeErrorCode.invalidAssignment, 140, 4), + error(CompileTimeErrorCode.invalidAssignment, 168, 4), + error(CompileTimeErrorCode.invalidAssignment, 210, 4), ], ); } @@ -952,7 +943,7 @@ test() { x = "hi"; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 19, 1)], + [error(WarningCode.unusedLocalVariable, 19, 1)], ); } @@ -965,7 +956,7 @@ test() { x = 3; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); } @@ -990,7 +981,7 @@ void main() { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 266, 1)], + [error(WarningCode.unusedLocalVariable, 266, 1)], ); } @@ -1013,7 +1004,7 @@ var t3 = [ ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 19, 1, ), @@ -1044,8 +1035,8 @@ void main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 26, 1), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 36, 7), + error(WarningCode.unusedLocalVariable, 26, 1), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 36, 7), ], ); } @@ -1060,8 +1051,8 @@ Future test() async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 75, 2), + error(WarningCode.unusedLocalVariable, 47, 2), + error(WarningCode.unusedLocalVariable, 75, 2), ], ); } @@ -1079,8 +1070,8 @@ Future main() async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 115, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 150, 1), + error(WarningCode.unusedLocalVariable, 115, 1), + error(WarningCode.unusedLocalVariable, 150, 1), ], ); } @@ -1101,7 +1092,7 @@ Function2, String> g = ([llll = const [1]]) => "hello"; [ error( CompileTimeErrorCode - .NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD_CONSTRUCTOR, + .notInitializedNonNullableInstanceFieldConstructor, 92, 3, ), @@ -1155,18 +1146,18 @@ void main() { } ''', [ - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 61, 1), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 197, 1), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 259, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 280, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 343, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 367, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 421, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 442, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 499, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 522, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 591, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 617, 7), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 61, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 197, 1), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 259, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 280, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 343, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 367, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 421, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 442, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 499, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 522, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 591, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 617, 7), ], ); } @@ -1207,18 +1198,18 @@ void main() { } ''', [ - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 43, 1), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 149, 1), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 197, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 214, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 265, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 285, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 327, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 344, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 389, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 408, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 465, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 487, 7), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 43, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 149, 1), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 197, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 214, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 265, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 285, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 327, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 344, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 389, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 408, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 465, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 487, 7), ], ); } @@ -1260,40 +1251,40 @@ void main () { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 79, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 95, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 128, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 180, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 185, 21), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 235, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 251, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 281, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 302, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 342, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 354, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 387, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 435, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 447, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 477, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 494, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 526, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 543, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 589, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 605, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 644, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 704, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 709, 23), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 767, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 784, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 821, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 843, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 881, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 920, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 964, 2), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 976, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1006, 2), - error(CompileTimeErrorCode.UNDEFINED_METHOD, 1020, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1064, 2), + error(WarningCode.unusedLocalVariable, 79, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 95, 4), + error(WarningCode.unusedLocalVariable, 128, 2), + error(WarningCode.unusedLocalVariable, 180, 2), + error(CompileTimeErrorCode.invalidAssignment, 185, 21), + error(WarningCode.unusedLocalVariable, 235, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 251, 1), + error(WarningCode.unusedLocalVariable, 281, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 302, 1), + error(WarningCode.unusedLocalVariable, 342, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 354, 4), + error(WarningCode.unusedLocalVariable, 387, 2), + error(WarningCode.unusedLocalVariable, 435, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 447, 1), + error(WarningCode.unusedLocalVariable, 477, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 494, 1), + error(WarningCode.unusedLocalVariable, 526, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 543, 1), + error(WarningCode.unusedLocalVariable, 589, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 605, 4), + error(WarningCode.unusedLocalVariable, 644, 2), + error(WarningCode.unusedLocalVariable, 704, 2), + error(CompileTimeErrorCode.invalidAssignment, 709, 23), + error(WarningCode.unusedLocalVariable, 767, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 784, 1), + error(WarningCode.unusedLocalVariable, 821, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 843, 1), + error(WarningCode.unusedLocalVariable, 881, 2), + error(WarningCode.unusedLocalVariable, 920, 2), + error(WarningCode.unusedLocalVariable, 964, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 976, 1), + error(WarningCode.unusedLocalVariable, 1006, 2), + error(CompileTimeErrorCode.undefinedMethod, 1020, 9), + error(WarningCode.unusedLocalVariable, 1064, 2), ], ); } @@ -1320,18 +1311,14 @@ void main () { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 38, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 52, 2), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 115, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 179, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 212, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 253, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 288, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 318, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 38, 4), + error(WarningCode.unusedLocalVariable, 52, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 115, 4), + error(WarningCode.unusedLocalVariable, 179, 1), + error(WarningCode.unusedLocalVariable, 212, 1), + error(WarningCode.unusedLocalVariable, 253, 1), + error(WarningCode.unusedLocalVariable, 288, 1), + error(WarningCode.unusedLocalVariable, 318, 1), ], ); } @@ -1350,7 +1337,7 @@ void main() { new F4(a: []); } ''', - [error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 91, 1)], + [error(CompileTimeErrorCode.missingDefaultValueForParameter, 91, 1)], ); } @@ -1415,21 +1402,21 @@ void main() { } ''', [ - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 63, 1), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 202, 1), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 338, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 364, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 442, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 471, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 540, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 566, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 638, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 666, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 750, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 781, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 819, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 846, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 879, 3), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 63, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 202, 1), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 338, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 364, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 442, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 471, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 540, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 566, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 638, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 666, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 750, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 781, 7), + error(WarningCode.unusedLocalVariable, 819, 3), + error(WarningCode.unusedLocalVariable, 846, 3), + error(WarningCode.unusedLocalVariable, 879, 3), ], ); } @@ -1481,52 +1468,32 @@ void main () { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 45, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 59, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 88, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 133, 24), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 181, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 211, 1), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 250, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 264, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 289, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 340, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 366, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 394, 1), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 439, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 453, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 482, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 529, 26), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 580, 1), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 612, 1), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 655, - 4, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 696, - 4, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 743, - 4, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 757, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 822, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 856, 1), - error(CompileTimeErrorCode.UNDEFINED_METHOD, 879, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 901, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 45, 4), + error(WarningCode.unusedLocalVariable, 59, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 88, 4), + error(CompileTimeErrorCode.invalidAssignment, 133, 24), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 181, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 211, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 250, 4), + error(WarningCode.unusedLocalVariable, 264, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 289, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 340, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 366, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 394, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 439, 4), + error(WarningCode.unusedLocalVariable, 453, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 482, 4), + error(CompileTimeErrorCode.invalidAssignment, 529, 26), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 580, 1), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 612, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 655, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 696, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 743, 4), + error(WarningCode.unusedLocalVariable, 757, 1), + error(WarningCode.unusedLocalVariable, 822, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 856, 1), + error(CompileTimeErrorCode.undefinedMethod, 879, 9), + error(WarningCode.unusedLocalVariable, 901, 1), ], ); } @@ -1632,83 +1599,83 @@ void main() { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 427, 4), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 495, 1), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 506, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 427, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 495, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 506, 1), error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 548, 1, ), error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 553, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 612, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 655, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 704, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 760, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 822, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 827, 31), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 879, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 884, 41), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 954, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 965, 7), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 974, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 997, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1014, 7), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1023, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1054, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1097, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1146, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1202, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1264, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1269, 34), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1324, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1329, 41), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1399, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1410, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1413, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1442, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1459, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1462, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1496, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1527, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1564, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1600, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1642, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1647, 17), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1682, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1687, 23), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1736, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1747, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1773, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 1790, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1827, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1867, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1913, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1966, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2028, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 2033, 28), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2082, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 2087, 38), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2154, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2165, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2188, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2205, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2239, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2325, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2406, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 2441, 7), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 2463, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2487, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2548, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2597, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2626, 7), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2635, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 2658, 2), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 2687, 7), + error(WarningCode.unusedLocalVariable, 612, 2), + error(WarningCode.unusedLocalVariable, 655, 2), + error(WarningCode.unusedLocalVariable, 704, 2), + error(WarningCode.unusedLocalVariable, 760, 2), + error(WarningCode.unusedLocalVariable, 822, 2), + error(CompileTimeErrorCode.invalidAssignment, 827, 31), + error(WarningCode.unusedLocalVariable, 879, 2), + error(CompileTimeErrorCode.invalidAssignment, 884, 41), + error(WarningCode.unusedLocalVariable, 954, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 965, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 974, 1), + error(WarningCode.unusedLocalVariable, 997, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1014, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1023, 1), + error(WarningCode.unusedLocalVariable, 1054, 2), + error(WarningCode.unusedLocalVariable, 1097, 2), + error(WarningCode.unusedLocalVariable, 1146, 2), + error(WarningCode.unusedLocalVariable, 1202, 2), + error(WarningCode.unusedLocalVariable, 1264, 2), + error(CompileTimeErrorCode.invalidAssignment, 1269, 34), + error(WarningCode.unusedLocalVariable, 1324, 2), + error(CompileTimeErrorCode.invalidAssignment, 1329, 41), + error(WarningCode.unusedLocalVariable, 1399, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1410, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1413, 7), + error(WarningCode.unusedLocalVariable, 1442, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1459, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1462, 7), + error(WarningCode.unusedLocalVariable, 1496, 2), + error(WarningCode.unusedLocalVariable, 1527, 2), + error(WarningCode.unusedLocalVariable, 1564, 2), + error(WarningCode.unusedLocalVariable, 1600, 2), + error(WarningCode.unusedLocalVariable, 1642, 2), + error(CompileTimeErrorCode.invalidAssignment, 1647, 17), + error(WarningCode.unusedLocalVariable, 1682, 2), + error(CompileTimeErrorCode.invalidAssignment, 1687, 23), + error(WarningCode.unusedLocalVariable, 1736, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1747, 7), + error(WarningCode.unusedLocalVariable, 1773, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 1790, 7), + error(WarningCode.unusedLocalVariable, 1827, 2), + error(WarningCode.unusedLocalVariable, 1867, 2), + error(WarningCode.unusedLocalVariable, 1913, 2), + error(WarningCode.unusedLocalVariable, 1966, 2), + error(WarningCode.unusedLocalVariable, 2028, 2), + error(CompileTimeErrorCode.invalidAssignment, 2033, 28), + error(WarningCode.unusedLocalVariable, 2082, 2), + error(CompileTimeErrorCode.invalidAssignment, 2087, 38), + error(WarningCode.unusedLocalVariable, 2154, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2165, 1), + error(WarningCode.unusedLocalVariable, 2188, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2205, 1), + error(WarningCode.unusedLocalVariable, 2239, 2), + error(WarningCode.unusedLocalVariable, 2325, 2), + error(WarningCode.unusedLocalVariable, 2406, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 2441, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 2463, 1), + error(WarningCode.unusedLocalVariable, 2487, 2), + error(WarningCode.unusedLocalVariable, 2548, 2), + error(WarningCode.unusedLocalVariable, 2597, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2626, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2635, 1), + error(WarningCode.unusedLocalVariable, 2658, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 2687, 7), ], ); } @@ -1754,39 +1721,39 @@ void main() { } ''', [ - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 79, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 122, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 145, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 169, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 175, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 199, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 205, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 244, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 271, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 299, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 333, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 374, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 379, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 402, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 407, 8), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 431, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 436, 14), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 442, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 466, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 471, 17), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 477, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 516, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 543, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 571, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 577, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 605, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 611, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 652, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 687, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 723, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 735, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 765, 2), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 777, 7), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 79, 2), + error(WarningCode.unusedLocalVariable, 122, 2), + error(WarningCode.unusedLocalVariable, 145, 2), + error(WarningCode.unusedLocalVariable, 169, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 175, 7), + error(WarningCode.unusedLocalVariable, 199, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 205, 7), + error(WarningCode.unusedLocalVariable, 244, 2), + error(WarningCode.unusedLocalVariable, 271, 2), + error(WarningCode.unusedLocalVariable, 299, 2), + error(WarningCode.unusedLocalVariable, 333, 2), + error(WarningCode.unusedLocalVariable, 374, 2), + error(CompileTimeErrorCode.invalidAssignment, 379, 7), + error(WarningCode.unusedLocalVariable, 402, 2), + error(CompileTimeErrorCode.invalidAssignment, 407, 8), + error(WarningCode.unusedLocalVariable, 431, 2), + error(CompileTimeErrorCode.invalidAssignment, 436, 14), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 442, 7), + error(WarningCode.unusedLocalVariable, 466, 2), + error(CompileTimeErrorCode.invalidAssignment, 471, 17), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 477, 7), + error(WarningCode.unusedLocalVariable, 516, 2), + error(WarningCode.unusedLocalVariable, 543, 2), + error(WarningCode.unusedLocalVariable, 571, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 577, 7), + error(WarningCode.unusedLocalVariable, 605, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 611, 7), + error(WarningCode.unusedLocalVariable, 652, 2), + error(WarningCode.unusedLocalVariable, 687, 2), + error(WarningCode.unusedLocalVariable, 723, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 735, 7), + error(WarningCode.unusedLocalVariable, 765, 2), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 777, 7), ], ); } @@ -1850,73 +1817,44 @@ main() { } ''', [ + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 122, 6), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 149, 9), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 241, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 330, 4), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 122, - 6, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 149, - 9, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 241, - 9, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 330, - 4, - ), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 391, 9, ), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 813, 9, ), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 1181, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 1261, 4), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 1181, - 9, - ), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 1261, - 4, - ), - error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 1344, 9, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 1526, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 1562, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 1611, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 1647, 1, ), @@ -1999,50 +1937,50 @@ void main() { } ''', [ - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 173, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 241, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 271, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 311, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 324, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 369, 2), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 385, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 415, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 446, 7), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 455, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 498, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 533, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 578, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 629, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 668, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 731, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 765, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 809, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 859, 2), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 868, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 897, 2), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 937, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 976, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1007, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1048, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 1061, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1107, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1142, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 1172, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1219, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1224, 16), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1263, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1268, 26), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1317, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 1322, 20), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1379, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1421, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1473, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 1492, 7), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1543, 2), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 1565, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 1601, 2), - error(CompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE, 1637, 7), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 1646, 1), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 173, 7), + error(WarningCode.unusedLocalVariable, 241, 2), + error(WarningCode.unusedLocalVariable, 271, 2), + error(WarningCode.unusedLocalVariable, 311, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 324, 7), + error(WarningCode.unusedLocalVariable, 369, 2), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 385, 1), + error(WarningCode.unusedLocalVariable, 415, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 446, 7), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 455, 1), + error(WarningCode.unusedLocalVariable, 498, 2), + error(WarningCode.unusedLocalVariable, 533, 2), + error(WarningCode.unusedLocalVariable, 578, 2), + error(WarningCode.unusedLocalVariable, 629, 2), + error(WarningCode.unusedLocalVariable, 668, 2), + error(WarningCode.unusedLocalVariable, 731, 2), + error(WarningCode.unusedLocalVariable, 765, 2), + error(WarningCode.unusedLocalVariable, 809, 2), + error(WarningCode.unusedLocalVariable, 859, 2), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 868, 1), + error(WarningCode.unusedLocalVariable, 897, 2), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 937, 1), + error(WarningCode.unusedLocalVariable, 976, 2), + error(WarningCode.unusedLocalVariable, 1007, 2), + error(WarningCode.unusedLocalVariable, 1048, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 1061, 7), + error(WarningCode.unusedLocalVariable, 1107, 2), + error(WarningCode.unusedLocalVariable, 1142, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 1172, 7), + error(WarningCode.unusedLocalVariable, 1219, 2), + error(CompileTimeErrorCode.invalidAssignment, 1224, 16), + error(WarningCode.unusedLocalVariable, 1263, 2), + error(CompileTimeErrorCode.invalidAssignment, 1268, 26), + error(WarningCode.unusedLocalVariable, 1317, 2), + error(CompileTimeErrorCode.invalidAssignment, 1322, 20), + error(WarningCode.unusedLocalVariable, 1379, 2), + error(WarningCode.unusedLocalVariable, 1421, 2), + error(WarningCode.unusedLocalVariable, 1473, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 1492, 7), + error(WarningCode.unusedLocalVariable, 1543, 2), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 1565, 1), + error(WarningCode.unusedLocalVariable, 1601, 2), + error(CompileTimeErrorCode.mapKeyTypeNotAssignable, 1637, 7), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 1646, 1), ], ); } @@ -2055,7 +1993,7 @@ class C { static int get _x => null; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 49, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 49, 4)], ); var x = _resultLibraryElement.classes[0].fields[0]; _assertTypeStr(x.type, 'int'); @@ -2069,7 +2007,7 @@ class C { } int get y => null; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 40, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 40, 4)], ); var x = _resultLibraryElement.classes[0].fields[0]; _assertTypeStr(x.type, 'int'); @@ -2087,17 +2025,15 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 66, 1), + error(WarningCode.unusedLocalVariable, 66, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 70, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 89, 1), + error(WarningCode.unusedLocalVariable, 89, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 93, 1, ), @@ -2138,58 +2074,50 @@ void main() { List errors = [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 188, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 226, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 239, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 226, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 239, 4), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 295, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 367, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 452, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 495, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 550, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 610, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 677, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 743, 1, ), @@ -2250,34 +2178,30 @@ void main() { build(declared: "MyFuture", downwards: "Future", upwards: "Future"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 300, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 387, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 519, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 594, 1, ), @@ -2289,34 +2213,30 @@ void main() { build(declared: "MyFuture", downwards: "Future", upwards: "MyFuture"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 300, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 389, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 523, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 600, 1, ), @@ -2328,34 +2248,30 @@ void main() { build(declared: "MyFuture", downwards: "MyFuture", upwards: "Future"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 302, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 391, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 525, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 602, 1, ), @@ -2367,34 +2283,30 @@ void main() { build(declared: "MyFuture", downwards: "MyFuture", upwards: "MyFuture"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 302, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 393, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 529, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 608, 1, ), @@ -2406,34 +2318,30 @@ void main() { build(declared: "Future", downwards: "Future", upwards: "MyFuture"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 298, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 387, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 521, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 598, 1, ), @@ -2445,34 +2353,30 @@ void main() { build(declared: "Future", downwards: "Future", upwards: "Future"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 298, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 385, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 517, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 592, 1, ), @@ -2494,17 +2398,15 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1), + error(WarningCode.unusedLocalVariable, 46, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 50, 1, ), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 50, 51), + error(CompileTimeErrorCode.invalidAssignment, 50, 51), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 109, 1, ), @@ -2528,21 +2430,19 @@ m2() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 34, 1, ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 67, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 92, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 96, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 67, 2), + error(WarningCode.unusedLocalVariable, 92, 1), + error(CompileTimeErrorCode.invalidAssignment, 96, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 135, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 185, 1), + error(WarningCode.unusedLocalVariable, 185, 1), ], ); } @@ -2578,16 +2478,16 @@ $declared foo() => new $declared.value(1); build(declared: "MyFuture", downwards: "Future", upwards: "Future"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 309, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 314, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 475, 2), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), + error(WarningCode.unusedLocalVariable, 309, 2), + error(CompileTimeErrorCode.invalidAssignment, 314, 1), + error(WarningCode.unusedLocalVariable, 475, 2), ], ); await disposeAnalysisContextCollection(); @@ -2596,17 +2496,17 @@ $declared foo() => new $declared.value(1); build(declared: "MyFuture", downwards: "MyFuture", upwards: "MyFuture"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 311, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 316, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 479, 2), - error(WarningCode.UNNECESSARY_CAST, 484, 49), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), + error(WarningCode.unusedLocalVariable, 311, 2), + error(CompileTimeErrorCode.invalidAssignment, 316, 1), + error(WarningCode.unusedLocalVariable, 479, 2), + error(WarningCode.unnecessaryCast, 484, 49), ], ); await disposeAnalysisContextCollection(); @@ -2615,17 +2515,17 @@ $declared foo() => new $declared.value(1); build(declared: "Future", downwards: "Future", upwards: "Future"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 309, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 314, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 475, 2), - error(WarningCode.UNNECESSARY_CAST, 480, 47), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), + error(WarningCode.unusedLocalVariable, 309, 2), + error(CompileTimeErrorCode.invalidAssignment, 314, 1), + error(WarningCode.unusedLocalVariable, 475, 2), + error(WarningCode.unnecessaryCast, 480, 47), ], ); await disposeAnalysisContextCollection(); @@ -2645,18 +2545,16 @@ main() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 39, 4, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 84, 4, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 125, 1), + error(WarningCode.unusedLocalVariable, 125, 1), ], ); } @@ -2687,27 +2585,27 @@ $downwards g3(bool x) async { await assertErrorsInCode(build(downwards: "Future", upwards: "Future"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 185, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 223, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 236, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 464, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 223, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 236, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 464, 1), ]); await disposeAnalysisContextCollection(); await assertErrorsInCode(build(downwards: "Future", upwards: "MyFuture"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 185, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 223, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 236, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 470, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 223, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 236, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 470, 1), ]); await disposeAnalysisContextCollection(); } @@ -2746,19 +2644,15 @@ $downwards> g3() async { build(declared: "MyFuture", downwards: "Future", upwards: "Future"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 256, - 1, - ), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 338, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 256, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 338, 4), ], ); await disposeAnalysisContextCollection(); @@ -2767,18 +2661,14 @@ $downwards> g3() async { build(declared: "MyFuture", downwards: "Future", upwards: "MyFuture"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 256, - 1, - ), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 256, 1), ], ); await disposeAnalysisContextCollection(); @@ -2787,19 +2677,15 @@ $downwards> g3() async { build(declared: "Future", downwards: "Future", upwards: "Future"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 254, - 1, - ), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 336, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 254, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 336, 4), ], ); await disposeAnalysisContextCollection(); @@ -2808,18 +2694,14 @@ $downwards> g3() async { build(declared: "Future", downwards: "Future", upwards: "MyFuture"), [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 187, 4, contextMessages: [message(dartAsyncFile, 589, 4)], ), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 225, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 254, - 1, - ), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 225, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 254, 1), ], ); await disposeAnalysisContextCollection(); @@ -2841,9 +2723,9 @@ foo() async { class A {} ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 37, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 66, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 88, 6), + error(CompileTimeErrorCode.invalidAssignment, 37, 4), + error(CompileTimeErrorCode.invalidAssignment, 66, 4), + error(WarningCode.unusedLocalVariable, 88, 6), ], ); } @@ -2860,10 +2742,9 @@ main() async { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 64, 1), + error(WarningCode.unusedLocalVariable, 64, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 77, 1, ), @@ -2889,7 +2770,7 @@ class A {} class B extends A {} class C extends A {} ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 207, 4)], + [error(WarningCode.unusedLocalVariable, 207, 4)], ); } @@ -2907,8 +2788,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 70, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 130, 8), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 70, 4), + error(WarningCode.unusedLocalVariable, 130, 8), ], ); } @@ -2923,9 +2804,9 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 18, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 42, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 18, 4), + error(WarningCode.unusedLocalVariable, 42, 1), + error(WarningCode.unusedLocalVariable, 62, 1), ], ); } @@ -2963,11 +2844,11 @@ main() { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 355, 11), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 467, 3), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 492, 3), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 683, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 689, 7), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 355, 11), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 467, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 492, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 683, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 689, 7), ], ); } @@ -2988,16 +2869,12 @@ main() { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 50, 1, contextMessages: [message(testFile, 12, 1)], ), - error( - CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, - 91, - 5, - ), + error(CompileTimeErrorCode.wrongNumberOfTypeArgumentsMethod, 91, 5), ], ); } @@ -3012,10 +2889,10 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 21, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 45, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 69, 1), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 76, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 21, 4), + error(WarningCode.unusedLocalVariable, 45, 1), + error(WarningCode.unusedLocalVariable, 69, 1), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 76, 2), ], ); } @@ -3040,29 +2917,25 @@ void functionExpressionInvocation() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 35, 1), + error(WarningCode.unusedLocalVariable, 35, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 39, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 77, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 175, 1), + error(WarningCode.unusedLocalVariable, 175, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 180, 1, ), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 220, 1, ), @@ -3089,13 +2962,13 @@ main() { ''', [ error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 74, 1, contextMessages: [message(testFile, 12, 1)], ), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 94, 1, contextMessages: [message(testFile, 33, 1)], @@ -3113,14 +2986,13 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 46, 1), + error(WarningCode.unusedLocalVariable, 46, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 50, 1, ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 70, 3), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 70, 3), ], ); } @@ -3137,8 +3009,8 @@ class D { typedef void F(V v); ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 45, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 88, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 45, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 88, 4), ], ); var f = _resultLibraryElement.getClass('C')!.methods[0]; @@ -3171,8 +3043,8 @@ class D { typedef V F(); ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 45, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 88, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 45, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 88, 4), ], ); var f = _resultLibraryElement.getClass('C')!.methods[0]; @@ -3214,11 +3086,11 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 183, 8), - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 257, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 293, 8), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 355, 33), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 410, 8), + error(WarningCode.unusedLocalVariable, 183, 8), + error(CompileTimeErrorCode.undefinedOperator, 257, 1), + error(WarningCode.unusedLocalVariable, 293, 8), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 355, 33), + error(WarningCode.unusedLocalVariable, 410, 8), ], ); } @@ -3241,7 +3113,7 @@ main() { }).fold(0, math.max); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 153, 7)], + [error(WarningCode.unusedLocalVariable, 153, 7)], ); } @@ -3258,8 +3130,8 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 96, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 118, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 96, 4), + error(WarningCode.unusedLocalVariable, 118, 1), ], ); @@ -3277,7 +3149,7 @@ T generic(a(T _), b(T _)) => null; var v = generic((F f) => null, (G g) => null); ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 96, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 96, 4)], ); var v = _resultLibraryElement.topLevelVariables[0]; _assertTypeStr(v.type, 'List Function(num)'); @@ -3307,7 +3179,7 @@ var v_postfix_mm = (new A().f--); ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 16, 1, ), @@ -3332,7 +3204,7 @@ var v_postfix_mm = (new B().a--); ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 88, 1, ), @@ -3353,7 +3225,7 @@ var d = (c = 1); ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 16, 1, ), @@ -3482,10 +3354,7 @@ var b = (throw 0) ? 1 : 2; var c = t ? (throw 1) : 2; var d = t ? 1 : (throw 2); ''', - [ - error(WarningCode.DEAD_CODE, 53, 1), - error(WarningCode.DEAD_CODE, 57, 1), - ], + [error(WarningCode.deadCode, 53, 1), error(WarningCode.deadCode, 57, 1)], ); } @@ -3560,7 +3429,7 @@ foo() { i = m1; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1)], + [error(WarningCode.unusedLocalVariable, 62, 1)], ); } @@ -3592,15 +3461,15 @@ foo() { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 82, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 112, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 121, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 148, 9), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 182, 9), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 234, 9), + error(WarningCode.unusedLocalVariable, 112, 1), + error(WarningCode.unusedLocalVariable, 121, 1), + error(CompileTimeErrorCode.invalidAssignment, 148, 9), + error(CompileTimeErrorCode.invalidAssignment, 182, 9), + error(CompileTimeErrorCode.invalidAssignment, 234, 9), ], ); } @@ -3652,26 +3521,26 @@ test1() { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 14, 1, ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 39, 4), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 171, 1), - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 201, 1), - error(CompileTimeErrorCode.UNDEFINED_OPERATOR, 572, 1), - error(WarningCode.CAST_FROM_NULL_ALWAYS_FAILS, 591, 9), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 619, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 647, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 687, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 709, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 729, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 753, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 772, 5), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 794, 5), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 807, 5), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 869, 5), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 882, 2), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 39, 4), + error(CompileTimeErrorCode.undefinedIdentifier, 171, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 201, 1), + error(CompileTimeErrorCode.undefinedOperator, 572, 1), + error(WarningCode.castFromNullAlwaysFails, 591, 9), + error(CompileTimeErrorCode.invalidAssignment, 619, 4), + error(CompileTimeErrorCode.invalidAssignment, 647, 4), + error(CompileTimeErrorCode.invalidAssignment, 687, 2), + error(CompileTimeErrorCode.invalidAssignment, 709, 2), + error(CompileTimeErrorCode.invalidAssignment, 729, 1), + error(CompileTimeErrorCode.invalidAssignment, 753, 2), + error(CompileTimeErrorCode.invalidAssignment, 772, 5), + error(CompileTimeErrorCode.invalidAssignment, 794, 5), + error(CompileTimeErrorCode.invalidAssignment, 807, 5), + error(CompileTimeErrorCode.invalidAssignment, 869, 5), + error(CompileTimeErrorCode.invalidAssignment, 882, 2), ], ); } @@ -3693,8 +3562,8 @@ foo() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 78, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 99, 1), + error(WarningCode.unusedLocalVariable, 78, 1), + error(WarningCode.unusedLocalVariable, 99, 1), ], ); } @@ -3716,8 +3585,8 @@ foo() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 89, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 110, 1), + error(WarningCode.unusedLocalVariable, 89, 1), + error(WarningCode.unusedLocalVariable, 110, 1), ], ); } @@ -3776,8 +3645,8 @@ test1() { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 45, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 57, 4), + error(CompileTimeErrorCode.invalidAssignment, 45, 4), + error(CompileTimeErrorCode.invalidAssignment, 57, 4), ], ); } @@ -3798,8 +3667,8 @@ test1() { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 68, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 82, 4), + error(CompileTimeErrorCode.invalidAssignment, 68, 4), + error(CompileTimeErrorCode.invalidAssignment, 82, 4), ], ); } @@ -3815,10 +3684,10 @@ main() { } ''', [ - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 34, 1), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 39, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 46, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 68, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 34, 1), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 39, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 46, 4), + error(WarningCode.unusedLocalVariable, 68, 1), ], ); @@ -3838,12 +3707,12 @@ main() { ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 29, 1, ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 36, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 59, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 36, 4), + error(WarningCode.unusedLocalVariable, 59, 1), ], ); @@ -3863,17 +3732,17 @@ main() { ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 34, 1, ), error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 39, 1, ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 46, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 69, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 46, 4), + error(WarningCode.unusedLocalVariable, 69, 1), ], ); @@ -3891,7 +3760,7 @@ main() { var y = new C().m(42); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 47, 1)], + [error(WarningCode.unusedLocalVariable, 47, 1)], ); var y = findElement2.localVar('y'); @@ -3928,15 +3797,15 @@ main() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 88, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 161, 3), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 204, 25), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 245, 25), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 313, 4), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 357, 25), - error(CompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE, 400, 25), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 467, 3), - error(CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 501, 25), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 88, 4), + error(WarningCode.unusedLocalVariable, 161, 3), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 204, 25), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 245, 25), + error(WarningCode.unusedLocalVariable, 313, 4), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 357, 25), + error(CompileTimeErrorCode.mapValueTypeNotAssignable, 400, 25), + error(WarningCode.unusedLocalVariable, 467, 3), + error(CompileTimeErrorCode.listElementTypeNotAssignable, 501, 25), ], ); } @@ -3962,16 +3831,16 @@ main() { } ''', [ - error(WarningCode.UNUSED_ELEMENT, 11, 2), - error(WarningCode.UNUSED_ELEMENT, 26, 2), - error(WarningCode.UNUSED_ELEMENT, 48, 2), - error(WarningCode.UNUSED_ELEMENT, 71, 2), - error(WarningCode.UNUSED_ELEMENT, 100, 2), - error(WarningCode.UNUSED_ELEMENT, 162, 2), - error(WarningCode.UNUSED_ELEMENT, 177, 2), - error(WarningCode.UNUSED_ELEMENT, 194, 2), + error(WarningCode.unusedElement, 11, 2), + error(WarningCode.unusedElement, 26, 2), + error(WarningCode.unusedElement, 48, 2), + error(WarningCode.unusedElement, 71, 2), + error(WarningCode.unusedElement, 100, 2), + error(WarningCode.unusedElement, 162, 2), + error(WarningCode.unusedElement, 177, 2), + error(WarningCode.unusedElement, 194, 2), error( - CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, + CompileTimeErrorCode.referencedBeforeDeclaration, 203, 2, contextMessages: [message(testFile, 211, 2)], @@ -4012,7 +3881,7 @@ class D { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 54, 3, ), @@ -4076,7 +3945,7 @@ class Foo { Foo([this.x = "1"]); } ''', - [error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 41, 3)], + [error(CompileTimeErrorCode.invalidAssignment, 41, 3)], ); } @@ -4087,7 +3956,7 @@ main() { var f = () {}; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var f = findElement2.localVar('f'); @@ -4106,12 +3975,12 @@ var v = new A()..a = 1..b.add(2)..m(); ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 16, 1, ), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 31, 1, ), @@ -4130,13 +3999,7 @@ class C { C c; var x = c*c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 49, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 49, 1)], ); var x = _resultLibraryElement.topLevelVariables[1]; expect(x.name, 'x'); @@ -4153,13 +4016,7 @@ abstract class C implements I {} C c; var x = c*c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 82, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 82, 1)], ); var x = _resultLibraryElement.topLevelVariables[1]; expect(x.name, 'x'); @@ -4178,10 +4035,9 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 72, 1), + error(WarningCode.unusedLocalVariable, 72, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 76, 1, ), @@ -4206,10 +4062,9 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 105, 1), + error(WarningCode.unusedLocalVariable, 105, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 109, 1, ), @@ -4230,13 +4085,7 @@ class C { C c; var x = -c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 42, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 42, 1)], ); var x = _resultLibraryElement.topLevelVariables[1]; expect(x.name, 'x'); @@ -4253,13 +4102,7 @@ abstract class C implements I {} C c; var x = -c; ''', - [ - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 75, - 1, - ), - ], + [error(CompileTimeErrorCode.notInitializedNonNullableVariable, 75, 1)], ); var x = _resultLibraryElement.topLevelVariables[1]; expect(x.name, 'x'); @@ -4275,7 +4118,7 @@ class C { C f() => null; var x = f().g; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 41, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 41, 4)], ); var x = _resultLibraryElement.topLevelVariables[0]; expect(x.name, 'x'); @@ -4292,7 +4135,7 @@ abstract class C implements I {} C f() => null; var x = f().g; ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 74, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 74, 4)], ); var x = _resultLibraryElement.topLevelVariables[0]; expect(x.name, 'x'); @@ -4316,7 +4159,7 @@ class C { C f() => null; var x = f().g(); ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 41, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 41, 4)], ); var x = _resultLibraryElement.topLevelVariables[0]; expect(x.name, 'x'); @@ -4333,7 +4176,7 @@ abstract class C implements I {} C f() => null; var x = f().g(); ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 74, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 74, 4)], ); var x = _resultLibraryElement.topLevelVariables[0]; expect(x.name, 'x'); @@ -4384,8 +4227,8 @@ String g() => null; var v = [f, g]; ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 11, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 31, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 11, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 31, 4), ], ); var v = _resultLibraryElement.topLevelVariables[0]; @@ -4400,8 +4243,8 @@ String g(int x(String y)) => null; var v = [f, g]; ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 26, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 61, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 26, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 61, 4), ], ); var v = _resultLibraryElement.topLevelVariables[0]; @@ -4416,10 +4259,10 @@ String g({int x}) => null; var v = [f, g]; ''', [ - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 11, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 18, 4), - error(CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER, 38, 1), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 45, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 11, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 18, 4), + error(CompileTimeErrorCode.missingDefaultValueForParameter, 38, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 45, 4), ], ); var v = _resultLibraryElement.topLevelVariables[0]; @@ -4435,17 +4278,17 @@ var v = [f, g]; ''', [ error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 11, 1, ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 18, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 18, 4), error( - CompileTimeErrorCode.MISSING_DEFAULT_VALUE_FOR_PARAMETER_POSITIONAL, + CompileTimeErrorCode.missingDefaultValueForParameterPositional, 38, 1, ), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 45, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 45, 4), ], ); var v = _resultLibraryElement.topLevelVariables[0]; @@ -4460,8 +4303,8 @@ String g(int x) => null; var v = [f, g]; ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 16, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 41, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 16, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 41, 4), ], ); var v = _resultLibraryElement.topLevelVariables[0]; @@ -4560,7 +4403,7 @@ foo() { i = y2; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 73, 1)], + [error(WarningCode.unusedLocalVariable, 73, 1)], ); } @@ -4608,7 +4451,7 @@ class T { static String m2(e) { return ''; } } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 103, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 103, 4)], ); } @@ -4629,9 +4472,9 @@ foo() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 80, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 84, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 101, 1), + error(WarningCode.unusedLocalVariable, 80, 1), + error(CompileTimeErrorCode.invalidAssignment, 84, 9), + error(WarningCode.unusedLocalVariable, 101, 1), ], ); } @@ -4653,9 +4496,9 @@ foo() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 89, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 93, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 110, 1), + error(WarningCode.unusedLocalVariable, 89, 1), + error(CompileTimeErrorCode.invalidAssignment, 93, 9), + error(WarningCode.unusedLocalVariable, 110, 1), ], ); } @@ -4670,8 +4513,8 @@ test1() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 16, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 29, 4), + error(WarningCode.unusedLocalVariable, 16, 1), + error(CompileTimeErrorCode.invalidAssignment, 29, 4), ], ); } @@ -4685,8 +4528,8 @@ test2() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 16, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 29, 4), + error(WarningCode.unusedLocalVariable, 16, 1), + error(CompileTimeErrorCode.invalidAssignment, 29, 4), ], ); } @@ -4714,14 +4557,14 @@ class A { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 44, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 59, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 84, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 99, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 124, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 139, 4), + error(WarningCode.unusedLocalVariable, 44, 1), + error(CompileTimeErrorCode.invalidAssignment, 59, 4), + error(WarningCode.unusedLocalVariable, 84, 1), + error(CompileTimeErrorCode.invalidAssignment, 99, 4), + error(WarningCode.unusedLocalVariable, 124, 1), + error(CompileTimeErrorCode.invalidAssignment, 139, 4), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 167, 1, ), @@ -4750,12 +4593,12 @@ int y = 0; // field def after use final z = 42; // should infer `int` ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 28, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 41, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 75, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 96, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 109, 4), + error(WarningCode.unusedLocalVariable, 28, 1), + error(CompileTimeErrorCode.invalidAssignment, 41, 4), + error(WarningCode.unusedLocalVariable, 62, 1), + error(CompileTimeErrorCode.invalidAssignment, 75, 4), + error(WarningCode.unusedLocalVariable, 96, 1), + error(CompileTimeErrorCode.invalidAssignment, 109, 4), ], ); } @@ -4782,10 +4625,10 @@ foo() { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 48, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 100, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 124, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 128, 9), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 48, 4), + error(WarningCode.unusedLocalVariable, 100, 1), + error(WarningCode.unusedLocalVariable, 124, 1), + error(CompileTimeErrorCode.invalidAssignment, 128, 9), ], ); } @@ -4809,16 +4652,12 @@ foo() { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 27, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 47, 4), - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, - 109, - 7, - ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 138, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 142, 9), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 159, 1), + error(CompileTimeErrorCode.invalidAssignment, 27, 4), + error(CompileTimeErrorCode.invalidAssignment, 47, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 109, 7), + error(WarningCode.unusedLocalVariable, 138, 1), + error(CompileTimeErrorCode.invalidAssignment, 142, 9), + error(WarningCode.unusedLocalVariable, 159, 1), ], ); } @@ -4842,18 +4681,18 @@ foo() { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 17, 1, ), error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 53, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 87, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 91, 17), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 119, 1), + error(WarningCode.unusedLocalVariable, 87, 1), + error(CompileTimeErrorCode.invalidAssignment, 91, 17), + error(WarningCode.unusedLocalVariable, 119, 1), ], ); } @@ -4887,12 +4726,12 @@ foo () { } ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 284, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 310, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 314, 21), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 330, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 346, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 366, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 284, 4), + error(WarningCode.unusedLocalVariable, 310, 1), + error(CompileTimeErrorCode.invalidAssignment, 314, 21), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 330, 4), + error(WarningCode.unusedLocalVariable, 346, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 366, 4), ], ); } @@ -4914,15 +4753,15 @@ foo() { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 27, 4), + error(CompileTimeErrorCode.invalidAssignment, 27, 4), error( - CompileTimeErrorCode.INVALID_OVERRIDE, + CompileTimeErrorCode.invalidOverride, 78, 1, contextMessages: [message(testFile, 23, 1)], ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 106, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 127, 1), + error(WarningCode.unusedLocalVariable, 106, 1), + error(WarningCode.unusedLocalVariable, 127, 1), ], ); } @@ -4963,13 +4802,13 @@ foo () { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 88, 4), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 238, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 264, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 268, 35), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 292, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 314, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 342, 4), + error(CompileTimeErrorCode.invalidAssignment, 88, 4), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 238, 4), + error(WarningCode.unusedLocalVariable, 264, 1), + error(CompileTimeErrorCode.invalidAssignment, 268, 35), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 292, 4), + error(WarningCode.unusedLocalVariable, 314, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 342, 4), ], ); } @@ -5041,22 +4880,22 @@ test() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 122, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 126, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 244, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 248, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 259, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 345, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 349, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 396, 1), - error(CompileTimeErrorCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, 427, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 446, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 497, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 565, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 634, 1), - error(CompileTimeErrorCode.FOR_IN_OF_INVALID_TYPE, 728, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 746, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 897, 1), + error(WarningCode.unusedLocalVariable, 122, 1), + error(CompileTimeErrorCode.invalidAssignment, 126, 1), + error(WarningCode.unusedLocalVariable, 244, 1), + error(CompileTimeErrorCode.invalidAssignment, 248, 1), + error(WarningCode.unusedLocalVariable, 259, 1), + error(WarningCode.unusedLocalVariable, 345, 1), + error(CompileTimeErrorCode.invalidAssignment, 349, 1), + error(WarningCode.unusedLocalVariable, 396, 1), + error(CompileTimeErrorCode.forInOfInvalidElementType, 427, 4), + error(WarningCode.unusedLocalVariable, 446, 1), + error(WarningCode.unusedLocalVariable, 497, 1), + error(WarningCode.unusedLocalVariable, 565, 1), + error(WarningCode.unusedLocalVariable, 634, 1), + error(CompileTimeErrorCode.forInOfInvalidType, 728, 3), + error(WarningCode.unusedLocalVariable, 746, 1), + error(WarningCode.unusedLocalVariable, 897, 1), ], ); } @@ -5070,7 +4909,7 @@ test() { } } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 50, 1)], + [error(WarningCode.unusedLocalVariable, 50, 1)], ); } @@ -5123,12 +4962,12 @@ test2() { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 39, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 54, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 84, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 134, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 167, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 171, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 39, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 54, 3), + error(WarningCode.unusedLocalVariable, 84, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 134, 4), + error(WarningCode.unusedLocalVariable, 167, 1), + error(CompileTimeErrorCode.invalidAssignment, 171, 1), ], ); } @@ -5151,12 +4990,12 @@ test2() { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 39, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 55, 3), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 86, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 137, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 171, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 175, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 39, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 55, 3), + error(WarningCode.unusedLocalVariable, 86, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 137, 4), + error(WarningCode.unusedLocalVariable, 171, 1), + error(CompileTimeErrorCode.invalidAssignment, 175, 2), ], ); } @@ -5177,7 +5016,7 @@ test1() { x.add(42); } ''', - [error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 36, 2)], + [error(CompileTimeErrorCode.argumentTypeNotAssignable, 36, 2)], ); var x = findElement2.localVar('x'); @@ -5208,15 +5047,15 @@ test2() { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 58, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 75, 3), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 96, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 119, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 209, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 247, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 265, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 302, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 306, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 58, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 75, 3), + error(CompileTimeErrorCode.invalidAssignment, 96, 2), + error(WarningCode.unusedLocalVariable, 119, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 209, 4), + error(CompileTimeErrorCode.invalidAssignment, 247, 2), + error(CompileTimeErrorCode.invalidAssignment, 265, 4), + error(WarningCode.unusedLocalVariable, 302, 1), + error(CompileTimeErrorCode.invalidAssignment, 306, 1), ], ); } @@ -5245,15 +5084,15 @@ test2() { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 59, 4), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 77, 3), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 99, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 122, 1), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 214, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 254, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 272, 4), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 310, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 314, 2), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 59, 4), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 77, 3), + error(CompileTimeErrorCode.invalidAssignment, 99, 2), + error(WarningCode.unusedLocalVariable, 122, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 214, 4), + error(CompileTimeErrorCode.invalidAssignment, 254, 2), + error(CompileTimeErrorCode.invalidAssignment, 272, 4), + error(WarningCode.unusedLocalVariable, 310, 1), + error(CompileTimeErrorCode.invalidAssignment, 314, 2), ], ); } @@ -5267,8 +5106,8 @@ test1() { } ''', [ - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 40, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 45, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 40, 1), + error(CompileTimeErrorCode.invalidAssignment, 45, 3), ], ); @@ -5293,7 +5132,7 @@ class C { class D {} var f = new C().f(); ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 27, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 27, 4)], ); var v = _resultLibraryElement.topLevelVariables[0]; _assertTypeStr(v.type, 'D'); @@ -5310,12 +5149,8 @@ C c; var f = c.f(); ''', [ - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 27, 4), - error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_VARIABLE, - 51, - 1, - ), + error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 27, 4), + error(CompileTimeErrorCode.notInitializedNonNullableVariable, 51, 1), ], ); var v = _resultLibraryElement.topLevelVariables[1]; @@ -5332,7 +5167,7 @@ class C { class D {} var f = C.f(); ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 34, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 34, 4)], ); var v = _resultLibraryElement.topLevelVariables[0]; _assertTypeStr(v.type, 'D'); @@ -5345,7 +5180,7 @@ D f() => null; class D {} var g = f(); ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 15, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 15, 4)], ); var v = _resultLibraryElement.topLevelVariables[0]; _assertTypeStr(v.type, 'D'); @@ -5360,8 +5195,8 @@ test1() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 16, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 29, 4), + error(WarningCode.unusedLocalVariable, 16, 1), + error(CompileTimeErrorCode.invalidAssignment, 29, 4), ], ); } @@ -5378,14 +5213,13 @@ main() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 34, 1, ), - error(WarningCode.DEAD_CODE, 36, 5), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 39, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 55, 1), + error(WarningCode.deadCode, 36, 5), + error(StaticWarningCode.deadNullAwareExpression, 39, 2), + error(WarningCode.unusedLocalVariable, 55, 1), ], ); } @@ -5400,15 +5234,14 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 36, 1), + error(WarningCode.unusedLocalVariable, 36, 1), error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 40, 1, ), - error(WarningCode.DEAD_CODE, 42, 5), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 45, 2), + error(WarningCode.deadCode, 42, 5), + error(StaticWarningCode.deadNullAwareExpression, 45, 2), ], ); @@ -5441,10 +5274,10 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 92, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 96, 5), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 117, 7), - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CLOSURE, 214, 4), + error(WarningCode.unusedLocalVariable, 92, 1), + error(CompileTimeErrorCode.invalidAssignment, 96, 5), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 117, 7), + error(CompileTimeErrorCode.returnOfInvalidTypeFromClosure, 214, 4), ], ); } @@ -5463,7 +5296,7 @@ test() { print(a.x + 2); // ok to use in bigger expression } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 58, 1)], + [error(WarningCode.unusedLocalVariable, 58, 1)], ); } @@ -5481,7 +5314,7 @@ test() { print((a.x) + 2); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1)], + [error(WarningCode.unusedLocalVariable, 62, 1)], ); } @@ -5501,8 +5334,8 @@ test5() { } ''', [ - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 65, 4), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 99, 4), + error(CompileTimeErrorCode.invalidAssignment, 65, 4), + error(CompileTimeErrorCode.invalidAssignment, 99, 4), ], ); } @@ -5560,14 +5393,14 @@ class C { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 29, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 66, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 89, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 112, 2), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 135, 2), + error(WarningCode.unusedLocalVariable, 66, 2), + error(WarningCode.unusedLocalVariable, 89, 2), + error(WarningCode.unusedLocalVariable, 112, 2), + error(WarningCode.unusedLocalVariable, 135, 2), ], ); } @@ -5593,19 +5426,19 @@ class C { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 29, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 58, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 63, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 76, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 81, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 94, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 99, 5), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 141, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 153, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 165, 1), + error(WarningCode.unusedLocalVariable, 58, 2), + error(CompileTimeErrorCode.invalidAssignment, 63, 5), + error(WarningCode.unusedLocalVariable, 76, 2), + error(CompileTimeErrorCode.invalidAssignment, 81, 5), + error(WarningCode.unusedLocalVariable, 94, 2), + error(CompileTimeErrorCode.invalidAssignment, 99, 5), + error(CompileTimeErrorCode.invalidAssignment, 141, 1), + error(CompileTimeErrorCode.invalidAssignment, 153, 1), + error(CompileTimeErrorCode.invalidAssignment, 165, 1), ], ); } @@ -5631,19 +5464,19 @@ class C { ''', [ error( - CompileTimeErrorCode.NOT_INITIALIZED_NON_NULLABLE_INSTANCE_FIELD, + CompileTimeErrorCode.notInitializedNonNullableInstanceField, 29, 1, ), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 56, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 61, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 74, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 79, 5), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 92, 2), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 97, 5), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 137, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 149, 1), - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 161, 1), + error(WarningCode.unusedLocalVariable, 56, 2), + error(CompileTimeErrorCode.invalidAssignment, 61, 5), + error(WarningCode.unusedLocalVariable, 74, 2), + error(CompileTimeErrorCode.invalidAssignment, 79, 5), + error(WarningCode.unusedLocalVariable, 92, 2), + error(CompileTimeErrorCode.invalidAssignment, 97, 5), + error(CompileTimeErrorCode.invalidAssignment, 137, 1), + error(CompileTimeErrorCode.invalidAssignment, 149, 1), + error(CompileTimeErrorCode.invalidAssignment, 161, 1), ], ); } @@ -5656,7 +5489,7 @@ class C { static int f(String s) => null; } ''', - [error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_METHOD, 53, 4)], + [error(CompileTimeErrorCode.returnOfInvalidTypeFromMethod, 53, 4)], ); var v = _resultLibraryElement.topLevelVariables[0]; _assertTypeStr(v.type, 'int Function(String)'); @@ -5670,7 +5503,7 @@ main() { var v = ((x) => 1.0)(() { return 1; }); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5715,7 +5548,7 @@ main() { }); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 42, 1)], + [error(WarningCode.unusedLocalVariable, 42, 1)], ); var v = findElement2.localVar('v'); @@ -5812,7 +5645,7 @@ main() { } List f(T g()) => [g()]; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5830,7 +5663,7 @@ main() { } List f(T g()) => [g()]; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5845,7 +5678,7 @@ main() { } double f(x) => 1.0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5860,7 +5693,7 @@ main() { } double f(x) => 1.0; ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5874,7 +5707,7 @@ main() { var v = [() { return 1; }]; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5889,7 +5722,7 @@ main() { var v = [() { return 1; }]; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1)], + [error(WarningCode.unusedLocalVariable, 32, 1)], ); var v = findElement2.localVar('v'); @@ -5906,7 +5739,7 @@ main() { }]; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5920,7 +5753,7 @@ main() { var v = {1: () { return 1; }}; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5935,7 +5768,7 @@ main() { var v = {1: () { return 1; }}; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 32, 1)], + [error(WarningCode.unusedLocalVariable, 32, 1)], ); var v = findElement2.localVar('v'); @@ -5952,7 +5785,7 @@ main() { }}; } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 15, 1)], + [error(WarningCode.unusedLocalVariable, 15, 1)], ); var v = findElement2.localVar('v'); @@ -5969,7 +5802,7 @@ main() { var v = new C().f(() { return 1; }); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1)], + [error(WarningCode.unusedLocalVariable, 62, 1)], ); var v = findElement2.localVar('v'); @@ -5986,7 +5819,7 @@ main() { var v = new C().f(() { return 1; }); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1)], + [error(WarningCode.unusedLocalVariable, 62, 1)], ); var v = findElement2.localVar('v'); @@ -6006,7 +5839,7 @@ main() { }); } ''', - [error(WarningCode.UNUSED_LOCAL_VARIABLE, 62, 1)], + [error(WarningCode.unusedLocalVariable, 62, 1)], ); var v = findElement2.localVar('v'); @@ -6051,8 +5884,8 @@ main() { } ''', [ - error(WarningCode.UNUSED_LOCAL_VARIABLE, 259, 1), - error(WarningCode.UNUSED_LOCAL_VARIABLE, 297, 1), + error(WarningCode.unusedLocalVariable, 259, 1), + error(WarningCode.unusedLocalVariable, 297, 1), ], ); @@ -6069,7 +5902,7 @@ main() { await resolveTestCode(code); assertErrorsInList( result.diagnostics.where((e) { - return e.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE && + return e.diagnosticCode != WarningCode.unusedLocalVariable && e.diagnosticCode is! TodoCode; }).toList(), expectedErrors, diff --git a/pkg/analyzer/test/src/wolf/ir/ast_to_ir_test.dart b/pkg/analyzer/test/src/wolf/ir/ast_to_ir_test.dart index 90b38b706a5..ba13258cda5 100644 --- a/pkg/analyzer/test/src/wolf/ir/ast_to_ir_test.dart +++ b/pkg/analyzer/test/src/wolf/ir/ast_to_ir_test.dart @@ -1790,8 +1790,7 @@ test() { ''', [ error( - CompileTimeErrorCode - .NOT_ASSIGNED_POTENTIALLY_NON_NULLABLE_LOCAL_VARIABLE, + CompileTimeErrorCode.notAssignedPotentiallyNonNullableLocalVariable, 27, 1, ), diff --git a/pkg/analyzer/test/verify_docs_test.dart b/pkg/analyzer/test/verify_docs_test.dart index 13d3622ca6e..64520de9c55 100644 --- a/pkg/analyzer/test/verify_docs_test.dart +++ b/pkg/analyzer/test/verify_docs_test.dart @@ -163,8 +163,8 @@ $snippet Iterable diagnostics = results.diagnostics.where((error) { DiagnosticCode diagnosticCode = error.diagnosticCode; // TODO(brianwilkerson): . - return diagnosticCode != WarningCode.UNUSED_IMPORT && - diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE && + return diagnosticCode != WarningCode.unusedImport && + diagnosticCode != WarningCode.unusedLocalVariable && !isAllowedLint(error); }); if (diagnostics.isNotEmpty) { diff --git a/pkg/analyzer/tool/messages/generate.dart b/pkg/analyzer/tool/messages/generate.dart index 86e3e5dfa8b..b8f75e61fc2 100644 --- a/pkg/analyzer/tool/messages/generate.dart +++ b/pkg/analyzer/tool/messages/generate.dart @@ -41,7 +41,7 @@ Future main() async { /// This is a temporary flag to allow the codebase to be transitioned to using /// camel-case error constants. TODO(paulberry): once the transition is /// complete, remove this constant. -const _useLowerCamelCaseNames = false; +const _useLowerCamelCaseNames = true; /// A list of all targets generated by this code generator. final List allTargets = _analyzerGeneratedFiles(); diff --git a/pkg/analyzer_cli/test/driver_test.dart b/pkg/analyzer_cli/test/driver_test.dart index 79a09b34b87..d75ae2ecb16 100644 --- a/pkg/analyzer_cli/test/driver_test.dart +++ b/pkg/analyzer_cli/test/driver_test.dart @@ -432,7 +432,7 @@ class OptionsTest extends BaseTest { source: TestSource(), offset: 0, length: 1, - diagnosticCode: WarningCode.UNUSED_LOCAL_VARIABLE, + diagnosticCode: WarningCode.unusedLocalVariable, arguments: [ ['x'], ], @@ -444,7 +444,7 @@ class OptionsTest extends BaseTest { source: TestSource(), offset: 0, length: 1, - diagnosticCode: WarningCode.ASSIGNMENT_OF_DO_NOT_STORE, + diagnosticCode: WarningCode.assignmentOfDoNotStore, arguments: [ ['x'], ], diff --git a/pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart index e7bf15c9592..e86b16b2d0e 100644 --- a/pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart +++ b/pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart @@ -92,7 +92,7 @@ class _TestServerPlugin extends MockServerPlugin with FixesMixin { source: MockSource(), offset: 0, length: 0, - diagnosticCode: CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, + diagnosticCode: CompileTimeErrorCode.awaitInWrongContext, ); var result = MockResolvedUnitResult( lineInfo: LineInfo([0, 20]), errors: [diagnostic]); diff --git a/pkg/analyzer_plugin/test/support/abstract_single_unit.dart b/pkg/analyzer_plugin/test/support/abstract_single_unit.dart index 825e2a0b553..c9150175abe 100644 --- a/pkg/analyzer_plugin/test/support/abstract_single_unit.dart +++ b/pkg/analyzer_plugin/test/support/abstract_single_unit.dart @@ -106,13 +106,13 @@ class AbstractSingleUnitTest extends AbstractContextTest { testUnit = result.unit; if (verifyNoTestUnitErrors) { expect(result.diagnostics.where((d) { - return d.diagnosticCode != WarningCode.DEAD_CODE && - d.diagnosticCode != WarningCode.UNUSED_CATCH_CLAUSE && - d.diagnosticCode != WarningCode.UNUSED_CATCH_STACK && - d.diagnosticCode != WarningCode.UNUSED_ELEMENT && - d.diagnosticCode != WarningCode.UNUSED_FIELD && - d.diagnosticCode != WarningCode.UNUSED_IMPORT && - d.diagnosticCode != WarningCode.UNUSED_LOCAL_VARIABLE; + return d.diagnosticCode != WarningCode.deadCode && + d.diagnosticCode != WarningCode.unusedCatchClause && + d.diagnosticCode != WarningCode.unusedCatchStack && + d.diagnosticCode != WarningCode.unusedElement && + d.diagnosticCode != WarningCode.unusedField && + d.diagnosticCode != WarningCode.unusedImport && + d.diagnosticCode != WarningCode.unusedLocalVariable; }), isEmpty); } findNode = FindNode(testCode, testUnit); diff --git a/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart b/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart index 3b19108c526..15365e9b7f6 100644 --- a/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart +++ b/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart @@ -74,7 +74,7 @@ class AnalyzerConverterTest extends AbstractSingleUnitTest { source: testSource, offset: offset, length: 5, - diagnosticCode: analyzer.CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, + diagnosticCode: analyzer.CompileTimeErrorCode.awaitInWrongContext, contextMessages: contextMessages, ); } diff --git a/pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart b/pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart index 4e07710b53b..03e711b40a5 100644 --- a/pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart +++ b/pkg/analyzer_testing/lib/src/analysis_rule/pub_package_resolution.dart @@ -153,9 +153,9 @@ class PubPackageResolutionTest with MockPackagesMixin, ResourceProviderMixin { /// Error codes that by default should be ignored in test expectations. List get ignoredDiagnosticCodes => [ - WarningCode.UNUSED_ELEMENT, - WarningCode.UNUSED_FIELD, - WarningCode.UNUSED_LOCAL_VARIABLE, + WarningCode.unusedElement, + WarningCode.unusedField, + WarningCode.unusedLocalVariable, ]; /// The path to the root of the external packages. diff --git a/pkg/front_end/test/scanner_cfe_test.dart b/pkg/front_end/test/scanner_cfe_test.dart index 533eb1f33fe..3931630841e 100644 --- a/pkg/front_end/test/scanner_cfe_test.dart +++ b/pkg/front_end/test/scanner_cfe_test.dart @@ -232,7 +232,7 @@ class ScannerTest_Cfe extends ScannerTestBase { expect(token.next!.isEof, isTrue); expect(listener.errors, hasLength(1)); TestError error = listener.errors[0]; - expect(error.diagnosticCode, ScannerErrorCode.MISSING_DIGIT); + expect(error.diagnosticCode, ScannerErrorCode.missingDigit); expect(error.offset, source.length - 1); } @@ -260,8 +260,8 @@ class ScannerTest_Cfe extends ScannerTestBase { expect(openBrace.endToken, same(closeBrace)); expect(openParen2.endToken, same(closeParen2)); listener.assertErrors([ - new TestError(6, ScannerErrorCode.EXPECTED_TOKEN, [')']), - new TestError(7, ScannerErrorCode.EXPECTED_TOKEN, [')']), + new TestError(6, ScannerErrorCode.expectedToken, [')']), + new TestError(7, ScannerErrorCode.expectedToken, [')']), ]); } @@ -304,9 +304,9 @@ class ScannerTest_Cfe extends ScannerTestBase { expect(openBracket.endToken, same(closeBracket)); expect(openParen.endToken, same(closeParen)); listener.assertErrors([ - new TestError(3, ScannerErrorCode.EXPECTED_TOKEN, ['}']), - new TestError(3, ScannerErrorCode.EXPECTED_TOKEN, [']']), - new TestError(3, ScannerErrorCode.EXPECTED_TOKEN, [')']), + new TestError(3, ScannerErrorCode.expectedToken, ['}']), + new TestError(3, ScannerErrorCode.expectedToken, [']']), + new TestError(3, ScannerErrorCode.expectedToken, [')']), ]); } } diff --git a/pkg/front_end/test/scanner_replacement_test.dart b/pkg/front_end/test/scanner_replacement_test.dart index 45d1e641be6..fd783f0bd5d 100644 --- a/pkg/front_end/test/scanner_replacement_test.dart +++ b/pkg/front_end/test/scanner_replacement_test.dart @@ -64,7 +64,7 @@ class ScannerTest_Replacement extends ScannerTestBase { expect(open.isSynthetic, isFalse); expect(close.isSynthetic, isTrue); listener.assertErrors([ - new TestError(1, ScannerErrorCode.EXPECTED_TOKEN, [expectedCloser]), + new TestError(1, ScannerErrorCode.expectedToken, [expectedCloser]), ]); } @@ -83,7 +83,7 @@ class ScannerTest_Replacement extends ScannerTestBase { expect(token.next!.isEof, isTrue); expect(listener.errors, hasLength(1)); TestError error = listener.errors[0]; - expect(error.diagnosticCode, ScannerErrorCode.MISSING_DIGIT); + expect(error.diagnosticCode, ScannerErrorCode.missingDigit); expect(error.offset, source.length - 1); } @@ -157,8 +157,8 @@ class ScannerTest_Replacement extends ScannerTestBase { expect(closeParen2.isSynthetic, isTrue); expect(eof.isEof, isTrue); listener.assertErrors([ - new TestError(6, ScannerErrorCode.EXPECTED_TOKEN, [')']), - new TestError(7, ScannerErrorCode.EXPECTED_TOKEN, [')']), + new TestError(6, ScannerErrorCode.expectedToken, [')']), + new TestError(7, ScannerErrorCode.expectedToken, [')']), ]); } @@ -181,9 +181,9 @@ class ScannerTest_Replacement extends ScannerTestBase { expect(eof.isEof, true); listener.assertErrors([ - new TestError(4, ScannerErrorCode.EXPECTED_TOKEN, [')']), - new TestError(4, ScannerErrorCode.EXPECTED_TOKEN, [']']), - new TestError(4, ScannerErrorCode.EXPECTED_TOKEN, ['}']), + new TestError(4, ScannerErrorCode.expectedToken, [')']), + new TestError(4, ScannerErrorCode.expectedToken, [']']), + new TestError(4, ScannerErrorCode.expectedToken, ['}']), ]); } diff --git a/pkg/front_end/test/scanner_test.dart b/pkg/front_end/test/scanner_test.dart index 75baa4f3394..ba3444eb362 100644 --- a/pkg/front_end/test/scanner_test.dart +++ b/pkg/front_end/test/scanner_test.dart @@ -222,7 +222,7 @@ abstract class ScannerTestBase { } void test_comment_multi_unterminated() { - _assertError(ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, 3, "/* x"); + _assertError(ScannerErrorCode.unterminatedMultiLineComment, 3, "/* x"); } void test_comment_nested() { @@ -263,7 +263,7 @@ abstract class ScannerTestBase { } void test_double_missingDigitInExponent() { - _assertError(ScannerErrorCode.MISSING_DIGIT, 1, "1e"); + _assertError(ScannerErrorCode.missingDigit, 1, "1e"); } void test_double_whole_E() { @@ -323,7 +323,7 @@ abstract class ScannerTestBase { } void test_hexadecimal_missingDigit() { - var token = _assertError(ScannerErrorCode.MISSING_HEX_DIGIT, 5, "a = 0x"); + var token = _assertError(ScannerErrorCode.missingHexDigit, 5, "a = 0x"); expect(token.lexeme, 'a'); token = token.next!; expect(token.lexeme, '='); @@ -333,7 +333,7 @@ abstract class ScannerTestBase { void test_hexadecimal_unexpectedSeparator() { var token = _assertError( - ScannerErrorCode.UNEXPECTED_SEPARATOR_IN_NUMBER, + ScannerErrorCode.unexpectedSeparatorInNumber, // TODO(srawlins): Should be 5? 4, "a = 0x5_"); @@ -350,8 +350,8 @@ abstract class ScannerTestBase { void test_illegalChar_cyrillicLetter_middle() { final identifier = "Shche\u0433lov"; - final token = _assertError( - ScannerErrorCode.ILLEGAL_CHARACTER, 5, identifier, [0x433]); + final token = + _assertError(ScannerErrorCode.illegalCharacter, 5, identifier, [0x433]); expect(token.type, TokenType.IDENTIFIER); expect(token.lexeme, identifier); } @@ -360,8 +360,8 @@ abstract class ScannerTestBase { ErrorListener listener = new ErrorListener(); var tokens = scanWithListener("a = Shche\u0433lov\u0429x;", listener); listener.assertErrors([ - new TestError(9, ScannerErrorCode.ILLEGAL_CHARACTER, [0x433]), - new TestError(13, ScannerErrorCode.ILLEGAL_CHARACTER, [0x429]), + new TestError(9, ScannerErrorCode.illegalCharacter, [0x433]), + new TestError(13, ScannerErrorCode.illegalCharacter, [0x429]), ]); var token = tokens; expect(token.lexeme, 'a'); @@ -376,15 +376,15 @@ abstract class ScannerTestBase { void test_illegalChar_cyrillicLetter_start() { final identifier = "\u0429"; - final token = _assertError( - ScannerErrorCode.ILLEGAL_CHARACTER, 0, identifier, [0x429]); + final token = + _assertError(ScannerErrorCode.illegalCharacter, 0, identifier, [0x429]); expect(token.type, TokenType.IDENTIFIER); expect(token.lexeme, identifier); } void test_illegalChar_cyrillicLetter_start_expression() { var token = _assertError( - ScannerErrorCode.ILLEGAL_CHARACTER, 4, 'a = \u0429;', [0x429]); + ScannerErrorCode.illegalCharacter, 4, 'a = \u0429;', [0x429]); expect(token.lexeme, 'a'); token = token.next!; expect(token.lexeme, '='); @@ -396,11 +396,11 @@ abstract class ScannerTestBase { } void test_illegalChar_nbsp() { - _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 0, "\u00A0", [0xa0]); + _assertError(ScannerErrorCode.illegalCharacter, 0, "\u00A0", [0xa0]); } void test_illegalChar_notLetter() { - _assertError(ScannerErrorCode.ILLEGAL_CHARACTER, 0, "\u0312", [0x312]); + _assertError(ScannerErrorCode.illegalCharacter, 0, "\u0312", [0x312]); } void test_incomplete_string_interpolation() { @@ -411,7 +411,7 @@ abstract class ScannerTestBase { new StringToken(TokenType.IDENTIFIER, "bar", 7), ]; var expectedErrors = [ - new TestError(9, ScannerErrorCode.UNTERMINATED_STRING_LITERAL, null), + new TestError(9, ScannerErrorCode.unterminatedStringLiteral, null), ]; // The scanner inserts synthetic closers expectedTokens.addAll([ @@ -419,7 +419,7 @@ abstract class ScannerTestBase { new SyntheticStringToken(TokenType.STRING, "\"", 10, 0), ]); expectedErrors.addAll([ - new TestError(10, ScannerErrorCode.EXPECTED_TOKEN, ['}']), + new TestError(10, ScannerErrorCode.expectedToken, ['}']), ]); ErrorListener listener = new ErrorListener(); Token token = scanWithListener("\"foo \${bar", listener); @@ -825,7 +825,7 @@ abstract class ScannerTestBase { expect(openBracket.endToken, same(closeBracket)); expect(openParen.endToken, same(closeParen)); listener.assertErrors([ - new TestError(2, ScannerErrorCode.EXPECTED_TOKEN, [')']), + new TestError(2, ScannerErrorCode.expectedToken, [')']), ]); } @@ -848,7 +848,7 @@ abstract class ScannerTestBase { expect(openBracket.endToken, closeBracket); expect(openParen.endToken, closeParen); listener.assertErrors([ - new TestError(2, ScannerErrorCode.EXPECTED_TOKEN, [']']), + new TestError(2, ScannerErrorCode.expectedToken, [']']), ]); } @@ -1053,7 +1053,7 @@ abstract class ScannerTestBase { new StringToken(TokenType.IDENTIFIER, "name", 5), ]; var expectedErrors = [ - new TestError(8, ScannerErrorCode.UNTERMINATED_STRING_LITERAL, null), + new TestError(8, ScannerErrorCode.unterminatedStringLiteral, null), ]; // Fasta inserts synthetic closers. expectedTokens.addAll([ @@ -1061,7 +1061,7 @@ abstract class ScannerTestBase { new SyntheticStringToken(TokenType.STRING, "'''", 9, 0), ]); expectedErrors.addAll([ - new TestError(9, ScannerErrorCode.EXPECTED_TOKEN, ['}']), + new TestError(9, ScannerErrorCode.expectedToken, ['}']), ]); ErrorListener listener = new ErrorListener(); Token token = scanWithListener("'''\${name", listener); @@ -1079,7 +1079,7 @@ abstract class ScannerTestBase { expectedTokens.addAll([ new SyntheticStringToken(TokenType.STRING, "'''", 8, 0), ]); - _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, + _assertErrorAndTokens(ScannerErrorCode.unterminatedStringLiteral, 7, "'''\$name", expectedTokens); } @@ -1098,8 +1098,8 @@ abstract class ScannerTestBase { expectedTokens.addAll([ new SyntheticStringToken(TokenType.STRING, "r'''string'''", 0, 10), ]); - _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 9, - source, expectedTokens); + _assertErrorAndTokens( + ScannerErrorCode.unterminatedStringLiteral, 9, source, expectedTokens); } void test_string_raw_simple_double() { @@ -1117,8 +1117,8 @@ abstract class ScannerTestBase { expectedTokens.addAll([ new SyntheticStringToken(TokenType.STRING, "r'string'", 0, 8), ]); - _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, - source, expectedTokens); + _assertErrorAndTokens( + ScannerErrorCode.unterminatedStringLiteral, 7, source, expectedTokens); } void test_string_raw_simple_unterminated_eol() { @@ -1128,8 +1128,8 @@ abstract class ScannerTestBase { expectedTokens.addAll([ new SyntheticStringToken(TokenType.STRING, "r'string'", 0, 8), ]); - _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7, - source, expectedTokens); + _assertErrorAndTokens( + ScannerErrorCode.unterminatedStringLiteral, 7, source, expectedTokens); } void test_string_simple_double() { @@ -1215,7 +1215,7 @@ abstract class ScannerTestBase { new StringToken(TokenType.STRING, "'", 4), ]); expectedErrors.addAll([ - new TestError(4, ScannerErrorCode.MISSING_IDENTIFIER, null), + new TestError(4, ScannerErrorCode.missingIdentifier, null), ]); ErrorListener listener = new ErrorListener(); Token token = scanWithListener("'\$x\$'", listener); @@ -1233,7 +1233,7 @@ abstract class ScannerTestBase { new SyntheticStringToken(TokenType.IDENTIFIER, "", 2), ]); expectedErrors.addAll([ - new TestError(2, ScannerErrorCode.MISSING_IDENTIFIER, null), + new TestError(2, ScannerErrorCode.missingIdentifier, null), ]); expectedTokens.addAll([ new StringToken(TokenType.STRING, "1'", 2), @@ -1255,8 +1255,8 @@ abstract class ScannerTestBase { expectedTokens.addAll([ new SyntheticStringToken(TokenType.STRING, "'string'", 0, 7), ]); - _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6, - source, expectedTokens); + _assertErrorAndTokens( + ScannerErrorCode.unterminatedStringLiteral, 6, source, expectedTokens); } void test_string_simple_unterminated_eol() { @@ -1266,8 +1266,8 @@ abstract class ScannerTestBase { expectedTokens.addAll([ new SyntheticStringToken(TokenType.STRING, "'string'", 0, 7), ]); - _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6, - source, expectedTokens); + _assertErrorAndTokens( + ScannerErrorCode.unterminatedStringLiteral, 6, source, expectedTokens); } void test_string_simple_unterminated_interpolation_block() { @@ -1277,7 +1277,7 @@ abstract class ScannerTestBase { new StringToken(TokenType.IDENTIFIER, "name", 3), ]; List expectedErrors = [ - new TestError(6, ScannerErrorCode.UNTERMINATED_STRING_LITERAL, null), + new TestError(6, ScannerErrorCode.unterminatedStringLiteral, null), ]; // Fasta inserts synthetic closers. expectedTokens.addAll([ @@ -1285,7 +1285,7 @@ abstract class ScannerTestBase { new SyntheticStringToken(TokenType.STRING, "'", 7, 0), ]); expectedErrors.addAll([ - new TestError(7, ScannerErrorCode.EXPECTED_TOKEN, ['}']), + new TestError(7, ScannerErrorCode.expectedToken, ['}']), ]); ErrorListener listener = new ErrorListener(); Token token = scanWithListener("'\${name", listener); @@ -1303,7 +1303,7 @@ abstract class ScannerTestBase { expectedTokens.addAll([ new SyntheticStringToken(TokenType.STRING, "'", 6, 0), ]); - _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 5, + _assertErrorAndTokens(ScannerErrorCode.unterminatedStringLiteral, 5, "'\$name", expectedTokens); } diff --git a/pkg/linter/test/rules/always_put_control_body_on_new_line_test.dart b/pkg/linter/test/rules/always_put_control_body_on_new_line_test.dart index 747fbc7d443..b1dabd65084 100644 --- a/pkg/linter/test/rules/always_put_control_body_on_new_line_test.dart +++ b/pkg/linter/test/rules/always_put_control_body_on_new_line_test.dart @@ -17,8 +17,8 @@ void main() { class AlwaysPutControlBodyOnNewLineTest extends LintRuleTest { @override List get ignoredDiagnosticCodes => [ - WarningCode.DEAD_CODE, - WarningCode.UNUSED_LOCAL_VARIABLE, + WarningCode.deadCode, + WarningCode.unusedLocalVariable, ]; @override diff --git a/pkg/linter/test/rules/annotate_overrides_test.dart b/pkg/linter/test/rules/annotate_overrides_test.dart index bfcd284c780..ff4e2e5b415 100644 --- a/pkg/linter/test/rules/annotate_overrides_test.dart +++ b/pkg/linter/test/rules/annotate_overrides_test.dart @@ -264,11 +264,7 @@ extension type B(A a) implements A { ''', [ // No lint. - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 69, - 1, - ), + error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 69, 1), ], ); } diff --git a/pkg/linter/test/rules/avoid_empty_else_test.dart b/pkg/linter/test/rules/avoid_empty_else_test.dart index 258c66f7e05..6d795b15c5a 100644 --- a/pkg/linter/test/rules/avoid_empty_else_test.dart +++ b/pkg/linter/test/rules/avoid_empty_else_test.dart @@ -92,8 +92,8 @@ void f() { ''', [ // No lint - error(ParserErrorCode.EXPECTED_TOKEN, 67, 4), - error(ParserErrorCode.MISSING_IDENTIFIER, 72, 1), + error(ParserErrorCode.expectedToken, 67, 4), + error(ParserErrorCode.missingIdentifier, 72, 1), ], ); } diff --git a/pkg/linter/test/rules/avoid_equals_and_hash_code_on_mutable_classes_test.dart b/pkg/linter/test/rules/avoid_equals_and_hash_code_on_mutable_classes_test.dart index f462d1a8727..ff767563b7c 100644 --- a/pkg/linter/test/rules/avoid_equals_and_hash_code_on_mutable_classes_test.dart +++ b/pkg/linter/test/rules/avoid_equals_and_hash_code_on_mutable_classes_test.dart @@ -32,13 +32,9 @@ enum E { } ''', [ + error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 83, 2), error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 83, - 2, - ), - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, + CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 145, 8, ), diff --git a/pkg/linter/test/rules/avoid_final_parameters_test.dart b/pkg/linter/test/rules/avoid_final_parameters_test.dart index a7862ad44bc..161cc8441cd 100644 --- a/pkg/linter/test/rules/avoid_final_parameters_test.dart +++ b/pkg/linter/test/rules/avoid_final_parameters_test.dart @@ -30,7 +30,7 @@ class C { [ // TODO(srawlins): Do not report this lint rule here, as it is redundant // with the Warning. - error(WarningCode.UNNECESSARY_FINAL, 23, 5), + error(WarningCode.unnecessaryFinal, 23, 5), lint(23, 12), ], ); @@ -214,8 +214,8 @@ class B extends A { [ // TODO(srawlins): Do not report this lint rule here, as it is redundant // with the Hint. - error(WarningCode.UNNECESSARY_FINAL, 83, 5), - error(WarningCode.UNNECESSARY_FINAL, 98, 5), + error(WarningCode.unnecessaryFinal, 83, 5), + error(WarningCode.unnecessaryFinal, 98, 5), lint(83, 13), lint(98, 13), ], diff --git a/pkg/linter/test/rules/avoid_function_literals_in_foreach_calls_test.dart b/pkg/linter/test/rules/avoid_function_literals_in_foreach_calls_test.dart index bed35d44f72..f49492daf03 100644 --- a/pkg/linter/test/rules/avoid_function_literals_in_foreach_calls_test.dart +++ b/pkg/linter/test/rules/avoid_function_literals_in_foreach_calls_test.dart @@ -25,7 +25,7 @@ void f(dynamic iter) => iter?.forEach(...); ''', [ // No lint - error(ParserErrorCode.MISSING_IDENTIFIER, 38, 3), + error(ParserErrorCode.missingIdentifier, 38, 3), ], ); } diff --git a/pkg/linter/test/rules/avoid_init_to_null_test.dart b/pkg/linter/test/rules/avoid_init_to_null_test.dart index 7be83c97fa0..03a270127f7 100644 --- a/pkg/linter/test/rules/avoid_init_to_null_test.dart +++ b/pkg/linter/test/rules/avoid_init_to_null_test.dart @@ -129,7 +129,7 @@ class X { ''', [ // No lint - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 20, 4), + error(CompileTimeErrorCode.invalidAssignment, 20, 4), ], ); } @@ -143,7 +143,7 @@ class X { ''', [ // No lint - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 23, 4), + error(CompileTimeErrorCode.invalidAssignment, 23, 4), ], ); } @@ -158,7 +158,7 @@ class X { ''', [ // No lint - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 33, 4), + error(CompileTimeErrorCode.invalidAssignment, 33, 4), ], ); } @@ -170,7 +170,7 @@ int i = null; ''', [ // No lint - error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 8, 4), + error(CompileTimeErrorCode.invalidAssignment, 8, 4), ], ); } diff --git a/pkg/linter/test/rules/avoid_null_checks_in_equality_operators_test.dart b/pkg/linter/test/rules/avoid_null_checks_in_equality_operators_test.dart index 51e2c40036a..c847522a05b 100644 --- a/pkg/linter/test/rules/avoid_null_checks_in_equality_operators_test.dart +++ b/pkg/linter/test/rules/avoid_null_checks_in_equality_operators_test.dart @@ -29,7 +29,7 @@ class C { } } ''', - [error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 52, 2)], + [error(WarningCode.nonNullableEqualsParameter, 52, 2)], ); } @@ -42,7 +42,7 @@ class C { operator ==(dynamic other) => other is C && foo == other.foo; } ''', - [error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 52, 2)], + [error(WarningCode.nonNullableEqualsParameter, 52, 2)], ); } @@ -58,7 +58,7 @@ class C { } } ''', - [error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE, 88, 7)], + [error(WarningCode.unnecessaryNullComparisonNeverNullTrue, 88, 7)], ); } @@ -72,7 +72,7 @@ class C { !(other == null) && other is C && foo == other.foo; } ''', - [error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 52, 2), lint(85, 13)], + [error(WarningCode.nonNullableEqualsParameter, 52, 2), lint(85, 13)], ); } @@ -86,7 +86,7 @@ class C { !((other) == null) && (other) is C && foo == (other.foo); } ''', - [error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 52, 2), lint(85, 15)], + [error(WarningCode.nonNullableEqualsParameter, 52, 2), lint(85, 15)], ); } @@ -108,10 +108,10 @@ class C { } ''', [ - error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 62, 2), + error(WarningCode.nonNullableEqualsParameter, 62, 2), lint(126, 14), - error(WarningCode.DEAD_CODE, 132, 8), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 135, 5), + error(WarningCode.deadCode, 132, 8), + error(StaticWarningCode.deadNullAwareExpression, 135, 5), ], ); } @@ -126,7 +126,7 @@ class C { other != null && other is C && foo == other.foo; } ''', - [error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 52, 2), lint(83, 13)], + [error(WarningCode.nonNullableEqualsParameter, 52, 2), lint(83, 13)], ); } @@ -140,9 +140,9 @@ class C { } ''', [ - error(WarningCode.NON_NULLABLE_EQUALS_PARAMETER, 52, 2), + error(WarningCode.nonNullableEqualsParameter, 52, 2), lint(94, 10), - error(StaticWarningCode.INVALID_NULL_AWARE_OPERATOR, 99, 2), + error(StaticWarningCode.invalidNullAwareOperator, 99, 2), ], ); } diff --git a/pkg/linter/test/rules/avoid_redundant_argument_values_test.dart b/pkg/linter/test/rules/avoid_redundant_argument_values_test.dart index f93214eec42..c3bf05a877c 100644 --- a/pkg/linter/test/rules/avoid_redundant_argument_values_test.dart +++ b/pkg/linter/test/rules/avoid_redundant_argument_values_test.dart @@ -214,8 +214,8 @@ void f() { ''', [ // No lint. - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 30, 5), - error(CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT, 57, 5), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 30, 5), + error(CompileTimeErrorCode.recursiveFactoryRedirect, 57, 5), ], ); } diff --git a/pkg/linter/test/rules/avoid_shadowing_type_parameters_test.dart b/pkg/linter/test/rules/avoid_shadowing_type_parameters_test.dart index 293fe8494f3..67b23afc9b8 100644 --- a/pkg/linter/test/rules/avoid_shadowing_type_parameters_test.dart +++ b/pkg/linter/test/rules/avoid_shadowing_type_parameters_test.dart @@ -212,10 +212,10 @@ typedef Predicate = bool (E element); ''', [ // No lint. - error(CompileTimeErrorCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, 20, 8), - error(CompileTimeErrorCode.NON_TYPE_AS_TYPE_ARGUMENT, 26, 1), - error(ParserErrorCode.EXPECTED_TOKEN, 28, 1), - error(CompileTimeErrorCode.UNDEFINED_CLASS, 29, 1), + error(CompileTimeErrorCode.wrongNumberOfTypeArguments, 20, 8), + error(CompileTimeErrorCode.nonTypeAsTypeArgument, 26, 1), + error(ParserErrorCode.expectedToken, 28, 1), + error(CompileTimeErrorCode.undefinedClass, 29, 1), ], ); } diff --git a/pkg/linter/test/rules/await_only_futures_test.dart b/pkg/linter/test/rules/await_only_futures_test.dart index fb24fa4d6b0..28f97129ad2 100644 --- a/pkg/linter/test/rules/await_only_futures_test.dart +++ b/pkg/linter/test/rules/await_only_futures_test.dart @@ -56,7 +56,7 @@ void f() async { ''', [ // No lint. - error(CompileTimeErrorCode.AWAIT_OF_INCOMPATIBLE_TYPE, 48, 5), + error(CompileTimeErrorCode.awaitOfIncompatibleType, 48, 5), ], ); } @@ -159,7 +159,7 @@ Undefined f() async => await f(); ''', [ // No lint. - error(CompileTimeErrorCode.UNDEFINED_CLASS, 0, 9), + error(CompileTimeErrorCode.undefinedClass, 0, 9), ], ); } diff --git a/pkg/linter/test/rules/cast_nullable_to_non_nullable_test.dart b/pkg/linter/test/rules/cast_nullable_to_non_nullable_test.dart index 6416931acf7..25fcc74a4e2 100644 --- a/pkg/linter/test/rules/cast_nullable_to_non_nullable_test.dart +++ b/pkg/linter/test/rules/cast_nullable_to_non_nullable_test.dart @@ -62,7 +62,7 @@ var a = s! as String; ''', [ // No lint. - error(CompileTimeErrorCode.UNDEFINED_CLASS, 0, 9), + error(CompileTimeErrorCode.undefinedClass, 0, 9), ], ); } diff --git a/pkg/linter/test/rules/combinators_ordering_test.dart b/pkg/linter/test/rules/combinators_ordering_test.dart index a4b0dfa2913..2c2e465fc26 100644 --- a/pkg/linter/test/rules/combinators_ordering_test.dart +++ b/pkg/linter/test/rules/combinators_ordering_test.dart @@ -16,9 +16,7 @@ void main() { @reflectiveTest class CombinatorsOrderingTest extends LintRuleTest { @override - List get ignoredDiagnosticCodes => [ - WarningCode.UNUSED_IMPORT, - ]; + List get ignoredDiagnosticCodes => [WarningCode.unusedImport]; @override String get lintRule => LintNames.combinators_ordering; diff --git a/pkg/linter/test/rules/conditional_uri_does_not_exist_test.dart b/pkg/linter/test/rules/conditional_uri_does_not_exist_test.dart index 8963024da02..dc5cdf7fb27 100644 --- a/pkg/linter/test/rules/conditional_uri_does_not_exist_test.dart +++ b/pkg/linter/test/rules/conditional_uri_does_not_exist_test.dart @@ -37,7 +37,7 @@ import '' [ // The imported library '' can't have a part-of directive, // but that's OK for the purposes of verifying the lint. - error(CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY, 26, 2), + error(CompileTimeErrorCode.importOfNonLibrary, 26, 2), lint(54, 16), lint(139, 16), ], @@ -53,7 +53,7 @@ import '' if (dart.library.async) 'dart:missing_2'; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 2), + error(WarningCode.unusedImport, 7, 2), lint(35, 16, messageContains: 'dart:missing_1'), lint(120, 16, messageContains: 'dart:missing_2'), ], @@ -71,7 +71,7 @@ import '' if (dart.library.async) 'missing_2.dart'; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 2), + error(WarningCode.unusedImport, 7, 2), lint(35, 16, messageContains: 'missing_1.dart'), lint(121, 16, messageContains: 'missing_2.dart'), ], @@ -87,7 +87,7 @@ import '' if (dart.library.io) 'package:foo/missing_2.dart'; ''', [ - error(WarningCode.UNUSED_IMPORT, 7, 2), + error(WarningCode.unusedImport, 7, 2), lint(35, 29, messageContains: 'missing_1.dart'), lint(142, 28, messageContains: 'missing_2.dart'), ], @@ -108,7 +108,7 @@ import '' part 'a.dart'; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 2), lint(35, 16), lint(120, 16)], + [error(WarningCode.unusedImport, 7, 2), lint(35, 16), lint(120, 16)], ); } } diff --git a/pkg/linter/test/rules/deprecated_member_use_from_same_package_test.dart b/pkg/linter/test/rules/deprecated_member_use_from_same_package_test.dart index 551af8c13bd..7274eef5b32 100644 --- a/pkg/linter/test/rules/deprecated_member_use_from_same_package_test.dart +++ b/pkg/linter/test/rules/deprecated_member_use_from_same_package_test.dart @@ -17,9 +17,9 @@ void main() { class DeprecatedMemberUseFromSamePackageTest extends LintRuleTest { @override List get ignoredDiagnosticCodes => [ - HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE, - HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE_WITH_MESSAGE, - WarningCode.UNUSED_LOCAL_VARIABLE, + HintCode.deprecatedMemberUseFromSamePackage, + HintCode.deprecatedMemberUseFromSamePackageWithMessage, + WarningCode.unusedLocalVariable, ]; @override @@ -298,7 +298,7 @@ import 'lib.dart' hide C; ''', [ // No lint. - error(WarningCode.UNUSED_IMPORT, 7, 10), + error(WarningCode.unusedImport, 7, 10), ], ); } @@ -312,7 +312,7 @@ class C {} r''' import 'lib.dart' show C; ''', - [error(WarningCode.UNUSED_IMPORT, 7, 10), lint(23, 1)], + [error(WarningCode.unusedImport, 7, 10), lint(23, 1)], ); } @@ -624,7 +624,7 @@ library a; r''' import 'lib.dart'; ''', - [lint(0, 18), error(WarningCode.UNUSED_IMPORT, 7, 10)], + [lint(0, 18), error(WarningCode.unusedImport, 7, 10)], ); } diff --git a/pkg/linter/test/rules/discarded_futures_test.dart b/pkg/linter/test/rules/discarded_futures_test.dart index cc27c2317ab..2ca500b69a6 100644 --- a/pkg/linter/test/rules/discarded_futures_test.dart +++ b/pkg/linter/test/rules/discarded_futures_test.dart @@ -272,7 +272,7 @@ Future g() async {} ''', [ // No lint. - error(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 13, 5), + error(CompileTimeErrorCode.awaitInWrongContext, 13, 5), ], ); } @@ -290,7 +290,7 @@ class C { ''', [ // No lint. - error(CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT, 27, 5), + error(CompileTimeErrorCode.awaitInWrongContext, 27, 5), ], ); } diff --git a/pkg/linter/test/rules/exhaustive_cases_test.dart b/pkg/linter/test/rules/exhaustive_cases_test.dart index 8b318a792e1..5aa0be3108a 100644 --- a/pkg/linter/test/rules/exhaustive_cases_test.dart +++ b/pkg/linter/test/rules/exhaustive_cases_test.dart @@ -116,7 +116,7 @@ void dep(DeprecatedFields e) { ''', [ lint(449, 10), - error(HintCode.DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE, 599, 6), + error(HintCode.deprecatedMemberUseFromSamePackage, 599, 6), ], ); } @@ -350,7 +350,7 @@ void s(Subclassed e) { test_enum_ok() async { await assertDiagnostics(actualEnumSource, [ - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_STATEMENT, 52, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchStatement, 52, 6), ]); } } @@ -360,7 +360,7 @@ class ExhaustiveCasesTestLanguage219 extends BaseExhaustiveCasesTest with LanguageVersion219Mixin { test_enum_ok() async { await assertDiagnostics(actualEnumSource, [ - error(StaticWarningCode.MISSING_ENUM_CONSTANT_IN_SWITCH, 52, 10), + error(StaticWarningCode.missingEnumConstantInSwitch, 52, 10), ]); } } diff --git a/pkg/linter/test/rules/hash_and_equals_test.dart b/pkg/linter/test/rules/hash_and_equals_test.dart index c9c1c341034..8437f5260ac 100644 --- a/pkg/linter/test/rules/hash_and_equals_test.dart +++ b/pkg/linter/test/rules/hash_and_equals_test.dart @@ -64,11 +64,7 @@ enum A { } ''', [ - error( - CompileTimeErrorCode.ILLEGAL_CONCRETE_ENUM_MEMBER_DECLARATION, - 46, - 2, - ), + error(CompileTimeErrorCode.illegalConcreteEnumMemberDeclaration, 46, 2), // no lint ], ); @@ -119,11 +115,7 @@ extension type E(Object o) { ''', [ // No lint. - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_MEMBER_OF_OBJECT, - 45, - 2, - ), + error(CompileTimeErrorCode.extensionTypeDeclaresMemberOfObject, 45, 2), ], ); } diff --git a/pkg/linter/test/rules/implementation_imports_test.dart b/pkg/linter/test/rules/implementation_imports_test.dart index 072e0557652..3ba85365fe3 100644 --- a/pkg/linter/test/rules/implementation_imports_test.dart +++ b/pkg/linter/test/rules/implementation_imports_test.dart @@ -30,7 +30,7 @@ part of 'a.dart'; import 'package:flutter/src/material/colors.dart'; ''', - [error(WarningCode.UNUSED_IMPORT, 26, 42), lint(26, 42)], + [error(WarningCode.unusedImport, 26, 42), lint(26, 42)], ); } } diff --git a/pkg/linter/test/rules/implicit_reopen_test.dart b/pkg/linter/test/rules/implicit_reopen_test.dart index 3aa18ee6c3d..6d577a15da3 100644 --- a/pkg/linter/test/rules/implicit_reopen_test.dart +++ b/pkg/linter/test/rules/implicit_reopen_test.dart @@ -67,11 +67,7 @@ class C extends A {} ''', [ // No lint. - error( - CompileTimeErrorCode.SUBTYPE_OF_BASE_IS_NOT_BASE_FINAL_OR_SEALED, - 84, - 1, - ), + error(CompileTimeErrorCode.subtypeOfBaseIsNotBaseFinalOrSealed, 84, 1), ], ); } @@ -155,11 +151,7 @@ class C extends S {} ''', [ // No lint. - error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, - 51, - 1, - ), + error(CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 51, 1), ], ); } @@ -182,11 +174,7 @@ class C extends F {} ''', [ // No lint. - error( - CompileTimeErrorCode.SUBTYPE_OF_FINAL_IS_NOT_BASE_FINAL_OR_SEALED, - 24, - 1, - ), + error(CompileTimeErrorCode.subtypeOfFinalIsNotBaseFinalOrSealed, 24, 1), ], ); } @@ -216,7 +204,7 @@ class C extends I {} [ // No lint. error( - CompileTimeErrorCode.INTERFACE_CLASS_EXTENDED_OUTSIDE_OF_LIBRARY, + CompileTimeErrorCode.interfaceClassExtendedOutsideOfLibrary, 34, 1, ), @@ -275,7 +263,7 @@ mixin class M extends I {} [ // No lint. error( - CompileTimeErrorCode.MIXIN_CLASS_DECLARATION_EXTENDS_NOT_OBJECT, + CompileTimeErrorCode.mixinClassDeclarationExtendsNotObject, 44, 1, ), @@ -325,7 +313,7 @@ mixin M extends I {} ''', [ // No lint. - error(ParserErrorCode.EXPECTED_INSTEAD, 30, 7), + error(ParserErrorCode.expectedInstead, 30, 7), ], ); } diff --git a/pkg/linter/test/rules/invalid_case_patterns_test.dart b/pkg/linter/test/rules/invalid_case_patterns_test.dart index 2daec6bbbb7..267f5797f13 100644 --- a/pkg/linter/test/rules/invalid_case_patterns_test.dart +++ b/pkg/linter/test/rules/invalid_case_patterns_test.dart @@ -53,7 +53,7 @@ void f(Object o) { } } ''', - [lint(43, 12), error(WarningCode.DEAD_CODE, 54, 1)], + [lint(43, 12), error(WarningCode.deadCode, 54, 1)], ); } @@ -109,7 +109,7 @@ void f(Object o) { } } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 43, 8), lint(43, 8)], + [error(WarningCode.unnecessaryTypeCheckTrue, 43, 8), lint(43, 8)], ); } @@ -122,7 +122,7 @@ void f(Object o) { } } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_FALSE, 43, 9), lint(43, 9)], + [error(WarningCode.unnecessaryTypeCheckFalse, 43, 9), lint(43, 9)], ); } diff --git a/pkg/linter/test/rules/invalid_runtime_check_with_js_interop_types_test.dart b/pkg/linter/test/rules/invalid_runtime_check_with_js_interop_types_test.dart index 58cc58420d2..9356b0a90a8 100644 --- a/pkg/linter/test/rules/invalid_runtime_check_with_js_interop_types_test.dart +++ b/pkg/linter/test/rules/invalid_runtime_check_with_js_interop_types_test.dart @@ -444,8 +444,8 @@ class InvalidRuntimeCheckWithJSInteropTypesTest extends LintRuleTest { } ''', [ - error(WarningCode.CAST_FROM_NULL_ALWAYS_FAILS, 54, 13), - error(WarningCode.DEAD_CODE, 75, 17), + error(WarningCode.castFromNullAlwaysFails, 54, 13), + error(WarningCode.deadCode, 75, 17), ], ); } @@ -501,7 +501,7 @@ class InvalidRuntimeCheckWithJSInteropTypesTest extends LintRuleTest { null is JSArray?; } ''', - [error(WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, 75, 16)], + [error(WarningCode.unnecessaryTypeCheckTrue, 75, 16)], ); } @@ -1269,12 +1269,12 @@ class InvalidRuntimeCheckWithJSInteropTypesTest extends LintRuleTest { if (typeTest.unnecessary) { if (cast) { lints.add( - error(WarningCode.UNNECESSARY_CAST, code.length, test.length), + error(WarningCode.unnecessaryCast, code.length, test.length), ); } else { lints.add( error( - WarningCode.UNNECESSARY_TYPE_CHECK_TRUE, + WarningCode.unnecessaryTypeCheckTrue, code.length, test.length, ), diff --git a/pkg/linter/test/rules/library_prefixes_test.dart b/pkg/linter/test/rules/library_prefixes_test.dart index b24bd6c676e..df3cc86f3bb 100644 --- a/pkg/linter/test/rules/library_prefixes_test.dart +++ b/pkg/linter/test/rules/library_prefixes_test.dart @@ -17,8 +17,8 @@ void main() { class LibraryPrefixesTest extends LintRuleTest { @override List get ignoredDiagnosticCodes => [ - WarningCode.UNUSED_IMPORT, - WarningCode.UNUSED_LOCAL_VARIABLE, + WarningCode.unusedImport, + WarningCode.unusedLocalVariable, ]; @override diff --git a/pkg/linter/test/rules/library_private_types_in_public_api_test.dart b/pkg/linter/test/rules/library_private_types_in_public_api_test.dart index af38e78c487..cdc4e7cc62e 100644 --- a/pkg/linter/test/rules/library_private_types_in_public_api_test.dart +++ b/pkg/linter/test/rules/library_private_types_in_public_api_test.dart @@ -139,11 +139,7 @@ extension type E(Object o) { ''', [ // No lint. - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 47, - 1, - ), + error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 47, 1), ], ); } diff --git a/pkg/linter/test/rules/literal_only_boolean_expressions_test.dart b/pkg/linter/test/rules/literal_only_boolean_expressions_test.dart index aa07192bd11..3108023c3d6 100644 --- a/pkg/linter/test/rules/literal_only_boolean_expressions_test.dart +++ b/pkg/linter/test/rules/literal_only_boolean_expressions_test.dart @@ -57,7 +57,7 @@ void f() { if (!true) {} } ''', - [lint(13, 13), error(WarningCode.DEAD_CODE, 24, 2)], + [lint(13, 13), error(WarningCode.deadCode, 24, 2)], ); } @@ -120,7 +120,7 @@ void bad() { if (true && false) {} } ''', - [lint(15, 21), error(WarningCode.DEAD_CODE, 34, 2)], + [lint(15, 21), error(WarningCode.deadCode, 34, 2)], ); } @@ -146,7 +146,7 @@ void f() { ''', [ // No lint - error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 24, 5), + error(WarningCode.patternNeverMatchesValueType, 24, 5), ], ); } @@ -229,7 +229,7 @@ void f() { } } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 35, 7), lint(43, 9)], + [error(WarningCode.patternNeverMatchesValueType, 35, 7), lint(43, 9)], ); } @@ -240,7 +240,7 @@ void f() { while (!true) {} } ''', - [lint(13, 16), error(WarningCode.DEAD_CODE, 27, 2)], + [lint(13, 16), error(WarningCode.deadCode, 27, 2)], ); } diff --git a/pkg/linter/test/rules/matching_super_parameters_test.dart b/pkg/linter/test/rules/matching_super_parameters_test.dart index a73bb2143b2..c423560fc8f 100644 --- a/pkg/linter/test/rules/matching_super_parameters_test.dart +++ b/pkg/linter/test/rules/matching_super_parameters_test.dart @@ -218,8 +218,7 @@ class C { [ // No lint. error( - CompileTimeErrorCode - .SUPER_FORMAL_PARAMETER_WITHOUT_ASSOCIATED_POSITIONAL, + CompileTimeErrorCode.superFormalParameterWithoutAssociatedPositional, 79, 1, ), diff --git a/pkg/linter/test/rules/missing_whitespace_between_adjacent_strings_test.dart b/pkg/linter/test/rules/missing_whitespace_between_adjacent_strings_test.dart index 8bbd8b47967..504046997f5 100644 --- a/pkg/linter/test/rules/missing_whitespace_between_adjacent_strings_test.dart +++ b/pkg/linter/test/rules/missing_whitespace_between_adjacent_strings_test.dart @@ -39,7 +39,7 @@ void f() { ''', [ // No lint - error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 17, 10), + error(CompileTimeErrorCode.newWithNonType, 17, 10), ], ); } diff --git a/pkg/linter/test/rules/no_duplicate_case_values_test.dart b/pkg/linter/test/rules/no_duplicate_case_values_test.dart index 0f2198840d0..000799c2a1f 100644 --- a/pkg/linter/test/rules/no_duplicate_case_values_test.dart +++ b/pkg/linter/test/rules/no_duplicate_case_values_test.dart @@ -41,7 +41,7 @@ void switchConstClass() { } } ''', - [error(WarningCode.UNREACHABLE_SWITCH_CASE, 237, 4)], + [error(WarningCode.unreachableSwitchCase, 237, 4)], ); } @@ -68,8 +68,8 @@ void switchEnum() { ''', [ // No lint. - error(WarningCode.UNREACHABLE_SWITCH_CASE, 139, 4), - error(WarningCode.UNREACHABLE_SWITCH_DEFAULT, 155, 7), + error(WarningCode.unreachableSwitchCase, 139, 4), + error(WarningCode.unreachableSwitchDefault, 155, 7), ], ); } @@ -93,8 +93,8 @@ void switchInt() { ''', [ // No lint. - error(WarningCode.UNREACHABLE_SWITCH_CASE, 95, 4), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 107, 4), + error(WarningCode.unreachableSwitchCase, 95, 4), + error(WarningCode.unreachableSwitchCase, 107, 4), ], ); } @@ -118,10 +118,10 @@ void switchString() { ''', [ // No lint. - error(WarningCode.UNREACHABLE_SWITCH_CASE, 115, 4), - error(ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY, 122, 1), - error(WarningCode.UNREACHABLE_SWITCH_CASE, 131, 4), - error(ParserErrorCode.INVALID_CONSTANT_PATTERN_BINARY, 153, 1), + error(WarningCode.unreachableSwitchCase, 115, 4), + error(ParserErrorCode.invalidConstantPatternBinary, 122, 1), + error(WarningCode.unreachableSwitchCase, 131, 4), + error(ParserErrorCode.invalidConstantPatternBinary, 153, 1), ], ); } diff --git a/pkg/linter/test/rules/no_leading_underscores_for_library_prefixes_test.dart b/pkg/linter/test/rules/no_leading_underscores_for_library_prefixes_test.dart index e0e1cb9e742..8a18c23bfa2 100644 --- a/pkg/linter/test/rules/no_leading_underscores_for_library_prefixes_test.dart +++ b/pkg/linter/test/rules/no_leading_underscores_for_library_prefixes_test.dart @@ -17,8 +17,8 @@ void main() { class NoLeadingUnderscoresForLibraryPrefixesTest extends LintRuleTest { @override List get ignoredDiagnosticCodes => [ - WarningCode.UNUSED_IMPORT, - WarningCode.UNUSED_LOCAL_VARIABLE, + WarningCode.unusedImport, + WarningCode.unusedLocalVariable, ]; @override diff --git a/pkg/linter/test/rules/no_leading_underscores_for_local_identifiers_test.dart b/pkg/linter/test/rules/no_leading_underscores_for_local_identifiers_test.dart index 3bad2a1896c..074f45e4fee 100644 --- a/pkg/linter/test/rules/no_leading_underscores_for_local_identifiers_test.dart +++ b/pkg/linter/test/rules/no_leading_underscores_for_local_identifiers_test.dart @@ -17,7 +17,7 @@ void main() { class NoLeadingUnderscoresForLocalIdentifiersTest extends LintRuleTest { @override List get ignoredDiagnosticCodes => [ - WarningCode.UNUSED_CATCH_STACK, + WarningCode.unusedCatchStack, ...super.ignoredDiagnosticCodes, ]; diff --git a/pkg/linter/test/rules/non_constant_identifier_names_test.dart b/pkg/linter/test/rules/non_constant_identifier_names_test.dart index 58066b75812..73fdcd2bf75 100644 --- a/pkg/linter/test/rules/non_constant_identifier_names_test.dart +++ b/pkg/linter/test/rules/non_constant_identifier_names_test.dart @@ -166,7 +166,7 @@ var r = (a: 1, a: 2); ''', [ // No Lint. - error(CompileTimeErrorCode.DUPLICATE_FIELD_NAME, 15, 1), + error(CompileTimeErrorCode.duplicateFieldName, 15, 1), ], ); } @@ -179,7 +179,7 @@ var a = (hashCode: 1); ''', [ // No Lint. - error(CompileTimeErrorCode.INVALID_FIELD_NAME_FROM_OBJECT, 9, 8), + error(CompileTimeErrorCode.invalidFieldNameFromObject, 9, 8), ], ); } @@ -192,7 +192,7 @@ var r = (0, $1: 2); ''', [ // No Lint. - error(CompileTimeErrorCode.INVALID_FIELD_NAME_POSITIONAL, 12, 2), + error(CompileTimeErrorCode.invalidFieldNamePositional, 12, 2), ], ); } @@ -205,7 +205,7 @@ var a = (_x: 1); ''', [ // No Lint. - error(CompileTimeErrorCode.INVALID_FIELD_NAME_PRIVATE, 9, 2), + error(CompileTimeErrorCode.invalidFieldNamePrivate, 9, 2), ], ); } @@ -433,7 +433,7 @@ f() { } catch(__, ___) {} } ''', - [lint(24, 2), error(WarningCode.UNUSED_CATCH_STACK, 28, 3), lint(28, 3)], + [lint(24, 2), error(WarningCode.unusedCatchStack, 28, 3), lint(28, 3)], ); } @@ -689,9 +689,9 @@ C; ''', [ // No lint - error(ParserErrorCode.MISSING_FUNCTION_PARAMETERS, 15, 1), - error(CompileTimeErrorCode.DUPLICATE_DEFINITION, 15, 1), - error(ParserErrorCode.MISSING_FUNCTION_BODY, 21, 1), + error(ParserErrorCode.missingFunctionParameters, 15, 1), + error(CompileTimeErrorCode.duplicateDefinition, 15, 1), + error(ParserErrorCode.missingFunctionBody, 21, 1), ], ); } diff --git a/pkg/linter/test/rules/null_check_on_nullable_type_parameter_test.dart b/pkg/linter/test/rules/null_check_on_nullable_type_parameter_test.dart index cc5d74e3b03..4e19dd6c4a0 100644 --- a/pkg/linter/test/rules/null_check_on_nullable_type_parameter_test.dart +++ b/pkg/linter/test/rules/null_check_on_nullable_type_parameter_test.dart @@ -185,7 +185,7 @@ f(T? x){ } } ''', - [lint(40, 1), error(WarningCode.DEAD_CODE, 42, 9), lint(50, 1)], + [lint(40, 1), error(WarningCode.deadCode, 42, 9), lint(50, 1)], ); } diff --git a/pkg/linter/test/rules/null_closures_test.dart b/pkg/linter/test/rules/null_closures_test.dart index affe4ce8f93..04e6b4209c2 100644 --- a/pkg/linter/test/rules/null_closures_test.dart +++ b/pkg/linter/test/rules/null_closures_test.dart @@ -122,14 +122,10 @@ void test_cycle() { ''', [ // No lint - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 41, 1), - error( - CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, - 41, - 1, - ), - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 81, 4), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 41, 1), + error(CompileTimeErrorCode.noDefaultSuperConstructorImplicit, 41, 1), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 81, 4), ], ); } diff --git a/pkg/linter/test/rules/overridden_fields_test.dart b/pkg/linter/test/rules/overridden_fields_test.dart index 11bf327fd08..1d65e6b0a0c 100644 --- a/pkg/linter/test/rules/overridden_fields_test.dart +++ b/pkg/linter/test/rules/overridden_fields_test.dart @@ -78,7 +78,7 @@ class B extends A { int x = 9; } ''', - [error(CompileTimeErrorCode.CONFLICTING_FIELD_AND_METHOD, 55, 1)], + [error(CompileTimeErrorCode.conflictingFieldAndMethod, 55, 1)], ); } @@ -302,18 +302,18 @@ class GC34 extends GC33 { } ''', [ - error(WarningCode.OVERRIDE_ON_NON_OVERRIDING_FIELD, 120, 1), + error(WarningCode.overrideOnNonOverridingField, 120, 1), lint(127, 5), lint(194, 9), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 273, 4), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 273, 4), lint(301, 9), lint(343, 5), lint(418, 9), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 472, 4), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 472, 4), lint(500, 9), lint(542, 5), lint(617, 9), - error(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, 751, 4), + error(CompileTimeErrorCode.mixinInheritsFromNotObject, 751, 4), lint(779, 9), lint(821, 4), lint(883, 1), @@ -391,8 +391,8 @@ class B extends A { ''', [ // No lint - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 6, 1), - error(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE, 27, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 6, 1), + error(CompileTimeErrorCode.recursiveInterfaceInheritance, 27, 1), ], ); } diff --git a/pkg/linter/test/rules/parameter_assignments_test.dart b/pkg/linter/test/rules/parameter_assignments_test.dart index 4d41894e7b3..ee20f96e398 100644 --- a/pkg/linter/test/rules/parameter_assignments_test.dart +++ b/pkg/linter/test/rules/parameter_assignments_test.dart @@ -50,7 +50,7 @@ void f([int? _]) { ''', [ // No lint. - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 21, 1), + error(CompileTimeErrorCode.undefinedIdentifier, 21, 1), ], ); } @@ -149,9 +149,9 @@ void f([int? optional]) { } ''', [ - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 59, 2), + error(StaticWarningCode.deadNullAwareExpression, 59, 2), lint(46, 15), - error(WarningCode.DEAD_CODE, 59, 3), + error(WarningCode.deadCode, 59, 3), ], ); } @@ -306,7 +306,7 @@ void f([int p = 42]) { p ??= 8; } ''', - [lint(65, 7), error(WarningCode.DEAD_CODE, 71, 2)], + [lint(65, 7), error(WarningCode.deadCode, 71, 2)], ); } @@ -318,7 +318,7 @@ void f({int p = 42}) { p ??= 8; } ''', - [lint(65, 7), error(WarningCode.DEAD_CODE, 71, 2)], + [lint(65, 7), error(WarningCode.deadCode, 71, 2)], ); } @@ -347,7 +347,7 @@ void f([int? p]) { p ??= 16; } ''', - [lint(72, 8), error(WarningCode.DEAD_CODE, 78, 3)], + [lint(72, 8), error(WarningCode.deadCode, 78, 3)], ); } diff --git a/pkg/linter/test/rules/prefer_asserts_in_initializer_lists_test.dart b/pkg/linter/test/rules/prefer_asserts_in_initializer_lists_test.dart index e5c15c95118..5848ecfb015 100644 --- a/pkg/linter/test/rules/prefer_asserts_in_initializer_lists_test.dart +++ b/pkg/linter/test/rules/prefer_asserts_in_initializer_lists_test.dart @@ -331,7 +331,7 @@ class A { ''', [ // No lint - error(CompileTimeErrorCode.NON_BOOL_EXPRESSION, 40, 50), + error(CompileTimeErrorCode.nonBoolExpression, 40, 50), ], ); } diff --git a/pkg/linter/test/rules/prefer_collection_literals_test.dart b/pkg/linter/test/rules/prefer_collection_literals_test.dart index 0c87c498218..98a370dc0b2 100644 --- a/pkg/linter/test/rules/prefer_collection_literals_test.dart +++ b/pkg/linter/test/rules/prefer_collection_literals_test.dart @@ -548,7 +548,7 @@ void f() { ''', [ // No lints. - error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 40, 15), + error(CompileTimeErrorCode.undefinedFunction, 40, 15), ], ); } diff --git a/pkg/linter/test/rules/prefer_const_constructors_in_immutables_test.dart b/pkg/linter/test/rules/prefer_const_constructors_in_immutables_test.dart index daf34d879b1..b412aef6759 100644 --- a/pkg/linter/test/rules/prefer_const_constructors_in_immutables_test.dart +++ b/pkg/linter/test/rules/prefer_const_constructors_in_immutables_test.dart @@ -403,7 +403,7 @@ class B extends A { ''', [ error( - CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, + CompileTimeErrorCode.undefinedConstructorInInitializerDefault, 99, 1, ), @@ -438,11 +438,7 @@ class F { ''', [ // No lint - error( - CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_CONSTRUCTOR, - 75, - 4, - ), + error(CompileTimeErrorCode.returnOfInvalidTypeFromConstructor, 75, 4), ], ); } diff --git a/pkg/linter/test/rules/prefer_const_constructors_test.dart b/pkg/linter/test/rules/prefer_const_constructors_test.dart index 8634ff641bb..202976006c3 100644 --- a/pkg/linter/test/rules/prefer_const_constructors_test.dart +++ b/pkg/linter/test/rules/prefer_const_constructors_test.dart @@ -391,7 +391,7 @@ K k() { ''', [ // No lint - error(WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, 90, 3), + error(WarningCode.nonConstCallToLiteralConstructor, 90, 3), ], ); } @@ -413,7 +413,7 @@ K k() { ''', [ // No lint - error(WarningCode.NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR, 88, 6), + error(WarningCode.nonConstCallToLiteralConstructor, 88, 6), ], ); } diff --git a/pkg/linter/test/rules/prefer_const_literals_to_create_immutables_test.dart b/pkg/linter/test/rules/prefer_const_literals_to_create_immutables_test.dart index 053f4baa4e3..2983abe626c 100644 --- a/pkg/linter/test/rules/prefer_const_literals_to_create_immutables_test.dart +++ b/pkg/linter/test/rules/prefer_const_literals_to_create_immutables_test.dart @@ -256,7 +256,7 @@ final k = K( ''', [ // No lint - error(CompileTimeErrorCode.MISSING_REQUIRED_ARGUMENT, 178, 1), + error(CompileTimeErrorCode.missingRequiredArgument, 178, 1), ], ); } @@ -282,7 +282,7 @@ var e1 = new B([]); // OK ''', [ // No lint - error(CompileTimeErrorCode.NEW_WITH_NON_TYPE, 13, 1), + error(CompileTimeErrorCode.newWithNonType, 13, 1), ], ); } diff --git a/pkg/linter/test/rules/prefer_contains_test.dart b/pkg/linter/test/rules/prefer_contains_test.dart index fe7099ad1af..29d05df8302 100644 --- a/pkg/linter/test/rules/prefer_contains_test.dart +++ b/pkg/linter/test/rules/prefer_contains_test.dart @@ -28,7 +28,7 @@ condition() { ''', [ // No lint - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 77, 3), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 77, 3), ], ); } @@ -497,7 +497,7 @@ bool f>(T list) => r''' bool le3 = ([].indexOf(1) as int) > -1; ''', - [lint(11, 27), error(WarningCode.UNNECESSARY_CAST, 12, 20)], + [lint(11, 27), error(WarningCode.unnecessaryCast, 12, 20)], ); } diff --git a/pkg/linter/test/rules/prefer_final_fields_test.dart b/pkg/linter/test/rules/prefer_final_fields_test.dart index a094eeffadd..43d9c401373 100644 --- a/pkg/linter/test/rules/prefer_final_fields_test.dart +++ b/pkg/linter/test/rules/prefer_final_fields_test.dart @@ -27,11 +27,7 @@ extension type E(Object o) { ''', [ // No Lint. - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 35, - 2, - ), + error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 35, 2), ], ); } @@ -153,7 +149,7 @@ enum A { ''', [ // No Lint. - error(CompileTimeErrorCode.NON_FINAL_FIELD_IN_ENUM, 24, 2), + error(CompileTimeErrorCode.nonFinalFieldInEnum, 24, 2), ], ); } diff --git a/pkg/linter/test/rules/prefer_final_locals_test.dart b/pkg/linter/test/rules/prefer_final_locals_test.dart index 65e46094412..a91df6cd3a8 100644 --- a/pkg/linter/test/rules/prefer_final_locals_test.dart +++ b/pkg/linter/test/rules/prefer_final_locals_test.dart @@ -607,7 +607,7 @@ f() { ''', [ // No lint. - error(WarningCode.UNNECESSARY_WILDCARD_PATTERN, 79, 5), + error(WarningCode.unnecessaryWildcardPattern, 79, 5), ], ); } diff --git a/pkg/linter/test/rules/prefer_final_parameters_test.dart b/pkg/linter/test/rules/prefer_final_parameters_test.dart index 6c03b350d6e..dbf9d408072 100644 --- a/pkg/linter/test/rules/prefer_final_parameters_test.dart +++ b/pkg/linter/test/rules/prefer_final_parameters_test.dart @@ -339,7 +339,7 @@ void f({final String? _}) { } [ // No lint. // https://github.com/dart-lang/language/blob/main/working/wildcards/feature-specification.md#declarations-that-are-capable-of-declaring-a-wildcard - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 22, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 22, 1), ], ); } @@ -371,7 +371,7 @@ void f({required String _}) { } [ // No lint. // https://github.com/dart-lang/language/blob/main/working/wildcards/feature-specification.md#declarations-that-are-capable-of-declaring-a-wildcard - error(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, 24, 1), + error(CompileTimeErrorCode.privateOptionalParameter, 24, 1), ], ); } diff --git a/pkg/linter/test/rules/prefer_generic_function_type_aliases_test.dart b/pkg/linter/test/rules/prefer_generic_function_type_aliases_test.dart index 5ab8e3ec958..a1a6173526e 100644 --- a/pkg/linter/test/rules/prefer_generic_function_type_aliases_test.dart +++ b/pkg/linter/test/rules/prefer_generic_function_type_aliases_test.dart @@ -62,8 +62,8 @@ typedef Cb2 ''', [ // No lint - error(ParserErrorCode.EXPECTED_TOKEN, 8, 3), - error(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, 12, 0), + error(ParserErrorCode.expectedToken, 8, 3), + error(ParserErrorCode.missingTypedefParameters, 12, 0), ], ); } diff --git a/pkg/linter/test/rules/prefer_is_empty_test.dart b/pkg/linter/test/rules/prefer_is_empty_test.dart index 0d3cd494510..76215daf2ad 100644 --- a/pkg/linter/test/rules/prefer_is_empty_test.dart +++ b/pkg/linter/test/rules/prefer_is_empty_test.dart @@ -32,7 +32,7 @@ var x = i.length != 0; r''' var x = ([].length as int) > 0; ''', - [lint(8, 22), error(WarningCode.UNNECESSARY_CAST, 9, 16)], + [lint(8, 22), error(WarningCode.unnecessaryCast, 9, 16)], ); } diff --git a/pkg/linter/test/rules/prefer_spread_collections_test.dart b/pkg/linter/test/rules/prefer_spread_collections_test.dart index b7d9902706d..e928e9f18d9 100644 --- a/pkg/linter/test/rules/prefer_spread_collections_test.dart +++ b/pkg/linter/test/rules/prefer_spread_collections_test.dart @@ -30,7 +30,7 @@ const cc = []..addAll(thangs); [ // No lint error( - CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, + CompileTimeErrorCode.constInitializedWithNonConstantValue, 30, 18, ), diff --git a/pkg/linter/test/rules/prefer_void_to_null_test.dart b/pkg/linter/test/rules/prefer_void_to_null_test.dart index 0c4c6221db6..51807dce2b8 100644 --- a/pkg/linter/test/rules/prefer_void_to_null_test.dart +++ b/pkg/linter/test/rules/prefer_void_to_null_test.dart @@ -134,7 +134,7 @@ void f(int a) { } } ''', - [error(WarningCode.PATTERN_NEVER_MATCHES_VALUE_TYPE, 49, 4)], + [error(WarningCode.patternNeverMatchesValueType, 49, 4)], ); } diff --git a/pkg/linter/test/rules/public_member_api_docs_test.dart b/pkg/linter/test/rules/public_member_api_docs_test.dart index 4175b0a9060..6d113f36398 100644 --- a/pkg/linter/test/rules/public_member_api_docs_test.dart +++ b/pkg/linter/test/rules/public_member_api_docs_test.dart @@ -44,11 +44,7 @@ extension type E(int i) { ''', [ // No lint. - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 42, - 1, - ), + error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 42, 1), ], ); } @@ -252,7 +248,7 @@ class C { ''', [ // Technically not in the private API but we can ignore that for testing. - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 35, 8), + error(WarningCode.invalidInternalAnnotation, 35, 8), ], ); } @@ -274,7 +270,7 @@ enum E { ''', [ // Technically not in the private API but we can ignore that for testing. - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 35, 8), + error(WarningCode.invalidInternalAnnotation, 35, 8), ], ); } @@ -294,7 +290,7 @@ extension X on Object { ''', [ // Technically not in the private API but we can ignore that for testing. - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 35, 8), + error(WarningCode.invalidInternalAnnotation, 35, 8), ], ); } @@ -310,7 +306,7 @@ void f() {} ''', [ // Technically not in the private API but we can ignore that for testing. - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 35, 8), + error(WarningCode.invalidInternalAnnotation, 35, 8), ], ); } @@ -330,7 +326,7 @@ mixin M { ''', [ // Technically not in the private API but we can ignore that for testing. - error(WarningCode.INVALID_INTERNAL_ANNOTATION, 35, 8), + error(WarningCode.invalidInternalAnnotation, 35, 8), ], ); } diff --git a/pkg/linter/test/rules/sort_unnamed_constructors_first_test.dart b/pkg/linter/test/rules/sort_unnamed_constructors_first_test.dart index 1d46448409e..cc255c82542 100644 --- a/pkg/linter/test/rules/sort_unnamed_constructors_first_test.dart +++ b/pkg/linter/test/rules/sort_unnamed_constructors_first_test.dart @@ -88,7 +88,7 @@ extension type E(Object o) { ''', [ // No lint. - error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 46, 1), + error(CompileTimeErrorCode.duplicateConstructorDefault, 46, 1), ], ); } diff --git a/pkg/linter/test/rules/strict_top_level_inference_test.dart b/pkg/linter/test/rules/strict_top_level_inference_test.dart index e66d27e17da..bab70747120 100644 --- a/pkg/linter/test/rules/strict_top_level_inference_test.dart +++ b/pkg/linter/test/rules/strict_top_level_inference_test.dart @@ -582,7 +582,7 @@ abstract class C implements I, J { ''', [ // In the presense of this error, we do not report. - error(CompileTimeErrorCode.NO_COMBINED_SUPER_SIGNATURE, 104, 1), + error(CompileTimeErrorCode.noCombinedSuperSignature, 104, 1), ], ); } diff --git a/pkg/linter/test/rules/tighten_type_of_initializing_formals_test.dart b/pkg/linter/test/rules/tighten_type_of_initializing_formals_test.dart index ba1c1847a7b..4820e08aec0 100644 --- a/pkg/linter/test/rules/tighten_type_of_initializing_formals_test.dart +++ b/pkg/linter/test/rules/tighten_type_of_initializing_formals_test.dart @@ -96,8 +96,8 @@ class A { ''', [ // No lint - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE, 53, 7), - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_TRUE, 93, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullTrue, 53, 7), + error(WarningCode.unnecessaryNullComparisonNeverNullTrue, 93, 7), ], ); } diff --git a/pkg/linter/test/rules/type_init_formals_test.dart b/pkg/linter/test/rules/type_init_formals_test.dart index 813d6e3718f..ff5f0d379a6 100644 --- a/pkg/linter/test/rules/type_init_formals_test.dart +++ b/pkg/linter/test/rules/type_init_formals_test.dart @@ -29,7 +29,7 @@ class A { [ // No lint error( - CompileTimeErrorCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, + CompileTimeErrorCode.fieldInitializingFormalNotAssignable, 49, 24, ), @@ -47,7 +47,7 @@ class Invalid { [ // No lint error( - CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD, + CompileTimeErrorCode.initializingFormalForNonExistentField, 26, 10, ), diff --git a/pkg/linter/test/rules/type_literal_in_constant_pattern_test.dart b/pkg/linter/test/rules/type_literal_in_constant_pattern_test.dart index 2afea0e326b..1632e062b82 100644 --- a/pkg/linter/test/rules/type_literal_in_constant_pattern_test.dart +++ b/pkg/linter/test/rules/type_literal_in_constant_pattern_test.dart @@ -32,7 +32,7 @@ void f(Type x) { if (x case 0) {} } ''', - [error(WarningCode.CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE, 30, 1)], + [error(WarningCode.constantPatternNeverMatchesValueType, 30, 1)], ); } diff --git a/pkg/linter/test/rules/unawaited_futures_test.dart b/pkg/linter/test/rules/unawaited_futures_test.dart index eaeb46f0e6e..cdd4dd1deda 100644 --- a/pkg/linter/test/rules/unawaited_futures_test.dart +++ b/pkg/linter/test/rules/unawaited_futures_test.dart @@ -351,7 +351,7 @@ f() async { ''', [ // No lint - error(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, 59, 3), + error(CompileTimeErrorCode.undefinedIdentifier, 59, 3), ], ); } diff --git a/pkg/linter/test/rules/unnecessary_async_test.dart b/pkg/linter/test/rules/unnecessary_async_test.dart index 00ca249cb1a..675631fc03f 100644 --- a/pkg/linter/test/rules/unnecessary_async_test.dart +++ b/pkg/linter/test/rules/unnecessary_async_test.dart @@ -322,7 +322,7 @@ Future? f() async { r''' Future? f() async {} ''', - [error(WarningCode.BODY_MIGHT_COMPLETE_NORMALLY_NULLABLE, 14, 1)], + [error(WarningCode.bodyMightCompleteNormallyNullable, 14, 1)], ); } diff --git a/pkg/linter/test/rules/unnecessary_breaks_test.dart b/pkg/linter/test/rules/unnecessary_breaks_test.dart index 3a06e5c8d55..b56c76c47f4 100644 --- a/pkg/linter/test/rules/unnecessary_breaks_test.dart +++ b/pkg/linter/test/rules/unnecessary_breaks_test.dart @@ -70,7 +70,7 @@ f(bool c) { ''', [ // No lint. - error(WarningCode.DEAD_CODE, 86, 8), + error(WarningCode.deadCode, 86, 8), ], ); } @@ -188,7 +188,7 @@ f(bool c) { ''', [ // No lint. - error(WarningCode.DEAD_CODE, 58, 8), + error(WarningCode.deadCode, 58, 8), ], ); } diff --git a/pkg/linter/test/rules/unnecessary_constructor_name_test.dart b/pkg/linter/test/rules/unnecessary_constructor_name_test.dart index ec02a064a14..4e02e24811f 100644 --- a/pkg/linter/test/rules/unnecessary_constructor_name_test.dart +++ b/pkg/linter/test/rules/unnecessary_constructor_name_test.dart @@ -49,7 +49,7 @@ class A { } ''', [ - error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 19, 5), + error(CompileTimeErrorCode.duplicateConstructorDefault, 19, 5), // A lint should likely not get reported here since we're already // producing a compilation error. ], @@ -73,7 +73,7 @@ extension type E(int i) { ''', [ // No lint. - error(CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, 28, 5), + error(CompileTimeErrorCode.duplicateConstructorDefault, 28, 5), ], ); } diff --git a/pkg/linter/test/rules/unnecessary_null_checks_test.dart b/pkg/linter/test/rules/unnecessary_null_checks_test.dart index 9242cb8ce4f..a514789cfb9 100644 --- a/pkg/linter/test/rules/unnecessary_null_checks_test.dart +++ b/pkg/linter/test/rules/unnecessary_null_checks_test.dart @@ -25,7 +25,7 @@ Future f(int? p, int? i, Future future) async { } ''', [ - error(StaticWarningCode.UNNECESSARY_NON_NULL_ASSERTION, 78, 1), + error(StaticWarningCode.unnecessaryNonNullAssertion, 78, 1), lint(78, 1), ], ); @@ -377,7 +377,7 @@ f6(int? p) { ''', [ // No lint - error(CompileTimeErrorCode.UNDEFINED_FUNCTION, 22, 1), + error(CompileTimeErrorCode.undefinedFunction, 22, 1), ], ); } diff --git a/pkg/linter/test/rules/unnecessary_null_in_if_null_operators_test.dart b/pkg/linter/test/rules/unnecessary_null_in_if_null_operators_test.dart index aec4ab70e08..1e4b6c1f2c5 100644 --- a/pkg/linter/test/rules/unnecessary_null_in_if_null_operators_test.dart +++ b/pkg/linter/test/rules/unnecessary_null_in_if_null_operators_test.dart @@ -25,8 +25,8 @@ void f() { } ''', [ - error(WarningCode.DEAD_CODE, 23, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 26, 1), + error(WarningCode.deadCode, 23, 4), + error(StaticWarningCode.deadNullAwareExpression, 26, 1), ], ); } @@ -50,9 +50,9 @@ void f() { } ''', [ - error(WarningCode.DEAD_CODE, 23, 7), + error(WarningCode.deadCode, 23, 7), lint(26, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 26, 4), + error(StaticWarningCode.deadNullAwareExpression, 26, 4), ], ); } @@ -68,9 +68,9 @@ class C { } ''', [ - error(WarningCode.DEAD_CODE, 32, 7), + error(WarningCode.deadCode, 32, 7), lint(35, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 35, 4), + error(StaticWarningCode.deadNullAwareExpression, 35, 4), lint(53, 4), ], ); @@ -87,8 +87,8 @@ class C { ''', [ // No lint. - error(WarningCode.DEAD_CODE, 32, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 35, 1), + error(WarningCode.deadCode, 32, 4), + error(StaticWarningCode.deadNullAwareExpression, 35, 1), ], ); } @@ -100,9 +100,9 @@ var x = 1 ?? null; var y = null ?? 1; ''', [ - error(WarningCode.DEAD_CODE, 10, 7), + error(WarningCode.deadCode, 10, 7), lint(13, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 13, 4), + error(StaticWarningCode.deadNullAwareExpression, 13, 4), lint(27, 4), ], ); @@ -115,8 +115,8 @@ var x = 1 ?? 1; ''', [ // No lint. - error(WarningCode.DEAD_CODE, 10, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 13, 1), + error(WarningCode.deadCode, 10, 4), + error(StaticWarningCode.deadNullAwareExpression, 13, 1), ], ); } @@ -127,8 +127,8 @@ var x = 1 ?? 1; var x = 1 ?? 1; ''', [ - error(WarningCode.DEAD_CODE, 10, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 13, 1), + error(WarningCode.deadCode, 10, 4), + error(StaticWarningCode.deadNullAwareExpression, 13, 1), ], ); } @@ -148,9 +148,9 @@ var x = null ?? 1; var x = 1 ?? null; ''', [ - error(WarningCode.DEAD_CODE, 10, 7), + error(WarningCode.deadCode, 10, 7), lint(13, 4), - error(StaticWarningCode.DEAD_NULL_AWARE_EXPRESSION, 13, 4), + error(StaticWarningCode.deadNullAwareExpression, 13, 4), ], ); } diff --git a/pkg/linter/test/rules/unnecessary_parenthesis_test.dart b/pkg/linter/test/rules/unnecessary_parenthesis_test.dart index 2a00afac100..25134ec227e 100644 --- a/pkg/linter/test/rules/unnecessary_parenthesis_test.dart +++ b/pkg/linter/test/rules/unnecessary_parenthesis_test.dart @@ -908,7 +908,7 @@ void f() { ''', [ error( - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, 24, 3, ), @@ -927,7 +927,7 @@ void g({required (int,) i}) {} ''', [ error( - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, 18, 3, ), @@ -947,7 +947,7 @@ void g((int,) i) {} ''', [ error( - CompileTimeErrorCode.RECORD_LITERAL_ONE_POSITIONAL_NO_TRAILING_COMMA, + CompileTimeErrorCode.recordLiteralOnePositionalNoTrailingComma, 15, 3, ), diff --git a/pkg/linter/test/rules/unnecessary_string_escapes_test.dart b/pkg/linter/test/rules/unnecessary_string_escapes_test.dart index f8bae3e02c6..b80456e5e55 100644 --- a/pkg/linter/test/rules/unnecessary_string_escapes_test.dart +++ b/pkg/linter/test/rules/unnecessary_string_escapes_test.dart @@ -214,8 +214,8 @@ String unclosedQuote() => '\ ''', [ // Ensure linter does not crash. - error(ParserErrorCode.INVALID_UNICODE_ESCAPE_STARTED, 27, 1), - error(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 27, 1), + error(ParserErrorCode.invalidUnicodeEscapeStarted, 27, 1), + error(ScannerErrorCode.unterminatedStringLiteral, 27, 1), ], ); } diff --git a/pkg/linter/test/rules/unreachable_from_main_test.dart b/pkg/linter/test/rules/unreachable_from_main_test.dart index a2e00d7fe8c..c34a22c229b 100644 --- a/pkg/linter/test/rules/unreachable_from_main_test.dart +++ b/pkg/linter/test/rules/unreachable_from_main_test.dart @@ -1648,7 +1648,7 @@ class B { ''', [ lint(109, 1), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 177, 7), + error(WarningCode.invalidWidgetPreviewApplication, 177, 7), lint(196, 3), ], ); @@ -1683,10 +1683,7 @@ class B { const B(); } ''', - [ - lint(70, 1), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 77, 7), - ], + [lint(70, 1), error(WarningCode.invalidWidgetPreviewApplication, 77, 7)], ); } @@ -1706,7 +1703,7 @@ class B { ''', [ lint(70, 1), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 77, 7), + error(WarningCode.invalidWidgetPreviewApplication, 77, 7), lint(122, 1), ], ); @@ -1736,10 +1733,10 @@ void _f6() {} ''', [ lint(168, 1), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 175, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 218, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 241, 7), - error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 291, 7), + error(WarningCode.invalidWidgetPreviewApplication, 175, 7), + error(WarningCode.invalidWidgetPreviewApplication, 218, 7), + error(WarningCode.invalidWidgetPreviewApplication, 241, 7), + error(WarningCode.invalidWidgetPreviewApplication, 291, 7), ], ); } @@ -1754,7 +1751,7 @@ void main() {} @Preview() void f6() {} ''', - [error(WarningCode.INVALID_WIDGET_PREVIEW_APPLICATION, 65, 7)], + [error(WarningCode.invalidWidgetPreviewApplication, 65, 7)], ); } diff --git a/pkg/linter/test/rules/unrelated_type_equality_checks_test.dart b/pkg/linter/test/rules/unrelated_type_equality_checks_test.dart index e4b5cb607c9..f8e6c3ca463 100644 --- a/pkg/linter/test/rules/unrelated_type_equality_checks_test.dart +++ b/pkg/linter/test/rules/unrelated_type_equality_checks_test.dart @@ -298,8 +298,8 @@ void f() { ''', [ // No lint. - error(WarningCode.UNNECESSARY_NULL_COMPARISON_NEVER_NULL_FALSE, 23, 7), - error(WarningCode.DEAD_CODE, 32, 2), + error(WarningCode.unnecessaryNullComparisonNeverNullFalse, 23, 7), + error(WarningCode.deadCode, 32, 2), ], ); } @@ -324,7 +324,7 @@ String f(int char) { } ''', [ - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 49, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchExpression, 49, 6), lint(69, 10), ], ); @@ -341,7 +341,7 @@ String f(int i) { ''', [ // No lint. - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 27, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchExpression, 27, 6), ], ); } @@ -358,7 +358,7 @@ String f(int char) { } ''', [ - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 49, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchExpression, 49, 6), lint(69, 10), ], ); @@ -375,7 +375,7 @@ String f(String char) { ''', [ // No lint. - error(CompileTimeErrorCode.NON_EXHAUSTIVE_SWITCH_EXPRESSION, 33, 6), + error(CompileTimeErrorCode.nonExhaustiveSwitchExpression, 33, 6), ], ); } diff --git a/pkg/linter/test/rules/use_build_context_synchronously_test.dart b/pkg/linter/test/rules/use_build_context_synchronously_test.dart index 386bc72a8b4..a49d59c0a0f 100644 --- a/pkg/linter/test/rules/use_build_context_synchronously_test.dart +++ b/pkg/linter/test/rules/use_build_context_synchronously_test.dart @@ -2607,7 +2607,7 @@ void foo(BuildContext context) async { [ // Just don't crash when one argument references BuildContext, and not all // positional arguments are given. - error(CompileTimeErrorCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, 95, 36), + error(CompileTimeErrorCode.argumentTypeNotAssignable, 95, 36), ], ); } diff --git a/pkg/linter/test/rules/use_enums_test.dart b/pkg/linter/test/rules/use_enums_test.dart index 9ea3a16a052..0ced68e9eb3 100644 --- a/pkg/linter/test/rules/use_enums_test.dart +++ b/pkg/linter/test/rules/use_enums_test.dart @@ -141,9 +141,9 @@ class _E { ''', [ // No lint. - error(CompileTimeErrorCode.RECURSIVE_CONSTANT_CONSTRUCTOR, 76, 2), + error(CompileTimeErrorCode.recursiveConstantConstructor, 76, 2), // We are reversing the deprecation: This code will remain a `HintCode`. - error(WarningCode.UNUSED_ELEMENT_PARAMETER, 83, 1), + error(WarningCode.unusedElementParameter, 83, 1), ], ); } diff --git a/pkg/linter/test/rules/use_is_even_rather_than_modulo_test.dart b/pkg/linter/test/rules/use_is_even_rather_than_modulo_test.dart index 6834211cbb7..a4e842e6767 100644 --- a/pkg/linter/test/rules/use_is_even_rather_than_modulo_test.dart +++ b/pkg/linter/test/rules/use_is_even_rather_than_modulo_test.dart @@ -113,7 +113,7 @@ bool a = tmp % 2 == 0; ''', [ // No lint - error(CompileTimeErrorCode.UNDEFINED_CLASS, 0, 5), + error(CompileTimeErrorCode.undefinedClass, 0, 5), ], ); } diff --git a/pkg/linter/test/rules/use_late_for_private_fields_and_variables_test.dart b/pkg/linter/test/rules/use_late_for_private_fields_and_variables_test.dart index 8e8f5021374..73a08824fa2 100644 --- a/pkg/linter/test/rules/use_late_for_private_fields_and_variables_test.dart +++ b/pkg/linter/test/rules/use_late_for_private_fields_and_variables_test.dart @@ -26,11 +26,7 @@ extension type E(int i) { ''', [ // No lint. - error( - CompileTimeErrorCode.EXTENSION_TYPE_DECLARES_INSTANCE_FIELD, - 33, - 2, - ), + error(CompileTimeErrorCode.extensionTypeDeclaresInstanceField, 33, 2), ], ); } @@ -120,11 +116,7 @@ class C { ''', [ // No lint. - error( - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - 54, - 2, - ), + error(CompileTimeErrorCode.patternAssignmentNotLocalVariable, 54, 2), ], ); } @@ -141,11 +133,7 @@ m() { ''', [ // No lint. - error( - CompileTimeErrorCode.PATTERN_ASSIGNMENT_NOT_LOCAL_VARIABLE, - 31, - 2, - ), + error(CompileTimeErrorCode.patternAssignmentNotLocalVariable, 31, 2), ], ); } diff --git a/pkg/linter/test/rules/use_null_aware_elements_test.dart b/pkg/linter/test/rules/use_null_aware_elements_test.dart index df8786ed1c8..4010e89d62b 100644 --- a/pkg/linter/test/rules/use_null_aware_elements_test.dart +++ b/pkg/linter/test/rules/use_null_aware_elements_test.dart @@ -32,12 +32,12 @@ List f() { [ // No lints, since `x` is not promotable. error( - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, 84, 1, ), error( - CompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE_NULLABILITY, + CompileTimeErrorCode.listElementTypeNotAssignableNullability, 106, 1, ), diff --git a/pkg/linter/test/rules/use_string_in_part_of_directives_test.dart b/pkg/linter/test/rules/use_string_in_part_of_directives_test.dart index ca154e5ba51..ba89b142e45 100644 --- a/pkg/linter/test/rules/use_string_in_part_of_directives_test.dart +++ b/pkg/linter/test/rules/use_string_in_part_of_directives_test.dart @@ -30,7 +30,7 @@ part '$testFileName'; r''' part of lib; ''', - [error(ParserErrorCode.PART_OF_NAME, 8, 3)], + [error(ParserErrorCode.partOfName, 8, 3)], ); } diff --git a/pkg/linter/test/rules/void_checks_test.dart b/pkg/linter/test/rules/void_checks_test.dart index 6f7e660c77d..f5125035214 100644 --- a/pkg/linter/test/rules/void_checks_test.dart +++ b/pkg/linter/test/rules/void_checks_test.dart @@ -62,7 +62,7 @@ missing_parameter_for_argument() { ''', [ // No lint - error(CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS, 57, 1), + error(CompileTimeErrorCode.extraPositionalArguments, 57, 1), ], ); } @@ -372,7 +372,7 @@ void bug2813() { ''', [ // No lint - error(CompileTimeErrorCode.RETURN_OF_INVALID_TYPE_FROM_FUNCTION, 26, 1), + error(CompileTimeErrorCode.returnOfInvalidTypeFromFunction, 26, 1), ], ); } diff --git a/pkg/linter/test/scope_util_test.dart b/pkg/linter/test/scope_util_test.dart index 5be64fbdde0..cc961321bff 100644 --- a/pkg/linter/test/scope_util_test.dart +++ b/pkg/linter/test/scope_util_test.dart @@ -73,7 +73,7 @@ class B extends A { } } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 8)], + [error(WarningCode.unusedImport, 7, 8)], ); var import = findElement.importFind('package:test/a.dart'); _checkGetterDifferent(import.topSet('foo')); @@ -140,7 +140,7 @@ class B extends A { } } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 8)], + [error(WarningCode.unusedImport, 7, 8)], ); var import = findElement.importFind('package:test/a.dart'); _checkGetterRequested(import.topGet('foo')); @@ -301,7 +301,7 @@ class B extends A { } } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 8)], + [error(WarningCode.unusedImport, 7, 8)], ); var import = findElement.importFind('package:test/a.dart'); _checkMethodRequested(import.topFunction('foo')); @@ -609,7 +609,7 @@ class B extends A { } } ''', - [error(WarningCode.UNUSED_IMPORT, 7, 8)], + [error(WarningCode.unusedImport, 7, 8)], ); var import = findElement.importFind('package:test/a.dart'); _checkSetterRequested(import.topSet('foo'));