Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Unified Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 221483002: Fix for translation of \!= to \!identical(), but use == and \!= for Enum. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/html.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/error.dart
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 9f1019751ca57edd587be6cf87066a4693165d50..ace8cf61bdd7718195c9f024fb4f3b4e40ba6683 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -22,35 +22,35 @@ class ErrorSeverity extends Enum<ErrorSeverity> {
* The severity representing a non-error. This is never used for any error code, but is useful for
* clients.
*/
- static final ErrorSeverity NONE = new ErrorSeverity('NONE', 0, " ", "none");
+ static const ErrorSeverity NONE = const ErrorSeverity('NONE', 0, " ", "none");
/**
* The severity representing an informational level analysis issue.
*/
- static final ErrorSeverity INFO = new ErrorSeverity('INFO', 1, "I", "info");
+ static const ErrorSeverity INFO = const ErrorSeverity('INFO', 1, "I", "info");
/**
* The severity representing a warning. Warnings can become errors if the `-Werror` command
* line flag is specified.
*/
- static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 2, "W", "warning");
+ static const ErrorSeverity WARNING = const ErrorSeverity('WARNING', 2, "W", "warning");
/**
* The severity representing an error.
*/
- static final ErrorSeverity ERROR = new ErrorSeverity('ERROR', 3, "E", "error");
+ static const ErrorSeverity ERROR = const ErrorSeverity('ERROR', 3, "E", "error");
- static final List<ErrorSeverity> values = [NONE, INFO, WARNING, ERROR];
+ static const List<ErrorSeverity> values = const [NONE, INFO, WARNING, ERROR];
/**
* The name of the severity used when producing machine output.
*/
- String machineCode;
+ final String machineCode;
/**
* The name of the severity used when producing readable output.
*/
- String displayName;
+ final String displayName;
/**
* Initialize a newly created severity with the given names.
@@ -58,10 +58,7 @@ class ErrorSeverity extends Enum<ErrorSeverity> {
* @param machineCode the name of the severity used when producing machine output
* @param displayName the name of the severity used when producing readable output
*/
- ErrorSeverity(String name, int ordinal, String machineCode, String displayName) : super(name, ordinal) {
- this.machineCode = machineCode;
- this.displayName = displayName;
- }
+ const ErrorSeverity(String name, int ordinal, this.machineCode, this.displayName) : super(name, ordinal);
/**
* Return the severity constant that represents the greatest severity.
@@ -144,35 +141,35 @@ class BooleanErrorListener implements AnalysisErrorListener {
* The enumeration `AngularCode` defines Angular specific problems.
*/
class AngularCode extends Enum<AngularCode> implements ErrorCode {
- static final AngularCode CANNOT_PARSE_SELECTOR = new AngularCode.con1('CANNOT_PARSE_SELECTOR', 0, "The selector '%s' cannot be parsed");
+ static const AngularCode CANNOT_PARSE_SELECTOR = const AngularCode('CANNOT_PARSE_SELECTOR', 0, "The selector '%s' cannot be parsed");
- static final AngularCode INVALID_PROPERTY_KIND = new AngularCode.con2('INVALID_PROPERTY_KIND', 1, "Unknown property binding kind '%s', use one of the '@', '=>', '=>!' or '<=>'", ErrorSeverity.ERROR);
+ static const AngularCode INVALID_PROPERTY_KIND = const AngularCode('INVALID_PROPERTY_KIND', 1, "Unknown property binding kind '%s', use one of the '@', '=>', '=>!' or '<=>'");
- static final AngularCode INVALID_PROPERTY_FIELD = new AngularCode.con1('INVALID_PROPERTY_FIELD', 2, "Unknown property field '%s'");
+ static const AngularCode INVALID_PROPERTY_FIELD = const AngularCode('INVALID_PROPERTY_FIELD', 2, "Unknown property field '%s'");
- static final AngularCode INVALID_PROPERTY_MAP = new AngularCode.con1('INVALID_PROPERTY_MAP', 3, "Argument 'map' must be a constant map literal");
+ static const AngularCode INVALID_PROPERTY_MAP = const AngularCode('INVALID_PROPERTY_MAP', 3, "Argument 'map' must be a constant map literal");
- static final AngularCode INVALID_PROPERTY_NAME = new AngularCode.con1('INVALID_PROPERTY_NAME', 4, "Property name must be a string literal");
+ static const AngularCode INVALID_PROPERTY_NAME = const AngularCode('INVALID_PROPERTY_NAME', 4, "Property name must be a string literal");
- static final AngularCode INVALID_PROPERTY_SPEC = new AngularCode.con1('INVALID_PROPERTY_SPEC', 5, "Property binding specification must be a string literal");
+ static const AngularCode INVALID_PROPERTY_SPEC = const AngularCode('INVALID_PROPERTY_SPEC', 5, "Property binding specification must be a string literal");
- static final AngularCode INVALID_REPEAT_SYNTAX = new AngularCode.con1('INVALID_REPEAT_SYNTAX', 6, "Expected statement in form '_item_ in _collection_ [tracked by _id_]'");
+ static const AngularCode INVALID_REPEAT_SYNTAX = const AngularCode('INVALID_REPEAT_SYNTAX', 6, "Expected statement in form '_item_ in _collection_ [tracked by _id_]'");
- static final AngularCode INVALID_REPEAT_ITEM_SYNTAX = new AngularCode.con1('INVALID_REPEAT_ITEM_SYNTAX', 7, "Item must by identifier or in '(_key_, _value_)' pair.");
+ static const AngularCode INVALID_REPEAT_ITEM_SYNTAX = const AngularCode('INVALID_REPEAT_ITEM_SYNTAX', 7, "Item must by identifier or in '(_key_, _value_)' pair.");
- static final AngularCode INVALID_URI = new AngularCode.con2('INVALID_URI', 8, "Invalid URI syntax: '%s'", ErrorSeverity.ERROR);
+ static const AngularCode INVALID_URI = const AngularCode('INVALID_URI', 8, "Invalid URI syntax: '%s'");
- static final AngularCode MISSING_FILTER_COLON = new AngularCode.con1('MISSING_FILTER_COLON', 9, "Missing ':' before filter argument");
+ static const AngularCode MISSING_FILTER_COLON = const AngularCode('MISSING_FILTER_COLON', 9, "Missing ':' before filter argument");
- static final AngularCode MISSING_NAME = new AngularCode.con1('MISSING_NAME', 10, "Argument 'name' must be provided");
+ static const AngularCode MISSING_NAME = const AngularCode('MISSING_NAME', 10, "Argument 'name' must be provided");
- static final AngularCode MISSING_PUBLISH_AS = new AngularCode.con1('MISSING_PUBLISH_AS', 11, "Argument 'publishAs' must be provided");
+ static const AngularCode MISSING_PUBLISH_AS = const AngularCode('MISSING_PUBLISH_AS', 11, "Argument 'publishAs' must be provided");
- static final AngularCode MISSING_SELECTOR = new AngularCode.con1('MISSING_SELECTOR', 12, "Argument 'selector' must be provided");
+ static const AngularCode MISSING_SELECTOR = const AngularCode('MISSING_SELECTOR', 12, "Argument 'selector' must be provided");
- static final AngularCode URI_DOES_NOT_EXIST = new AngularCode.con1('URI_DOES_NOT_EXIST', 13, "Target of URI does not exist: '%s'");
+ static const AngularCode URI_DOES_NOT_EXIST = const AngularCode('URI_DOES_NOT_EXIST', 13, "Target of URI does not exist: '%s'");
- static final List<AngularCode> values = [
+ static const List<AngularCode> values = const [
CANNOT_PARSE_SELECTOR,
INVALID_PROPERTY_KIND,
INVALID_PROPERTY_FIELD,
@@ -191,39 +188,20 @@ class AngularCode extends Enum<AngularCode> implements ErrorCode {
/**
* The template used to create the message to be displayed for this error.
*/
- String _message;
-
- /**
- * The severity of the problem.
- */
- ErrorSeverity _severity;
-
- /**
- * Initialize a newly created error code to have the given message.
- *
- * @param message the message template used to create the message to be displayed for the error
- */
- AngularCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, ErrorSeverity.WARNING);
+ final String message;
/**
* Initialize a newly created error code to have the given message.
*
* @param message the message template used to create the message to be displayed for the error
- * @param severity the severity of the problem
*/
- AngularCode.con2(String name, int ordinal, String message, ErrorSeverity severity) : super(name, ordinal) {
- this._message = message;
- this._severity = ErrorSeverity.INFO;
- }
+ const AngularCode(String name, int ordinal, this.message) : super(name, ordinal);
@override
String get correction => null;
@override
- ErrorSeverity get errorSeverity => _severity;
-
- @override
- String get message => _message;
+ ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
@override
ErrorType get type => ErrorType.ANGULAR;
@@ -237,12 +215,12 @@ class ErrorReporter {
/**
* The error listener to which errors will be reported.
*/
- AnalysisErrorListener _errorListener;
+ final AnalysisErrorListener _errorListener;
/**
* The default source to be used when reporting errors.
*/
- Source _defaultSource;
+ final Source _defaultSource;
/**
* The source to be used when reporting errors.
@@ -255,15 +233,13 @@ class ErrorReporter {
* @param errorListener the error listener to which errors will be reported
* @param defaultSource the default source to be used when reporting errors
*/
- ErrorReporter(AnalysisErrorListener errorListener, Source defaultSource) {
- if (errorListener == null) {
+ ErrorReporter(this._errorListener, this._defaultSource) {
+ if (_errorListener == null) {
throw new IllegalArgumentException("An error listener must be provided");
- } else if (defaultSource == null) {
+ } else if (_defaultSource == null) {
throw new IllegalArgumentException("A default source must be provided");
}
- this._errorListener = errorListener;
- this._defaultSource = defaultSource;
- this._source = defaultSource;
+ this._source = _defaultSource;
}
/**
@@ -379,7 +355,7 @@ class AnalysisError {
/**
* The error code associated with the error.
*/
- ErrorCode errorCode;
+ final ErrorCode errorCode;
/**
* The localized error message.
@@ -422,9 +398,7 @@ class AnalysisError {
* @param errorCode the error code to be associated with this error
* @param arguments the arguments used to build the error message
*/
- AnalysisError.con1(Source source, ErrorCode errorCode, List<Object> arguments) {
- this.source = source;
- this.errorCode = errorCode;
+ AnalysisError.con1(this.source, this.errorCode, List<Object> arguments) {
this._message = JavaString.format(errorCode.message, arguments);
}
@@ -437,11 +411,9 @@ class AnalysisError {
* @param errorCode the error code to be associated with this error
* @param arguments the arguments used to build the error message
*/
- AnalysisError.con2(Source source, int offset, int length, ErrorCode errorCode, List<Object> arguments) {
- this.source = source;
+ AnalysisError.con2(this.source, int offset, int length, this.errorCode, List<Object> arguments) {
this._offset = offset;
this._length = length;
- this.errorCode = errorCode;
this._message = JavaString.format(errorCode.message, arguments);
String correctionTemplate = errorCode.correction;
if (correctionTemplate != null) {
@@ -460,7 +432,7 @@ class AnalysisError {
}
AnalysisError other = obj as AnalysisError;
// Quick checks.
- if (errorCode != other.errorCode) {
+ if (!identical(errorCode, other.errorCode)) {
return false;
}
if (_offset != other._offset || _length != other._length) {
@@ -553,11 +525,11 @@ class ErrorProperty extends Enum<ErrorProperty> {
* A property whose value is an array of [ExecutableElement] that should
* be but are not implemented by a concrete class.
*/
- static final ErrorProperty UNIMPLEMENTED_METHODS = new ErrorProperty('UNIMPLEMENTED_METHODS', 0);
+ static const ErrorProperty UNIMPLEMENTED_METHODS = const ErrorProperty('UNIMPLEMENTED_METHODS', 0);
- static final List<ErrorProperty> values = [UNIMPLEMENTED_METHODS];
+ static const List<ErrorProperty> values = const [UNIMPLEMENTED_METHODS];
- ErrorProperty(String name, int ordinal) : super(name, ordinal);
+ const ErrorProperty(String name, int ordinal) : super(name, ordinal);
}
/**
@@ -567,9 +539,9 @@ class TodoCode extends Enum<TodoCode> implements ErrorCode {
/**
* The single enum of TodoCode.
*/
- static final TodoCode TODO = new TodoCode('TODO', 0);
+ static const TodoCode TODO = const TodoCode('TODO', 0);
- static final List<TodoCode> values = [TODO];
+ static const List<TodoCode> values = const [TODO];
/**
* This matches the two common Dart task styles
@@ -586,7 +558,7 @@ class TodoCode extends Enum<TodoCode> implements ErrorCode {
*/
static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|(TODO:?\$))");
- TodoCode(String name, int ordinal) : super(name, ordinal);
+ const TodoCode(String name, int ordinal) : super(name, ordinal);
@override
String get correction => null;
@@ -615,19 +587,19 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
* @param expectedType the name of the expected type
* @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
*/
- static final HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new HintCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 0, StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE.message);
+ static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 0, "The argument type '%s' cannot be assigned to the parameter type '%s'");
/**
* Dead code is code that is never reached, this can happen for instance if a statement follows a
* return statement.
*/
- static final HintCode DEAD_CODE = new HintCode.con1('DEAD_CODE', 1, "Dead code");
+ static const HintCode DEAD_CODE = const HintCode.con1('DEAD_CODE', 1, "Dead code");
/**
* Dead code is code that is never reached. This case covers cases where the user has catch
* clauses after `catch (e)` or `on Object catch (e)`.
*/
- static final HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = new HintCode.con1('DEAD_CODE_CATCH_FOLLOWING_CATCH', 2, "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
+ static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode.con1('DEAD_CODE_CATCH_FOLLOWING_CATCH', 2, "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
/**
* Dead code is code that is never reached. This case covers cases where the user has an on-catch
@@ -636,44 +608,44 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
* @param subtypeName name of the subtype
* @param supertypeName name of the supertype
*/
- static final HintCode DEAD_CODE_ON_CATCH_SUBTYPE = new HintCode.con1('DEAD_CODE_ON_CATCH_SUBTYPE', 3, "Dead code, this on-catch block will never be executed since '%s' is a subtype of '%s'");
+ static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode.con1('DEAD_CODE_ON_CATCH_SUBTYPE', 3, "Dead code, this on-catch block will never be executed since '%s' is a subtype of '%s'");
/**
* Deprecated members should not be invoked or used.
*
* @param memberName the name of the member
*/
- static final HintCode DEPRECATED_MEMBER_USE = new HintCode.con1('DEPRECATED_MEMBER_USE', 4, "'%s' is deprecated");
+ static const HintCode DEPRECATED_MEMBER_USE = const HintCode.con1('DEPRECATED_MEMBER_USE', 4, "'%s' is deprecated");
/**
* Duplicate imports.
*/
- static final HintCode DUPLICATE_IMPORT = new HintCode.con1('DUPLICATE_IMPORT', 5, "Duplicate import");
+ static const HintCode DUPLICATE_IMPORT = const HintCode.con1('DUPLICATE_IMPORT', 5, "Duplicate import");
/**
* Hint to use the ~/ operator.
*/
- static final HintCode DIVISION_OPTIMIZATION = new HintCode.con1('DIVISION_OPTIMIZATION', 6, "The operator x ~/ y is more efficient than (x / y).toInt()");
+ static const HintCode DIVISION_OPTIMIZATION = const HintCode.con1('DIVISION_OPTIMIZATION', 6, "The operator x ~/ y is more efficient than (x / y).toInt()");
/**
* Hint for the `x is double` type checks.
*/
- static final HintCode IS_DOUBLE = new HintCode.con1('IS_DOUBLE', 7, "When compiled to JS, this test might return true when the left hand side is an int");
+ static const HintCode IS_DOUBLE = const HintCode.con1('IS_DOUBLE', 7, "When compiled to JS, this test might return true when the left hand side is an int");
/**
* Hint for the `x is int` type checks.
*/
- static final HintCode IS_INT = new HintCode.con1('IS_INT', 8, "When compiled to JS, this test might return true when the left hand side is a double");
+ static const HintCode IS_INT = const HintCode.con1('IS_INT', 8, "When compiled to JS, this test might return true when the left hand side is a double");
/**
* Hint for the `x is! double` type checks.
*/
- static final HintCode IS_NOT_DOUBLE = new HintCode.con1('IS_NOT_DOUBLE', 9, "When compiled to JS, this test might return false when the left hand side is an int");
+ static const HintCode IS_NOT_DOUBLE = const HintCode.con1('IS_NOT_DOUBLE', 9, "When compiled to JS, this test might return false when the left hand side is an int");
/**
* Hint for the `x is! int` type checks.
*/
- static final HintCode IS_NOT_INT = new HintCode.con1('IS_NOT_INT', 10, "When compiled to JS, this test might return false when the left hand side is a double");
+ static const HintCode IS_NOT_INT = const HintCode.con1('IS_NOT_INT', 10, "When compiled to JS, this test might return false when the left hand side is a double");
/**
* Generate a hint for methods or functions that have a return type, but do not have a non-void
@@ -682,22 +654,22 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
*
* @param returnType the name of the declared return type
*/
- static final HintCode MISSING_RETURN = new HintCode.con2('MISSING_RETURN', 11, "This function declares a return type of '%s', but does not end with a return statement", "Either add a return statement or change the return type to 'void'");
+ static const HintCode MISSING_RETURN = const HintCode.con2('MISSING_RETURN', 11, "This function declares a return type of '%s', but does not end with a return statement", "Either add a return statement or change the return type to 'void'");
/**
* A getter with the override annotation does not override an existing getter.
*/
- static final HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = new HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_GETTER', 12, "Getter does not override an inherited getter");
+ static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_GETTER', 12, "Getter does not override an inherited getter");
/**
* A method with the override annotation does not override an existing method.
*/
- static final HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = new HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_METHOD', 13, "Method does not override an inherited method");
+ static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_METHOD', 13, "Method does not override an inherited method");
/**
* A setter with the override annotation does not override an existing setter.
*/
- static final HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = new HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_SETTER', 14, "Setter does not override an inherited setter");
+ static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode.con1('OVERRIDE_ON_NON_OVERRIDING_SETTER', 14, "Setter does not override an inherited setter");
/**
* It is not in best practice to declare a private method that happens to override the method in a
@@ -708,24 +680,24 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
* @param memberName some private member name
* @param className the class name where the member is overriding the functionality
*/
- static final HintCode OVERRIDDING_PRIVATE_MEMBER = new HintCode.con1('OVERRIDDING_PRIVATE_MEMBER', 15, "The %s '%s' does not override the definition from '%s' because it is private and in a different library");
+ static const HintCode OVERRIDDING_PRIVATE_MEMBER = const HintCode.con1('OVERRIDDING_PRIVATE_MEMBER', 15, "The %s '%s' does not override the definition from '%s' because it is private and in a different library");
/**
* Hint for classes that override equals, but not hashCode.
*
* @param className the name of the current class
*/
- static final HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = new HintCode.con1('OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', 16, "The class '%s' overrides 'operator==', but not 'get hashCode'");
+ static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode.con1('OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', 16, "The class '%s' overrides 'operator==', but not 'get hashCode'");
/**
* Type checks of the type `x is! Null` should be done with `x != null`.
*/
- static final HintCode TYPE_CHECK_IS_NOT_NULL = new HintCode.con1('TYPE_CHECK_IS_NOT_NULL', 17, "Tests for non-null should be done with '!= null'");
+ static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode.con1('TYPE_CHECK_IS_NOT_NULL', 17, "Tests for non-null should be done with '!= null'");
/**
* Type checks of the type `x is Null` should be done with `x == null`.
*/
- static final HintCode TYPE_CHECK_IS_NULL = new HintCode.con1('TYPE_CHECK_IS_NULL', 18, "Tests for null should be done with '== null'");
+ static const HintCode TYPE_CHECK_IS_NULL = const HintCode.con1('TYPE_CHECK_IS_NULL', 18, "Tests for null should be done with '== null'");
/**
* This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_GETTER] or
@@ -737,7 +709,7 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
* @see StaticTypeWarningCode#UNDEFINED_GETTER
* @see StaticWarningCode#UNDEFINED_GETTER
*/
- static final HintCode UNDEFINED_GETTER = new HintCode.con1('UNDEFINED_GETTER', 19, StaticTypeWarningCode.UNDEFINED_GETTER.message);
+ static const HintCode UNDEFINED_GETTER = const HintCode.con1('UNDEFINED_GETTER', 19, "There is no such getter '%s' in '%s'");
/**
* This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_METHOD] would
@@ -747,7 +719,7 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
* @param typeName the resolved type name that the method lookup is happening on
* @see StaticTypeWarningCode#UNDEFINED_METHOD
*/
- static final HintCode UNDEFINED_METHOD = new HintCode.con1('UNDEFINED_METHOD', 20, StaticTypeWarningCode.UNDEFINED_METHOD.message);
+ static const HintCode UNDEFINED_METHOD = const HintCode.con1('UNDEFINED_METHOD', 20, "The method '%s' is not defined for the class '%s'");
/**
* This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_OPERATOR]
@@ -757,7 +729,7 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
* @param enclosingType the name of the enclosing type where the operator is being looked for
* @see StaticTypeWarningCode#UNDEFINED_OPERATOR
*/
- static final HintCode UNDEFINED_OPERATOR = new HintCode.con1('UNDEFINED_OPERATOR', 21, StaticTypeWarningCode.UNDEFINED_OPERATOR.message);
+ static const HintCode UNDEFINED_OPERATOR = const HintCode.con1('UNDEFINED_OPERATOR', 21, "There is no such operator '%s' in '%s'");
/**
* This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_SETTER] or
@@ -769,27 +741,27 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
* @see StaticTypeWarningCode#UNDEFINED_SETTER
* @see StaticWarningCode#UNDEFINED_SETTER
*/
- static final HintCode UNDEFINED_SETTER = new HintCode.con1('UNDEFINED_SETTER', 22, StaticTypeWarningCode.UNDEFINED_SETTER.message);
+ static const HintCode UNDEFINED_SETTER = const HintCode.con1('UNDEFINED_SETTER', 22, "There is no such setter '%s' in '%s'");
/**
* Unnecessary cast.
*/
- static final HintCode UNNECESSARY_CAST = new HintCode.con1('UNNECESSARY_CAST', 23, "Unnecessary cast");
+ static const HintCode UNNECESSARY_CAST = const HintCode.con1('UNNECESSARY_CAST', 23, "Unnecessary cast");
/**
* Unnecessary type checks, the result is always true.
*/
- static final HintCode UNNECESSARY_TYPE_CHECK_FALSE = new HintCode.con1('UNNECESSARY_TYPE_CHECK_FALSE', 24, "Unnecessary type check, the result is always false");
+ static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode.con1('UNNECESSARY_TYPE_CHECK_FALSE', 24, "Unnecessary type check, the result is always false");
/**
* Unnecessary type checks, the result is always false.
*/
- static final HintCode UNNECESSARY_TYPE_CHECK_TRUE = new HintCode.con1('UNNECESSARY_TYPE_CHECK_TRUE', 25, "Unnecessary type check, the result is always true");
+ static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode.con1('UNNECESSARY_TYPE_CHECK_TRUE', 25, "Unnecessary type check, the result is always true");
/**
* Unused imports are imports which are never not used.
*/
- static final HintCode UNUSED_IMPORT = new HintCode.con1('UNUSED_IMPORT', 26, "Unused import");
+ static const HintCode UNUSED_IMPORT = const HintCode.con1('UNUSED_IMPORT', 26, "Unused import");
/**
* Hint for cases where the source expects a method or function to return a non-void result, but
@@ -797,9 +769,9 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
*
* @param name the name of the method or function that returns void
*/
- static final HintCode USE_OF_VOID_RESULT = new HintCode.con1('USE_OF_VOID_RESULT', 27, "The result of '%s' is being used, even though it is declared to be 'void'");
+ static const HintCode USE_OF_VOID_RESULT = const HintCode.con1('USE_OF_VOID_RESULT', 27, "The result of '%s' is being used, even though it is declared to be 'void'");
- static final List<HintCode> values = [
+ static const List<HintCode> values = const [
ARGUMENT_TYPE_NOT_ASSIGNABLE,
DEAD_CODE,
DEAD_CODE_CATCH_FOLLOWING_CATCH,
@@ -832,22 +804,20 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
/**
* The template used to create the message to be displayed for this error.
*/
- String message;
+ final String message;
/**
* The template used to create the correction to be displayed for this error, or `null` if
* there is no correction information for this error.
*/
- String correction3;
+ final String correction;
/**
* Initialize a newly created error code to have the given message.
*
* @param message the message template used to create the message to be displayed for the error
*/
- HintCode.con1(String name, int ordinal, String message) : super(name, ordinal) {
- this.message = message;
- }
+ const HintCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
/**
* Initialize a newly created error code to have the given message and correction.
@@ -855,13 +825,7 @@ class HintCode extends Enum<HintCode> implements ErrorCode {
* @param message the template used to create the message to be displayed for the error
* @param correction the template used to create the correction to be displayed for the error
*/
- HintCode.con2(String name, int ordinal, String message, String correction) : super(name, ordinal) {
- this.message = message;
- this.correction3 = correction;
- }
-
- @override
- String get correction => correction3;
+ const HintCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
@override
ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
@@ -918,49 +882,49 @@ class ErrorType extends Enum<ErrorType> {
/**
* Task (todo) comments in user code.
*/
- static final ErrorType TODO = new ErrorType('TODO', 0, ErrorSeverity.INFO);
+ static const ErrorType TODO = const ErrorType('TODO', 0, ErrorSeverity.INFO);
/**
* Extra analysis run over the code to follow best practices, which are not in the Dart Language
* Specification.
*/
- static final ErrorType HINT = new ErrorType('HINT', 1, ErrorSeverity.INFO);
+ static const ErrorType HINT = const ErrorType('HINT', 1, ErrorSeverity.INFO);
/**
* Compile-time errors are errors that preclude execution. A compile time error must be reported
* by a Dart compiler before the erroneous code is executed.
*/
- static final ErrorType COMPILE_TIME_ERROR = new ErrorType('COMPILE_TIME_ERROR', 2, ErrorSeverity.ERROR);
+ static const ErrorType COMPILE_TIME_ERROR = const ErrorType('COMPILE_TIME_ERROR', 2, ErrorSeverity.ERROR);
/**
* Suggestions made in situations where the user has deviated from recommended pub programming
* practices.
*/
- static final ErrorType PUB_SUGGESTION = new ErrorType('PUB_SUGGESTION', 3, ErrorSeverity.WARNING);
+ static const ErrorType PUB_SUGGESTION = const ErrorType('PUB_SUGGESTION', 3, ErrorSeverity.WARNING);
/**
* Static warnings are those warnings reported by the static checker. They have no effect on
* execution. Static warnings must be provided by Dart compilers used during development.
*/
- static final ErrorType STATIC_WARNING = new ErrorType('STATIC_WARNING', 4, ErrorSeverity.WARNING);
+ static const ErrorType STATIC_WARNING = const ErrorType('STATIC_WARNING', 4, ErrorSeverity.WARNING);
/**
* Many, but not all, static warnings relate to types, in which case they are known as static type
* warnings.
*/
- static final ErrorType STATIC_TYPE_WARNING = new ErrorType('STATIC_TYPE_WARNING', 5, ErrorSeverity.WARNING);
+ static const ErrorType STATIC_TYPE_WARNING = const ErrorType('STATIC_TYPE_WARNING', 5, ErrorSeverity.WARNING);
/**
* Syntactic errors are errors produced as a result of input that does not conform to the grammar.
*/
- static final ErrorType SYNTACTIC_ERROR = new ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
+ static const ErrorType SYNTACTIC_ERROR = const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
/**
* Angular specific semantic problems.
*/
- static final ErrorType ANGULAR = new ErrorType('ANGULAR', 7, ErrorSeverity.INFO);
+ static const ErrorType ANGULAR = const ErrorType('ANGULAR', 7, ErrorSeverity.INFO);
- static final List<ErrorType> values = [
+ static const List<ErrorType> values = const [
TODO,
HINT,
COMPILE_TIME_ERROR,
@@ -973,16 +937,14 @@ class ErrorType extends Enum<ErrorType> {
/**
* The severity of this type of error.
*/
- ErrorSeverity severity;
+ final ErrorSeverity severity;
/**
* Initialize a newly created error type to have the given severity.
*
* @param severity the severity of this type of error
*/
- ErrorType(String name, int ordinal, ErrorSeverity severity) : super(name, ordinal) {
- this.severity = severity;
- }
+ const ErrorType(String name, int ordinal, this.severity) : super(name, ordinal);
String get displayName => name.toLowerCase().replaceAll('_', ' ');
}
@@ -1003,7 +965,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param firstLibraryName the name of the first library that the type is found
* @param secondLibraryName the name of the second library that the type is found
*/
- static final CompileTimeErrorCode AMBIGUOUS_EXPORT = new CompileTimeErrorCode.con1('AMBIGUOUS_EXPORT', 0, "The element '%s' is defined in the libraries '%s' and '%s'");
+ static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCode.con1('AMBIGUOUS_EXPORT', 0, "The element '%s' is defined in the libraries '%s' and '%s'");
/**
* 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does not denote a formal
@@ -1011,57 +973,57 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param the name of the identifier in the argument definition test that is not a parameter
*/
- static final CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = new CompileTimeErrorCode.con1('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 1, "'%s' is not a parameter");
+ static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = const CompileTimeErrorCode.con1('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 1, "'%s' is not a parameter");
/**
* 12.30 Identifier Reference: It is a compile-time error to use a built-in identifier other than
* dynamic as a type annotation.
*/
- static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = new CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE', 2, "The built-in identifier '%s' cannot be as a type");
+ static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE', 2, "The built-in identifier '%s' cannot be as a type");
/**
* 12.30 Identifier Reference: It is a compile-time error if a built-in identifier is used as the
* declared name of a class, type parameter or type alias.
*/
- static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = new CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 3, "The built-in identifier '%s' cannot be used as a type name");
+ static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 3, "The built-in identifier '%s' cannot be used as a type name");
/**
* 12.30 Identifier Reference: It is a compile-time error if a built-in identifier is used as the
* declared name of a class, type parameter or type alias.
*/
- static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = new CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 4, "The built-in identifier '%s' cannot be used as a type alias name");
+ static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 4, "The built-in identifier '%s' cannot be used as a type alias name");
/**
* 12.30 Identifier Reference: It is a compile-time error if a built-in identifier is used as the
* declared name of a class, type parameter or type alias.
*/
- static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = new CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', 5, "The built-in identifier '%s' cannot be used as a type parameter name");
+ static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', 5, "The built-in identifier '%s' cannot be used as a type parameter name");
/**
* 13.9 Switch: It is a compile-time error if the class <i>C</i> implements the operator
* <i>==</i>.
*/
- static final CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = new CompileTimeErrorCode.con1('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 6, "The switch case expression type '%s' cannot override the == operator");
+ static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = const CompileTimeErrorCode.con1('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 6, "The switch case expression type '%s' cannot override the == operator");
/**
* 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise
* an exception.
*/
- static final CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = new CompileTimeErrorCode.con1('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 7, "");
+ static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = const CompileTimeErrorCode.con1('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 7, "");
/**
* 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
* name. This restriction holds regardless of whether the getter is defined explicitly or
* implicitly, or whether the getter or the method are inherited or not.
*/
- static final CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = new CompileTimeErrorCode.con1('CONFLICTING_GETTER_AND_METHOD', 8, "Class '%s' cannot have both getter '%s.%s' and method with the same name");
+ static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const CompileTimeErrorCode.con1('CONFLICTING_GETTER_AND_METHOD', 8, "Class '%s' cannot have both getter '%s.%s' and method with the same name");
/**
* 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
* name. This restriction holds regardless of whether the getter is defined explicitly or
* implicitly, or whether the getter or the method are inherited or not.
*/
- static final CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = new CompileTimeErrorCode.con1('CONFLICTING_METHOD_AND_GETTER', 9, "Class '%s' cannot have both method '%s.%s' and getter with the same name");
+ static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const CompileTimeErrorCode.con1('CONFLICTING_METHOD_AND_GETTER', 9, "Class '%s' cannot have both method '%s.%s' and getter with the same name");
/**
* 7.6 Constructors: A constructor name always begins with the name of its immediately enclosing
@@ -1069,7 +1031,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* compile-time error if <i>id</i> is the name of a member declared in the immediately enclosing
* class.
*/
- static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = new CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 10, "'%s' cannot be used to name a constructor and a field in this class");
+ static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = const CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 10, "'%s' cannot be used to name a constructor and a field in this class");
/**
* 7.6 Constructors: A constructor name always begins with the name of its immediately enclosing
@@ -1077,32 +1039,32 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* compile-time error if <i>id</i> is the name of a member declared in the immediately enclosing
* class.
*/
- static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = new CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 11, "'%s' cannot be used to name a constructor and a method in this class");
+ static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = const CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 11, "'%s' cannot be used to name a constructor and a method in this class");
/**
* 7. Classes: It is a compile time error if a generic class declares a type variable with the
* same name as the class or any of its members or constructors.
*/
- static final CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = new CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_CLASS', 12, "'%s' cannot be used to name a type varaible in a class with the same name");
+ static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_CLASS', 12, "'%s' cannot be used to name a type varaible in a class with the same name");
/**
* 7. Classes: It is a compile time error if a generic class declares a type variable with the
* same name as the class or any of its members or constructors.
*/
- static final CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = new CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', 13, "'%s' cannot be used to name a type varaible and member in this class");
+ static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', 13, "'%s' cannot be used to name a type varaible and member in this class");
/**
* 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
* uncaught exception being thrown.
*/
- static final CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = new CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 14, "'const' constructors cannot throw exceptions");
+ static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 14, "'const' constructors cannot throw exceptions");
/**
* 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in
* the initializer list of a constant constructor must specify a constant constructor of the
* superclass of the immediately enclosing class or a compile-time error occurs.
*/
- static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = new CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 15, "Constant constructor cannot call non-constant super constructor");
+ static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 15, "Constant constructor cannot call non-constant super constructor");
/**
* 7.6.3 Constant Constructors: It is a compile-time error if a constant constructor is declared
@@ -1110,7 +1072,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* The above refers to both locally declared and inherited instance variables.
*/
- static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = new CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 16, "Cannot define the 'const' constructor for a class with non-final fields");
+ static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 16, "Cannot define the 'const' constructor for a class with non-final fields");
/**
* 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not
@@ -1123,32 +1085,32 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param initializerType the name of the type of the initializer expression
* @param fieldType the name of the type of the field
*/
- static final CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = new CompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 17, "The initializer type '%s' cannot be assigned to the field type '%s'");
+ static const CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = const CompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 17, "The initializer type '%s' cannot be assigned to the field type '%s'");
/**
* 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a
* constant variable.
*/
- static final CompileTimeErrorCode CONST_FORMAL_PARAMETER = new CompileTimeErrorCode.con1('CONST_FORMAL_PARAMETER', 18, "Parameters cannot be 'const'");
+ static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeErrorCode.con1('CONST_FORMAL_PARAMETER', 18, "Parameters cannot be 'const'");
/**
* 5 Variables: A constant variable must be initialized to a compile-time constant or a
* compile-time error occurs.
*/
- static final CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = new CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 19, "'const' variables must be constant value");
+ static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 19, "'const' variables must be constant value");
/**
* 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be
* constant.
*/
- static final CompileTimeErrorCode CONST_INSTANCE_FIELD = new CompileTimeErrorCode.con1('CONST_INSTANCE_FIELD', 20, "Only static fields can be declared as 'const'");
+ static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErrorCode.con1('CONST_INSTANCE_FIELD', 20, "Only static fields can be declared as 'const'");
/**
* 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an
* instance of a class that implements the operator <i>==</i> unless the key is a string or
* integer.
*/
- static final CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = new CompileTimeErrorCode.con1('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 21, "The constant map entry key expression type '%s' cannot override the == operator");
+ static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = const CompileTimeErrorCode.con1('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 21, "The constant map entry key expression type '%s' cannot override the == operator");
/**
* 5 Variables: A constant variable must be initialized to a compile-time constant (12.1) or a
@@ -1156,45 +1118,45 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param name the name of the uninitialized final variable
*/
- static final CompileTimeErrorCode CONST_NOT_INITIALIZED = new CompileTimeErrorCode.con1('CONST_NOT_INITIALIZED', 22, "The const variable '%s' must be initialized");
+ static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErrorCode.con1('CONST_NOT_INITIALIZED', 22, "The const variable '%s' must be initialized");
/**
* 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2
* are constant expressions that evaluate to a boolean value.
*/
- static final CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = new CompileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL', 23, "An expression of type 'bool' was expected");
+ static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL', 23, "An expression of type 'bool' was expected");
/**
* 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are
* constant expressions that evaluate to a numeric, string or boolean value or to null.
*/
- static final CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = new CompileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 24, "An expression of type 'bool', 'num', 'String' or 'null' was expected");
+ static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const CompileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 24, "An expression of type 'bool', 'num', 'String' or 'null' was expected");
/**
* 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1
* << e2, where e, e1 and e2 are constant expressions that evaluate to an integer value or to
* null.
*/
- static final CompileTimeErrorCode CONST_EVAL_TYPE_INT = new CompileTimeErrorCode.con1('CONST_EVAL_TYPE_INT', 25, "An expression of type 'int' was expected");
+ static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeErrorCode.con1('CONST_EVAL_TYPE_INT', 25, "An expression of type 'int' was expected");
/**
* 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/
* e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant
* expressions that evaluate to a numeric value or to null..
*/
- static final CompileTimeErrorCode CONST_EVAL_TYPE_NUM = new CompileTimeErrorCode.con1('CONST_EVAL_TYPE_NUM', 26, "An expression of type 'num' was expected");
+ static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeErrorCode.con1('CONST_EVAL_TYPE_NUM', 26, "An expression of type 'num' was expected");
/**
* 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
* uncaught exception being thrown.
*/
- static final CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = new CompileTimeErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 27, "Evaluation of this constant expression causes exception");
+ static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileTimeErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 27, "Evaluation of this constant expression causes exception");
/**
* 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
* uncaught exception being thrown.
*/
- static final CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = new CompileTimeErrorCode.con1('CONST_EVAL_THROWS_IDBZE', 28, "Evaluation of this constant expression throws IntegerDivisionByZeroException");
+ static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeErrorCode.con1('CONST_EVAL_THROWS_IDBZE', 28, "Evaluation of this constant expression throws IntegerDivisionByZeroException");
/**
* 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, &hellip;,
@@ -1207,7 +1169,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
* @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS
*/
- static final CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = new CompileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 29, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
+ static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const CompileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 29, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
/**
* 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip;, a<sub>n</sub>,
@@ -1215,13 +1177,13 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* compile-time error if the type <i>T</i> does not declare a constant constructor with the same
* name as the declaration of <i>T</i>.
*/
- static final CompileTimeErrorCode CONST_WITH_NON_CONST = new CompileTimeErrorCode.con1('CONST_WITH_NON_CONST', 30, "The constructor being called is not a 'const' constructor");
+ static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErrorCode.con1('CONST_WITH_NON_CONST', 30, "The constructor being called is not a 'const' constructor");
/**
* 12.11.2 Const: In all of the above cases, it is a compile-time error if <i>a<sub>i</sub>, 1
* &lt;= i &lt;= n + k</i>, is not a compile-time constant expression.
*/
- static final CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = new CompileTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 31, "Arguments of a constant creation must be constant expressions");
+ static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const CompileTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 31, "Arguments of a constant creation must be constant expressions");
/**
* 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class accessible in the current
@@ -1234,12 +1196,12 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param name the name of the non-type element
*/
- static final CompileTimeErrorCode CONST_WITH_NON_TYPE = new CompileTimeErrorCode.con1('CONST_WITH_NON_TYPE', 32, "The name '%s' is not a class");
+ static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeErrorCode.con1('CONST_WITH_NON_TYPE', 32, "The name '%s' is not a class");
/**
* 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type parameters.
*/
- static final CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = new CompileTimeErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 33, "The constant creation cannot use a type parameter");
+ static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTimeErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 33, "The constant creation cannot use a type parameter");
/**
* 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
@@ -1248,7 +1210,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param typeName the name of the type
* @param constructorName the name of the requested constant constructor
*/
- static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = new CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 34, "The class '%s' does not have a constant constructor '%s'");
+ static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 34, "The class '%s' does not have a constant constructor '%s'");
/**
* 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
@@ -1256,32 +1218,32 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param typeName the name of the type
*/
- static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 35, "The class '%s' does not have a default constant constructor");
+ static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 35, "The class '%s' does not have a default constant constructor");
/**
* 15.3.1 Typedef: It is a compile-time error if any default values are specified in the signature
* of a function type alias.
*/
- static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = new CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 36, "Default values aren't allowed in typedefs");
+ static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 36, "Default values aren't allowed in typedefs");
/**
* 6.2.1 Required Formals: By means of a function signature that names the parameter and describes
* its type as a function type. It is a compile-time error if any default values are specified in
* the signature of such a function type.
*/
- static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = new CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 37, "Default values aren't allowed in function type parameters");
+ static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 37, "Default values aren't allowed in function type parameters");
/**
* 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifies a default value
* for an optional parameter.
*/
- static final CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR = new CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR', 38, "Default values aren't allowed in factory constructors that redirect to another constructor");
+ static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR', 38, "Default values aren't allowed in factory constructors that redirect to another constructor");
/**
* 3.1 Scoping: It is a compile-time error if there is more than one entity with the same name
* declared in the same scope.
*/
- static final CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = new CompileTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 39, "The default constructor is already defined");
+ static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const CompileTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 39, "The default constructor is already defined");
/**
* 3.1 Scoping: It is a compile-time error if there is more than one entity with the same name
@@ -1289,7 +1251,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param duplicateName the name of the duplicate entity
*/
- static final CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = new CompileTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 40, "The constructor with name '%s' is already defined");
+ static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 40, "The constructor with name '%s' is already defined");
/**
* 3.1 Scoping: It is a compile-time error if there is more than one entity with the same name
@@ -1302,7 +1264,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param duplicateName the name of the duplicate entity
*/
- static final CompileTimeErrorCode DUPLICATE_DEFINITION = new CompileTimeErrorCode.con1('DUPLICATE_DEFINITION', 41, "The name '%s' is already defined");
+ static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErrorCode.con1('DUPLICATE_DEFINITION', 41, "The name '%s' is already defined");
/**
* 7. Classes: It is a compile-time error if a class has an instance member and a static member
@@ -1314,21 +1276,21 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param name the name of the conflicting members
* @see #DUPLICATE_DEFINITION
*/
- static final CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = new CompileTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 42, "The name '%s' is already defined in '%s'");
+ static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const CompileTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 42, "The name '%s' is already defined in '%s'");
/**
* 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub>i</sub> =
* q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named
* argument].
*/
- static final CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = new CompileTimeErrorCode.con1('DUPLICATE_NAMED_ARGUMENT', 43, "The argument for the named parameter '%s' was already specified");
+ static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTimeErrorCode.con1('DUPLICATE_NAMED_ARGUMENT', 43, "The argument for the named parameter '%s' was already specified");
/**
* SDK implementation libraries can be exported only by other SDK libraries.
*
* @param uri the uri pointing to a library
*/
- static final CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = new CompileTimeErrorCode.con1('EXPORT_INTERNAL_LIBRARY', 44, "The library '%s' is internal and cannot be exported");
+ static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeErrorCode.con1('EXPORT_INTERNAL_LIBRARY', 44, "The library '%s' is internal and cannot be exported");
/**
* 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
@@ -1336,7 +1298,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param uri the uri pointing to a non-library declaration
*/
- static final CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = new CompileTimeErrorCode.con1('EXPORT_OF_NON_LIBRARY', 45, "The exported library '%s' must not have a part-of directive");
+ static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErrorCode.con1('EXPORT_OF_NON_LIBRARY', 45, "The exported library '%s' must not have a part-of directive");
/**
* 7.9 Superclasses: It is a compile-time error if the extends clause of a class <i>C</i> includes
@@ -1344,7 +1306,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param typeName the name of the superclass that was not found
*/
- static final CompileTimeErrorCode EXTENDS_NON_CLASS = new CompileTimeErrorCode.con1('EXTENDS_NON_CLASS', 46, "Classes can only extend other classes");
+ static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCode.con1('EXTENDS_NON_CLASS', 46, "Classes can only extend other classes");
/**
* 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
@@ -1363,7 +1325,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param typeName the name of the type that cannot be extended
* @see #IMPLEMENTS_DISALLOWED_CLASS
*/
- static final CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = new CompileTimeErrorCode.con1('EXTENDS_DISALLOWED_CLASS', 47, "Classes cannot extend '%s'");
+ static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTimeErrorCode.con1('EXTENDS_DISALLOWED_CLASS', 47, "Classes cannot extend '%s'");
/**
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</i> or if <i>m &gt;
@@ -1375,21 +1337,21 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param requiredCount the maximum number of positional arguments
* @param argumentCount the actual number of positional arguments given
*/
- static final CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = new CompileTimeErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 48, "%d positional arguments expected, but %d found");
+ static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTimeErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 48, "%d positional arguments expected, but %d found");
/**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
* error if more than one initializer corresponding to a given instance variable appears in
* <i>k</i>'s list.
*/
- static final CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = new CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 49, "The field '%s' cannot be initialized twice in the same constructor");
+ static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 49, "The field '%s' cannot be initialized twice in the same constructor");
/**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
* error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized
* by means of an initializing formal of <i>k</i>.
*/
- static final CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER = new CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', 50, "Fields cannot be initialized in both the parameter list and the initializers");
+ static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', 50, "Fields cannot be initialized in both the parameter list and the initializers");
/**
* 5 Variables: It is a compile-time error if a final instance variable that has is initialized by
@@ -1398,19 +1360,19 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param name the name of the field in question
*/
- static final CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = new CompileTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 51, "'%s' is a final field and so can only be set once");
+ static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const CompileTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 51, "'%s' is a final field and so can only be set once");
/**
* 7.6.1 Generative Constructors: It is a compile-time error if an initializing formal is used by
* a function other than a non-redirecting generative constructor.
*/
- static final CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = new CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 52, "Initializing formal fields cannot be used in factory constructors");
+ static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 52, "Initializing formal fields cannot be used in factory constructors");
/**
* 7.6.1 Generative Constructors: It is a compile-time error if an initializing formal is used by
* a function other than a non-redirecting generative constructor.
*/
- static final CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 53, "Initializing formal fields can only be used in constructors");
+ static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 53, "Initializing formal fields can only be used in constructors");
/**
* 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
@@ -1419,7 +1381,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* 7.6.1 Generative Constructors: It is a compile-time error if an initializing formal is used by
* a function other than a non-redirecting generative constructor.
*/
- static final CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = new CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 54, "The redirecting constructor cannot have a field initializer");
+ static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 54, "The redirecting constructor cannot have a field initializer");
/**
* 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
@@ -1427,7 +1389,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param name the conflicting name of the getter and method
*/
- static final CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = new CompileTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 55, "'%s' cannot be used to name a getter, there is already a method with the same name");
+ static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const CompileTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 55, "'%s' cannot be used to name a getter, there is already a method with the same name");
/**
* 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
@@ -1446,13 +1408,13 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param typeName the name of the type that cannot be implemented
* @see #EXTENDS_DISALLOWED_CLASS
*/
- static final CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = new CompileTimeErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 56, "Classes cannot implement '%s'");
+ static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileTimeErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 56, "Classes cannot implement '%s'");
/**
* 7.10 Superinterfaces: It is a compile-time error if the implements clause of a class includes
* type dynamic.
*/
- static final CompileTimeErrorCode IMPLEMENTS_DYNAMIC = new CompileTimeErrorCode.con1('IMPLEMENTS_DYNAMIC', 57, "Classes cannot implement 'dynamic'");
+ static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorCode.con1('IMPLEMENTS_DYNAMIC', 57, "Classes cannot implement 'dynamic'");
/**
* 7.10 Superinterfaces: It is a compile-time error if the implements clause of a class <i>C</i>
@@ -1461,7 +1423,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param typeName the name of the interface that was not found
*/
- static final CompileTimeErrorCode IMPLEMENTS_NON_CLASS = new CompileTimeErrorCode.con1('IMPLEMENTS_NON_CLASS', 58, "Classes can only implement other classes");
+ static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErrorCode.con1('IMPLEMENTS_NON_CLASS', 58, "Classes can only implement other classes");
/**
* 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in
@@ -1469,7 +1431,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param className the name of the class that is implemented more than once
*/
- static final CompileTimeErrorCode IMPLEMENTS_REPEATED = new CompileTimeErrorCode.con1('IMPLEMENTS_REPEATED', 59, "'%s' can only be implemented once");
+ static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeErrorCode.con1('IMPLEMENTS_REPEATED', 59, "'%s' can only be implemented once");
/**
* 7.10 Superinterfaces: It is a compile-time error if the superclass of a class <i>C</i> appears
@@ -1477,7 +1439,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param className the name of the class that appears in both "extends" and "implements" clauses
*/
- static final CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = new CompileTimeErrorCode.con1('IMPLEMENTS_SUPER_CLASS', 60, "'%s' cannot be used in both 'extends' and 'implements' clauses");
+ static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeErrorCode.con1('IMPLEMENTS_SUPER_CLASS', 60, "'%s' cannot be used in both 'extends' and 'implements' clauses");
/**
* 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of
@@ -1489,14 +1451,14 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param name the name of the type in question
*/
- static final CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = new CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 61, "Only static members can be accessed in initializers");
+ static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = const CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 61, "Only static members can be accessed in initializers");
/**
* SDK implementation libraries can be imported only by other SDK libraries.
*
* @param uri the uri pointing to a library
*/
- static final CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = new CompileTimeErrorCode.con1('IMPORT_INTERNAL_LIBRARY', 62, "The library '%s' is internal and cannot be imported");
+ static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeErrorCode.con1('IMPORT_INTERNAL_LIBRARY', 62, "The library '%s' is internal and cannot be imported");
/**
* 14.1 Imports: It is a compile-time error if the compilation unit found at the specified URI is
@@ -1504,7 +1466,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param uri the uri pointing to a non-library declaration
*/
- static final CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = new CompileTimeErrorCode.con1('IMPORT_OF_NON_LIBRARY', 63, "The imported library '%s' must not have a part-of directive");
+ static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErrorCode.con1('IMPORT_OF_NON_LIBRARY', 63, "The imported library '%s' must not have a part-of directive");
/**
* 13.9 Switch: It is a compile-time error if values of the expressions <i>e<sub>k</sub></i> are
@@ -1513,7 +1475,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param expressionSource the expression source code that is the unexpected type
* @param expectedType the name of the expected type
*/
- static final CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = new CompileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 64, "Case expressions must have the same types, '%s' is not a %s'");
+ static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const CompileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 64, "Case expressions must have the same types, '%s' is not a %s'");
/**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
@@ -1524,7 +1486,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* immediately enclosing class
* @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD
*/
- static final CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = new CompileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTANT_FIELD', 65, "'%s' is not a variable in the enclosing class");
+ static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = const CompileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTANT_FIELD', 65, "'%s' is not a variable in the enclosing class");
/**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
@@ -1535,7 +1497,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* enclosing class
* @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
*/
- static final CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = new CompileTimeErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 66, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
+ static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 66, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
/**
* 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
@@ -1547,7 +1509,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
* @see #INITIALIZER_FOR_NON_EXISTANT_FIELD
*/
- static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = new CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 67, "'%s' is not a variable in the enclosing class");
+ static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 67, "'%s' is not a variable in the enclosing class");
/**
* 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
@@ -1558,20 +1520,20 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* enclosing class
* @see #INITIALIZER_FOR_STATIC_FIELD
*/
- static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = new CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 68, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
+ static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 68, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
/**
* 12.30 Identifier Reference: Otherwise, e is equivalent to the property extraction
* <b>this</b>.<i>id</i>.
*/
- static final CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = new CompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 69, "Instance member cannot be accessed from static method");
+ static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const CompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 69, "Instance member cannot be accessed from static method");
/**
* 11 Metadata: Metadata consists of a series of annotations, each of which begin with the
* character @, followed by a constant expression that must be either a reference to a
* compile-time constant variable, or a call to a constant constructor.
*/
- static final CompileTimeErrorCode INVALID_ANNOTATION = new CompileTimeErrorCode.con1('INVALID_ANNOTATION', 70, "Annotation can be only constant variable or constant constructor invocation");
+ static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorCode.con1('INVALID_ANNOTATION', 70, "Annotation can be only constant variable or constant constructor invocation");
/**
* TODO(brianwilkerson) Remove this when we have decided on how to report errors in compile-time
@@ -1579,26 +1541,26 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* See TODOs in ConstantVisitor
*/
- static final CompileTimeErrorCode INVALID_CONSTANT = new CompileTimeErrorCode.con1('INVALID_CONSTANT', 71, "Invalid constant value");
+ static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCode.con1('INVALID_CONSTANT', 71, "Invalid constant value");
/**
* 7.6 Constructors: It is a compile-time error if the name of a constructor is not a constructor
* name.
*/
- static final CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = new CompileTimeErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 72, "Invalid constructor name");
+ static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTimeErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 72, "Invalid constructor name");
/**
* 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately
* enclosing class.
*/
- static final CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = new CompileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 73, "The name of the immediately enclosing class expected");
+ static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const CompileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 73, "The name of the immediately enclosing class expected");
/**
* 12.10 This: It is a compile-time error if this appears in a top-level function or variable
* initializer, in a factory constructor, or in a static method or variable initializer, or in the
* initializer of an instance variable.
*/
- static final CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = new CompileTimeErrorCode.con1('INVALID_REFERENCE_TO_THIS', 74, "Invalid reference to 'this' expression");
+ static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTimeErrorCode.con1('INVALID_REFERENCE_TO_THIS', 74, "Invalid reference to 'this' expression");
/**
* 12.6 Lists: It is a compile time error if the type argument of a constant list literal includes
@@ -1606,7 +1568,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @name the name of the type parameter
*/
- static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 75, "Constant list literals cannot include a type parameter as a type argument, such as '%s'");
+ static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 75, "Constant list literals cannot include a type parameter as a type argument, such as '%s'");
/**
* 12.7 Maps: It is a compile time error if the type arguments of a constant map literal include a
@@ -1614,7 +1576,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @name the name of the type parameter
*/
- static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 76, "Constant map literals cannot include a type parameter as a type argument, such as '%s'");
+ static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 76, "Constant map literals cannot include a type parameter as a type argument, such as '%s'");
/**
* 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
@@ -1629,7 +1591,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param uri the URI that is invalid
* @see #URI_DOES_NOT_EXIST
*/
- static final CompileTimeErrorCode INVALID_URI = new CompileTimeErrorCode.con1('INVALID_URI', 77, "Invalid URI syntax: '%s'");
+ static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con1('INVALID_URI', 77, "Invalid URI syntax: '%s'");
/**
* 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</sub></i> exists within
@@ -1640,7 +1602,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param labelName the name of the unresolvable label
*/
- static final CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = new CompileTimeErrorCode.con1('LABEL_IN_OUTER_SCOPE', 78, "Cannot reference label '%s' declared in an outer method");
+ static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErrorCode.con1('LABEL_IN_OUTER_SCOPE', 78, "Cannot reference label '%s' declared in an outer method");
/**
* 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</sub></i> exists within
@@ -1651,7 +1613,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param labelName the name of the unresolvable label
*/
- static final CompileTimeErrorCode LABEL_UNDEFINED = new CompileTimeErrorCode.con1('LABEL_UNDEFINED', 79, "Cannot reference undefined label '%s'");
+ static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode.con1('LABEL_UNDEFINED', 79, "Cannot reference undefined label '%s'");
/**
* 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
@@ -1665,7 +1627,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
* j &lt;= m</i>.
*/
- static final CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new CompileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 80, "The element type '%s' cannot be assigned to the list type '%s'");
+ static const CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const CompileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 80, "The element type '%s' cannot be assigned to the list type '%s'");
/**
* 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</sub></i> :
@@ -1679,7 +1641,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
* j &lt;= m</i>.
*/
- static final CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new CompileTimeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 81, "The element type '%s' cannot be assigned to the map key type '%s'");
+ static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const CompileTimeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 81, "The element type '%s' cannot be assigned to the map key type '%s'");
/**
* 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</sub></i> :
@@ -1693,13 +1655,13 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
* j &lt;= m</i>.
*/
- static final CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new CompileTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 82, "The element type '%s' cannot be assigned to the map value type '%s'");
+ static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const CompileTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 82, "The element type '%s' cannot be assigned to the map value type '%s'");
/**
* 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name
* as <i>C</i>.
*/
- static final CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = new CompileTimeErrorCode.con1('MEMBER_WITH_CLASS_NAME', 83, "Class members cannot have the same name as the enclosing class");
+ static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeErrorCode.con1('MEMBER_WITH_CLASS_NAME', 83, "Class members cannot have the same name as the enclosing class");
/**
* 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
@@ -1707,17 +1669,17 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param name the conflicting name of the getter and method
*/
- static final CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = new CompileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 84, "'%s' cannot be used to name a method, there is already a getter with the same name");
+ static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const CompileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 84, "'%s' cannot be used to name a method, there is already a getter with the same name");
/**
* 12.1 Constants: A constant expression is ... a constant list literal.
*/
- static final CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = new CompileTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 85, "List literals must be prefixed with 'const' when used as a constant expression");
+ static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const CompileTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 85, "List literals must be prefixed with 'const' when used as a constant expression");
/**
* 12.1 Constants: A constant expression is ... a constant map literal.
*/
- static final CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = new CompileTimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 86, "Map literals must be prefixed with 'const' when used as a constant expression");
+ static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const CompileTimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 86, "Map literals must be prefixed with 'const' when used as a constant expression");
/**
* 9 Mixins: It is a compile-time error if a declared or derived mixin explicitly declares a
@@ -1725,7 +1687,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param typeName the name of the mixin that is invalid
*/
- static final CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = new CompileTimeErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 87, "The class '%s' cannot be used as a mixin because it declares a constructor");
+ static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTimeErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 87, "The class '%s' cannot be used as a mixin because it declares a constructor");
/**
* 9 Mixins: It is a compile-time error if a mixin is derived from a class whose superclass is not
@@ -1733,7 +1695,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param typeName the name of the mixin that is invalid
*/
- static final CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = new CompileTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 88, "The class '%s' cannot be used as a mixin because it extends a class other than Object");
+ static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const CompileTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 88, "The class '%s' cannot be used as a mixin because it extends a class other than Object");
/**
* 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
@@ -1752,43 +1714,43 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param typeName the name of the type that cannot be extended
* @see #IMPLEMENTS_DISALLOWED_CLASS
*/
- static final CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = new CompileTimeErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 89, "Classes cannot mixin '%s'");
+ static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTimeErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 89, "Classes cannot mixin '%s'");
/**
* 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not denote a class or mixin
* available in the immediately enclosing scope.
*/
- static final CompileTimeErrorCode MIXIN_OF_NON_CLASS = new CompileTimeErrorCode.con1('MIXIN_OF_NON_CLASS', 90, "Classes can only mixin other classes");
+ static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorCode.con1('MIXIN_OF_NON_CLASS', 90, "Classes can only mixin other classes");
/**
* 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super.
*/
- static final CompileTimeErrorCode MIXIN_REFERENCES_SUPER = new CompileTimeErrorCode.con1('MIXIN_REFERENCES_SUPER', 91, "The class '%s' cannot be used as a mixin because it references 'super'");
+ static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeErrorCode.con1('MIXIN_REFERENCES_SUPER', 91, "The class '%s' cannot be used as a mixin because it references 'super'");
/**
* 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not denote a class available
* in the immediately enclosing scope.
*/
- static final CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = new CompileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 92, "Mixin can only be applied to class");
+ static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const CompileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 92, "Mixin can only be applied to class");
/**
* 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
* only action is to invoke another generative constructor.
*/
- static final CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = new CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', 93, "Constructor may have at most one 'this' redirection");
+ static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', 93, "Constructor may have at most one 'this' redirection");
/**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Then <i>k</i> may
* include at most one superinitializer in its initializer list or a compile time error occurs.
*/
- static final CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = new CompileTimeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 94, "Constructor may have at most one 'super' initializer");
+ static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileTimeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 94, "Constructor may have at most one 'super' initializer");
/**
* 11 Metadata: Metadata consists of a series of annotations, each of which begin with the
* character @, followed by a constant expression that must be either a reference to a
* compile-time constant variable, or a call to a constant constructor.
*/
- static final CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = new CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 95, "Annotation creation must have arguments");
+ static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 95, "Annotation creation must have arguments");
/**
* 7.6.1 Generative Constructors: If no superinitializer is provided, an implicit superinitializer
@@ -1798,7 +1760,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
* generative constructor named <i>S</i> (respectively <i>S.id</i>)
*/
- static final CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = new CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 96, "The class '%s' does not have a default constructor");
+ static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = const CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 96, "The class '%s' does not have a default constructor");
/**
* 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a
@@ -1807,13 +1769,13 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
* generative constructor named <i>S</i> (respectively <i>S.id</i>)
*/
- static final CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = new CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 97, "The class '%s' does not have a default constructor");
+ static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = const CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 97, "The class '%s' does not have a default constructor");
/**
* 13.2 Expression Statements: It is a compile-time error if a non-constant map literal that has
* no explicit type arguments appears in a place where a statement is expected.
*/
- static final CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = new CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 98, "A non-constant map literal without type arguments cannot be used as an expression statement");
+ static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = const CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 98, "A non-constant map literal without type arguments cannot be used as an expression statement");
/**
* 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub>11</sub> &hellip;
@@ -1824,44 +1786,44 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub>k</sub></i> are not
* compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
*/
- static final CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = new CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 99, "Case expressions must be constant");
+ static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 99, "Case expressions must be constant");
/**
* 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
* parameter is not a compile-time constant.
*/
- static final CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = new CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 100, "Default values of an optional parameter must be constant");
+ static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 100, "Default values of an optional parameter must be constant");
/**
* 12.6 Lists: It is a compile time error if an element of a constant list literal is not a
* compile-time constant.
*/
- static final CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = new CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 101, "'const' lists must have all constant values");
+ static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 101, "'const' lists must have all constant values");
/**
* 12.7 Maps: It is a compile time error if either a key or a value of an entry in a constant map
* literal is not a compile-time constant.
*/
- static final CompileTimeErrorCode NON_CONSTANT_MAP_KEY = new CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY', 102, "The keys in a map must be constant");
+ static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY', 102, "The keys in a map must be constant");
/**
* 12.7 Maps: It is a compile time error if either a key or a value of an entry in a constant map
* literal is not a compile-time constant.
*/
- static final CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = new CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE', 103, "The values in a 'const' map must be constant");
+ static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE', 103, "The values in a 'const' map must be constant");
/**
* 11 Metadata: Metadata consists of a series of annotations, each of which begin with the
* character @, followed by a constant expression that must be either a reference to a
* compile-time constant variable, or a call to a constant constructor.
*/
- static final CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = new CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 104, "Annotation creation can use only 'const' constructor");
+ static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 104, "Annotation creation can use only 'const' constructor");
/**
* 7.6.3 Constant Constructors: Any expression that appears within the initializer list of a
* constant constructor must be a potentially constant expression, or a compile-time error occurs.
*/
- static final CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = new CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 105, "Initializer expressions in constant constructors must be constants");
+ static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 105, "Initializer expressions in constant constructors must be constants");
/**
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>.
@@ -1872,7 +1834,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param requiredCount the expected number of required arguments
* @param argumentCount the actual number of positional arguments given
*/
- static final CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new CompileTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 106, "%d required argument(s) expected, but %d found");
+ static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const CompileTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 106, "%d required argument(s) expected, but %d found");
/**
* 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
@@ -1880,17 +1842,17 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
* (respectively <i>S.id</i>)
*/
- static final CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = new CompileTimeErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 107, "The generative constructor '%s' expected, but factory found");
+ static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 107, "The generative constructor '%s' expected, but factory found");
/**
* 7.9 Superclasses: It is a compile-time error to specify an extends clause for class Object.
*/
- static final CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = new CompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 108, "");
+ static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const CompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 108, "");
/**
* 7.1.1 Operators: It is a compile-time error to declare an optional parameter in an operator.
*/
- static final CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = new CompileTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 109, "Optional parameters are not allowed when defining an operator");
+ static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const CompileTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 109, "Optional parameters are not allowed when defining an operator");
/**
* 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
@@ -1898,25 +1860,25 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param uri the uri pointing to a non-library declaration
*/
- static final CompileTimeErrorCode PART_OF_NON_PART = new CompileTimeErrorCode.con1('PART_OF_NON_PART', 110, "The included part '%s' must have a part-of directive");
+ static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCode.con1('PART_OF_NON_PART', 110, "The included part '%s' must have a part-of directive");
/**
* 14.1 Imports: It is a compile-time error if the current library declares a top-level member
* named <i>p</i>.
*/
- static final CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = new CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 111, "The name '%s' is already used as an import prefix and cannot be used to name a top-level element");
+ static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = const CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 111, "The name '%s' is already used as an import prefix and cannot be used to name a top-level element");
/**
* 6.2.2 Optional Formals: It is a compile-time error if the name of a named optional parameter
* begins with an '_' character.
*/
- static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTimeErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 112, "Named optional parameters cannot start with an underscore");
+ static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTimeErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 112, "Named optional parameters cannot start with an underscore");
/**
* 12.1 Constants: It is a compile-time error if the value of a compile-time constant expression
* depends on itself.
*/
- static final CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = new CompileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 113, "");
+ static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const CompileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 113, "");
/**
* 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
@@ -1927,13 +1889,13 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* https://code.google.com/p/dart/issues/detail?id=954
*/
- static final CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = new CompileTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 114, "Cycle in redirecting generative constructors");
+ static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const CompileTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 114, "Cycle in redirecting generative constructors");
/**
* 7.6.2 Factories: It is a compile-time error if a redirecting factory constructor redirects to
* itself, either directly or indirectly via a sequence of redirections.
*/
- static final CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = new CompileTimeErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 115, "Cycle in redirecting factory constructors");
+ static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTimeErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 115, "Cycle in redirecting factory constructors");
/**
* 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
@@ -1946,7 +1908,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param className the name of the class that implements itself recursively
* @param strImplementsPath a string representation of the implements loop
*/
- static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = new CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 116, "'%s' cannot be a superinterface of itself: %s");
+ static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 116, "'%s' cannot be a superinterface of itself: %s");
/**
* 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
@@ -1958,7 +1920,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param className the name of the class that implements itself recursively
*/
- static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS = new CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS', 117, "'%s' cannot extend itself");
+ static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS', 117, "'%s' cannot extend itself");
/**
* 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
@@ -1970,43 +1932,43 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param className the name of the class that implements itself recursively
*/
- static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS = new CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS', 118, "'%s' cannot implement itself");
+ static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS', 118, "'%s' cannot implement itself");
/**
* 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with the const modifier but
* <i>k'</i> is not a constant constructor.
*/
- static final CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = new CompileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 119, "The constructor '%s' could not be found in '%s'");
+ static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 119, "The constructor '%s' could not be found in '%s'");
/**
* 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with the const modifier but
* <i>k'</i> is not a constant constructor.
*/
- static final CompileTimeErrorCode REDIRECT_TO_NON_CLASS = new CompileTimeErrorCode.con1('REDIRECT_TO_NON_CLASS', 120, "The name '%s' is not a type and cannot be used in a redirected constructor");
+ static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErrorCode.con1('REDIRECT_TO_NON_CLASS', 120, "The name '%s' is not a type and cannot be used in a redirected constructor");
/**
* 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with the const modifier but
* <i>k'</i> is not a constant constructor.
*/
- static final CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = new CompileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 121, "Constant factory constructor cannot delegate to a non-constant constructor");
+ static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 121, "Constant factory constructor cannot delegate to a non-constant constructor");
/**
* 5 Variables: A local variable may only be referenced at a source code location that is after
* its initializer, if any, is complete, or a compile-time error occurs.
*/
- static final CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = new CompileTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 122, "Local variables cannot be referenced before they are declared");
+ static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const CompileTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 122, "Local variables cannot be referenced before they are declared");
/**
* 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i>rethrow;</i> is not
* enclosed within a on-catch clause.
*/
- static final CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = new CompileTimeErrorCode.con1('RETHROW_OUTSIDE_CATCH', 123, "rethrow must be inside of a catch clause");
+ static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErrorCode.con1('RETHROW_OUTSIDE_CATCH', 123, "rethrow must be inside of a catch clause");
/**
- * 13.11 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
+ * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
* appears in a generative constructor.
*/
- static final CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = new CompileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 124, "Constructors cannot return a value");
+ static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const CompileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 124, "Constructors cannot return a value");
/**
* 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
@@ -2016,19 +1978,19 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* initializer list, in class Object, in a factory constructor, or in a static method or variable
* initializer.
*/
- static final CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = new CompileTimeErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 125, "Invalid context for 'super' invocation");
+ static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTimeErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 125, "Invalid context for 'super' invocation");
/**
* 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
* only action is to invoke another generative constructor.
*/
- static final CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = new CompileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 126, "The redirecting constructor cannot have a 'super' initializer");
+ static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 126, "The redirecting constructor cannot have a 'super' initializer");
/**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
* error if a generative constructor of class Object includes a superinitializer.
*/
- static final CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = new CompileTimeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 127, "");
+ static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileTimeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 127, "");
/**
* 12.11 Instance Creation: It is a static type warning if any of the type arguments to a
@@ -2047,19 +2009,19 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param boundingTypeName the name of the bounding type
* @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
*/
- static final CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new CompileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 128, "'%s' does not extend '%s'");
+ static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const CompileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 128, "'%s' does not extend '%s'");
/**
* 15.3.1 Typedef: Any self reference, either directly, or recursively via another typedef, is a
* compile time error.
*/
- static final CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = new CompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 129, "Type alias cannot reference itself directly or recursively via another typedef");
+ static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const CompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 129, "Type alias cannot reference itself directly or recursively via another typedef");
/**
* 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class accessible in the current
* scope, optionally followed by type arguments.
*/
- static final CompileTimeErrorCode UNDEFINED_CLASS = new CompileTimeErrorCode.con1('UNDEFINED_CLASS', 130, "Undefined class '%s'");
+ static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode.con1('UNDEFINED_CLASS', 130, "Undefined class '%s'");
/**
* 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
@@ -2067,7 +2029,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
* (respectively <i>S.id</i>)
*/
- static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 131, "The class '%s' does not have a generative constructor '%s'");
+ static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 131, "The class '%s' does not have a generative constructor '%s'");
/**
* 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
@@ -2075,7 +2037,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
* (respectively <i>S.id</i>)
*/
- static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = new CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', 132, "The class '%s' does not have a default generative constructor");
+ static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', 132, "The class '%s' does not have a default generative constructor");
/**
* 12.14.3 Unqualified Invocation: If there exists a lexically visible declaration named
@@ -2085,7 +2047,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param methodName the name of the method that is undefined
*/
- static final CompileTimeErrorCode UNDEFINED_FUNCTION = new CompileTimeErrorCode.con1('UNDEFINED_FUNCTION', 133, "The function '%s' is not defined");
+ static const CompileTimeErrorCode UNDEFINED_FUNCTION = const CompileTimeErrorCode.con1('UNDEFINED_FUNCTION', 133, "The function '%s' is not defined");
/**
* 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
@@ -2097,7 +2059,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param name the name of the requested named parameter
*/
- static final CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = new CompileTimeErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 134, "The named parameter '%s' is not defined");
+ static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTimeErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 134, "The named parameter '%s' is not defined");
/**
* 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
@@ -2112,7 +2074,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param uri the URI pointing to a non-existent file
* @see #INVALID_URI
*/
- static final CompileTimeErrorCode URI_DOES_NOT_EXIST = new CompileTimeErrorCode.con1('URI_DOES_NOT_EXIST', 135, "Target of URI does not exist: '%s'");
+ static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorCode.con1('URI_DOES_NOT_EXIST', 135, "Target of URI does not exist: '%s'");
/**
* 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if
@@ -2124,7 +2086,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that describes a URI is
* not a compile-time constant, or if <i>x</i> involves string interpolation.
*/
- static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErrorCode.con1('URI_WITH_INTERPOLATION', 136, "URIs cannot use string interpolation");
+ static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeErrorCode.con1('URI_WITH_INTERPOLATION', 136, "URIs cannot use string interpolation");
/**
* 7.1.1 Operators: It is a compile-time error if the arity of the user-declared operator []= is
@@ -2137,7 +2099,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param expectedNumberOfParameters the number of parameters expected
* @param actualNumberOfParameters the number of parameters found in the operator declaration
*/
- static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = new CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 137, "Operator '%s' should declare exactly %d parameter(s), but %d found");
+ static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 137, "Operator '%s' should declare exactly %d parameter(s), but %d found");
/**
* 7.1.1 Operators: It is a compile time error if the arity of the user-declared operator - is not
@@ -2145,15 +2107,15 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
*
* @param actualNumberOfParameters the number of parameters found in the operator declaration
*/
- static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS = new CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', 138, "Operator '-' should declare 0 or 1 parameter, but %d found");
+ static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', 138, "Operator '-' should declare 0 or 1 parameter, but %d found");
/**
* 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include
* exactly one required formal parameter <i>p</i>.
*/
- static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 139, "Setters should declare exactly one required parameter");
+ static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 139, "Setters should declare exactly one required parameter");
- static final List<CompileTimeErrorCode> values = [
+ static const List<CompileTimeErrorCode> values = const [
AMBIGUOUS_EXPORT,
ARGUMENT_DEFINITION_TEST_NON_PARAMETER,
BUILT_IN_IDENTIFIER_AS_TYPE,
@@ -2298,22 +2260,20 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
/**
* The template used to create the message to be displayed for this error.
*/
- String message;
+ final String message;
/**
* The template used to create the correction to be displayed for this error, or `null` if
* there is no correction information for this error.
*/
- String correction2;
+ final String correction;
/**
* Initialize a newly created error code to have the given message.
*
* @param message the message template used to create the message to be displayed for the error
*/
- CompileTimeErrorCode.con1(String name, int ordinal, String message) : super(name, ordinal) {
- this.message = message;
- }
+ const CompileTimeErrorCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
/**
* Initialize a newly created error code to have the given message and correction.
@@ -2321,13 +2281,7 @@ class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
* @param message the template used to create the message to be displayed for the error
* @param correction the template used to create the correction to be displayed for the error
*/
- CompileTimeErrorCode.con2(String name, int ordinal, String message, String correction) : super(name, ordinal) {
- this.message = message;
- this.correction2 = correction;
- }
-
- @override
- String get correction => correction2;
+ const CompileTimeErrorCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
@override
ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;
@@ -2349,7 +2303,7 @@ class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode {
* contain a directive such as `import '../web/some.dart'` which references a file outside
* the lib directory.
*/
- static final PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = new PubSuggestionCode.con1('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 0, "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
+ static const PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const PubSuggestionCode.con1('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 0, "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
/**
* It is a bad practice for a source file ouside a package "lib" directory hierarchy to traverse
@@ -2357,16 +2311,16 @@ class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode {
* contain a directive such as `import '../lib/some.dart'` which references a file inside
* the lib directory.
*/
- static final PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = new PubSuggestionCode.con1('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 1, "A file outside the 'lib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
+ static const PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const PubSuggestionCode.con1('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 1, "A file outside the 'lib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
/**
* It is a bad practice for a package import to reference anything outside the given package, or
* more generally, it is bad practice for a package import to contain a "..". For example, a
* source file should not contain a directive such as `import 'package:foo/../some.dart'`.
*/
- static final PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = new PubSuggestionCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should not contain '..'");
+ static const PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const PubSuggestionCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should not contain '..'");
- static final List<PubSuggestionCode> values = [
+ static const List<PubSuggestionCode> values = const [
FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE,
FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE,
PACKAGE_IMPORT_CONTAINS_DOT_DOT];
@@ -2374,22 +2328,20 @@ class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode {
/**
* The template used to create the message to be displayed for this error.
*/
- String message;
+ final String message;
/**
* The template used to create the correction to be displayed for this error, or `null` if
* there is no correction information for this error.
*/
- String correction5;
+ final String correction;
/**
* Initialize a newly created error code to have the given message.
*
* @param message the message template used to create the message to be displayed for the error
*/
- PubSuggestionCode.con1(String name, int ordinal, String message) : super(name, ordinal) {
- this.message = message;
- }
+ const PubSuggestionCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
/**
* Initialize a newly created error code to have the given message and correction.
@@ -2397,13 +2349,7 @@ class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode {
* @param message the template used to create the message to be displayed for the error
* @param correction the template used to create the correction to be displayed for the error
*/
- PubSuggestionCode.con2(String name, int ordinal, String message, String correction) : super(name, ordinal) {
- this.message = message;
- this.correction5 = correction;
- }
-
- @override
- String get correction => correction5;
+ const PubSuggestionCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
@override
ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity;
@@ -2433,7 +2379,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param firstLibraryName the name of the first library that the type is found
* @param secondLibraryName the name of the second library that the type is found
*/
- static final StaticWarningCode AMBIGUOUS_IMPORT = new StaticWarningCode.con1('AMBIGUOUS_IMPORT', 0, "The type '%s' is defined in the libraries '%s' and '%s'");
+ static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode.con1('AMBIGUOUS_IMPORT', 0, "The type '%s' is defined in the libraries '%s' and '%s'");
/**
* 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+
@@ -2459,7 +2405,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param actualType the name of the actual argument type
* @param expectedType the name of the expected type
*/
- static final StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new StaticWarningCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '%s' cannot be assigned to the parameter type '%s'");
+ static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarningCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '%s' cannot be assigned to the parameter type '%s'");
/**
* 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError
@@ -2468,38 +2414,38 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* A constant variable is always implicitly final.
*/
- static final StaticWarningCode ASSIGNMENT_TO_CONST = new StaticWarningCode.con1('ASSIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value");
+ static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode.con1('ASSIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value");
/**
* 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError
* to be thrown, because no setter is defined for it. The assignment will also give rise to a
* static warning for the same reason.
*/
- static final StaticWarningCode ASSIGNMENT_TO_FINAL = new StaticWarningCode.con1('ASSIGNMENT_TO_FINAL', 3, "'%s' cannot be used as a setter, it is final");
+ static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode.con1('ASSIGNMENT_TO_FINAL', 3, "'%s' cannot be used as a setter, it is final");
/**
* 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
* warning if <i>T</i> does not have an accessible instance setter named <i>v =</i>.
*/
- static final StaticWarningCode ASSIGNMENT_TO_METHOD = new StaticWarningCode.con1('ASSIGNMENT_TO_METHOD', 4, "Methods cannot be assigned a value");
+ static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode.con1('ASSIGNMENT_TO_METHOD', 4, "Methods cannot be assigned a value");
/**
* 13.9 Switch: It is a static warning if the last statement of the statement sequence
* <i>s<sub>k</sub></i> is not a break, continue, return or throw statement.
*/
- static final StaticWarningCode CASE_BLOCK_NOT_TERMINATED = new StaticWarningCode.con1('CASE_BLOCK_NOT_TERMINATED', 5, "The last statement of the 'case' should be 'break', 'continue', 'return' or 'throw'");
+ static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarningCode.con1('CASE_BLOCK_NOT_TERMINATED', 5, "The last statement of the 'case' should be 'break', 'continue', 'return' or 'throw'");
/**
* 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type available in the
* current lexical scope.
*/
- static final StaticWarningCode CAST_TO_NON_TYPE = new StaticWarningCode.con1('CAST_TO_NON_TYPE', 6, "The name '%s' is not a type and cannot be used in an 'as' expression");
+ static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode.con1('CAST_TO_NON_TYPE', 6, "The name '%s' is not a type and cannot be used in an 'as' expression");
/**
* 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or
* inherited in a concrete class.
*/
- static final StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = new StaticWarningCode.con1('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 7, "'%s' must have a method body because '%s' is not abstract");
+ static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const StaticWarningCode.con1('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 7, "'%s' must have a method body because '%s' is not abstract");
/**
* 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i>N</i> would be
@@ -2512,7 +2458,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param sdkLibraryName the name of the dart: library that the element is found
* @param otherLibraryName the name of the non-dart: library that the element is found
*/
- static final StaticWarningCode CONFLICTING_DART_IMPORT = new StaticWarningCode.con1('CONFLICTING_DART_IMPORT', 8, "Element '%s' from SDK library '%s' is implicitly hidden by '%s'");
+ static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCode.con1('CONFLICTING_DART_IMPORT', 8, "Element '%s' from SDK library '%s' is implicitly hidden by '%s'");
/**
* 7.2 Getters: It is a static warning if a class <i>C</i> declares an instance getter named
@@ -2521,19 +2467,19 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param superName the name of the super class declaring a static member
*/
- static final StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER', 9, "Superclass '%s' declares static member with the same name");
+ static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER', 9, "Superclass '%s' declares static member with the same name");
/**
* 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares an instance method
* named <i>n</i> and has a setter named <i>n=</i>.
*/
- static final StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER', 10, "Class '%s' declares instance method '%s', but also has a setter with the same name from '%s'");
+ static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER', 10, "Class '%s' declares instance method '%s', but also has a setter with the same name from '%s'");
/**
* 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares an instance method
* named <i>n</i> and has a setter named <i>n=</i>.
*/
- static final StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = new StaticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER2', 11, "Class '%s' declares the setter '%s', but also has an instance method in the same class");
+ static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const StaticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER2', 11, "Class '%s' declares the setter '%s', but also has an instance method in the same class");
/**
* 7.3 Setters: It is a static warning if a class <i>C</i> declares an instance setter named
@@ -2542,31 +2488,31 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param superName the name of the super class declaring a static member
*/
- static final StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER', 12, "Superclass '%s' declares static member with the same name");
+ static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER', 12, "Superclass '%s' declares static member with the same name");
/**
* 7.2 Getters: It is a static warning if a class declares a static getter named <i>v</i> and also
* has a non-static setter named <i>v=</i>.
*/
- static final StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = new StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 13, "Class '%s' declares non-static setter with the same name");
+ static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 13, "Class '%s' declares non-static setter with the same name");
/**
* 7.3 Setters: It is a static warning if a class declares a static setter named <i>v=</i> and
* also has a non-static member named <i>v</i>.
*/
- static final StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = new StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 14, "Class '%s' declares non-static member with the same name");
+ static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 14, "Class '%s' declares non-static member with the same name");
/**
* 12.11.2 Const: Given an instance creation expression of the form <i>const q(a<sub>1</sub>,
* &hellip; a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the constructor of an
* abstract class but <i>q</i> is not a factory constructor.
*/
- static final StaticWarningCode CONST_WITH_ABSTRACT_CLASS = new StaticWarningCode.con1('CONST_WITH_ABSTRACT_CLASS', 15, "Abstract classes cannot be created with a 'const' expression");
+ static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarningCode.con1('CONST_WITH_ABSTRACT_CLASS', 15, "Abstract classes cannot be created with a 'const' expression");
/**
* 12.7 Maps: It is a static warning if the values of any two keys in a map literal are equal.
*/
- static final StaticWarningCode EQUAL_KEYS_IN_MAP = new StaticWarningCode.con1('EQUAL_KEYS_IN_MAP', 16, "Keys in a map cannot be equal");
+ static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode.con1('EQUAL_KEYS_IN_MAP', 16, "Keys in a map cannot be equal");
/**
* 14.2 Exports: It is a static warning to export two different libraries with the same name.
@@ -2575,7 +2521,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param uri2 the uri pointing to a second library
* @param name the shared name of the exported libraries
*/
- static final StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = new StaticWarningCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 17, "The exported libraries '%s' and '%s' should not have the same name '%s'");
+ static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = const StaticWarningCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 17, "The exported libraries '%s' and '%s' should not have the same name '%s'");
/**
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</i> or if <i>m &gt;
@@ -2585,13 +2531,13 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param argumentCount the actual number of positional arguments given
* @see #NOT_ENOUGH_REQUIRED_ARGUMENTS
*/
- static final StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = new StaticWarningCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 18, "%d positional arguments expected, but %d found");
+ static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarningCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 18, "%d positional arguments expected, but %d found");
/**
* 5. Variables: It is a static warning if a final instance variable that has been initialized at
* its point of declaration is also initialized in a constructor.
*/
- static final StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = new StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', 19, "Values cannot be set in the constructor if they are final, and have already been set");
+ static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = const StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', 19, "Values cannot be set in the constructor if they are final, and have already been set");
/**
* 5. Variables: It is a static warning if a final instance variable that has been initialized at
@@ -2599,7 +2545,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param name the name of the field in question
*/
- static final StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR = new StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', 20, "'%s' is final and was given a value when it was declared, so it cannot be set to a new value");
+ static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR = const StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', 20, "'%s' is final and was given a value when it was declared, so it cannot be set to a new value");
/**
* 7.6.1 Generative Constructors: Execution of an initializer of the form <b>this</b>.<i>v</i> =
@@ -2616,7 +2562,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param initializerType the name of the type of the initializer expression
* @param fieldType the name of the type of the field
*/
- static final StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = new StaticWarningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 21, "The initializer type '%s' cannot be assigned to the field type '%s'");
+ static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const StaticWarningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 21, "The initializer type '%s' cannot be assigned to the field type '%s'");
/**
* 7.6.1 Generative Constructors: An initializing formal has the form <i>this.id</i>. It is a
@@ -2625,7 +2571,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param parameterType the name of the type of the field formal parameter
* @param fieldType the name of the type of the field
*/
- static final StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = new StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 22, "The parameter type '%s' is incompatable with the field type '%s'");
+ static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = const StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 22, "The parameter type '%s' is incompatable with the field type '%s'");
/**
* 5 Variables: It is a static warning if a library, static or local variable <i>v</i> is final
@@ -2640,13 +2586,13 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param name the name of the uninitialized final variable
*/
- static final StaticWarningCode FINAL_NOT_INITIALIZED = new StaticWarningCode.con1('FINAL_NOT_INITIALIZED', 23, "The final variable '%s' must be initialized");
+ static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode.con1('FINAL_NOT_INITIALIZED', 23, "The final variable '%s' must be initialized");
/**
* 15.5 Function Types: It is a static warning if a concrete class implements Function and does
* not have a concrete method named call().
*/
- static final StaticWarningCode FUNCTION_WITHOUT_CALL = new StaticWarningCode.con1('FUNCTION_WITHOUT_CALL', 24, "Concrete classes that implement Function must implement the method call()");
+ static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode.con1('FUNCTION_WITHOUT_CALL', 24, "Concrete classes that implement Function must implement the method call()");
/**
* 14.1 Imports: It is a static warning to import two different libraries with the same name.
@@ -2655,7 +2601,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param uri2 the uri pointing to a second library
* @param name the shared name of the imported libraries
*/
- static final StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = new StaticWarningCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 25, "The imported libraries '%s' and '%s' should not have the same name '%s'");
+ static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = const StaticWarningCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 25, "The imported libraries '%s' and '%s' should not have the same name '%s'");
/**
* 8.1.1 Inheritance and Overriding: However, if there are multiple members <i>m<sub>1</sub>,
@@ -2667,7 +2613,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* not all of the <i>m<sub>i</sub></i> are setters, none of the <i>m<sub>i</sub></i> are
* inherited, and a static warning is issued.
*/
- static final StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD = new StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD', 26, "'%s' is inherited as a getter and also a method");
+ static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD = const StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD', 26, "'%s' is inherited as a getter and also a method");
/**
* 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares an instance method
@@ -2677,7 +2623,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param memberName the name of the member with the name conflict
* @param superclassName the name of the enclosing class that has the static member
*/
- static final StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC = new StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC', 27, "'%s' collides with a static member in the superclass '%s'");
+ static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC = const StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC', 27, "'%s' collides with a static member in the superclass '%s'");
/**
* 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a getter <i>m2</i> and the
@@ -2689,7 +2635,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param className the name of the class where the overridden getter is declared
* @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE
*/
- static final StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = new StaticWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 28, "The return type '%s' is not assignable to '%s' as required by the getter it is overriding from '%s'");
+ static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const StaticWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 28, "The return type '%s' is not assignable to '%s' as required by the getter it is overriding from '%s'");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2700,7 +2646,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* actualParamTypeName
* @param className the name of the class where the overridden method is declared
*/
- static final StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = new StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 29, "The parameter type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'");
+ static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = const StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 29, "The parameter type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2712,7 +2658,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param className the name of the class where the overridden method is declared
* @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE
*/
- static final StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = new StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 30, "The parameter type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'");
+ static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = const StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 30, "The parameter type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2723,7 +2669,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* actualParamTypeName
* @param className the name of the class where the overridden method is declared
*/
- static final StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = new StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 31, "The parameter type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'");
+ static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = const StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 31, "The parameter type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2735,7 +2681,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param className the name of the class where the overridden method is declared
* @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE
*/
- static final StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = new StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 32, "The return type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'");
+ static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 32, "The return type '%s' is not assignable to '%s' as required by the method it is overriding from '%s'");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2743,7 +2689,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a different default value
* for <i>p</i>.
*/
- static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', 33, "Parameters cannot override default values, this method overrides '%s.%s' where '%s' has a different value");
+ static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', 33, "Parameters cannot override default values, this method overrides '%s.%s' where '%s' has a different value");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2751,7 +2697,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a different default value
* for <i>p</i>.
*/
- static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL = new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL', 34, "Parameters cannot override default values, this method overrides '%s.%s' where this positional parameter has a different value");
+ static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL', 34, "Parameters cannot override default values, this method overrides '%s.%s' where this positional parameter has a different value");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2761,7 +2707,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param paramCount the number of named parameters in the overridden member
* @param className the name of the class from the overridden method
*/
- static final StaticWarningCode INVALID_OVERRIDE_NAMED = new StaticWarningCode.con1('INVALID_OVERRIDE_NAMED', 35, "Missing the named parameter '%s' to match the overridden method from '%s'");
+ static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCode.con1('INVALID_OVERRIDE_NAMED', 35, "Missing the named parameter '%s' to match the overridden method from '%s'");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2770,7 +2716,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param paramCount the number of positional parameters in the overridden member
* @param className the name of the class from the overridden method
*/
- static final StaticWarningCode INVALID_OVERRIDE_POSITIONAL = new StaticWarningCode.con1('INVALID_OVERRIDE_POSITIONAL', 36, "Must have at least %d parameters to match the overridden method from '%s'");
+ static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarningCode.con1('INVALID_OVERRIDE_POSITIONAL', 36, "Must have at least %d parameters to match the overridden method from '%s'");
/**
* 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
@@ -2780,7 +2726,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param paramCount the number of required parameters in the overridden member
* @param className the name of the class from the overridden method
*/
- static final StaticWarningCode INVALID_OVERRIDE_REQUIRED = new StaticWarningCode.con1('INVALID_OVERRIDE_REQUIRED', 37, "Must have %d required parameters or less to match the overridden method from '%s'");
+ static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarningCode.con1('INVALID_OVERRIDE_REQUIRED', 37, "Must have %d required parameters or less to match the overridden method from '%s'");
/**
* 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a setter <i>m2</i> and the
@@ -2792,7 +2738,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param className the name of the class where the overridden setter is declared
* @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE
*/
- static final StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = new StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 38, "The parameter type '%s' is not assignable to '%s' as required by the setter it is overriding from '%s'");
+ static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = const StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 38, "The parameter type '%s' is not assignable to '%s' as required by the setter it is overriding from '%s'");
/**
* 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
@@ -2806,7 +2752,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
* j &lt;= m</i>.
*/
- static final StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new StaticWarningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 39, "The element type '%s' cannot be assigned to the list type '%s'");
+ static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const StaticWarningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 39, "The element type '%s' cannot be assigned to the list type '%s'");
/**
* 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</sub></i> :
@@ -2820,7 +2766,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
* j &lt;= m</i>.
*/
- static final StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new StaticWarningCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 40, "The element type '%s' cannot be assigned to the map key type '%s'");
+ static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarningCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 40, "The element type '%s' cannot be assigned to the map key type '%s'");
/**
* 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</sub></i> :
@@ -2834,33 +2780,33 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 &lt;=
* j &lt;= m</i>.
*/
- static final StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new StaticWarningCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 41, "The element type '%s' cannot be assigned to the map value type '%s'");
+ static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWarningCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 41, "The element type '%s' cannot be assigned to the map value type '%s'");
/**
* 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type
* <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i> may not be
* assigned to <i>S</i>.
*/
- static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 42, "The parameter type for setter '%s' is '%s' which is not assignable to its getter (of type '%s')");
+ static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 42, "The parameter type for setter '%s' is '%s' which is not assignable to its getter (of type '%s')");
/**
* 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type
* <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i> may not be
* assigned to <i>S</i>.
*/
- static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE = new StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE', 43, "The parameter type for setter '%s' is '%s' which is not assignable to its getter (of type '%s'), from superclass '%s'");
+ static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE = const StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE', 43, "The parameter type for setter '%s' is '%s' which is not assignable to its getter (of type '%s'), from superclass '%s'");
/**
* 13.12 Return: It is a static warning if a function contains both one or more return statements
* of the form <i>return;</i> and one or more return statements of the form <i>return e;</i>.
*/
- static final StaticWarningCode MIXED_RETURN_TYPES = new StaticWarningCode.con1('MIXED_RETURN_TYPES', 44, "Methods and functions cannot use return both with and without values");
+ static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode.con1('MIXED_RETURN_TYPES', 44, "Methods and functions cannot use return both with and without values");
/**
* 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abstract class and
* <i>q</i> is not a factory constructor.
*/
- static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode.con1('NEW_WITH_ABSTRACT_CLASS', 45, "Abstract classes cannot be created with a 'new' expression");
+ static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCode.con1('NEW_WITH_ABSTRACT_CLASS', 45, "Abstract classes cannot be created with a 'new' expression");
/**
* 15.8 Parameterized Types: Any use of a malbounded type gives rise to a static warning.
@@ -2871,7 +2817,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS
* @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS
*/
- static final StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = new StaticWarningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 46, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
+ static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const StaticWarningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 46, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
/**
* 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible in the current scope,
@@ -2879,7 +2825,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param name the name of the non-type element
*/
- static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode.con1('NEW_WITH_NON_TYPE', 47, "The name '%s' is not a class");
+ static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode.con1('NEW_WITH_NON_TYPE', 47, "The name '%s' is not a class");
/**
* 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then:
@@ -2890,7 +2836,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a static warning if the
* type <i>T</i> does not declare a constructor with the same name as the declaration of <i>T</i>.
*/
- static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 48, "The class '%s' does not have a constructor '%s'");
+ static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 48, "The class '%s' does not have a constructor '%s'");
/**
* 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then:
@@ -2901,7 +2847,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a static warning if the
* type <i>T</i> does not declare a constructor with the same name as the declaration of <i>T</i>.
*/
- static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 49, "The class '%s' does not have a default constructor");
+ static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 49, "The class '%s' does not have a default constructor");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
@@ -2921,7 +2867,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param memberName the name of the fourth member
* @param additionalCount the number of additional missing members that aren't listed
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS', 50, "Missing concrete implementation of '%s', '%s', '%s', '%s' and %d more");
+ static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS', 50, "Missing concrete implementation of %s, %s, %s, %s and %d more");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
@@ -2940,7 +2886,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param memberName the name of the third member
* @param memberName the name of the fourth member
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', 51, "Missing concrete implementation of '%s', '%s', '%s' and '%s'");
+ static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', 51, "Missing concrete implementation of %s, %s, %s and %s");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
@@ -2956,7 +2902,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param memberName the name of the member
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', 52, "Missing concrete implementation of '%s'");
+ static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', 52, "Missing concrete implementation of %s");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
@@ -2974,7 +2920,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param memberName the name of the second member
* @param memberName the name of the third member
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE', 53, "Missing concrete implementation of '%s', '%s' and '%s'");
+ static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE', 53, "Missing concrete implementation of %s, %s and %s");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
@@ -2991,7 +2937,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param memberName the name of the first member
* @param memberName the name of the second member
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', 54, "Missing concrete implementation of '%s' and '%s'");
+ static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', 54, "Missing concrete implementation of %s and %s");
/**
* 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, p<sub>2</sub>) s</i> or
@@ -3001,18 +2947,18 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param name the name of the non-type element
*/
- static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCode.con1('NON_TYPE_IN_CATCH_CLAUSE', 55, "The name '%s' is not a type and cannot be used in an on-catch clause");
+ static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningCode.con1('NON_TYPE_IN_CATCH_CLAUSE', 55, "The name '%s' is not a type and cannot be used in an on-catch clause");
/**
* 7.1.1 Operators: It is a static warning if the return type of the user-declared operator []= is
* explicitly declared and not void.
*/
- static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarningCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 56, "The return type of the operator []= must be 'void'");
+ static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarningCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 56, "The return type of the operator []= must be 'void'");
/**
* 7.3 Setters: It is a static warning if a setter declares a return type other than void.
*/
- static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningCode.con1('NON_VOID_RETURN_FOR_SETTER', 57, "The return type of the setter must be 'void'");
+ static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarningCode.con1('NON_VOID_RETURN_FOR_SETTER', 57, "The return type of the setter must be 'void'");
/**
* 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the form <i>id</i> or the
@@ -3025,7 +2971,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param nonTypeName the name that is not a type
*/
- static final StaticWarningCode NOT_A_TYPE = new StaticWarningCode.con1('NOT_A_TYPE', 58, "%s is not a type");
+ static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode.con1('NOT_A_TYPE', 58, "%s is not a type");
/**
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</i> or if <i>m &gt;
@@ -3035,7 +2981,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param argumentCount the actual number of positional arguments given
* @see #EXTRA_POSITIONAL_ARGUMENTS
*/
- static final StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new StaticWarningCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 59, "%d required argument(s) expected, but %d found");
+ static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWarningCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 59, "%d required argument(s) expected, but %d found");
/**
* 14.3 Parts: It is a static warning if the referenced part declaration <i>p</i> names a library
@@ -3044,7 +2990,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param expectedLibraryName the name of expected library name
* @param actualLibraryName the non-matching actual library name from the "part of" declaration
*/
- static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCode.con1('PART_OF_DIFFERENT_LIBRARY', 60, "Expected this library to be part of '%s', not '%s'");
+ static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarningCode.con1('PART_OF_DIFFERENT_LIBRARY', 60, "Expected this library to be part of '%s', not '%s'");
/**
* 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> is not a subtype of
@@ -3053,7 +2999,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param redirectedName the name of the redirected constructor
* @param redirectingName the name of the redirecting constructor
*/
- static final StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = new StaticWarningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 61, "The redirected constructor '%s' has incompatible parameters with '%s'");
+ static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const StaticWarningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 61, "The redirected constructor '%s' has incompatible parameters with '%s'");
/**
* 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> is not a subtype of
@@ -3062,31 +3008,31 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param redirectedName the name of the redirected constructor return type
* @param redirectingName the name of the redirecting constructor return type
*/
- static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWarningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 62, "The return type '%s' of the redirected constructor is not assignable to '%s'");
+ static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticWarningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 62, "The return type '%s' of the redirected constructor is not assignable to '%s'");
/**
* 7.6.2 Factories: It is a static warning if type does not denote a class accessible in the
* current scope; if type does denote such a class <i>C</i> it is a static warning if the
* referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a constructor of <i>C</i>.
*/
- static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWarningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 63, "The constructor '%s' could not be found in '%s'");
+ static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticWarningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 63, "The constructor '%s' could not be found in '%s'");
/**
* 7.6.2 Factories: It is a static warning if type does not denote a class accessible in the
* current scope; if type does denote such a class <i>C</i> it is a static warning if the
* referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a constructor of <i>C</i>.
*/
- static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode.con1('REDIRECT_TO_NON_CLASS', 64, "The name '%s' is not a type and cannot be used in a redirected constructor");
+ static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode.con1('REDIRECT_TO_NON_CLASS', 64, "The name '%s' is not a type and cannot be used in a redirected constructor");
/**
- * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return statement of the form
+ * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return statement of the form
* <i>return;</i> It is a static warning if both of the following conditions hold:
* <ol>
* * <i>f</i> is not a generative constructor.
* * The return type of <i>f</i> may not be assigned to void.
* </ol>
*/
- static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode.con1('RETURN_WITHOUT_VALUE', 65, "Missing return value after 'return'");
+ static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode.con1('RETURN_WITHOUT_VALUE', 65, "Missing return value after 'return'");
/**
* 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not declare a static method
@@ -3094,19 +3040,19 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param memberName the name of the instance member
*/
- static final StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = new StaticWarningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 66, "Instance member '%s' cannot be accessed using static access");
+ static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const StaticWarningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 66, "Instance member '%s' cannot be accessed using static access");
/**
* 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assigned to the type of
* <i>e<sub>k</sub></i>.
*/
- static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWarningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 67, "Type '%s' of the switch expression is not assignable to the type '%s' of case expressions");
+ static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const StaticWarningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 67, "Type '%s' of the switch expression is not assignable to the type '%s' of case expressions");
/**
* 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type available in the
* current lexical scope.
*/
- static final StaticWarningCode TYPE_TEST_NON_TYPE = new StaticWarningCode.con1('TYPE_TEST_NON_TYPE', 68, "The name '%s' is not a type and cannot be used in an 'is' expression");
+ static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode.con1('TYPE_TEST_NON_TYPE', 68, "The name '%s' is not a type and cannot be used in an 'is' expression");
/**
* 10 Generics: However, a type parameter is considered to be a malformed type when referenced by
@@ -3115,7 +3061,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* 15.1 Static Types: Any use of a malformed type gives rise to a static warning. A malformed type
* is then interpreted as dynamic by the static type checker and the runtime.
*/
- static final StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = new StaticWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 69, "Static members cannot reference type parameters");
+ static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const StaticWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 69, "Static members cannot reference type parameters");
/**
* 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form
@@ -3125,12 +3071,12 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param undefinedClassName the name of the undefined class
*/
- static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode.con1('UNDEFINED_CLASS', 70, "Undefined class '%s'");
+ static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode.con1('UNDEFINED_CLASS', 70, "Undefined class '%s'");
/**
* Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool".
*/
- static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode.con1('UNDEFINED_CLASS_BOOLEAN', 71, "Undefined class 'boolean'; did you mean 'bool'?");
+ static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCode.con1('UNDEFINED_CLASS_BOOLEAN', 71, "Undefined class 'boolean'; did you mean 'bool'?");
/**
* 12.17 Getter Invocation: It is a static warning if there is no class <i>C</i> in the enclosing
@@ -3140,7 +3086,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param getterName the name of the getter
* @param enclosingType the name of the enclosing type where the getter is being looked for
*/
- static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode.con1('UNDEFINED_GETTER', 72, "There is no such getter '%s' in '%s'");
+ static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode.con1('UNDEFINED_GETTER', 72, "There is no such getter '%s' in '%s'");
/**
* 12.30 Identifier Reference: It is as static warning if an identifier expression of the form
@@ -3150,7 +3096,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param name the name of the identifier
*/
- static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode.con1('UNDEFINED_IDENTIFIER', 73, "Undefined name '%s'");
+ static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode.con1('UNDEFINED_IDENTIFIER', 73, "Undefined name '%s'");
/**
* 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
@@ -3159,7 +3105,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
*
* @param name the name of the requested named parameter
*/
- static final StaticWarningCode UNDEFINED_NAMED_PARAMETER = new StaticWarningCode.con1('UNDEFINED_NAMED_PARAMETER', 74, "The named parameter '%s' is not defined");
+ static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarningCode.con1('UNDEFINED_NAMED_PARAMETER', 74, "The named parameter '%s' is not defined");
/**
* 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs
@@ -3174,7 +3120,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param setterName the name of the getter
* @param enclosingType the name of the enclosing type where the setter is being looked for
*/
- static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode.con1('UNDEFINED_SETTER', 75, "There is no such setter '%s' in '%s'");
+ static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode.con1('UNDEFINED_SETTER', 75, "There is no such setter '%s' in '%s'");
/**
* 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not declare a static method
@@ -3183,9 +3129,14 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param methodName the name of the method
* @param enclosingType the name of the enclosing type where the method is being looked for
*/
- static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticWarningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 76, "There is no such static method, getter or setter '%s' in '%s'");
+ static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const StaticWarningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 76, "There is no such static method, getter or setter '%s' in '%s'");
- static final List<StaticWarningCode> values = [
+ /**
+ * 7.2 Getters: It is a static warning if the return type of a getter is void.
+ */
+ static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCode.con1('VOID_RETURN_FOR_GETTER', 77, "The return type of the getter must not be 'void'");
+
+ static const List<StaticWarningCode> values = const [
AMBIGUOUS_IMPORT,
ARGUMENT_TYPE_NOT_ASSIGNABLE,
ASSIGNMENT_TO_CONST,
@@ -3262,27 +3213,26 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
UNDEFINED_IDENTIFIER,
UNDEFINED_NAMED_PARAMETER,
UNDEFINED_SETTER,
- UNDEFINED_STATIC_METHOD_OR_GETTER];
+ UNDEFINED_STATIC_METHOD_OR_GETTER,
+ VOID_RETURN_FOR_GETTER];
/**
* The template used to create the message to be displayed for this error.
*/
- String message;
+ final String message;
/**
* The template used to create the correction to be displayed for this error, or `null` if
* there is no correction information for this error.
*/
- String correction7;
+ final String correction;
/**
* Initialize a newly created error code to have the given message.
*
* @param message the message template used to create the message to be displayed for the error
*/
- StaticWarningCode.con1(String name, int ordinal, String message) : super(name, ordinal) {
- this.message = message;
- }
+ const StaticWarningCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
/**
* Initialize a newly created error code to have the given message and correction.
@@ -3290,13 +3240,7 @@ class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
* @param message the template used to create the message to be displayed for the error
* @param correction the template used to create the correction to be displayed for the error
*/
- StaticWarningCode.con2(String name, int ordinal, String message, String correction) : super(name, ordinal) {
- this.message = message;
- this.correction7 = correction;
- }
-
- @override
- String get correction => correction7;
+ const StaticWarningCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
@override
ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity;
@@ -3342,7 +3286,7 @@ class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode {
*
* @param uri the URI that is invalid
*/
- static final HtmlWarningCode INVALID_URI = new HtmlWarningCode.con1('INVALID_URI', 0, "Invalid URI syntax: '%s'");
+ static const HtmlWarningCode INVALID_URI = const HtmlWarningCode.con1('INVALID_URI', 0, "Invalid URI syntax: '%s'");
/**
* An error code indicating that the value of the 'src' attribute of a Dart script tag references
@@ -3350,29 +3294,27 @@ class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode {
*
* @param uri the URI pointing to a non-existent file
*/
- static final HtmlWarningCode URI_DOES_NOT_EXIST = new HtmlWarningCode.con1('URI_DOES_NOT_EXIST', 1, "Target of URI does not exist: '%s'");
+ static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode.con1('URI_DOES_NOT_EXIST', 1, "Target of URI does not exist: '%s'");
- static final List<HtmlWarningCode> values = [INVALID_URI, URI_DOES_NOT_EXIST];
+ static const List<HtmlWarningCode> values = const [INVALID_URI, URI_DOES_NOT_EXIST];
/**
* The template used to create the message to be displayed for this error.
*/
- String message;
+ final String message;
/**
* The template used to create the correction to be displayed for this error, or `null` if
* there is no correction information for this error.
*/
- String correction4;
+ final String correction;
/**
* Initialize a newly created error code to have the given message.
*
* @param message the message template used to create the message to be displayed for the error
*/
- HtmlWarningCode.con1(String name, int ordinal, String message) : super(name, ordinal) {
- this.message = message;
- }
+ const HtmlWarningCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
/**
* Initialize a newly created error code to have the given message and correction.
@@ -3380,13 +3322,7 @@ class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode {
* @param message the template used to create the message to be displayed for the error
* @param correction the template used to create the correction to be displayed for the error
*/
- HtmlWarningCode.con2(String name, int ordinal, String message, String correction) : super(name, ordinal) {
- this.message = message;
- this.correction4 = correction;
- }
-
- @override
- String get correction => correction4;
+ const HtmlWarningCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
@override
ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
@@ -3408,7 +3344,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
*
* @param numTypeArgument the number of provided type arguments
*/
- static final StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = new StaticTypeWarningCode.con1('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 0, "List literal requires exactly one type arguments or none, but %d found");
+ static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const StaticTypeWarningCode.con1('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 0, "List literal requires exactly one type arguments or none, but %d found");
/**
* 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class implements the
@@ -3416,7 +3352,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
*
* @param numTypeArgument the number of provided type arguments
*/
- static final StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = new StaticTypeWarningCode.con1('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 1, "Map literal requires exactly two type arguments or none, but %d found");
+ static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const StaticTypeWarningCode.con1('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 1, "Map literal requires exactly two type arguments or none, but %d found");
/**
* 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
@@ -3424,7 +3360,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
*
* @see #UNDEFINED_SETTER
*/
- static final StaticTypeWarningCode INACCESSIBLE_SETTER = new StaticTypeWarningCode.con1('INACCESSIBLE_SETTER', 2, "");
+ static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarningCode.con1('INACCESSIBLE_SETTER', 2, "");
/**
* 8.1.1 Inheritance and Overriding: However, if there are multiple members <i>m<sub>1</sub>,
@@ -3446,7 +3382,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* * Otherwise none of the members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> is inherited.
* </ol>
*/
- static final StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = new StaticTypeWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE', 3, "'%s' is inherited by at least two interfaces inconsistently, from %s");
+ static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const StaticTypeWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE', 3, "'%s' is inherited by at least two interfaces inconsistently, from %s");
/**
* 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does not have an
@@ -3455,7 +3391,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param memberName the name of the static member
* @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER
*/
- static final StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = new StaticTypeWarningCode.con1('INSTANCE_ACCESS_TO_STATIC_MEMBER', 4, "Static member '%s' cannot be accessed using instance access");
+ static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const StaticTypeWarningCode.con1('INSTANCE_ACCESS_TO_STATIC_MEMBER', 4, "Static member '%s' cannot be accessed using instance access");
/**
* 12.18 Assignment: It is a static type warning if the static type of <i>e</i> may not be
@@ -3472,7 +3408,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param rhsTypeName the name of the right hand side type
* @param lhsTypeName the name of the left hand side type
*/
- static final StaticTypeWarningCode INVALID_ASSIGNMENT = new StaticTypeWarningCode.con1('INVALID_ASSIGNMENT', 5, "A value of type '%s' cannot be assigned to a variable of type '%s'");
+ static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarningCode.con1('INVALID_ASSIGNMENT', 5, "A value of type '%s' cannot be assigned to a variable of type '%s'");
/**
* 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the form
@@ -3494,7 +3430,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
*
* @param nonFunctionIdentifier the name of the identifier that is not a function type
*/
- static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = new StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION', 6, "'%s' is not a method");
+ static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION', 6, "'%s' is not a method");
/**
* 12.14.4 Function Expression Invocation: A function expression invocation <i>i</i> has the form
@@ -3504,7 +3440,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub></i> may not be
* assigned to a function type.
*/
- static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = new StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 7, "Cannot invoke a non-function");
+ static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = const StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 7, "Cannot invoke a non-function");
/**
* 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</sub></i> may not be
@@ -3517,13 +3453,13 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
*
* 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assigned to bool.
*/
- static final StaticTypeWarningCode NON_BOOL_CONDITION = new StaticTypeWarningCode.con1('NON_BOOL_CONDITION', 8, "Conditions must have a static type of 'bool'");
+ static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarningCode.con1('NON_BOOL_CONDITION', 8, "Conditions must have a static type of 'bool'");
/**
* 13.15 Assert: It is a static type warning if the type of <i>e</i> may not be assigned to either
* bool or () &rarr; bool
*/
- static final StaticTypeWarningCode NON_BOOL_EXPRESSION = new StaticTypeWarningCode.con1('NON_BOOL_EXPRESSION', 9, "Assertions must be on either a 'bool' or '() -> bool'");
+ static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarningCode.con1('NON_BOOL_EXPRESSION', 9, "Assertions must be on either a 'bool' or '() -> bool'");
/**
* 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the expression
@@ -3532,13 +3468,13 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</sub></i> may not be
* assigned to bool.
*/
- static final StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = new StaticTypeWarningCode.con1('NON_BOOL_NEGATION_EXPRESSION', 10, "Negation argument must have a static type of 'bool'");
+ static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const StaticTypeWarningCode.con1('NON_BOOL_NEGATION_EXPRESSION', 10, "Negation argument must have a static type of 'bool'");
/**
* 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>, 1 &lt;= i &lt;=
* n</i> does not denote a type in the enclosing lexical scope.
*/
- static final StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = new StaticTypeWarningCode.con1('NON_TYPE_AS_TYPE_ARGUMENT', 11, "The name '%s' is not a type and cannot be used as a parameterized type");
+ static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTypeWarningCode.con1('NON_TYPE_AS_TYPE_ARGUMENT', 11, "The name '%s' is not a type and cannot be used as a parameterized type");
/**
* 13.11 Return: It is a static type warning if the type of <i>e</i> may not be assigned to the
@@ -3548,7 +3484,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param expectedReturnType the expected return type as defined by the method
* @param methodName the name of the method
*/
- static final StaticTypeWarningCode RETURN_OF_INVALID_TYPE = new StaticTypeWarningCode.con1('RETURN_OF_INVALID_TYPE', 12, "The return type '%s' is not a '%s', as defined by the method '%s'");
+ static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWarningCode.con1('RETURN_OF_INVALID_TYPE', 12, "The return type '%s' is not a '%s', as defined by the method '%s'");
/**
* 12.11 Instance Creation: It is a static type warning if any of the type arguments to a
@@ -3572,7 +3508,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param boundingTypeName the name of the bounding type
* @see #TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND
*/
- static final StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new StaticTypeWarningCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 13, "'%s' does not extend '%s'");
+ static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const StaticTypeWarningCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 13, "'%s' does not extend '%s'");
/**
* 10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound.
@@ -3580,7 +3516,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param typeParameterName the name of the type parameter
* @see #TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
*/
- static final StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = new StaticTypeWarningCode.con1('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', 14, "'%s' cannot be a supertype of its upper bound");
+ static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = const StaticTypeWarningCode.con1('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', 14, "'%s' cannot be a supertype of its upper bound");
/**
* 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is a static type
@@ -3589,7 +3525,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param getterName the name of the getter
* @param enclosingType the name of the enclosing type where the getter is being looked for
*/
- static final StaticTypeWarningCode UNDEFINED_GETTER = new StaticTypeWarningCode.con1('UNDEFINED_GETTER', 15, "There is no such getter '%s' in '%s'");
+ static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningCode.con1('UNDEFINED_GETTER', 15, "There is no such getter '%s' in '%s'");
/**
* 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. It is a static type
@@ -3598,7 +3534,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param methodName the name of the method that is undefined
* @param typeName the resolved type name that the method lookup is happening on
*/
- static final StaticTypeWarningCode UNDEFINED_METHOD = new StaticTypeWarningCode.con1('UNDEFINED_METHOD', 16, "The method '%s' is not defined for the class '%s'");
+ static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningCode.con1('UNDEFINED_METHOD', 16, "The method '%s' is not defined for the class '%s'");
/**
* 12.18 Assignment: Evaluation of an assignment of the form
@@ -3616,7 +3552,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param operator the name of the operator
* @param enclosingType the name of the enclosing type where the operator is being looked for
*/
- static final StaticTypeWarningCode UNDEFINED_OPERATOR = new StaticTypeWarningCode.con1('UNDEFINED_OPERATOR', 17, "There is no such operator '%s' in '%s'");
+ static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarningCode.con1('UNDEFINED_OPERATOR', 17, "There is no such operator '%s' in '%s'");
/**
* 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
@@ -3626,7 +3562,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param enclosingType the name of the enclosing type where the setter is being looked for
* @see #INACCESSIBLE_SETTER
*/
- static final StaticTypeWarningCode UNDEFINED_SETTER = new StaticTypeWarningCode.con1('UNDEFINED_SETTER', 18, "There is no such setter '%s' in '%s'");
+ static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningCode.con1('UNDEFINED_SETTER', 18, "There is no such setter '%s' in '%s'");
/**
* 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
@@ -3637,7 +3573,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param methodName the name of the method that is undefined
* @param typeName the resolved type name that the method lookup is happening on
*/
- static final StaticTypeWarningCode UNDEFINED_SUPER_METHOD = new StaticTypeWarningCode.con1('UNDEFINED_SUPER_METHOD', 19, "There is no such method '%s' in '%s'");
+ static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWarningCode.con1('UNDEFINED_SUPER_METHOD', 19, "There is no such method '%s' in '%s'");
/**
* 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does not have an
@@ -3647,7 +3583,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* able to find the name defined in a supertype. It exists to provide a more informative error
* message.
*/
- static final StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER = new StaticTypeWarningCode.con1('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', 20, "Static members from supertypes must be qualified by the name of the defining type");
+ static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER = const StaticTypeWarningCode.con1('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', 20, "Static members from supertypes must be qualified by the name of the defining type");
/**
* 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a generic type with
@@ -3659,9 +3595,9 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS
* @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
*/
- static final StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new StaticTypeWarningCode.con1('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 21, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
+ static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const StaticTypeWarningCode.con1('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 21, "The type '%s' is declared with %d type parameters, but %d type arguments were given");
- static final List<StaticTypeWarningCode> values = [
+ static const List<StaticTypeWarningCode> values = const [
EXPECTED_ONE_LIST_TYPE_ARGUMENTS,
EXPECTED_TWO_MAP_TYPE_ARGUMENTS,
INACCESSIBLE_SETTER,
@@ -3688,22 +3624,20 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
/**
* The template used to create the message to be displayed for this error.
*/
- String message;
+ final String message;
/**
* The template used to create the correction to be displayed for this error, or `null` if
* there is no correction information for this error.
*/
- String correction6;
+ final String correction;
/**
* Initialize a newly created error code to have the given message.
*
* @param message the message template used to create the message to be displayed for the error
*/
- StaticTypeWarningCode.con1(String name, int ordinal, String message) : super(name, ordinal) {
- this.message = message;
- }
+ const StaticTypeWarningCode.con1(String name, int ordinal, String message) : this.con2(name, ordinal, message, null);
/**
* Initialize a newly created error code to have the given message and correction.
@@ -3711,13 +3645,7 @@ class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
* @param message the template used to create the message to be displayed for the error
* @param correction the template used to create the correction to be displayed for the error
*/
- StaticTypeWarningCode.con2(String name, int ordinal, String message, String correction) : super(name, ordinal) {
- this.message = message;
- this.correction6 = correction;
- }
-
- @override
- String get correction => correction6;
+ const StaticTypeWarningCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
@override
ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity;
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698