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

Side by Side Diff: pkg/analyzer/lib/src/generated/error.dart

Issue 322603002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/index.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.error; 8 library engine.error;
9 9
10 import 'dart:collection';
10 import 'java_core.dart'; 11 import 'java_core.dart';
11 import 'source.dart'; 12 import 'source.dart';
12 import 'scanner.dart' show Token; 13 import 'scanner.dart' show Token;
13 import 'ast.dart' show AstNode; 14 import 'ast.dart' show AstNode;
14 import 'element.dart' show Element; 15 import 'element.dart';
15 16
16 /** 17 /**
17 * Instances of the class `AnalysisError` represent an error discovered during t he analysis of 18 * Instances of the class `AnalysisError` represent an error discovered during t he analysis of
18 * some Dart code. 19 * some Dart code.
19 * 20 *
20 * @see AnalysisErrorListener 21 * @see AnalysisErrorListener
21 */ 22 */
22 class AnalysisError { 23 class AnalysisError {
23 /** 24 /**
24 * An empty array of errors used when no errors are expected. 25 * An empty array of errors used when no errors are expected.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 238 }
238 } 239 }
239 240
240 /** 241 /**
241 * Instances of the class `AnalysisErrorWithProperties` 242 * Instances of the class `AnalysisErrorWithProperties`
242 */ 243 */
243 class AnalysisErrorWithProperties extends AnalysisError { 244 class AnalysisErrorWithProperties extends AnalysisError {
244 /** 245 /**
245 * The properties associated with this error. 246 * The properties associated with this error.
246 */ 247 */
247 Map<ErrorProperty, Object> _propertyMap = new Map<ErrorProperty, Object>(); 248 HashMap<ErrorProperty, Object> _propertyMap = new HashMap<ErrorProperty, Objec t>();
248 249
249 /** 250 /**
250 * Initialize a newly created analysis error for the specified source. The err or has no location 251 * Initialize a newly created analysis error for the specified source. The err or has no location
251 * information. 252 * information.
252 * 253 *
253 * @param source the source for which the exception occurred 254 * @param source the source for which the exception occurred
254 * @param errorCode the error code to be associated with this error 255 * @param errorCode the error code to be associated with this error
255 * @param arguments the arguments used to build the error message 256 * @param arguments the arguments used to build the error message
256 */ 257 */
257 AnalysisErrorWithProperties.con1(Source source, ErrorCode errorCode, List<Obje ct> arguments) : super.con1(source, errorCode, arguments); 258 AnalysisErrorWithProperties.con1(Source source, ErrorCode errorCode, List<Obje ct> arguments) : super.con1(source, errorCode, arguments);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 const AngularCode(String name, int ordinal, this.message) : super(name, ordina l); 347 const AngularCode(String name, int ordinal, this.message) : super(name, ordina l);
347 348
348 @override 349 @override
349 String get correction => null; 350 String get correction => null;
350 351
351 @override 352 @override
352 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 353 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
353 354
354 @override 355 @override
355 ErrorType get type => ErrorType.ANGULAR; 356 ErrorType get type => ErrorType.ANGULAR;
357
358 @override
359 String get uniqueName => "${runtimeType.toString()}.${name}";
356 } 360 }
357 361
358 /** 362 /**
359 * Instances of the class `BooleanErrorListener` implement a listener that keeps track of 363 * Instances of the class `BooleanErrorListener` implement a listener that keeps track of
360 * whether an error has been reported to it. 364 * whether an error has been reported to it.
361 */ 365 */
362 class BooleanErrorListener implements AnalysisErrorListener { 366 class BooleanErrorListener implements AnalysisErrorListener {
363 /** 367 /**
364 * A flag indicating whether an error has been reported to this listener. 368 * A flag indicating whether an error has been reported to this listener.
365 */ 369 */
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 * @param id the name of the initializing formal that is a static variable in the immediately 997 * @param id the name of the initializing formal that is a static variable in the immediately
994 * enclosing class 998 * enclosing class
995 * @see #INITIALIZER_FOR_STATIC_FIELD 999 * @see #INITIALIZER_FOR_STATIC_FIELD
996 */ 1000 */
997 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 73, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static"); 1001 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 73, "'%s' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
998 1002
999 /** 1003 /**
1000 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action 1004 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action
1001 * <b>this</b>.<i>id</i>. 1005 * <b>this</b>.<i>id</i>.
1002 */ 1006 */
1003 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const C ompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 74, "Instance mem ber cannot be accessed from static method"); 1007 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', 74, "Instance m embers cannot be accessed from a factory constructor");
1008
1009 /**
1010 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action
1011 * <b>this</b>.<i>id</i>.
1012 */
1013 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const C ompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 75, "Instance mem bers cannot be accessed from a static method");
1004 1014
1005 /** 1015 /**
1006 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1016 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1007 * character @, followed by a constant expression that must be either a refere nce to a 1017 * character @, followed by a constant expression that must be either a refere nce to a
1008 * compile-time constant variable, or a call to a constant constructor. 1018 * compile-time constant variable, or a call to a constant constructor.
1009 */ 1019 */
1010 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode.con1('INVALID_ANNOTATION', 75, "Annotation can be only constant variable or constant constructor invocation"); 1020 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode.con1('INVALID_ANNOTATION', 76, "Annotation can be only constant variable or constant constructor invocation");
1011 1021
1012 /** 1022 /**
1013 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1023 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1014 * character @, followed by a constant expression that must be either a refere nce to a 1024 * character @, followed by a constant expression that must be either a refere nce to a
1015 * compile-time constant variable, or a call to a constant constructor. 1025 * compile-time constant variable, or a call to a constant constructor.
1016 * 1026 *
1017 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1027 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1018 * deferred prefix. 1028 * deferred prefix.
1019 */ 1029 */
1020 static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = c onst CompileTimeErrorCode.con1('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', 76, " Constant values from a deferred library cannot be used as annotations"); 1030 static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = c onst CompileTimeErrorCode.con1('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', 77, " Constant values from a deferred library cannot be used as annotations");
1021 1031
1022 /** 1032 /**
1023 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time 1033 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time
1024 * constants. Until then, this acts as a placeholder for more informative erro rs. 1034 * constants. Until then, this acts as a placeholder for more informative erro rs.
1025 * 1035 *
1026 * See TODOs in ConstantVisitor 1036 * See TODOs in ConstantVisitor
1027 */ 1037 */
1028 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e.con1('INVALID_CONSTANT', 77, "Invalid constant value"); 1038 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e.con1('INVALID_CONSTANT', 78, "Invalid constant value");
1029 1039
1030 /** 1040 /**
1031 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor 1041 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor
1032 * name. 1042 * name.
1033 */ 1043 */
1034 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 78, "Invalid constructor name"); 1044 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 79, "Invalid constructor name");
1035 1045
1036 /** 1046 /**
1037 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately 1047 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately
1038 * enclosing class. 1048 * enclosing class.
1039 */ 1049 */
1040 static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const Com pileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 79, "The name of the immediately enclosing class expected"); 1050 static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const Com pileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 80, "The name of the immediately enclosing class expected");
1041 1051
1042 /** 1052 /**
1043 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable 1053 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable
1044 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the 1054 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the
1045 * initializer of an instance variable. 1055 * initializer of an instance variable.
1046 */ 1056 */
1047 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode.con1('INVALID_REFERENCE_TO_THIS', 80, "Invalid reference to 'this' ex pression"); 1057 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode.con1('INVALID_REFERENCE_TO_THIS', 81, "Invalid reference to 'this' ex pression");
1048 1058
1049 /** 1059 /**
1050 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes 1060 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes
1051 * a type parameter. 1061 * a type parameter.
1052 * 1062 *
1053 * @name the name of the type parameter 1063 * @name the name of the type parameter
1054 */ 1064 */
1055 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 81, "Constant l ist literals cannot include a type parameter as a type argument, such as '%s'"); 1065 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 82, "Constant l ist literals cannot include a type parameter as a type argument, such as '%s'");
1056 1066
1057 /** 1067 /**
1058 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a 1068 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a
1059 * type parameter. 1069 * type parameter.
1060 * 1070 *
1061 * @name the name of the type parameter 1071 * @name the name of the type parameter
1062 */ 1072 */
1063 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const C ompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 82, "Constant map literals cannot include a type parameter as a type argument, such as '%s'"); 1073 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const C ompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 83, "Constant map literals cannot include a type parameter as a type argument, such as '%s'");
1064 1074
1065 /** 1075 /**
1066 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 1076 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is
1067 * not a library declaration. 1077 * not a library declaration.
1068 * 1078 *
1069 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 1079 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is
1070 * not a library declaration. 1080 * not a library declaration.
1071 * 1081 *
1072 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1082 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
1073 * declaration. 1083 * declaration.
1074 * 1084 *
1075 * @param uri the URI that is invalid 1085 * @param uri the URI that is invalid
1076 * @see #URI_DOES_NOT_EXIST 1086 * @see #URI_DOES_NOT_EXIST
1077 */ 1087 */
1078 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con 1('INVALID_URI', 83, "Invalid URI syntax: '%s'"); 1088 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con 1('INVALID_URI', 84, "Invalid URI syntax: '%s'");
1079 1089
1080 /** 1090 /**
1081 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within 1091 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within
1082 * the innermost function in which <i>s<sub>b</sub></i> occurs. 1092 * the innermost function in which <i>s<sub>b</sub></i> occurs.
1083 * 1093 *
1084 * 13.14 Continue: It is a compile-time error if no such statement or case cla use 1094 * 13.14 Continue: It is a compile-time error if no such statement or case cla use
1085 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. 1095 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs.
1086 * 1096 *
1087 * @param labelName the name of the unresolvable label 1097 * @param labelName the name of the unresolvable label
1088 */ 1098 */
1089 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErro rCode.con1('LABEL_IN_OUTER_SCOPE', 84, "Cannot reference label '%s' declared in an outer method"); 1099 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErro rCode.con1('LABEL_IN_OUTER_SCOPE', 85, "Cannot reference label '%s' declared in an outer method");
1090 1100
1091 /** 1101 /**
1092 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within 1102 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within
1093 * the innermost function in which <i>s<sub>b</sub></i> occurs. 1103 * the innermost function in which <i>s<sub>b</sub></i> occurs.
1094 * 1104 *
1095 * 13.14 Continue: It is a compile-time error if no such statement or case cla use 1105 * 13.14 Continue: It is a compile-time error if no such statement or case cla use
1096 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. 1106 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs.
1097 * 1107 *
1098 * @param labelName the name of the unresolvable label 1108 * @param labelName the name of the unresolvable label
1099 */ 1109 */
1100 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode .con1('LABEL_UNDEFINED', 85, "Cannot reference undefined label '%s'"); 1110 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode .con1('LABEL_UNDEFINED', 86, "Cannot reference undefined label '%s'");
1101 1111
1102 /** 1112 /**
1103 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ... 1113 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
1104 * <i>e<sub>n</sub></i>] is evaluated as follows: 1114 * <i>e<sub>n</sub></i>] is evaluated as follows:
1105 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument 1115 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument
1106 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i> 1116 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
1107 * 1117 *
1108 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 1118 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1109 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 1119 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
1110 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 1120 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
1111 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 1121 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1112 * j &lt;= m</i>. 1122 * j &lt;= m</i>.
1113 */ 1123 */
1114 static const CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Com pileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 86, "The element type '%s' cannot be assigned to the list type '%s'"); 1124 static const CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Com pileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 87, "The element type '%s' cannot be assigned to the list type '%s'");
1115 1125
1116 /** 1126 /**
1117 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 1127 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
1118 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 1128 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
1119 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 1129 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
1120 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 1130 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
1121 * 1131 *
1122 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 1132 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1123 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 1133 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
1124 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 1134 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
1125 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 1135 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1126 * j &lt;= m</i>. 1136 * j &lt;= m</i>.
1127 */ 1137 */
1128 static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const CompileT imeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 87, "The element type '%s' cann ot be assigned to the map key type '%s'"); 1138 static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const CompileT imeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 88, "The element type '%s' cann ot be assigned to the map key type '%s'");
1129 1139
1130 /** 1140 /**
1131 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 1141 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
1132 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 1142 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
1133 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 1143 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
1134 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 1144 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
1135 * 1145 *
1136 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 1146 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1137 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 1147 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;=
1138 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>. 1148 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i> q</i> of <i>f</i>.
1139 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 1149 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1140 * j &lt;= m</i>. 1150 * j &lt;= m</i>.
1141 */ 1151 */
1142 static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const Compil eTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 88, "The element type '%s' cannot be assigned to the map value type '%s'"); 1152 static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const Compil eTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 89, "The element type '%s' cannot be assigned to the map value type '%s'");
1143 1153
1144 /** 1154 /**
1145 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name 1155 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name
1146 * as <i>C</i>. 1156 * as <i>C</i>.
1147 */ 1157 */
1148 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeEr rorCode.con1('MEMBER_WITH_CLASS_NAME', 89, "Class members cannot have the same n ame as the enclosing class"); 1158 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeEr rorCode.con1('MEMBER_WITH_CLASS_NAME', 90, "Class members cannot have the same n ame as the enclosing class");
1149 1159
1150 /** 1160 /**
1151 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 1161 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
1152 * name. 1162 * name.
1153 * 1163 *
1154 * @param name the conflicting name of the getter and method 1164 * @param name the conflicting name of the getter and method
1155 */ 1165 */
1156 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 90, "'%s' cannot be u sed to name a method, there is already a getter with the same name"); 1166 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 91, "'%s' cannot be u sed to name a method, there is already a getter with the same name");
1157 1167
1158 /** 1168 /**
1159 * 12.1 Constants: A constant expression is ... a constant list literal. 1169 * 12.1 Constants: A constant expression is ... a constant list literal.
1160 */ 1170 */
1161 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const Compil eTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 91, "List literals must be prefixed with 'const' when used as a constant expression"); 1171 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const Compil eTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 92, "List literals must be prefixed with 'const' when used as a constant expression");
1162 1172
1163 /** 1173 /**
1164 * 12.1 Constants: A constant expression is ... a constant map literal. 1174 * 12.1 Constants: A constant expression is ... a constant map literal.
1165 */ 1175 */
1166 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const Compile TimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 92, "Map literals must be pre fixed with 'const' when used as a constant expression"); 1176 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const Compile TimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 93, "Map literals must be pre fixed with 'const' when used as a constant expression");
1167 1177
1168 /** 1178 /**
1169 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a 1179 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a
1170 * constructor. 1180 * constructor.
1171 * 1181 *
1172 * @param typeName the name of the mixin that is invalid 1182 * @param typeName the name of the mixin that is invalid
1173 */ 1183 */
1174 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi meErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 93, "The class '%s' cannot be use d as a mixin because it declares a constructor"); 1184 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi meErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 94, "The class '%s' cannot be use d as a mixin because it declares a constructor");
1175 1185
1176 /** 1186 /**
1177 * 9.1 Mixin Application: It is a compile-time error if the with clause of a m ixin application 1187 * 9.1 Mixin Application: It is a compile-time error if the with clause of a m ixin application
1178 * <i>C</i> includes a deferred type expression. 1188 * <i>C</i> includes a deferred type expression.
1179 * 1189 *
1180 * @param typeName the name of the type that cannot be extended 1190 * @param typeName the name of the type that cannot be extended
1181 * @see #EXTENDS_DEFERRED_CLASS 1191 * @see #EXTENDS_DEFERRED_CLASS
1182 * @see #IMPLEMENTS_DEFERRED_CLASS 1192 * @see #IMPLEMENTS_DEFERRED_CLASS
1183 */ 1193 */
1184 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode.con1('MIXIN_DEFERRED_CLASS', 94, "This class cannot mixin the deferred cla ss '%s'"); 1194 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode.con1('MIXIN_DEFERRED_CLASS', 95, "This class cannot mixin the deferred cla ss '%s'");
1185 1195
1186 /** 1196 /**
1187 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not 1197 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not
1188 * Object. 1198 * Object.
1189 * 1199 *
1190 * @param typeName the name of the mixin that is invalid 1200 * @param typeName the name of the mixin that is invalid
1191 */ 1201 */
1192 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 95, "The class '%s' canno t be used as a mixin because it extends a class other than Object"); 1202 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 96, "The class '%s' canno t be used as a mixin because it extends a class other than Object");
1193 1203
1194 /** 1204 /**
1195 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 1205 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null.
1196 * 1206 *
1197 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 1207 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int.
1198 * 1208 *
1199 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 1209 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double.
1200 * 1210 *
1201 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 1211 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
1202 * attempt to extend or implement num. 1212 * attempt to extend or implement num.
1203 * 1213 *
1204 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 1214 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
1205 * 1215 *
1206 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 1216 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String.
1207 * 1217 *
1208 * @param typeName the name of the type that cannot be extended 1218 * @param typeName the name of the type that cannot be extended
1209 * @see #IMPLEMENTS_DISALLOWED_CLASS 1219 * @see #IMPLEMENTS_DISALLOWED_CLASS
1210 */ 1220 */
1211 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 96, "Classes cannot mixin '%s'"); 1221 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 97, "Classes cannot mixin '%s'");
1212 1222
1213 /** 1223 /**
1214 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin 1224 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin
1215 * available in the immediately enclosing scope. 1225 * available in the immediately enclosing scope.
1216 */ 1226 */
1217 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode.con1('MIXIN_OF_NON_CLASS', 97, "Classes can only mixin other classes"); 1227 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode.con1('MIXIN_OF_NON_CLASS', 98, "Classes can only mixin other classes");
1218 1228
1219 /** 1229 /**
1220 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super. 1230 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super.
1221 */ 1231 */
1222 static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeEr rorCode.con1('MIXIN_REFERENCES_SUPER', 98, "The class '%s' cannot be used as a m ixin because it references 'super'"); 1232 static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeEr rorCode.con1('MIXIN_REFERENCES_SUPER', 99, "The class '%s' cannot be used as a m ixin because it references 'super'");
1223 1233
1224 /** 1234 /**
1225 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available 1235 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available
1226 * in the immediately enclosing scope. 1236 * in the immediately enclosing scope.
1227 */ 1237 */
1228 static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const Comp ileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 99, "Mixin can only be applied to class"); 1238 static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const Comp ileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 100, "Mixin can only be applied to class");
1229 1239
1230 /** 1240 /**
1231 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1241 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1232 * only action is to invoke another generative constructor. 1242 * only action is to invoke another generative constructor.
1233 */ 1243 */
1234 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS ', 100, "Constructor may have at most one 'this' redirection"); 1244 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS ', 101, "Constructor may have at most one 'this' redirection");
1235 1245
1236 /** 1246 /**
1237 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may 1247 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may
1238 * include at most one superinitializer in its initializer list or a compile t ime error occurs. 1248 * include at most one superinitializer in its initializer list or a compile t ime error occurs.
1239 */ 1249 */
1240 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 101, "Constructor may have at m ost one 'super' initializer"); 1250 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 102, "Constructor may have at m ost one 'super' initializer");
1241 1251
1242 /** 1252 /**
1243 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1253 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1244 * character @, followed by a constant expression that must be either a refere nce to a 1254 * character @, followed by a constant expression that must be either a refere nce to a
1245 * compile-time constant variable, or a call to a constant constructor. 1255 * compile-time constant variable, or a call to a constant constructor.
1246 */ 1256 */
1247 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 102, "Annotatio n creation must have arguments"); 1257 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 103, "Annotatio n creation must have arguments");
1248 1258
1249 /** 1259 /**
1250 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer 1260 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer
1251 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the 1261 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the
1252 * enclosing class is class <i>Object</i>. 1262 * enclosing class is class <i>Object</i>.
1253 * 1263 *
1254 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a 1264 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
1255 * generative constructor named <i>S</i> (respectively <i>S.id</i>) 1265 * generative constructor named <i>S</i> (respectively <i>S.id</i>)
1256 */ 1266 */
1257 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 103, "The c lass '%s' does not have a default constructor"); 1267 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 104, "The c lass '%s' does not have a default constructor");
1258 1268
1259 /** 1269 /**
1260 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a 1270 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a
1261 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>. 1271 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>.
1262 * 1272 *
1263 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a 1273 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
1264 * generative constructor named <i>S</i> (respectively <i>S.id</i>) 1274 * generative constructor named <i>S</i> (respectively <i>S.id</i>)
1265 */ 1275 */
1266 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 104, "The c lass '%s' does not have a default constructor"); 1276 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 105, "The c lass '%s' does not have a default constructor");
1267 1277
1268 /** 1278 /**
1269 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has 1279 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has
1270 * no explicit type arguments appears in a place where a statement is expected . 1280 * no explicit type arguments appears in a place where a statement is expected .
1271 */ 1281 */
1272 static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = cons t CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 105, "A non -constant map literal without type arguments cannot be used as an expression sta tement"); 1282 static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = cons t CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 106, "A non -constant map literal without type arguments cannot be used as an expression sta tement");
1273 1283
1274 /** 1284 /**
1275 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip; 1285 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip;
1276 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip; 1286 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip;
1277 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form 1287 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form
1278 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>: 1288 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>:
1279 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>: 1289 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>:
1280 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not 1290 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not
1281 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>. 1291 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
1282 */ 1292 */
1283 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 106, "Case expressions must b e constant"); 1293 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 107, "Case expressions must b e constant");
1284 1294
1285 /** 1295 /**
1286 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip; 1296 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip;
1287 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip; 1297 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip;
1288 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form 1298 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form
1289 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>: 1299 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>:
1290 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>: 1300 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>:
1291 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not 1301 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not
1292 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>. 1302 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
1293 * 1303 *
1294 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1304 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1295 * deferred prefix. 1305 * deferred prefix.
1296 */ 1306 */
1297 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_L IBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFE RRED_LIBRARY', 107, "Constant values from a deferred library cannot be used as a case expression"); 1307 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_L IBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFE RRED_LIBRARY', 108, "Constant values from a deferred library cannot be used as a case expression");
1298 1308
1299 /** 1309 /**
1300 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional 1310 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
1301 * parameter is not a compile-time constant. 1311 * parameter is not a compile-time constant.
1302 */ 1312 */
1303 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTi meErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 108, "Default values of an option al parameter must be constant"); 1313 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTi meErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 109, "Default values of an option al parameter must be constant");
1304 1314
1305 /** 1315 /**
1306 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional 1316 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
1307 * parameter is not a compile-time constant. 1317 * parameter is not a compile-time constant.
1308 * 1318 *
1309 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1319 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1310 * deferred prefix. 1320 * deferred prefix.
1311 */ 1321 */
1312 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIB RARY = const CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED _LIBRARY', 109, "Constant values from a deferred library cannot be used as a def ault parameter value"); 1322 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIB RARY = const CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED _LIBRARY', 110, "Constant values from a deferred library cannot be used as a def ault parameter value");
1313 1323
1314 /** 1324 /**
1315 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a 1325 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a
1316 * compile-time constant. 1326 * compile-time constant.
1317 */ 1327 */
1318 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 110, "'const' lists must have all c onstant values"); 1328 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 111, "'const' lists must have all c onstant values");
1319 1329
1320 /** 1330 /**
1321 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a 1331 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a
1322 * compile-time constant. 1332 * compile-time constant.
1323 * 1333 *
1324 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1334 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1325 * deferred prefix. 1335 * deferred prefix.
1326 */ 1336 */
1327 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBR ARY = const CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_L IBRARY', 111, "Constant values from a deferred library cannot be used as values in a 'const' list"); 1337 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBR ARY = const CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_L IBRARY', 112, "Constant values from a deferred library cannot be used as values in a 'const' list");
1328 1338
1329 /** 1339 /**
1330 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1340 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1331 * literal is not a compile-time constant. 1341 * literal is not a compile-time constant.
1332 */ 1342 */
1333 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode.con1('NON_CONSTANT_MAP_KEY', 112, "The keys in a map must be constant"); 1343 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode.con1('NON_CONSTANT_MAP_KEY', 113, "The keys in a map must be constant");
1334 1344
1335 /** 1345 /**
1336 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1346 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1337 * literal is not a compile-time constant. 1347 * literal is not a compile-time constant.
1338 * 1348 *
1339 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1349 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1340 * deferred prefix. 1350 * deferred prefix.
1341 */ 1351 */
1342 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', 1 13, "Constant values from a deferred library cannot be used as keys in a map"); 1352 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', 1 14, "Constant values from a deferred library cannot be used as keys in a map");
1343 1353
1344 /** 1354 /**
1345 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1355 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1346 * literal is not a compile-time constant. 1356 * literal is not a compile-time constant.
1347 */ 1357 */
1348 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeEr rorCode.con1('NON_CONSTANT_MAP_VALUE', 114, "The values in a 'const' map must be constant"); 1358 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeEr rorCode.con1('NON_CONSTANT_MAP_VALUE', 115, "The values in a 'const' map must be constant");
1349 1359
1350 /** 1360 /**
1351 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1361 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1352 * literal is not a compile-time constant. 1362 * literal is not a compile-time constant.
1353 * 1363 *
1354 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1364 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1355 * deferred prefix. 1365 * deferred prefix.
1356 */ 1366 */
1357 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY ', 115, "Constant values from a deferred library cannot be used as values in a ' const' map"); 1367 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY ', 116, "Constant values from a deferred library cannot be used as values in a ' const' map");
1358 1368
1359 /** 1369 /**
1360 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1370 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1361 * character @, followed by a constant expression that must be either a refere nce to a 1371 * character @, followed by a constant expression that must be either a refere nce to a
1362 * compile-time constant variable, or a call to a constant constructor. 1372 * compile-time constant variable, or a call to a constant constructor.
1363 * 1373 *
1364 * "From deferred library" case is covered by 1374 * "From deferred library" case is covered by
1365 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]. 1375 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY].
1366 */ 1376 */
1367 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 116, "Annotatio n creation can use only 'const' constructor"); 1377 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 117, "Annotatio n creation can use only 'const' constructor");
1368 1378
1369 /** 1379 /**
1370 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a 1380 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a
1371 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. 1381 * constant constructor must be a potentially constant expression, or a compil e-time error occurs.
1372 */ 1382 */
1373 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co mpileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 117, "Initializer e xpressions in constant constructors must be constants"); 1383 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co mpileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 118, "Initializer e xpressions in constant constructors must be constants");
1374 1384
1375 /** 1385 /**
1376 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a 1386 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a
1377 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. 1387 * constant constructor must be a potentially constant expression, or a compil e-time error occurs.
1378 * 1388 *
1379 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1389 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1380 * deferred prefix. 1390 * deferred prefix.
1381 */ 1391 */
1382 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFER RED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER _FROM_DEFERRED_LIBRARY', 118, "Constant values from a deferred library cannot be used as constant initializers"); 1392 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFER RED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER _FROM_DEFERRED_LIBRARY', 119, "Constant values from a deferred library cannot be used as constant initializers");
1383 1393
1384 /** 1394 /**
1385 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>. 1395 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>.
1386 * 1396 *
1387 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1397 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1388 * uncaught exception being thrown. 1398 * uncaught exception being thrown.
1389 * 1399 *
1390 * @param requiredCount the expected number of required arguments 1400 * @param requiredCount the expected number of required arguments
1391 * @param argumentCount the actual number of positional arguments given 1401 * @param argumentCount the actual number of positional arguments given
1392 */ 1402 */
1393 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 119, "%d required argument( s) expected, but %d found"); 1403 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 120, "%d required argument( s) expected, but %d found");
1394 1404
1395 /** 1405 /**
1396 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1406 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
1397 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1407 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
1398 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1408 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
1399 * (respectively <i>S.id</i>) 1409 * (respectively <i>S.id</i>)
1400 */ 1410 */
1401 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 120, "The generative constructor '%s' expected, but factory found"); 1411 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 121, "The generative constructor '%s' expected, but factory found");
1402 1412
1403 /** 1413 /**
1404 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object. 1414 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object.
1405 */ 1415 */
1406 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 121, ""); 1416 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 122, "");
1407 1417
1408 /** 1418 /**
1409 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator. 1419 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator.
1410 */ 1420 */
1411 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const Compi leTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 122, "Optional parameters are not allowed when defining an operator"); 1421 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const Compi leTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 123, "Optional parameters are not allowed when defining an operator");
1412 1422
1413 /** 1423 /**
1414 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1424 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
1415 * declaration. 1425 * declaration.
1416 * 1426 *
1417 * @param uri the uri pointing to a non-library declaration 1427 * @param uri the uri pointing to a non-library declaration
1418 */ 1428 */
1419 static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCod e.con1('PART_OF_NON_PART', 123, "The included part '%s' must have a part-of dire ctive"); 1429 static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCod e.con1('PART_OF_NON_PART', 124, "The included part '%s' must have a part-of dire ctive");
1420 1430
1421 /** 1431 /**
1422 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member 1432 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member
1423 * named <i>p</i>. 1433 * named <i>p</i>.
1424 */ 1434 */
1425 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = cons t CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 124, "The n ame '%s' is already used as an import prefix and cannot be used to name a top-le vel element"); 1435 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = cons t CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 125, "The n ame '%s' is already used as an import prefix and cannot be used to name a top-le vel element");
1426 1436
1427 /** 1437 /**
1428 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter 1438 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter
1429 * begins with an '_' character. 1439 * begins with an '_' character.
1430 */ 1440 */
1431 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 125, "Named optional parameters c annot start with an underscore"); 1441 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 126, "Named optional parameters c annot start with an underscore");
1432 1442
1433 /** 1443 /**
1434 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression 1444 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression
1435 * depends on itself. 1445 * depends on itself.
1436 */ 1446 */
1437 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 126, ""); 1447 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 127, "");
1438 1448
1439 /** 1449 /**
1440 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1450 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1441 * only action is to invoke another generative constructor. 1451 * only action is to invoke another generative constructor.
1442 * 1452 *
1443 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in 1453 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in
1444 * specification. But it was added to the co19 and there is same error for fac tories. 1454 * specification. But it was added to the co19 and there is same error for fac tories.
1445 * 1455 *
1446 * https://code.google.com/p/dart/issues/detail?id=954 1456 * https://code.google.com/p/dart/issues/detail?id=954
1447 */ 1457 */
1448 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 127, "Cycle in redirectin g generative constructors"); 1458 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 128, "Cycle in redirectin g generative constructors");
1449 1459
1450 /** 1460 /**
1451 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to 1461 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to
1452 * itself, either directly or indirectly via a sequence of redirections. 1462 * itself, either directly or indirectly via a sequence of redirections.
1453 */ 1463 */
1454 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 128, "Cycle in redirecting factor y constructors"); 1464 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 129, "Cycle in redirecting factor y constructors");
1455 1465
1456 /** 1466 /**
1457 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1467 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1458 * superinterface of itself. 1468 * superinterface of itself.
1459 * 1469 *
1460 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1470 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1461 * 1471 *
1462 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1472 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1463 * 1473 *
1464 * @param className the name of the class that implements itself recursively 1474 * @param className the name of the class that implements itself recursively
1465 * @param strImplementsPath a string representation of the implements loop 1475 * @param strImplementsPath a string representation of the implements loop
1466 */ 1476 */
1467 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 129, "'%s' cannot be a superinterface of itself: %s"); 1477 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 130, "'%s' cannot be a superinterface of itself: %s");
1468 1478
1469 /** 1479 /**
1470 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1480 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1471 * superinterface of itself. 1481 * superinterface of itself.
1472 * 1482 *
1473 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1483 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1474 * 1484 *
1475 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1485 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1476 * 1486 *
1477 * @param className the name of the class that implements itself recursively 1487 * @param className the name of the class that implements itself recursively
1478 */ 1488 */
1479 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CA SE_EXTENDS', 130, "'%s' cannot extend itself"); 1489 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CA SE_EXTENDS', 131, "'%s' cannot extend itself");
1480 1490
1481 /** 1491 /**
1482 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1492 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1483 * superinterface of itself. 1493 * superinterface of itself.
1484 * 1494 *
1485 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1495 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1486 * 1496 *
1487 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1497 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1488 * 1498 *
1489 * @param className the name of the class that implements itself recursively 1499 * @param className the name of the class that implements itself recursively
1490 */ 1500 */
1491 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE _CASE_IMPLEMENTS', 131, "'%s' cannot implement itself"); 1501 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE _CASE_IMPLEMENTS', 132, "'%s' cannot implement itself");
1492 1502
1493 /** 1503 /**
1494 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1504 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1495 * superinterface of itself. 1505 * superinterface of itself.
1496 * 1506 *
1497 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1507 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1498 * 1508 *
1499 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1509 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1500 * 1510 *
1501 * @param className the name of the class that implements itself recursively 1511 * @param className the name of the class that implements itself recursively
1502 */ 1512 */
1503 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_ WITH', 132, "'%s' cannot use itself as a mixin"); 1513 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_ WITH', 133, "'%s' cannot use itself as a mixin");
1504 1514
1505 /** 1515 /**
1506 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1516 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1507 * <i>k'</i> is not a constant constructor. 1517 * <i>k'</i> is not a constant constructor.
1508 */ 1518 */
1509 static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const Comp ileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 133, "The constructor ' %s' could not be found in '%s'"); 1519 static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const Comp ileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 134, "The constructor ' %s' could not be found in '%s'");
1510 1520
1511 /** 1521 /**
1512 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1522 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1513 * <i>k'</i> is not a constant constructor. 1523 * <i>k'</i> is not a constant constructor.
1514 */ 1524 */
1515 static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErr orCode.con1('REDIRECT_TO_NON_CLASS', 134, "The name '%s' is not a type and canno t be used in a redirected constructor"); 1525 static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErr orCode.con1('REDIRECT_TO_NON_CLASS', 135, "The name '%s' is not a type and canno t be used in a redirected constructor");
1516 1526
1517 /** 1527 /**
1518 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1528 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1519 * <i>k'</i> is not a constant constructor. 1529 * <i>k'</i> is not a constant constructor.
1520 */ 1530 */
1521 static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const Co mpileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 135, "Constant fact ory constructor cannot delegate to a non-constant constructor"); 1531 static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const Co mpileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 136, "Constant fact ory constructor cannot delegate to a non-constant constructor");
1522 1532
1523 /** 1533 /**
1524 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which 1534 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which
1525 * case its only action is to invoke another generative constructor. 1535 * case its only action is to invoke another generative constructor.
1526 */ 1536 */
1527 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', 1 36, "The constructor '%s' could not be found in '%s'"); 1537 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', 1 37, "The constructor '%s' could not be found in '%s'");
1528 1538
1529 /** 1539 /**
1530 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which 1540 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which
1531 * case its only action is to invoke another generative constructor. 1541 * case its only action is to invoke another generative constructor.
1532 */ 1542 */
1533 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTR UCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_C ONSTRUCTOR', 137, "Generative constructor cannot redirect to a factory construct or"); 1543 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTR UCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_C ONSTRUCTOR', 138, "Generative constructor cannot redirect to a factory construct or");
1534 1544
1535 /** 1545 /**
1536 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after 1546 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after
1537 * its initializer, if any, is complete, or a compile-time error occurs. 1547 * its initializer, if any, is complete, or a compile-time error occurs.
1538 */ 1548 */
1539 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 138, "Local variables canno t be referenced before they are declared"); 1549 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 139, "Local variables canno t be referenced before they are declared");
1540 1550
1541 /** 1551 /**
1542 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not 1552 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not
1543 * enclosed within a on-catch clause. 1553 * enclosed within a on-catch clause.
1544 */ 1554 */
1545 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode.con1('RETHROW_OUTSIDE_CATCH', 139, "rethrow must be inside of a catch cla use"); 1555 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode.con1('RETHROW_OUTSIDE_CATCH', 140, "rethrow must be inside of a catch cla use");
1546 1556
1547 /** 1557 /**
1548 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i> 1558 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
1549 * appears in a generative constructor. 1559 * appears in a generative constructor.
1550 */ 1560 */
1551 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 140, "Constructors ca nnot return a value"); 1561 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 141, "Constructors ca nnot return a value");
1552 1562
1553 /** 1563 /**
1554 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred imp ort is used in 1564 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred imp ort is used in
1555 * another import clause. 1565 * another import clause.
1556 */ 1566 */
1557 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeEr rorCode.con1('SHARED_DEFERRED_PREFIX', 141, "The prefix of a deferred import can not be used in other import directives"); 1567 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeEr rorCode.con1('SHARED_DEFERRED_PREFIX', 142, "The prefix of a deferred import can not be used in other import directives");
1558 1568
1559 /** 1569 /**
1560 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 1570 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
1561 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip; 1571 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip;
1562 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation 1572 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation
1563 * occurs in a top-level function or variable initializer, in an instance vari able initializer or 1573 * occurs in a top-level function or variable initializer, in an instance vari able initializer or
1564 * initializer list, in class Object, in a factory constructor, or in a static method or variable 1574 * initializer list, in class Object, in a factory constructor, or in a static method or variable
1565 * initializer. 1575 * initializer.
1566 */ 1576 */
1567 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 142, "Invalid context for 'super' inv ocation"); 1577 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 143, "Invalid context for 'super' inv ocation");
1568 1578
1569 /** 1579 /**
1570 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1580 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1571 * only action is to invoke another generative constructor. 1581 * only action is to invoke another generative constructor.
1572 */ 1582 */
1573 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 143, "The redirecting constructor cannot have a 'super' initializer"); 1583 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 144, "The redirecting constructor cannot have a 'super' initializer");
1574 1584
1575 /** 1585 /**
1576 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1586 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
1577 * error if a generative constructor of class Object includes a superinitializ er. 1587 * error if a generative constructor of class Object includes a superinitializ er.
1578 */ 1588 */
1579 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 144, ""); 1589 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 145, "");
1580 1590
1581 /** 1591 /**
1582 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a 1592 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a
1583 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object 1593 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object
1584 * expression are not subtypes of the bounds of the corresponding formal type parameters of 1594 * expression are not subtypes of the bounds of the corresponding formal type parameters of
1585 * <i>G</i>. 1595 * <i>G</i>.
1586 * 1596 *
1587 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a 1597 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a
1588 * dynamic error occurs. 1598 * dynamic error occurs.
1589 * 1599 *
1590 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise 1600 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise
1591 * an exception. 1601 * an exception.
1592 * 1602 *
1593 * @param boundedTypeName the name of the type used in the instance creation t hat should be 1603 * @param boundedTypeName the name of the type used in the instance creation t hat should be
1594 * limited by the bound as specified in the class declaration 1604 * limited by the bound as specified in the class declaration
1595 * @param boundingTypeName the name of the bounding type 1605 * @param boundingTypeName the name of the bounding type
1596 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS 1606 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
1597 */ 1607 */
1598 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 145, "'%s' does not extend '%s'"); 1608 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 146, "'%s' does not extend '%s'");
1599 1609
1600 /** 1610 /**
1601 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a 1611 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a
1602 * compile time error. 1612 * compile time error.
1603 */ 1613 */
1604 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C ompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 146, "Type alias cannot reference itself directly or recursively via another typedef"); 1614 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C ompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 147, "Type alias cannot reference itself directly or recursively via another typedef");
1605 1615
1606 /** 1616 /**
1607 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current 1617 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current
1608 * scope, optionally followed by type arguments. 1618 * scope, optionally followed by type arguments.
1609 */ 1619 */
1610 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode .con1('UNDEFINED_CLASS', 147, "Undefined class '%s'"); 1620 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode .con1('UNDEFINED_CLASS', 148, "Undefined class '%s'");
1611 1621
1612 /** 1622 /**
1613 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1623 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
1614 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1624 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
1615 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1625 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
1616 * (respectively <i>S.id</i>) 1626 * (respectively <i>S.id</i>)
1617 */ 1627 */
1618 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 148, "The cla ss '%s' does not have a generative constructor '%s'"); 1628 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 149, "The cla ss '%s' does not have a generative constructor '%s'");
1619 1629
1620 /** 1630 /**
1621 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1631 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
1622 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1632 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
1623 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1633 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
1624 * (respectively <i>S.id</i>) 1634 * (respectively <i>S.id</i>)
1625 */ 1635 */
1626 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT ', 149, "The class '%s' does not have a default generative constructor"); 1636 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT ', 150, "The class '%s' does not have a default generative constructor");
1627 1637
1628 /** 1638 /**
1629 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, 1639 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
1630 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ... 1640 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ...
1631 * <i>p<sub>n+k</sub></i>} or a static warning occurs. 1641 * <i>p<sub>n+k</sub></i>} or a static warning occurs.
1632 * 1642 *
1633 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1643 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1634 * uncaught exception being thrown. 1644 * uncaught exception being thrown.
1635 * 1645 *
1636 * @param name the name of the requested named parameter 1646 * @param name the name of the requested named parameter
1637 */ 1647 */
1638 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 150, "The named parameter '%s' is n ot defined"); 1648 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 151, "The named parameter '%s' is n ot defined");
1639 1649
1640 /** 1650 /**
1641 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 1651 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is
1642 * not a library declaration. 1652 * not a library declaration.
1643 * 1653 *
1644 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 1654 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is
1645 * not a library declaration. 1655 * not a library declaration.
1646 * 1656 *
1647 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1657 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
1648 * declaration. 1658 * declaration.
1649 * 1659 *
1650 * @param uri the URI pointing to a non-existent file 1660 * @param uri the URI pointing to a non-existent file
1651 * @see #INVALID_URI 1661 * @see #INVALID_URI
1652 */ 1662 */
1653 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode.con1('URI_DOES_NOT_EXIST', 151, "Target of URI does not exist: '%s'"); 1663 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode.con1('URI_DOES_NOT_EXIST', 152, "Target of URI does not exist: '%s'");
1654 1664
1655 /** 1665 /**
1656 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if 1666 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if
1657 * <i>x</i> involves string interpolation. 1667 * <i>x</i> involves string interpolation.
1658 * 1668 *
1659 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if 1669 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if
1660 * <i>s</i> involves string interpolation. 1670 * <i>s</i> involves string interpolation.
1661 * 1671 *
1662 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is 1672 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is
1663 * not a compile-time constant, or if <i>x</i> involves string interpolation. 1673 * not a compile-time constant, or if <i>x</i> involves string interpolation.
1664 */ 1674 */
1665 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode.con1('URI_WITH_INTERPOLATION', 152, "URIs cannot use string interpolatio n"); 1675 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode.con1('URI_WITH_INTERPOLATION', 153, "URIs cannot use string interpolatio n");
1666 1676
1667 /** 1677 /**
1668 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is 1678 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is
1669 * not 2. It is a compile time error if the arity of a user-declared operator with one of the 1679 * not 2. It is a compile time error if the arity of a user-declared operator with one of the
1670 * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt ;&gt;, [] is not 1. 1680 * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt ;&gt;, [] is not 1.
1671 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a 1681 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a
1672 * compile time error if the arity of the user-declared operator ~ is not 0. 1682 * compile time error if the arity of the user-declared operator ~ is not 0.
1673 * 1683 *
1674 * @param operatorName the name of the declared operator 1684 * @param operatorName the name of the declared operator
1675 * @param expectedNumberOfParameters the number of parameters expected 1685 * @param expectedNumberOfParameters the number of parameters expected
1676 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration 1686 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration
1677 */ 1687 */
1678 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = co nst CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 153, "O perator '%s' should declare exactly %d parameter(s), but %d found"); 1688 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = co nst CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 154, "O perator '%s' should declare exactly %d parameter(s), but %d found");
1679 1689
1680 /** 1690 /**
1681 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not 1691 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not
1682 * 0 or 1. 1692 * 0 or 1.
1683 * 1693 *
1684 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration 1694 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration
1685 */ 1695 */
1686 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MIN US', 154, "Operator '-' should declare 0 or 1 parameter, but %d found"); 1696 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MIN US', 155, "Operator '-' should declare 0 or 1 parameter, but %d found");
1687 1697
1688 /** 1698 /**
1689 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include 1699 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include
1690 * exactly one required formal parameter <i>p</i>. 1700 * exactly one required formal parameter <i>p</i>.
1691 */ 1701 */
1692 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = cons t CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 155, "Sette rs should declare exactly one required parameter"); 1702 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = cons t CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 156, "Sette rs should declare exactly one required parameter");
1693 1703
1694 static const List<CompileTimeErrorCode> values = const [ 1704 static const List<CompileTimeErrorCode> values = const [
1695 AMBIGUOUS_EXPORT, 1705 AMBIGUOUS_EXPORT,
1696 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, 1706 ARGUMENT_DEFINITION_TEST_NON_PARAMETER,
1697 BUILT_IN_IDENTIFIER_AS_TYPE, 1707 BUILT_IN_IDENTIFIER_AS_TYPE,
1698 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 1708 BUILT_IN_IDENTIFIER_AS_TYPE_NAME,
1699 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 1709 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME,
1700 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, 1710 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME,
1701 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, 1711 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
1702 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, 1712 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1759 IMPLEMENTS_REPEATED, 1769 IMPLEMENTS_REPEATED,
1760 IMPLEMENTS_SUPER_CLASS, 1770 IMPLEMENTS_SUPER_CLASS,
1761 IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, 1771 IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
1762 IMPORT_INTERNAL_LIBRARY, 1772 IMPORT_INTERNAL_LIBRARY,
1763 IMPORT_OF_NON_LIBRARY, 1773 IMPORT_OF_NON_LIBRARY,
1764 INCONSISTENT_CASE_EXPRESSION_TYPES, 1774 INCONSISTENT_CASE_EXPRESSION_TYPES,
1765 INITIALIZER_FOR_NON_EXISTANT_FIELD, 1775 INITIALIZER_FOR_NON_EXISTANT_FIELD,
1766 INITIALIZER_FOR_STATIC_FIELD, 1776 INITIALIZER_FOR_STATIC_FIELD,
1767 INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD, 1777 INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD,
1768 INITIALIZING_FORMAL_FOR_STATIC_FIELD, 1778 INITIALIZING_FORMAL_FOR_STATIC_FIELD,
1779 INSTANCE_MEMBER_ACCESS_FROM_FACTORY,
1769 INSTANCE_MEMBER_ACCESS_FROM_STATIC, 1780 INSTANCE_MEMBER_ACCESS_FROM_STATIC,
1770 INVALID_ANNOTATION, 1781 INVALID_ANNOTATION,
1771 INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY, 1782 INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY,
1772 INVALID_CONSTANT, 1783 INVALID_CONSTANT,
1773 INVALID_CONSTRUCTOR_NAME, 1784 INVALID_CONSTRUCTOR_NAME,
1774 INVALID_FACTORY_NAME_NOT_A_CLASS, 1785 INVALID_FACTORY_NAME_NOT_A_CLASS,
1775 INVALID_REFERENCE_TO_THIS, 1786 INVALID_REFERENCE_TO_THIS,
1776 INVALID_TYPE_ARGUMENT_IN_CONST_LIST, 1787 INVALID_TYPE_ARGUMENT_IN_CONST_LIST,
1777 INVALID_TYPE_ARGUMENT_IN_CONST_MAP, 1788 INVALID_TYPE_ARGUMENT_IN_CONST_MAP,
1778 INVALID_URI, 1789 INVALID_URI,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 * @param message the template used to create the message to be displayed for the error 1884 * @param message the template used to create the message to be displayed for the error
1874 * @param correction the template used to create the correction to be displaye d for the error 1885 * @param correction the template used to create the correction to be displaye d for the error
1875 */ 1886 */
1876 const CompileTimeErrorCode.con2(String name, int ordinal, this.message, this.c orrection) : super(name, ordinal); 1887 const CompileTimeErrorCode.con2(String name, int ordinal, this.message, this.c orrection) : super(name, ordinal);
1877 1888
1878 @override 1889 @override
1879 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; 1890 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;
1880 1891
1881 @override 1892 @override
1882 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; 1893 ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
1894
1895 @override
1896 String get uniqueName => "${runtimeType.toString()}.${name}";
1883 } 1897 }
1884 1898
1885 /** 1899 /**
1886 * The interface `ErrorCode` defines the behavior common to objects representing error codes 1900 * The interface `ErrorCode` defines the behavior common to objects representing error codes
1887 * associated with [AnalysisError]. 1901 * associated with [AnalysisError].
1888 * 1902 *
1889 * Generally, we want to provide messages that consist of three sentences: 1. wh at is wrong, 2. why 1903 * Generally, we want to provide messages that consist of three sentences: 1. wh at is wrong, 2. why
1890 * is it wrong, and 3. how do I fix it. However, we combine the first two in the result of 1904 * is it wrong, and 3. how do I fix it. However, we combine the first two in the result of
1891 * [getMessage] and the last in the result of [getCorrection]. 1905 * [getMessage] and the last in the result of [getCorrection].
1892 */ 1906 */
(...skipping 21 matching lines...) Expand all
1914 * @return the template used to create the message to be displayed for this er ror 1928 * @return the template used to create the message to be displayed for this er ror
1915 */ 1929 */
1916 String get message; 1930 String get message;
1917 1931
1918 /** 1932 /**
1919 * Return the type of the error. 1933 * Return the type of the error.
1920 * 1934 *
1921 * @return the type of the error 1935 * @return the type of the error
1922 */ 1936 */
1923 ErrorType get type; 1937 ErrorType get type;
1938
1939 /**
1940 * Return a unique name for this error code.
1941 *
1942 * @return a unique name for this error code
1943 */
1944 String get uniqueName;
1924 } 1945 }
1925 1946
1926 /** 1947 /**
1927 * The enumeration `ErrorProperty` defines the properties that can be associated with an 1948 * The enumeration `ErrorProperty` defines the properties that can be associated with an
1928 * [AnalysisError]. 1949 * [AnalysisError].
1929 */ 1950 */
1930 class ErrorProperty extends Enum<ErrorProperty> { 1951 class ErrorProperty extends Enum<ErrorProperty> {
1931 /** 1952 /**
1932 * A property whose value is an array of [ExecutableElement] that should 1953 * A property whose value is an array of [ExecutableElement] that should
1933 * be but are not implemented by a concrete class. 1954 * be but are not implemented by a concrete class.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 * @param error the error to report 2010 * @param error the error to report
1990 */ 2011 */
1991 void reportError(AnalysisError error) { 2012 void reportError(AnalysisError error) {
1992 _errorListener.onError(error); 2013 _errorListener.onError(error);
1993 } 2014 }
1994 2015
1995 /** 2016 /**
1996 * Report an error with the given error code and arguments. 2017 * Report an error with the given error code and arguments.
1997 * 2018 *
1998 * @param errorCode the error code of the error to be reported 2019 * @param errorCode the error code of the error to be reported
1999 * @param node the node specifying the location of the error
2000 * @param arguments the arguments to the error, used to compose the error mess age
2001 */
2002 void reportErrorForNode(ErrorCode errorCode, AstNode node, List<Object> argume nts) {
2003 reportErrorForOffset(errorCode, node.offset, node.length, arguments);
2004 }
2005
2006 /**
2007 * Report an error with the given error code and arguments.
2008 *
2009 * @param errorCode the error code of the error to be reported
2010 * @param element the element which name should be used as the location of the error 2020 * @param element the element which name should be used as the location of the error
2011 * @param arguments the arguments to the error, used to compose the error mess age 2021 * @param arguments the arguments to the error, used to compose the error mess age
2012 */ 2022 */
2013 void reportErrorForElement(ErrorCode errorCode, Element element, List<Object> arguments) { 2023 void reportErrorForElement(ErrorCode errorCode, Element element, List<Object> arguments) {
2014 reportErrorForOffset(errorCode, element.nameOffset, element.displayName.leng th, arguments); 2024 reportErrorForOffset(errorCode, element.nameOffset, element.displayName.leng th, arguments);
2015 } 2025 }
2016 2026
2017 /** 2027 /**
2028 * Report an error with the given error code and arguments.
2029 *
2030 * If the arguments contain the names of two or more types, the method
2031 * [reportTypeErrorForNode] should be used and the types
2032 * themselves (rather than their names) should be passed as arguments.
2033 *
2034 * @param errorCode the error code of the error to be reported
2035 * @param node the node specifying the location of the error
2036 * @param arguments the arguments to the error, used to compose the error mess age
2037 */
2038 void reportErrorForNode(ErrorCode errorCode, AstNode node, List<Object> argume nts) {
2039 reportErrorForOffset(errorCode, node.offset, node.length, arguments);
2040 }
2041
2042 /**
2018 * Report an error with the given error code and arguments. 2043 * Report an error with the given error code and arguments.
2019 * 2044 *
2020 * @param errorCode the error code of the error to be reported 2045 * @param errorCode the error code of the error to be reported
2021 * @param offset the offset of the location of the error 2046 * @param offset the offset of the location of the error
2022 * @param length the length of the location of the error 2047 * @param length the length of the location of the error
2023 * @param arguments the arguments to the error, used to compose the error mess age 2048 * @param arguments the arguments to the error, used to compose the error mess age
2024 */ 2049 */
2025 void reportErrorForOffset(ErrorCode errorCode, int offset, int length, List<Ob ject> arguments) { 2050 void reportErrorForOffset(ErrorCode errorCode, int offset, int length, List<Ob ject> arguments) {
2026 _errorListener.onError(new AnalysisError.con2(_source, offset, length, error Code, arguments)); 2051 _errorListener.onError(new AnalysisError.con2(_source, offset, length, error Code, arguments));
2027 } 2052 }
2028 2053
2029 /** 2054 /**
2030 * Report an error with the given error code and arguments. 2055 * Report an error with the given error code and arguments.
2031 * 2056 *
2032 * @param errorCode the error code of the error to be reported 2057 * @param errorCode the error code of the error to be reported
2033 * @param token the token specifying the location of the error 2058 * @param token the token specifying the location of the error
2034 * @param arguments the arguments to the error, used to compose the error mess age 2059 * @param arguments the arguments to the error, used to compose the error mess age
2035 */ 2060 */
2036 void reportErrorForToken(ErrorCode errorCode, Token token, List<Object> argume nts) { 2061 void reportErrorForToken(ErrorCode errorCode, Token token, List<Object> argume nts) {
2037 reportErrorForOffset(errorCode, token.offset, token.length, arguments); 2062 reportErrorForOffset(errorCode, token.offset, token.length, arguments);
2038 } 2063 }
2039 2064
2040 /** 2065 /**
2066 * Report an error with the given error code and arguments. The arguments are expected to contain
2067 * two or more types. Convert the types into strings by using the display name s of the types,
2068 * unless there are two or more types with the same names, in which case the e xtended display
2069 * names of the types will be used in order to clarify the message.
2070 *
2071 * If there are not two or more types in the argument list, the method
2072 * [reportErrorForNode] should be used instead.
2073 *
2074 * @param errorCode the error code of the error to be reported
2075 * @param node the node specifying the location of the error
2076 * @param arguments the arguments to the error, used to compose the error mess age
2077 */
2078 void reportTypeErrorForNode(ErrorCode errorCode, AstNode node, List<Object> ar guments) {
2079 _convertTypeNames(arguments);
2080 reportErrorForOffset(errorCode, node.offset, node.length, arguments);
2081 }
2082
2083 /**
2041 * Set the source to be used when reporting errors. Setting the source to `nul l` will cause 2084 * Set the source to be used when reporting errors. Setting the source to `nul l` will cause
2042 * the default source to be used. 2085 * the default source to be used.
2043 * 2086 *
2044 * @param source the source to be used when reporting errors 2087 * @param source the source to be used when reporting errors
2045 */ 2088 */
2046 void set source(Source source) { 2089 void set source(Source source) {
2047 this._source = source == null ? _defaultSource : source; 2090 this._source = source == null ? _defaultSource : source;
2048 } 2091 }
2092
2093 /**
2094 * Given an array of arguments that is expected to contain two or more types, convert the types
2095 * into strings by using the display names of the types, unless there are two or more types with
2096 * the same names, in which case the extended display names of the types will be used in order to
2097 * clarify the message.
2098 *
2099 * @param arguments the arguments that are to be converted
2100 */
2101 void _convertTypeNames(List<Object> arguments) {
2102 if (_hasEqualTypeNames(arguments)) {
2103 int count = arguments.length;
2104 for (int i = 0; i < count; i++) {
2105 Object argument = arguments[i];
2106 if (argument is DartType) {
2107 DartType type = argument;
2108 Element element = type.element;
2109 if (element == null) {
2110 arguments[i] = type.displayName;
2111 } else {
2112 arguments[i] = element.extendedDisplayName;
2113 }
2114 }
2115 }
2116 } else {
2117 int count = arguments.length;
2118 for (int i = 0; i < count; i++) {
2119 Object argument = arguments[i];
2120 if (argument is DartType) {
2121 arguments[i] = argument.displayName;
2122 }
2123 }
2124 }
2125 }
2126
2127 /**
2128 * Return `true` if the given array of arguments contains two or more types wi th the same
2129 * display name.
2130 *
2131 * @param arguments the arguments being tested
2132 * @return `true` if the array of arguments contains two or more types with th e same display
2133 * name
2134 */
2135 bool _hasEqualTypeNames(List<Object> arguments) {
2136 int count = arguments.length;
2137 Set<String> typeNames = new Set<String>();
2138 for (int i = 0; i < count; i++) {
2139 if (arguments[i] is DartType && typeNames.add((arguments[i] as DartType).d isplayName)) {
2140 return true;
2141 }
2142 }
2143 return false;
2144 }
2049 } 2145 }
2050 2146
2051 /** 2147 /**
2052 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er rorCode] 2148 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er rorCode]
2053 * . 2149 * .
2054 */ 2150 */
2055 class ErrorSeverity extends Enum<ErrorSeverity> { 2151 class ErrorSeverity extends Enum<ErrorSeverity> {
2056 /** 2152 /**
2057 * The severity representing a non-error. This is never used for any error cod e, but is useful for 2153 * The severity representing a non-error. This is never used for any error cod e, but is useful for
2058 * clients. 2154 * clients.
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
2441 * @param message the template used to create the message to be displayed for the error 2537 * @param message the template used to create the message to be displayed for the error
2442 * @param correction the template used to create the correction to be displaye d for the error 2538 * @param correction the template used to create the correction to be displaye d for the error
2443 */ 2539 */
2444 const HintCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal); 2540 const HintCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
2445 2541
2446 @override 2542 @override
2447 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; 2543 ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
2448 2544
2449 @override 2545 @override
2450 ErrorType get type => ErrorType.HINT; 2546 ErrorType get type => ErrorType.HINT;
2547
2548 @override
2549 String get uniqueName => "${runtimeType.toString()}.${name}";
2451 } 2550 }
2452 2551
2453 /** 2552 /**
2454 * The enumeration `HtmlWarningCode` defines the error codes used for warnings i n HTML files. 2553 * The enumeration `HtmlWarningCode` defines the error codes used for warnings i n HTML files.
2455 * The convention for this class is for the name of the error code to indicate t he problem that 2554 * The convention for this class is for the name of the error code to indicate t he problem that
2456 * caused the error to be generated and for the error message to explain what is wrong and, when 2555 * caused the error to be generated and for the error message to explain what is wrong and, when
2457 * appropriate, how the problem can be corrected. 2556 * appropriate, how the problem can be corrected.
2458 */ 2557 */
2459 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode { 2558 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode {
2460 /** 2559 /**
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2499 * @param message the template used to create the message to be displayed for the error 2598 * @param message the template used to create the message to be displayed for the error
2500 * @param correction the template used to create the correction to be displaye d for the error 2599 * @param correction the template used to create the correction to be displaye d for the error
2501 */ 2600 */
2502 const HtmlWarningCode.con2(String name, int ordinal, this.message, this.correc tion) : super(name, ordinal); 2601 const HtmlWarningCode.con2(String name, int ordinal, this.message, this.correc tion) : super(name, ordinal);
2503 2602
2504 @override 2603 @override
2505 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; 2604 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
2506 2605
2507 @override 2606 @override
2508 ErrorType get type => ErrorType.STATIC_WARNING; 2607 ErrorType get type => ErrorType.STATIC_WARNING;
2608
2609 @override
2610 String get uniqueName => "${runtimeType.toString()}.${name}";
2509 } 2611 }
2510 2612
2511 /** 2613 /**
2512 * The enumeration `PolymerCode` defines Polymer specific problems. 2614 * The enumeration `PolymerCode` defines Polymer specific problems.
2513 */ 2615 */
2514 class PolymerCode extends Enum<PolymerCode> implements ErrorCode { 2616 class PolymerCode extends Enum<PolymerCode> implements ErrorCode {
2515 static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode('AT TRIBUTE_FIELD_NOT_PUBLISHED', 0, "Field '%s' in '%s' must be @published"); 2617 static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode('AT TRIBUTE_FIELD_NOT_PUBLISHED', 0, "Field '%s' in '%s' must be @published");
2516 2618
2517 static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode('D UPLICATE_ATTRIBUTE_DEFINITION', 1, "The attribute '%s' is already defined"); 2619 static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode('D UPLICATE_ATTRIBUTE_DEFINITION', 1, "The attribute '%s' is already defined");
2518 2620
(...skipping 29 matching lines...) Expand all
2548 const PolymerCode(String name, int ordinal, this.message) : super(name, ordina l); 2650 const PolymerCode(String name, int ordinal, this.message) : super(name, ordina l);
2549 2651
2550 @override 2652 @override
2551 String get correction => null; 2653 String get correction => null;
2552 2654
2553 @override 2655 @override
2554 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 2656 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
2555 2657
2556 @override 2658 @override
2557 ErrorType get type => ErrorType.POLYMER; 2659 ErrorType get type => ErrorType.POLYMER;
2660
2661 @override
2662 String get uniqueName => "${runtimeType.toString()}.${name}";
2558 } 2663 }
2559 2664
2560 /** 2665 /**
2561 * The enumeration `PubSuggestionCode` defines the suggestions used for reportin g deviations 2666 * The enumeration `PubSuggestionCode` defines the suggestions used for reportin g deviations
2562 * from pub best practices. The convention for this class is for the name of the bad practice to 2667 * from pub best practices. The convention for this class is for the name of the bad practice to
2563 * indicate the problem that caused the suggestion to be generated and for the m essage to explain 2668 * indicate the problem that caused the suggestion to be generated and for the m essage to explain
2564 * what is wrong and, when appropriate, how the situation can be corrected. 2669 * what is wrong and, when appropriate, how the situation can be corrected.
2565 */ 2670 */
2566 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode { 2671 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode {
2567 /** 2672 /**
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 * @param message the template used to create the message to be displayed for the error 2721 * @param message the template used to create the message to be displayed for the error
2617 * @param correction the template used to create the correction to be displaye d for the error 2722 * @param correction the template used to create the correction to be displaye d for the error
2618 */ 2723 */
2619 const PubSuggestionCode.con2(String name, int ordinal, this.message, this.corr ection) : super(name, ordinal); 2724 const PubSuggestionCode.con2(String name, int ordinal, this.message, this.corr ection) : super(name, ordinal);
2620 2725
2621 @override 2726 @override
2622 ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity; 2727 ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity;
2623 2728
2624 @override 2729 @override
2625 ErrorType get type => ErrorType.PUB_SUGGESTION; 2730 ErrorType get type => ErrorType.PUB_SUGGESTION;
2731
2732 @override
2733 String get uniqueName => "${runtimeType.toString()}.${name}";
2626 } 2734 }
2627 2735
2628 /** 2736 /**
2629 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat ic type 2737 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat ic type
2630 * warnings. The convention for this class is for the name of the error code to indicate the problem 2738 * warnings. The convention for this class is for the name of the error code to indicate the problem
2631 * that caused the error to be generated and for the error message to explain wh at is wrong and, 2739 * that caused the error to be generated and for the error message to explain wh at is wrong and,
2632 * when appropriate, how the problem can be corrected. 2740 * when appropriate, how the problem can be corrected.
2633 */ 2741 */
2634 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error Code { 2742 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error Code {
2635 /** 2743 /**
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 * @param message the template used to create the message to be displayed for the error 3071 * @param message the template used to create the message to be displayed for the error
2964 * @param correction the template used to create the correction to be displaye d for the error 3072 * @param correction the template used to create the correction to be displaye d for the error
2965 */ 3073 */
2966 const StaticTypeWarningCode.con2(String name, int ordinal, this.message, this. correction) : super(name, ordinal); 3074 const StaticTypeWarningCode.con2(String name, int ordinal, this.message, this. correction) : super(name, ordinal);
2967 3075
2968 @override 3076 @override
2969 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; 3077 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity;
2970 3078
2971 @override 3079 @override
2972 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; 3080 ErrorType get type => ErrorType.STATIC_TYPE_WARNING;
3081
3082 @override
3083 String get uniqueName => "${runtimeType.toString()}.${name}";
2973 } 3084 }
2974 3085
2975 /** 3086 /**
2976 * The enumeration `StaticWarningCode` defines the error codes used for static w arnings. The 3087 * The enumeration `StaticWarningCode` defines the error codes used for static w arnings. The
2977 * convention for this class is for the name of the error code to indicate the p roblem that caused 3088 * convention for this class is for the name of the error code to indicate the p roblem that caused
2978 * the error to be generated and for the error message to explain what is wrong and, when 3089 * the error to be generated and for the error message to explain what is wrong and, when
2979 * appropriate, how the problem can be corrected. 3090 * appropriate, how the problem can be corrected.
2980 */ 3091 */
2981 class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode { 3092 class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode {
2982 /** 3093 /**
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
3890 * @param message the template used to create the message to be displayed for the error 4001 * @param message the template used to create the message to be displayed for the error
3891 * @param correction the template used to create the correction to be displaye d for the error 4002 * @param correction the template used to create the correction to be displaye d for the error
3892 */ 4003 */
3893 const StaticWarningCode.con2(String name, int ordinal, this.message, this.corr ection) : super(name, ordinal); 4004 const StaticWarningCode.con2(String name, int ordinal, this.message, this.corr ection) : super(name, ordinal);
3894 4005
3895 @override 4006 @override
3896 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; 4007 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity;
3897 4008
3898 @override 4009 @override
3899 ErrorType get type => ErrorType.STATIC_WARNING; 4010 ErrorType get type => ErrorType.STATIC_WARNING;
4011
4012 @override
4013 String get uniqueName => "${runtimeType.toString()}.${name}";
3900 } 4014 }
3901 4015
3902 /** 4016 /**
3903 * The enumeration `TodoCode` defines the single TODO `ErrorCode`. 4017 * The enumeration `TodoCode` defines the single TODO `ErrorCode`.
3904 */ 4018 */
3905 class TodoCode extends Enum<TodoCode> implements ErrorCode { 4019 class TodoCode extends Enum<TodoCode> implements ErrorCode {
3906 /** 4020 /**
3907 * The single enum of TodoCode. 4021 * The single enum of TodoCode.
3908 */ 4022 */
3909 static const TodoCode TODO = const TodoCode('TODO', 0); 4023 static const TodoCode TODO = const TodoCode('TODO', 0);
(...skipping 21 matching lines...) Expand all
3931 String get correction => null; 4045 String get correction => null;
3932 4046
3933 @override 4047 @override
3934 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 4048 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
3935 4049
3936 @override 4050 @override
3937 String get message => "%s"; 4051 String get message => "%s";
3938 4052
3939 @override 4053 @override
3940 ErrorType get type => ErrorType.TODO; 4054 ErrorType get type => ErrorType.TODO;
4055
4056 @override
4057 String get uniqueName => "${runtimeType.toString()}.${name}";
3941 } 4058 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/index.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698