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

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

Issue 990793002: Clean up comments in error support (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 library engine.error; 5 library engine.error;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'ast.dart' show AstNode; 9 import 'ast.dart' show AstNode;
10 import 'element.dart'; 10 import 'element.dart';
11 import 'java_core.dart'; 11 import 'java_core.dart';
12 import 'scanner.dart' show Token; 12 import 'scanner.dart' show Token;
13 import 'source.dart'; 13 import 'source.dart';
14 14
15 /** 15 /**
16 * Instances of the class `AnalysisError` represent an error discovered during t he analysis of 16 * An error discovered during the analysis of some Dart code.
17 * some Dart code.
18 * 17 *
19 * See [AnalysisErrorListener]. 18 * See [AnalysisErrorListener].
20 */ 19 */
21 class AnalysisError { 20 class AnalysisError {
22 /** 21 /**
23 * An empty array of errors used when no errors are expected. 22 * An empty array of errors used when no errors are expected.
24 */ 23 */
25 static const List<AnalysisError> NO_ERRORS = const <AnalysisError>[]; 24 static const List<AnalysisError> NO_ERRORS = const <AnalysisError>[];
26 25
27 /** 26 /**
28 * A [Comparator] that sorts by the name of the file that the [AnalysisError] was 27 * A [Comparator] that sorts by the name of the file that the [AnalysisError]
29 * found. 28 * was found.
30 */ 29 */
31 static Comparator<AnalysisError> FILE_COMPARATOR = (AnalysisError o1, 30 static Comparator<AnalysisError> FILE_COMPARATOR = (AnalysisError o1,
32 AnalysisError o2) => o1.source.shortName.compareTo(o2.source.shortName); 31 AnalysisError o2) => o1.source.shortName.compareTo(o2.source.shortName);
33 32
34 /** 33 /**
35 * A [Comparator] that sorts error codes first by their severity (errors first , warnings 34 * A [Comparator] that sorts error codes first by their severity (errors
36 * second), and then by the the error code type. 35 * first, warnings second), and then by the the error code type.
37 */ 36 */
38 static Comparator<AnalysisError> ERROR_CODE_COMPARATOR = (AnalysisError o1, 37 static Comparator<AnalysisError> ERROR_CODE_COMPARATOR = (AnalysisError o1,
39 AnalysisError o2) { 38 AnalysisError o2) {
40 ErrorCode errorCode1 = o1.errorCode; 39 ErrorCode errorCode1 = o1.errorCode;
41 ErrorCode errorCode2 = o2.errorCode; 40 ErrorCode errorCode2 = o2.errorCode;
42 ErrorSeverity errorSeverity1 = errorCode1.errorSeverity; 41 ErrorSeverity errorSeverity1 = errorCode1.errorSeverity;
43 ErrorSeverity errorSeverity2 = errorCode2.errorSeverity; 42 ErrorSeverity errorSeverity2 = errorCode2.errorSeverity;
44 ErrorType errorType1 = errorCode1.type; 43 ErrorType errorType1 = errorCode1.type;
45 ErrorType errorType2 = errorCode2.type; 44 ErrorType errorType2 = errorCode2.type;
46 if (errorSeverity1 == errorSeverity2) { 45 if (errorSeverity1 == errorSeverity2) {
47 return errorType1.compareTo(errorType2); 46 return errorType1.compareTo(errorType2);
48 } else { 47 } else {
49 return errorSeverity2.compareTo(errorSeverity1); 48 return errorSeverity2.compareTo(errorSeverity1);
50 } 49 }
51 }; 50 };
52 51
53 /** 52 /**
54 * The error code associated with the error. 53 * The error code associated with the error.
55 */ 54 */
56 final ErrorCode errorCode; 55 final ErrorCode errorCode;
57 56
58 /** 57 /**
59 * The localized error message. 58 * The localized error message.
60 */ 59 */
61 String _message; 60 String _message;
62 61
63 /** 62 /**
64 * The correction to be displayed for this error, or `null` if there is no cor rection 63 * The correction to be displayed for this error, or `null` if there is no
65 * information for this error. 64 * correction information for this error.
66 */ 65 */
67 String _correction; 66 String _correction;
68 67
69 /** 68 /**
70 * The source in which the error occurred, or `null` if unknown. 69 * The source in which the error occurred, or `null` if unknown.
71 */ 70 */
72 Source source; 71 Source source;
73 72
74 /** 73 /**
75 * The character offset from the beginning of the source (zero based) where 74 * The character offset from the beginning of the source (zero based) where
76 * the error occurred. 75 * the error occurred.
77 */ 76 */
78 int offset = 0; 77 int offset = 0;
79 78
80 /** 79 /**
81 * The number of characters from the offset to the end of the source which enc ompasses the 80 * The number of characters from the offset to the end of the source which
82 * compilation error. 81 * encompasses the compilation error.
83 */ 82 */
84 int _length = 0; 83 int _length = 0;
85 84
86 /** 85 /**
87 * A flag indicating whether this error can be shown to be a non-issue because of the result of 86 * A flag indicating whether this error can be shown to be a non-issue because
88 * type propagation. 87 * of the result of type propagation.
89 */ 88 */
90 bool isStaticOnly = false; 89 bool isStaticOnly = false;
91 90
92 /** 91 /**
93 * Initialize a newly created analysis error for the specified source. The err or has no location 92 * Initialize a newly created analysis error for the specified [source]. The
94 * information. 93 * error will have the given [errorCode] and the list of [arguments] will be
95 * 94 * used to complete the message. The error has no location information.
96 * @param source the source for which the exception occurred
97 * @param errorCode the error code to be associated with this error
98 * @param arguments the arguments used to build the error message
99 */ 95 */
100 AnalysisError.con1(this.source, this.errorCode, [List<Object> arguments]) { 96 AnalysisError.con1(this.source, this.errorCode, [List<Object> arguments]) {
101 this._message = formatList(errorCode.message, arguments); 97 this._message = formatList(errorCode.message, arguments);
102 } 98 }
103 99
104 /** 100 /**
105 * Initialize a newly created analysis error for the specified source at the g iven location. 101 * Initialize a newly created analysis error for the specified [source] at the
106 * 102 * given [offset] with the given [length]. The error will have the given
107 * @param source the source for which the exception occurred 103 * [errorCode] and the list of [arguments] will be used to complete the
108 * @param offset the offset of the location of the error 104 * message.
109 * @param length the length of the location of the error
110 * @param errorCode the error code to be associated with this error
111 * @param arguments the arguments used to build the error message
112 */ 105 */
113 AnalysisError.con2(this.source, this.offset, int length, this.errorCode, 106 AnalysisError.con2(this.source, this.offset, int length, this.errorCode,
114 [List<Object> arguments]) { 107 [List<Object> arguments]) {
115 this._length = length; 108 this._length = length;
116 this._message = formatList(errorCode.message, arguments); 109 this._message = formatList(errorCode.message, arguments);
117 String correctionTemplate = errorCode.correction; 110 String correctionTemplate = errorCode.correction;
118 if (correctionTemplate != null) { 111 if (correctionTemplate != null) {
119 this._correction = formatList(correctionTemplate, arguments); 112 this._correction = formatList(correctionTemplate, arguments);
120 } 113 }
121 } 114 }
122 115
123 /** 116 /**
124 * Return the correction to be displayed for this error, or `null` if there is no correction 117 * Return the template used to create the correction to be displayed for this
125 * information for this error. The correction should indicate how the user can fix the error. 118 * error, or `null` if there is no correction information for this error. The
126 * 119 * correction should indicate how the user can fix the error.
127 * @return the template used to create the correction to be displayed for this error
128 */ 120 */
129 String get correction => _correction; 121 String get correction => _correction;
130 122
131 @override 123 @override
132 int get hashCode { 124 int get hashCode {
133 int hashCode = offset; 125 int hashCode = offset;
134 hashCode ^= (_message != null) ? _message.hashCode : 0; 126 hashCode ^= (_message != null) ? _message.hashCode : 0;
135 hashCode ^= (source != null) ? source.hashCode : 0; 127 hashCode ^= (source != null) ? source.hashCode : 0;
136 return hashCode; 128 return hashCode;
137 } 129 }
138 130
139 /** 131 /**
140 * Return the number of characters from the offset to the end of the source wh ich encompasses the 132 * Return the length of the error location, that is, the number of characters
141 * compilation error. 133 * from the offset to the end of the source which encompasses the compilation
142 * 134 * error.
143 * @return the length of the error location
144 */ 135 */
145 int get length => _length; 136 int get length => _length;
146 137
147 /** 138 /**
148 * Return the message to be displayed for this error. The message should indic ate what is wrong 139 * Return the message to be displayed for this error. The message should
149 * and why it is wrong. 140 * indicate what is wrong and why it is wrong.
150 *
151 * @return the message to be displayed for this error
152 */ 141 */
153 String get message => _message; 142 String get message => _message;
154 143
155 @override 144 @override
156 bool operator ==(Object obj) { 145 bool operator ==(Object obj) {
157 if (identical(obj, this)) { 146 if (identical(obj, this)) {
158 return true; 147 return true;
159 } 148 }
160 // prepare other AnalysisError 149 // prepare other AnalysisError
161 if (obj is! AnalysisError) { 150 if (obj is! AnalysisError) {
(...skipping 15 matching lines...) Expand all
177 return false; 166 return false;
178 } 167 }
179 if (source != other.source) { 168 if (source != other.source) {
180 return false; 169 return false;
181 } 170 }
182 // OK 171 // OK
183 return true; 172 return true;
184 } 173 }
185 174
186 /** 175 /**
187 * Return the value of the given property, or `null` if the given property is not defined 176 * Return the value of the given [property], or `null` if the given property
188 * for this error. 177 * is not defined for this error.
189 *
190 * @param property the property whose value is to be returned
191 * @return the value of the given property
192 */ 178 */
193 Object getProperty(ErrorProperty property) => null; 179 Object getProperty(ErrorProperty property) => null;
194 180
195 @override 181 @override
196 String toString() { 182 String toString() {
197 StringBuffer buffer = new StringBuffer(); 183 StringBuffer buffer = new StringBuffer();
198 buffer.write((source != null) ? source.fullName : "<unknown source>"); 184 buffer.write((source != null) ? source.fullName : "<unknown source>");
199 buffer.write("("); 185 buffer.write("(");
200 buffer.write(offset); 186 buffer.write(offset);
201 buffer.write(".."); 187 buffer.write("..");
202 buffer.write(offset + _length - 1); 188 buffer.write(offset + _length - 1);
203 buffer.write("): "); 189 buffer.write("): ");
204 //buffer.write("(" + lineNumber + ":" + columnNumber + "): "); 190 //buffer.write("(" + lineNumber + ":" + columnNumber + "): ");
205 buffer.write(_message); 191 buffer.write(_message);
206 return buffer.toString(); 192 return buffer.toString();
207 } 193 }
208 } 194 }
209 195
210 /** 196 /**
211 * The interface `AnalysisErrorListener` defines the behavior of objects that li sten for 197 * An object that listen for [AnalysisError]s being produced by the analysis
212 * [AnalysisError] being produced by the analysis engine. 198 * engine.
213 */ 199 */
214 abstract class AnalysisErrorListener { 200 abstract class AnalysisErrorListener {
215 /** 201 /**
216 * An error listener that ignores errors that are reported to it. 202 * An error listener that ignores errors that are reported to it.
217 */ 203 */
218 static final AnalysisErrorListener NULL_LISTENER = 204 static final AnalysisErrorListener NULL_LISTENER =
219 new AnalysisErrorListener_NULL_LISTENER(); 205 new AnalysisErrorListener_NULL_LISTENER();
220 206
221 /** 207 /**
222 * This method is invoked when an error has been found by the analysis engine. 208 * This method is invoked when an [error] has been found by the analysis
223 * 209 * engine.
224 * @param error the error that was just found (not `null`)
225 */ 210 */
226 void onError(AnalysisError error); 211 void onError(AnalysisError error);
227 } 212 }
228 213
214 /**
215 * An [AnalysisErrorListener] that ignores error.
216 */
229 class AnalysisErrorListener_NULL_LISTENER implements AnalysisErrorListener { 217 class AnalysisErrorListener_NULL_LISTENER implements AnalysisErrorListener {
230 @override 218 @override
231 void onError(AnalysisError event) { 219 void onError(AnalysisError event) {
232 // Ignore errors 220 // Ignore errors
233 } 221 }
234 } 222 }
235 223
236 /** 224 /**
237 * Instances of the class `AnalysisErrorWithProperties` 225 * An [AnalysisError] that can have arbitrary properties associated with it.
238 */ 226 */
239 class AnalysisErrorWithProperties extends AnalysisError { 227 class AnalysisErrorWithProperties extends AnalysisError {
240 /** 228 /**
241 * The properties associated with this error. 229 * The properties associated with this error.
242 */ 230 */
243 HashMap<ErrorProperty, Object> _propertyMap = 231 HashMap<ErrorProperty, Object> _propertyMap =
244 new HashMap<ErrorProperty, Object>(); 232 new HashMap<ErrorProperty, Object>();
245 233
246 /** 234 /**
247 * Initialize a newly created analysis error for the specified source. The err or has no location 235 * Initialize a newly created analysis error for the specified [source]. The
248 * information. 236 * error will have the given [errorCode] and the list of [arguments] will be
249 * 237 * used to complete the message. The error has no location information.
250 * @param source the source for which the exception occurred
251 * @param errorCode the error code to be associated with this error
252 * @param arguments the arguments used to build the error message
253 */ 238 */
254 AnalysisErrorWithProperties.con1( 239 AnalysisErrorWithProperties.con1(
255 Source source, ErrorCode errorCode, List<Object> arguments) 240 Source source, ErrorCode errorCode, List<Object> arguments)
256 : super.con1(source, errorCode, arguments); 241 : super.con1(source, errorCode, arguments);
257 242
258 /** 243 /**
259 * Initialize a newly created analysis error for the specified source at the g iven location. 244 * Initialize a newly created analysis error for the specified [source] at the
260 * 245 * given [offset] with the given [length]. The error will have the given
261 * @param source the source for which the exception occurred 246 * [errorCode] and the list of [arguments] will be used to complete the
262 * @param offset the offset of the location of the error 247 * message.
263 * @param length the length of the location of the error
264 * @param errorCode the error code to be associated with this error
265 * @param arguments the arguments used to build the error message
266 */ 248 */
267 AnalysisErrorWithProperties.con2(Source source, int offset, int length, 249 AnalysisErrorWithProperties.con2(Source source, int offset, int length,
268 ErrorCode errorCode, List<Object> arguments) 250 ErrorCode errorCode, List<Object> arguments)
269 : super.con2(source, offset, length, errorCode, arguments); 251 : super.con2(source, offset, length, errorCode, arguments);
270 252
271 @override 253 @override
272 Object getProperty(ErrorProperty property) => _propertyMap[property]; 254 Object getProperty(ErrorProperty property) => _propertyMap[property];
273 255
274 /** 256 /**
275 * Set the value of the given property to the given value. Using a value of `n ull` will 257 * Set the value of the given [property] to the given [value]. Using a value
276 * effectively remove the property from this error. 258 * of `null` will effectively remove the property from this error.
277 *
278 * @param property the property whose value is to be returned
279 * @param value the new value of the given property
280 */ 259 */
281 void setProperty(ErrorProperty property, Object value) { 260 void setProperty(ErrorProperty property, Object value) {
282 _propertyMap[property] = value; 261 _propertyMap[property] = value;
283 } 262 }
284 } 263 }
285 264
286 /** 265 /**
287 * Instances of the class `BooleanErrorListener` implement a listener that keeps track of 266 * An [AnalysisErrorListener] that keeps track of whether any error has been
288 * whether an error has been reported to it. 267 * reported to it.
289 */ 268 */
290 class BooleanErrorListener implements AnalysisErrorListener { 269 class BooleanErrorListener implements AnalysisErrorListener {
291 /** 270 /**
292 * A flag indicating whether an error has been reported to this listener. 271 * A flag indicating whether an error has been reported to this listener.
293 */ 272 */
294 bool _errorReported = false; 273 bool _errorReported = false;
295 274
296 /** 275 /**
297 * Return `true` if an error has been reported to this listener. 276 * Return `true` if an error has been reported to this listener.
298 *
299 * @return `true` if an error has been reported to this listener
300 */ 277 */
301 bool get errorReported => _errorReported; 278 bool get errorReported => _errorReported;
302 279
303 @override 280 @override
304 void onError(AnalysisError error) { 281 void onError(AnalysisError error) {
305 _errorReported = true; 282 _errorReported = true;
306 } 283 }
307 } 284 }
308 285
309 /** 286 /**
310 * The enumeration `CompileTimeErrorCode` defines the error codes used for 287 * The error codes used for compile time errors caused by constant evaluation
311 * compile time errors caused by constant evaluation that would throw an 288 * that would throw an exception when run in checked mode. The client of the
312 * exception when run in checked mode. The client of the analysis engine is 289 * analysis engine is responsible for determining how these errors should be
313 * responsible for determining how these errors should be presented to the user 290 * presented to the user (for example, a command-line compiler might elect to
314 * (for example, a command-line compiler might elect to treat these errors 291 * treat these errors differently depending whether it is compiling it "checked"
315 * differently depending whether it is compiling it "checked" mode). 292 * mode).
316 */ 293 */
317 class CheckedModeCompileTimeErrorCode extends ErrorCode { 294 class CheckedModeCompileTimeErrorCode extends ErrorCode {
318 // TODO(paulberry): improve the text of these error messages so that it's 295 // TODO(paulberry): improve the text of these error messages so that it's
319 // clear to the user that the error is coming from constant evaluation (and 296 // clear to the user that the error is coming from constant evaluation (and
320 // hence the constant needs to be a subtype of the annotated type) as opposed 297 // hence the constant needs to be a subtype of the annotated type) as opposed
321 // to static type analysis (which only requires that the two types be 298 // to static type analysis (which only requires that the two types be
322 // assignable). Also consider populating the "correction" field for these 299 // assignable). Also consider populating the "correction" field for these
323 // errors. 300 // errors.
324 301
325 /** 302 /**
(...skipping 15 matching lines...) Expand all
341 "The object type '{0}' cannot be assigned to a parameter of type '{1}' "); 318 "The object type '{0}' cannot be assigned to a parameter of type '{1}' ");
342 319
343 /** 320 /**
344 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error 321 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error
345 * if o is not <b>null</b> and the interface of the class of <i>o</i> is not a 322 * if o is not <b>null</b> and the interface of the class of <i>o</i> is not a
346 * subtype of the static type of the field <i>v</i>. 323 * subtype of the static type of the field <i>v</i>.
347 * 324 *
348 * 12.11.2 Const: It is a compile-time error if evaluation of a constant 325 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
349 * object results in an uncaught exception being thrown. 326 * object results in an uncaught exception being thrown.
350 * 327 *
351 * @param initializerType the name of the type of the initializer expression 328 * Parameters:
352 * @param fieldType the name of the type of the field 329 * 0: the name of the type of the initializer expression
330 * 1: the name of the type of the field
353 */ 331 */
354 static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIG NABLE = 332 static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIG NABLE =
355 const CheckedModeCompileTimeErrorCode( 333 const CheckedModeCompileTimeErrorCode(
356 'CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 334 'CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE',
357 "The initializer type '{0}' cannot be assigned to the field type '{1}' "); 335 "The initializer type '{0}' cannot be assigned to the field type '{1}' ");
358 336
359 /** 337 /**
360 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> 338 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
361 * ... <i>e<sub>n</sub></i>] is evaluated as follows: 339 * ... <i>e<sub>n</sub></i>] is evaluated as follows:
362 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and 340 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 409
432 @override 410 @override
433 ErrorSeverity get errorSeverity => 411 ErrorSeverity get errorSeverity =>
434 ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR.severity; 412 ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR.severity;
435 413
436 @override 414 @override
437 ErrorType get type => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR; 415 ErrorType get type => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR;
438 } 416 }
439 417
440 /** 418 /**
441 * The enumeration `CompileTimeErrorCode` defines the error codes used for 419 * The error codes used for compile time errors. The convention for this class
442 * compile time errors. The convention for this class is for the name of the 420 * is for the name of the error code to indicate the problem that caused the
443 * error code to indicate the problem that caused the error to be generated and 421 * error to be generated and for the error message to explain what is wrong and,
444 * for the error message to explain what is wrong and, when appropriate, how the 422 * when appropriate, how the problem can be corrected.
445 * problem can be corrected.
446 */ 423 */
447 class CompileTimeErrorCode extends ErrorCode { 424 class CompileTimeErrorCode extends ErrorCode {
448 /** 425 /**
449 * Enum proposal: It is also a compile-time error to explicitly instantiate an 426 * Enum proposal: It is also a compile-time error to explicitly instantiate an
450 * enum via 'new' or 'const' or to access its private fields. 427 * enum via 'new' or 'const' or to access its private fields.
451 */ 428 */
452 static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD = 429 static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD =
453 const CompileTimeErrorCode('ACCESS_PRIVATE_ENUM_FIELD', 430 const CompileTimeErrorCode('ACCESS_PRIVATE_ENUM_FIELD',
454 "The private fields of an enum cannot be accessed, even within the sam e library"); 431 "The private fields of an enum cannot be accessed, even within the sam e library");
455 432
456 /** 433 /**
457 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported 434 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
458 * by a library <i>L</i> and <i>N</i> is introduced into the export namespace 435 * by a library <i>L</i> and <i>N</i> is introduced into the export namespace
459 * of <i>L</i> by more than one export, unless each all exports refer to same 436 * of <i>L</i> by more than one export, unless each all exports refer to same
460 * declaration for the name N. 437 * declaration for the name N.
461 * 438 *
462 * @param ambiguousElementName the name of the ambiguous element 439 * Parameters:
463 * @param firstLibraryName the name of the first library that the type is 440 * 0: the name of the ambiguous element
464 * found 441 * 1: the name of the first library that the type is found
465 * @param secondLibraryName the name of the second library that the type is 442 * 2: the name of the second library that the type is found
466 * found
467 */ 443 */
468 static const CompileTimeErrorCode AMBIGUOUS_EXPORT = 444 static const CompileTimeErrorCode AMBIGUOUS_EXPORT =
469 const CompileTimeErrorCode('AMBIGUOUS_EXPORT', 445 const CompileTimeErrorCode('AMBIGUOUS_EXPORT',
470 "The name '{0}' is defined in the libraries '{1}' and '{2}'"); 446 "The name '{0}' is defined in the libraries '{1}' and '{2}'");
471 447
472 /** 448 /**
473 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does 449 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
474 * not denote a formal parameter. 450 * not denote a formal parameter.
475 * 451 *
476 * @param the name of the identifier in the argument definition test that is 452 * Parameters:
477 * not a parameter 453 * 0: the name of the identifier in the argument definition test that is not a
454 * parameter
478 */ 455 */
479 static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = 456 static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER =
480 const CompileTimeErrorCode( 457 const CompileTimeErrorCode(
481 'ARGUMENT_DEFINITION_TEST_NON_PARAMETER', "'{0}' is not a parameter"); 458 'ARGUMENT_DEFINITION_TEST_NON_PARAMETER', "'{0}' is not a parameter");
482 459
483 /** 460 /**
484 * ?? Asynchronous For-in: It is a compile-time error if an asynchronous 461 * ?? Asynchronous For-in: It is a compile-time error if an asynchronous
485 * for-in statement appears inside a synchronous function. 462 * for-in statement appears inside a synchronous function.
486 */ 463 */
487 static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT = 464 static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT =
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 */ 683 */
707 static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS = 684 static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS =
708 const CompileTimeErrorCode( 685 const CompileTimeErrorCode(
709 'CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 686 'CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS',
710 "The constant map entry key expression type '{0}' cannot override the == operator"); 687 "The constant map entry key expression type '{0}' cannot override the == operator");
711 688
712 /** 689 /**
713 * 5 Variables: A constant variable must be initialized to a compile-time 690 * 5 Variables: A constant variable must be initialized to a compile-time
714 * constant (12.1) or a compile-time error occurs. 691 * constant (12.1) or a compile-time error occurs.
715 * 692 *
716 * @param name the name of the uninitialized final variable 693 * Parameters:
694 * 0: the name of the uninitialized final variable
717 */ 695 */
718 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = 696 static const CompileTimeErrorCode CONST_NOT_INITIALIZED =
719 const CompileTimeErrorCode('CONST_NOT_INITIALIZED', 697 const CompileTimeErrorCode('CONST_NOT_INITIALIZED',
720 "The const variable '{0}' must be initialized"); 698 "The const variable '{0}' must be initialized");
721 699
722 /** 700 /**
723 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, 701 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
724 * where e, e1 and e2 are constant expressions that evaluate to a boolean 702 * where e, e1 and e2 are constant expressions that evaluate to a boolean
725 * value. 703 * value.
726 */ 704 */
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 */ 748 */
771 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = 749 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE =
772 const CompileTimeErrorCode('CONST_EVAL_THROWS_IDBZE', 750 const CompileTimeErrorCode('CONST_EVAL_THROWS_IDBZE',
773 "Evaluation of this constant expression throws IntegerDivisionByZeroEx ception"); 751 "Evaluation of this constant expression throws IntegerDivisionByZeroEx ception");
774 752
775 /** 753 /**
776 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, 754 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>,
777 * &hellip;, U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time 755 * &hellip;, U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time
778 * error if <i>S</i> is not a generic type with <i>m</i> type parameters. 756 * error if <i>S</i> is not a generic type with <i>m</i> type parameters.
779 * 757 *
780 * @param typeName the name of the type being referenced (<i>S</i>) 758 * Parameters:
781 * @param parameterCount the number of type parameters that were declared 759 * 0: the name of the type being referenced (<i>S</i>)
782 * @param argumentCount the number of type arguments provided 760 * 1: the number of type parameters that were declared
761 * 2: the number of type arguments provided
762 *
783 * See [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS], and 763 * See [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS], and
784 * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]. 764 * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS].
785 */ 765 */
786 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = 766 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS =
787 const CompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', 767 const CompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS',
788 "The type '{0}' is declared with {1} type parameters, but {2} type arg uments were given"); 768 "The type '{0}' is declared with {1} type parameters, but {2} type arg uments were given");
789 769
790 /** 770 /**
791 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, 771 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>,
792 * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, 772 * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;,
(...skipping 17 matching lines...) Expand all
810 /** 790 /**
811 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class 791 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
812 * accessible in the current scope, optionally followed by type arguments. 792 * accessible in the current scope, optionally followed by type arguments.
813 * 793 *
814 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, 794 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>,
815 * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip; 795 * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
816 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if 796 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if
817 * <i>T</i> is not a class accessible in the current scope, optionally 797 * <i>T</i> is not a class accessible in the current scope, optionally
818 * followed by type arguments. 798 * followed by type arguments.
819 * 799 *
820 * @param name the name of the non-type element 800 * Parameters:
801 * 0: the name of the non-type element
821 */ 802 */
822 static const CompileTimeErrorCode CONST_WITH_NON_TYPE = 803 static const CompileTimeErrorCode CONST_WITH_NON_TYPE =
823 const CompileTimeErrorCode( 804 const CompileTimeErrorCode(
824 'CONST_WITH_NON_TYPE', "The name '{0}' is not a class"); 805 'CONST_WITH_NON_TYPE', "The name '{0}' is not a class");
825 806
826 /** 807 /**
827 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type 808 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type
828 * parameters. 809 * parameters.
829 */ 810 */
830 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = 811 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS =
831 const CompileTimeErrorCode('CONST_WITH_TYPE_PARAMETERS', 812 const CompileTimeErrorCode('CONST_WITH_TYPE_PARAMETERS',
832 "The constant creation cannot use a type parameter"); 813 "The constant creation cannot use a type parameter");
833 814
834 /** 815 /**
835 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of 816 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
836 * a constant constructor declared by the type <i>T</i>. 817 * a constant constructor declared by the type <i>T</i>.
837 * 818 *
838 * @param typeName the name of the type 819 * Parameters:
839 * @param constructorName the name of the requested constant constructor 820 * 0: the name of the type
821 * 1: the name of the requested constant constructor
840 */ 822 */
841 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = 823 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR =
842 const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR', 824 const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR',
843 "The class '{0}' does not have a constant constructor '{1}'"); 825 "The class '{0}' does not have a constant constructor '{1}'");
844 826
845 /** 827 /**
846 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of 828 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
847 * a constant constructor declared by the type <i>T</i>. 829 * a constant constructor declared by the type <i>T</i>.
848 * 830 *
849 * @param typeName the name of the type 831 * Parameters:
832 * 0: the name of the type
850 */ 833 */
851 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = 834 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT =
852 const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 835 const CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT',
853 "The class '{0}' does not have a default constant constructor"); 836 "The class '{0}' does not have a default constant constructor");
854 837
855 /** 838 /**
856 * 15.3.1 Typedef: It is a compile-time error if any default values are 839 * 15.3.1 Typedef: It is a compile-time error if any default values are
857 * specified in the signature of a function type alias. 840 * specified in the signature of a function type alias.
858 */ 841 */
859 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = 842 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS =
(...skipping 24 matching lines...) Expand all
884 * with the same name declared in the same scope. 867 * with the same name declared in the same scope.
885 */ 868 */
886 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = 869 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT =
887 const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_DEFAULT', 870 const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_DEFAULT',
888 "The default constructor is already defined"); 871 "The default constructor is already defined");
889 872
890 /** 873 /**
891 * 3.1 Scoping: It is a compile-time error if there is more than one entity 874 * 3.1 Scoping: It is a compile-time error if there is more than one entity
892 * with the same name declared in the same scope. 875 * with the same name declared in the same scope.
893 * 876 *
894 * @param duplicateName the name of the duplicate entity 877 * Parameters:
878 * 0: the name of the duplicate entity
895 */ 879 */
896 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = 880 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME =
897 const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_NAME', 881 const CompileTimeErrorCode('DUPLICATE_CONSTRUCTOR_NAME',
898 "The constructor with name '{0}' is already defined"); 882 "The constructor with name '{0}' is already defined");
899 883
900 /** 884 /**
901 * 3.1 Scoping: It is a compile-time error if there is more than one entity 885 * 3.1 Scoping: It is a compile-time error if there is more than one entity
902 * with the same name declared in the same scope. 886 * with the same name declared in the same scope.
903 * 887 *
904 * 7 Classes: It is a compile-time error if a class declares two members of 888 * 7 Classes: It is a compile-time error if a class declares two members of
905 * the same name. 889 * the same name.
906 * 890 *
907 * 7 Classes: It is a compile-time error if a class has an instance member and 891 * 7 Classes: It is a compile-time error if a class has an instance member and
908 * a static member with the same name. 892 * a static member with the same name.
909 * 893 *
910 * @param duplicateName the name of the duplicate entity 894 * Parameters:
895 * 0: the name of the duplicate entity
911 */ 896 */
912 static const CompileTimeErrorCode DUPLICATE_DEFINITION = 897 static const CompileTimeErrorCode DUPLICATE_DEFINITION =
913 const CompileTimeErrorCode( 898 const CompileTimeErrorCode(
914 'DUPLICATE_DEFINITION', "The name '{0}' is already defined"); 899 'DUPLICATE_DEFINITION', "The name '{0}' is already defined");
915 900
916 /** 901 /**
917 * 7. Classes: It is a compile-time error if a class has an instance member 902 * 7. Classes: It is a compile-time error if a class has an instance member
918 * and a static member with the same name. 903 * and a static member with the same name.
919 * 904 *
920 * This covers the additional duplicate definition cases where inheritance has 905 * This covers the additional duplicate definition cases where inheritance has
921 * to be considered. 906 * to be considered.
922 * 907 *
923 * @param className the name of the class that has conflicting instance/static 908 * Parameters:
924 * members 909 * 0: the name of the class that has conflicting instance/static members
925 * @param name the name of the conflicting members 910 * 1: the name of the conflicting members
911 *
926 * See [DUPLICATE_DEFINITION]. 912 * See [DUPLICATE_DEFINITION].
927 */ 913 */
928 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = 914 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE =
929 const CompileTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE', 915 const CompileTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE',
930 "The name '{0}' is already defined in '{1}'"); 916 "The name '{0}' is already defined in '{1}'");
931 917
932 /** 918 /**
933 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if 919 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if
934 * <i>q<sub>i</sub> = q<sub>j</sub></i> for any <i>i != j</i> [where 920 * <i>q<sub>i</sub> = q<sub>j</sub></i> for any <i>i != j</i> [where
935 * <i>q<sub>i</sub></i> is the label for a named argument]. 921 * <i>q<sub>i</sub></i> is the label for a named argument].
936 */ 922 */
937 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = 923 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT =
938 const CompileTimeErrorCode('DUPLICATE_NAMED_ARGUMENT', 924 const CompileTimeErrorCode('DUPLICATE_NAMED_ARGUMENT',
939 "The argument for the named parameter '{0}' was already specified"); 925 "The argument for the named parameter '{0}' was already specified");
940 926
941 /** 927 /**
942 * SDK implementation libraries can be exported only by other SDK libraries. 928 * SDK implementation libraries can be exported only by other SDK libraries.
943 * 929 *
944 * @param uri the uri pointing to a library 930 * Parameters:
931 * 0: the uri pointing to a library
945 */ 932 */
946 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = 933 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY =
947 const CompileTimeErrorCode('EXPORT_INTERNAL_LIBRARY', 934 const CompileTimeErrorCode('EXPORT_INTERNAL_LIBRARY',
948 "The library '{0}' is internal and cannot be exported"); 935 "The library '{0}' is internal and cannot be exported");
949 936
950 /** 937 /**
951 * 14.2 Exports: It is a compile-time error if the compilation unit found at 938 * 14.2 Exports: It is a compile-time error if the compilation unit found at
952 * the specified URI is not a library declaration. 939 * the specified URI is not a library declaration.
953 * 940 *
954 * @param uri the uri pointing to a non-library declaration 941 * Parameters:
942 * 0: the uri pointing to a non-library declaration
955 */ 943 */
956 static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = 944 static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY =
957 const CompileTimeErrorCode('EXPORT_OF_NON_LIBRARY', 945 const CompileTimeErrorCode('EXPORT_OF_NON_LIBRARY',
958 "The exported library '{0}' must not have a part-of directive"); 946 "The exported library '{0}' must not have a part-of directive");
959 947
960 /** 948 /**
961 * Enum proposal: It is a compile-time error to subclass, mix-in or implement 949 * Enum proposal: It is a compile-time error to subclass, mix-in or implement
962 * an enum. 950 * an enum.
963 */ 951 */
964 static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode( 952 static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode(
965 'EXTENDS_ENUM', "Classes cannot extend an enum"); 953 'EXTENDS_ENUM', "Classes cannot extend an enum");
966 954
967 /** 955 /**
968 * 7.9 Superclasses: It is a compile-time error if the extends clause of a 956 * 7.9 Superclasses: It is a compile-time error if the extends clause of a
969 * class <i>C</i> includes a type expression that does not denote a class 957 * class <i>C</i> includes a type expression that does not denote a class
970 * available in the lexical scope of <i>C</i>. 958 * available in the lexical scope of <i>C</i>.
971 * 959 *
972 * @param typeName the name of the superclass that was not found 960 * Parameters:
961 * 0: the name of the superclass that was not found
973 */ 962 */
974 static const CompileTimeErrorCode EXTENDS_NON_CLASS = 963 static const CompileTimeErrorCode EXTENDS_NON_CLASS =
975 const CompileTimeErrorCode( 964 const CompileTimeErrorCode(
976 'EXTENDS_NON_CLASS', "Classes can only extend other classes"); 965 'EXTENDS_NON_CLASS', "Classes can only extend other classes");
977 966
978 /** 967 /**
979 * 12.2 Null: It is a compile-time error for a class to attempt to extend or 968 * 12.2 Null: It is a compile-time error for a class to attempt to extend or
980 * implement Null. 969 * implement Null.
981 * 970 *
982 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend 971 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
983 * or implement int. 972 * or implement int.
984 * 973 *
985 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend 974 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
986 * or implement double. 975 * or implement double.
987 * 976 *
988 * 12.3 Numbers: It is a compile-time error for any type other than the types 977 * 12.3 Numbers: It is a compile-time error for any type other than the types
989 * int and double to 978 * int and double to
990 * attempt to extend or implement num. 979 * attempt to extend or implement num.
991 * 980 *
992 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend 981 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
993 * or implement bool. 982 * or implement bool.
994 * 983 *
995 * 12.5 Strings: It is a compile-time error for a class to attempt to extend 984 * 12.5 Strings: It is a compile-time error for a class to attempt to extend
996 * or implement String. 985 * or implement String.
997 * 986 *
998 * @param typeName the name of the type that cannot be extended 987 * Parameters:
988 * 0: the name of the type that cannot be extended
989 *
999 * See [IMPLEMENTS_DISALLOWED_CLASS]. 990 * See [IMPLEMENTS_DISALLOWED_CLASS].
1000 */ 991 */
1001 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = 992 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS =
1002 const CompileTimeErrorCode( 993 const CompileTimeErrorCode(
1003 'EXTENDS_DISALLOWED_CLASS', "Classes cannot extend '{0}'"); 994 'EXTENDS_DISALLOWED_CLASS', "Classes cannot extend '{0}'");
1004 995
1005 /** 996 /**
1006 * 7.9 Superclasses: It is a compile-time error if the extends clause of a 997 * 7.9 Superclasses: It is a compile-time error if the extends clause of a
1007 * class <i>C</i> includes a deferred type expression. 998 * class <i>C</i> includes a deferred type expression.
1008 * 999 *
1009 * @param typeName the name of the type that cannot be extended 1000 * Parameters:
1001 * 0: the name of the type that cannot be extended
1002 *
1010 * See [IMPLEMENTS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS]. 1003 * See [IMPLEMENTS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS].
1011 */ 1004 */
1012 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = 1005 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS =
1013 const CompileTimeErrorCode('EXTENDS_DEFERRED_CLASS', 1006 const CompileTimeErrorCode('EXTENDS_DEFERRED_CLASS',
1014 "This class cannot extend the deferred class '{0}'"); 1007 "This class cannot extend the deferred class '{0}'");
1015 1008
1016 /** 1009 /**
1017 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; 1010 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
1018 * h</i> or if <i>m &gt; n</i>. 1011 * h</i> or if <i>m &gt; n</i>.
1019 * 1012 *
1020 * 12.11.2 Const: It is a compile-time error if evaluation of a constant 1013 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
1021 * object results in an uncaught exception being thrown. 1014 * object results in an uncaught exception being thrown.
1022 * 1015 *
1023 * @param requiredCount the maximum number of positional arguments 1016 * Parameters:
1024 * @param argumentCount the actual number of positional arguments given 1017 * 0: the maximum number of positional arguments
1018 * 1: the actual number of positional arguments given
1025 */ 1019 */
1026 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = 1020 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS =
1027 const CompileTimeErrorCode('EXTRA_POSITIONAL_ARGUMENTS', 1021 const CompileTimeErrorCode('EXTRA_POSITIONAL_ARGUMENTS',
1028 "{0} positional arguments expected, but {1} found"); 1022 "{0} positional arguments expected, but {1} found");
1029 1023
1030 /** 1024 /**
1031 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It 1025 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
1032 * is a compile time error if more than one initializer corresponding to a 1026 * is a compile time error if more than one initializer corresponding to a
1033 * given instance variable appears in <i>k</i>'s list. 1027 * given instance variable appears in <i>k</i>'s list.
1034 */ 1028 */
(...skipping 10 matching lines...) Expand all
1045 static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER = 1039 static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER =
1046 const CompileTimeErrorCode( 1040 const CompileTimeErrorCode(
1047 'FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER', 1041 'FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER',
1048 "Fields cannot be initialized in both the parameter list and the initi alizers"); 1042 "Fields cannot be initialized in both the parameter list and the initi alizers");
1049 1043
1050 /** 1044 /**
1051 * 5 Variables: It is a compile-time error if a final instance variable that 1045 * 5 Variables: It is a compile-time error if a final instance variable that
1052 * has is initialized by means of an initializing formal of a constructor is 1046 * has is initialized by means of an initializing formal of a constructor is
1053 * also initialized elsewhere in the same constructor. 1047 * also initialized elsewhere in the same constructor.
1054 * 1048 *
1055 * @param name the name of the field in question 1049 * Parameters:
1050 * 0: the name of the field in question
1056 */ 1051 */
1057 static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = 1052 static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES =
1058 const CompileTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES', 1053 const CompileTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES',
1059 "'{0}' is a final field and so can only be set once"); 1054 "'{0}' is a final field and so can only be set once");
1060 1055
1061 /** 1056 /**
1062 * 7.6.1 Generative Constructors: It is a compile-time error if an 1057 * 7.6.1 Generative Constructors: It is a compile-time error if an
1063 * initializing formal is used by a function other than a non-redirecting 1058 * initializing formal is used by a function other than a non-redirecting
1064 * generative constructor. 1059 * generative constructor.
1065 */ 1060 */
(...skipping 19 matching lines...) Expand all
1085 * generative constructor. 1080 * generative constructor.
1086 */ 1081 */
1087 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = 1082 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR =
1088 const CompileTimeErrorCode('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 1083 const CompileTimeErrorCode('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR',
1089 "The redirecting constructor cannot have a field initializer"); 1084 "The redirecting constructor cannot have a field initializer");
1090 1085
1091 /** 1086 /**
1092 * 7.2 Getters: It is a compile-time error if a class has both a getter and a 1087 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
1093 * method with the same name. 1088 * method with the same name.
1094 * 1089 *
1095 * @param name the conflicting name of the getter and method 1090 * Parameters:
1091 * 0: the conflicting name of the getter and method
1096 */ 1092 */
1097 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = 1093 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME =
1098 const CompileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', 1094 const CompileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME',
1099 "'{0}' cannot be used to name a getter, there is already a method with the same name"); 1095 "'{0}' cannot be used to name a getter, there is already a method with the same name");
1100 1096
1101 /** 1097 /**
1102 * 7.10 Superinterfaces: It is a compile-time error if the implements clause 1098 * 7.10 Superinterfaces: It is a compile-time error if the implements clause
1103 * of a class <i>C</i> specifies a malformed type or deferred type as a 1099 * of a class <i>C</i> specifies a malformed type or deferred type as a
1104 * superinterface. 1100 * superinterface.
1105 * 1101 *
1106 * @param typeName the name of the type that cannot be extended 1102 * Parameters:
1103 * 0: the name of the type that cannot be extended
1104 *
1107 * See [EXTENDS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS]. 1105 * See [EXTENDS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS].
1108 */ 1106 */
1109 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = 1107 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS =
1110 const CompileTimeErrorCode('IMPLEMENTS_DEFERRED_CLASS', 1108 const CompileTimeErrorCode('IMPLEMENTS_DEFERRED_CLASS',
1111 "This class cannot implement the deferred class '{0}'"); 1109 "This class cannot implement the deferred class '{0}'");
1112 1110
1113 /** 1111 /**
1114 * 12.2 Null: It is a compile-time error for a class to attempt to extend or 1112 * 12.2 Null: It is a compile-time error for a class to attempt to extend or
1115 * implement Null. 1113 * implement Null.
1116 * 1114 *
1117 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend 1115 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
1118 * or implement int. 1116 * or implement int.
1119 * 1117 *
1120 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend 1118 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
1121 * or implement double. 1119 * or implement double.
1122 * 1120 *
1123 * 12.3 Numbers: It is a compile-time error for any type other than the types 1121 * 12.3 Numbers: It is a compile-time error for any type other than the types
1124 * int and double to 1122 * int and double to
1125 * attempt to extend or implement num. 1123 * attempt to extend or implement num.
1126 * 1124 *
1127 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend 1125 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
1128 * or implement bool. 1126 * or implement bool.
1129 * 1127 *
1130 * 12.5 Strings: It is a compile-time error for a class to attempt to extend 1128 * 12.5 Strings: It is a compile-time error for a class to attempt to extend
1131 * or implement String. 1129 * or implement String.
1132 * 1130 *
1133 * @param typeName the name of the type that cannot be implemented 1131 * Parameters:
1132 * 0: the name of the type that cannot be implemented
1133 *
1134 * See [EXTENDS_DISALLOWED_CLASS]. 1134 * See [EXTENDS_DISALLOWED_CLASS].
1135 */ 1135 */
1136 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = 1136 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS =
1137 const CompileTimeErrorCode( 1137 const CompileTimeErrorCode(
1138 'IMPLEMENTS_DISALLOWED_CLASS', "Classes cannot implement '{0}'"); 1138 'IMPLEMENTS_DISALLOWED_CLASS', "Classes cannot implement '{0}'");
1139 1139
1140 /** 1140 /**
1141 * 7.10 Superinterfaces: It is a compile-time error if the implements clause 1141 * 7.10 Superinterfaces: It is a compile-time error if the implements clause
1142 * of a class includes type dynamic. 1142 * of a class includes type dynamic.
1143 */ 1143 */
1144 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = 1144 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC =
1145 const CompileTimeErrorCode( 1145 const CompileTimeErrorCode(
1146 'IMPLEMENTS_DYNAMIC', "Classes cannot implement 'dynamic'"); 1146 'IMPLEMENTS_DYNAMIC', "Classes cannot implement 'dynamic'");
1147 1147
1148 /** 1148 /**
1149 * Enum proposal: It is a compile-time error to subclass, mix-in or implement 1149 * Enum proposal: It is a compile-time error to subclass, mix-in or implement
1150 * an enum. 1150 * an enum.
1151 */ 1151 */
1152 static const CompileTimeErrorCode IMPLEMENTS_ENUM = 1152 static const CompileTimeErrorCode IMPLEMENTS_ENUM =
1153 const CompileTimeErrorCode( 1153 const CompileTimeErrorCode(
1154 'IMPLEMENTS_ENUM', "Classes cannot implement an enum"); 1154 'IMPLEMENTS_ENUM', "Classes cannot implement an enum");
1155 1155
1156 /** 1156 /**
1157 * 7.10 Superinterfaces: It is a compile-time error if the implements clause 1157 * 7.10 Superinterfaces: It is a compile-time error if the implements clause
1158 * of a class <i>C</i> includes a type expression that does not denote a class 1158 * of a class <i>C</i> includes a type expression that does not denote a class
1159 * available in the lexical scope of <i>C</i>. 1159 * available in the lexical scope of <i>C</i>.
1160 * 1160 *
1161 * @param typeName the name of the interface that was not found 1161 * Parameters:
1162 * 0: the name of the interface that was not found
1162 */ 1163 */
1163 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = 1164 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS =
1164 const CompileTimeErrorCode( 1165 const CompileTimeErrorCode(
1165 'IMPLEMENTS_NON_CLASS', "Classes can only implement other classes"); 1166 'IMPLEMENTS_NON_CLASS', "Classes can only implement other classes");
1166 1167
1167 /** 1168 /**
1168 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears 1169 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears
1169 * more than once in the implements clause of a class. 1170 * more than once in the implements clause of a class.
1170 * 1171 *
1171 * @param className the name of the class that is implemented more than once 1172 * Parameters:
1173 * 0: the name of the class that is implemented more than once
1172 */ 1174 */
1173 static const CompileTimeErrorCode IMPLEMENTS_REPEATED = 1175 static const CompileTimeErrorCode IMPLEMENTS_REPEATED =
1174 const CompileTimeErrorCode( 1176 const CompileTimeErrorCode(
1175 'IMPLEMENTS_REPEATED', "'{0}' can only be implemented once"); 1177 'IMPLEMENTS_REPEATED', "'{0}' can only be implemented once");
1176 1178
1177 /** 1179 /**
1178 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a 1180 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a
1179 * class <i>C</i> appears in the implements clause of <i>C</i>. 1181 * class <i>C</i> appears in the implements clause of <i>C</i>.
1180 * 1182 *
1181 * @param className the name of the class that appears in both "extends" and 1183 * Parameters:
1182 * "implements" clauses 1184 * 0: the name of the class that appears in both "extends" and "implements"
1185 * clauses
1183 */ 1186 */
1184 static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = 1187 static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS =
1185 const CompileTimeErrorCode('IMPLEMENTS_SUPER_CLASS', 1188 const CompileTimeErrorCode('IMPLEMENTS_SUPER_CLASS',
1186 "'{0}' cannot be used in both 'extends' and 'implements' clauses"); 1189 "'{0}' cannot be used in both 'extends' and 'implements' clauses");
1187 1190
1188 /** 1191 /**
1189 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the 1192 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the
1190 * right hand side of an initializer. 1193 * right hand side of an initializer.
1191 * 1194 *
1192 * 12.10 This: It is a compile-time error if this appears in a top-level 1195 * 12.10 This: It is a compile-time error if this appears in a top-level
1193 * function or variable initializer, in a factory constructor, or in a static 1196 * function or variable initializer, in a factory constructor, or in a static
1194 * method or variable initializer, or in the initializer of an instance 1197 * method or variable initializer, or in the initializer of an instance
1195 * variable. 1198 * variable.
1196 * 1199 *
1197 * @param name the name of the type in question 1200 * Parameters:
1201 * 0: the name of the type in question
1198 */ 1202 */
1199 static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = 1203 static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER =
1200 const CompileTimeErrorCode('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 1204 const CompileTimeErrorCode('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER',
1201 "Only static members can be accessed in initializers"); 1205 "Only static members can be accessed in initializers");
1202 1206
1203 /** 1207 /**
1204 * SDK implementation libraries can be imported only by other SDK libraries. 1208 * SDK implementation libraries can be imported only by other SDK libraries.
1205 * 1209 *
1206 * @param uri the uri pointing to a library 1210 * Parameters:
1211 * 0: the uri pointing to a library
1207 */ 1212 */
1208 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = 1213 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY =
1209 const CompileTimeErrorCode('IMPORT_INTERNAL_LIBRARY', 1214 const CompileTimeErrorCode('IMPORT_INTERNAL_LIBRARY',
1210 "The library '{0}' is internal and cannot be imported"); 1215 "The library '{0}' is internal and cannot be imported");
1211 1216
1212 /** 1217 /**
1213 * 14.1 Imports: It is a compile-time error if the specified URI of an 1218 * 14.1 Imports: It is a compile-time error if the specified URI of an
1214 * immediate import does not refer to a library declaration. 1219 * immediate import does not refer to a library declaration.
1215 * 1220 *
1216 * @param uri the uri pointing to a non-library declaration 1221 * Parameters:
1222 * 0: the uri pointing to a non-library declaration
1223 *
1217 * See [StaticWarningCode.IMPORT_OF_NON_LIBRARY]. 1224 * See [StaticWarningCode.IMPORT_OF_NON_LIBRARY].
1218 */ 1225 */
1219 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = 1226 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY =
1220 const CompileTimeErrorCode('IMPORT_OF_NON_LIBRARY', 1227 const CompileTimeErrorCode('IMPORT_OF_NON_LIBRARY',
1221 "The imported library '{0}' must not have a part-of directive"); 1228 "The imported library '{0}' must not have a part-of directive");
1222 1229
1223 /** 1230 /**
1224 * 13.9 Switch: It is a compile-time error if values of the expressions 1231 * 13.9 Switch: It is a compile-time error if values of the expressions
1225 * <i>e<sub>k</sub></i> are not instances of the same class <i>C</i>, for all 1232 * <i>e<sub>k</sub></i> are not instances of the same class <i>C</i>, for all
1226 * <i>1 &lt;= k &lt;= n</i>. 1233 * <i>1 &lt;= k &lt;= n</i>.
1227 * 1234 *
1228 * @param expressionSource the expression source code that is the unexpected 1235 * Parameters:
1229 * type 1236 * 0: the expression source code that is the unexpected type
1230 * @param expectedType the name of the expected type 1237 * 1: the name of the expected type
1231 */ 1238 */
1232 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = 1239 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES =
1233 const CompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES', 1240 const CompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES',
1234 "Case expressions must have the same types, '{0}' is not a '{1}'"); 1241 "Case expressions must have the same types, '{0}' is not a '{1}'");
1235 1242
1236 /** 1243 /**
1237 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It 1244 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
1238 * is a compile-time error if <i>k</i>'s initializer list contains an 1245 * is a compile-time error if <i>k</i>'s initializer list contains an
1239 * initializer for a variable that is not an instance variable declared in the 1246 * initializer for a variable that is not an instance variable declared in the
1240 * immediately surrounding class. 1247 * immediately surrounding class.
1241 * 1248 *
1242 * @param id the name of the initializing formal that is not an instance 1249 * Parameters:
1243 * variable in the immediately enclosing class 1250 * 0: the name of the initializing formal that is not an instance variable in
1251 * the immediately enclosing class
1252 *
1244 * See [INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]. 1253 * See [INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD].
1245 */ 1254 */
1246 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = 1255 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD =
1247 const CompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTENT_FIELD', 1256 const CompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTENT_FIELD',
1248 "'{0}' is not a variable in the enclosing class"); 1257 "'{0}' is not a variable in the enclosing class");
1249 1258
1250 /** 1259 /**
1251 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It 1260 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
1252 * is a compile-time error if <i>k</i>'s initializer list contains an 1261 * is a compile-time error if <i>k</i>'s initializer list contains an
1253 * initializer for a variable that is not an instance variable declared in the 1262 * initializer for a variable that is not an instance variable declared in the
1254 * immediately surrounding class. 1263 * immediately surrounding class.
1255 * 1264 *
1256 * @param id the name of the initializing formal that is a static variable in 1265 * Parameters:
1257 * the immediately enclosing class 1266 * 0: the name of the initializing formal that is a static variable in the
1267 * immediately enclosing class
1268 *
1258 * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD]. 1269 * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD].
1259 */ 1270 */
1260 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = 1271 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD =
1261 const CompileTimeErrorCode('INITIALIZER_FOR_STATIC_FIELD', 1272 const CompileTimeErrorCode('INITIALIZER_FOR_STATIC_FIELD',
1262 "'{0}' is a static variable in the enclosing class, variables initiali zed in a constructor cannot be static"); 1273 "'{0}' is a static variable in the enclosing class, variables initiali zed in a constructor cannot be static");
1263 1274
1264 /** 1275 /**
1265 * 7.6.1 Generative Constructors: An initializing formal has the form 1276 * 7.6.1 Generative Constructors: An initializing formal has the form
1266 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of 1277 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of
1267 * an instance variable of the immediately enclosing class. 1278 * an instance variable of the immediately enclosing class.
1268 * 1279 *
1269 * @param id the name of the initializing formal that is not an instance 1280 * Parameters:
1270 * variable in the immediately enclosing class 1281 * 0: the name of the initializing formal that is not an instance variable in
1282 * the immediately enclosing class
1283 *
1271 * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD], and 1284 * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD], and
1272 * [INITIALIZER_FOR_NON_EXISTENT_FIELD]. 1285 * [INITIALIZER_FOR_NON_EXISTENT_FIELD].
1273 */ 1286 */
1274 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD = 1287 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD =
1275 const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', 1288 const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD',
1276 "'{0}' is not a variable in the enclosing class"); 1289 "'{0}' is not a variable in the enclosing class");
1277 1290
1278 /** 1291 /**
1279 * 7.6.1 Generative Constructors: An initializing formal has the form 1292 * 7.6.1 Generative Constructors: An initializing formal has the form
1280 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of 1293 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of
1281 * an instance variable of the immediately enclosing class. 1294 * an instance variable of the immediately enclosing class.
1282 * 1295 *
1283 * @param id the name of the initializing formal that is a static variable in 1296 * Parameters:
1284 * the immediately enclosing class 1297 * 0: the name of the initializing formal that is a static variable in the
1298 * immediately enclosing class
1299 *
1285 * See [INITIALIZER_FOR_STATIC_FIELD]. 1300 * See [INITIALIZER_FOR_STATIC_FIELD].
1286 */ 1301 */
1287 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = 1302 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD =
1288 const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 1303 const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD',
1289 "'{0}' is a static field in the enclosing class, fields initialized in a constructor cannot be static"); 1304 "'{0}' is a static field in the enclosing class, fields initialized in a constructor cannot be static");
1290 1305
1291 /** 1306 /**
1292 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property 1307 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
1293 * extraction <b>this</b>.<i>id</i>. 1308 * extraction <b>this</b>.<i>id</i>.
1294 */ 1309 */
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 * variable. 1408 * variable.
1394 */ 1409 */
1395 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = 1410 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS =
1396 const CompileTimeErrorCode('INVALID_REFERENCE_TO_THIS', 1411 const CompileTimeErrorCode('INVALID_REFERENCE_TO_THIS',
1397 "Invalid reference to 'this' expression"); 1412 "Invalid reference to 'this' expression");
1398 1413
1399 /** 1414 /**
1400 * 12.6 Lists: It is a compile time error if the type argument of a constant 1415 * 12.6 Lists: It is a compile time error if the type argument of a constant
1401 * list literal includes a type parameter. 1416 * list literal includes a type parameter.
1402 * 1417 *
1403 * @name the name of the type parameter 1418 * Parameters:
1419 * 0: the name of the type parameter
1404 */ 1420 */
1405 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = 1421 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST =
1406 const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 1422 const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST',
1407 "Constant list literals cannot include a type parameter as a type argu ment, such as '{0}'"); 1423 "Constant list literals cannot include a type parameter as a type argu ment, such as '{0}'");
1408 1424
1409 /** 1425 /**
1410 * 12.7 Maps: It is a compile time error if the type arguments of a constant 1426 * 12.7 Maps: It is a compile time error if the type arguments of a constant
1411 * map literal include a type parameter. 1427 * map literal include a type parameter.
1412 * 1428 *
1413 * @name the name of the type parameter 1429 * Parameters:
1430 * 0: the name of the type parameter
1414 */ 1431 */
1415 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = 1432 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP =
1416 const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 1433 const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP',
1417 "Constant map literals cannot include a type parameter as a type argum ent, such as '{0}'"); 1434 "Constant map literals cannot include a type parameter as a type argum ent, such as '{0}'");
1418 1435
1419 /** 1436 /**
1420 * 14.2 Exports: It is a compile-time error if the compilation unit found at 1437 * 14.2 Exports: It is a compile-time error if the compilation unit found at
1421 * the specified URI is not a library declaration. 1438 * the specified URI is not a library declaration.
1422 * 1439 *
1423 * 14.1 Imports: It is a compile-time error if the compilation unit found at 1440 * 14.1 Imports: It is a compile-time error if the compilation unit found at
1424 * the specified URI is not a library declaration. 1441 * the specified URI is not a library declaration.
1425 * 1442 *
1426 * 14.3 Parts: It is a compile time error if the contents of the URI are not a 1443 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
1427 * valid part declaration. 1444 * valid part declaration.
1428 * 1445 *
1429 * @param uri the URI that is invalid 1446 * Parameters:
1447 * 0: the URI that is invalid
1448 *
1430 * See [URI_DOES_NOT_EXIST]. 1449 * See [URI_DOES_NOT_EXIST].
1431 */ 1450 */
1432 static const CompileTimeErrorCode INVALID_URI = 1451 static const CompileTimeErrorCode INVALID_URI =
1433 const CompileTimeErrorCode('INVALID_URI', "Invalid URI syntax: '{0}'"); 1452 const CompileTimeErrorCode('INVALID_URI', "Invalid URI syntax: '{0}'");
1434 1453
1435 /** 1454 /**
1436 * 13.13 Break: It is a compile-time error if no such statement 1455 * 13.13 Break: It is a compile-time error if no such statement
1437 * <i>s<sub>E</sub></i> exists within the innermost function in which 1456 * <i>s<sub>E</sub></i> exists within the innermost function in which
1438 * <i>s<sub>b</sub></i> occurs. 1457 * <i>s<sub>b</sub></i> occurs.
1439 * 1458 *
1440 * 13.14 Continue: It is a compile-time error if no such statement or case 1459 * 13.14 Continue: It is a compile-time error if no such statement or case
1441 * clause <i>s<sub>E</sub></i> exists within the innermost function in which 1460 * clause <i>s<sub>E</sub></i> exists within the innermost function in which
1442 * <i>s<sub>c</sub></i> occurs. 1461 * <i>s<sub>c</sub></i> occurs.
1443 * 1462 *
1444 * @param labelName the name of the unresolvable label 1463 * Parameters:
1464 * 0: the name of the unresolvable label
1445 */ 1465 */
1446 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = 1466 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE =
1447 const CompileTimeErrorCode('LABEL_IN_OUTER_SCOPE', 1467 const CompileTimeErrorCode('LABEL_IN_OUTER_SCOPE',
1448 "Cannot reference label '{0}' declared in an outer method"); 1468 "Cannot reference label '{0}' declared in an outer method");
1449 1469
1450 /** 1470 /**
1451 * 13.13 Break: It is a compile-time error if no such statement 1471 * 13.13 Break: It is a compile-time error if no such statement
1452 * <i>s<sub>E</sub></i> exists within the innermost function in which 1472 * <i>s<sub>E</sub></i> exists within the innermost function in which
1453 * <i>s<sub>b</sub></i> occurs. 1473 * <i>s<sub>b</sub></i> occurs.
1454 * 1474 *
1455 * 13.14 Continue: It is a compile-time error if no such statement or case 1475 * 13.14 Continue: It is a compile-time error if no such statement or case
1456 * clause <i>s<sub>E</sub></i> exists within the innermost function in which 1476 * clause <i>s<sub>E</sub></i> exists within the innermost function in which
1457 * <i>s<sub>c</sub></i> occurs. 1477 * <i>s<sub>c</sub></i> occurs.
1458 * 1478 *
1459 * @param labelName the name of the unresolvable label 1479 * Parameters:
1480 * 0: the name of the unresolvable label
1460 */ 1481 */
1461 static const CompileTimeErrorCode LABEL_UNDEFINED = 1482 static const CompileTimeErrorCode LABEL_UNDEFINED =
1462 const CompileTimeErrorCode( 1483 const CompileTimeErrorCode(
1463 'LABEL_UNDEFINED', "Cannot reference undefined label '{0}'"); 1484 'LABEL_UNDEFINED', "Cannot reference undefined label '{0}'");
1464 1485
1465 /** 1486 /**
1466 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member 1487 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member
1467 * with the same name as <i>C</i>. 1488 * with the same name as <i>C</i>.
1468 */ 1489 */
1469 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = 1490 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME =
1470 const CompileTimeErrorCode('MEMBER_WITH_CLASS_NAME', 1491 const CompileTimeErrorCode('MEMBER_WITH_CLASS_NAME',
1471 "Class members cannot have the same name as the enclosing class"); 1492 "Class members cannot have the same name as the enclosing class");
1472 1493
1473 /** 1494 /**
1474 * 7.2 Getters: It is a compile-time error if a class has both a getter and a 1495 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
1475 * method with the same name. 1496 * method with the same name.
1476 * 1497 *
1477 * @param name the conflicting name of the getter and method 1498 * Parameters:
1499 * 0: the conflicting name of the getter and method
1478 */ 1500 */
1479 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = 1501 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME =
1480 const CompileTimeErrorCode('METHOD_AND_GETTER_WITH_SAME_NAME', 1502 const CompileTimeErrorCode('METHOD_AND_GETTER_WITH_SAME_NAME',
1481 "'{0}' cannot be used to name a method, there is already a getter with the same name"); 1503 "'{0}' cannot be used to name a method, there is already a getter with the same name");
1482 1504
1483 /** 1505 /**
1484 * 12.1 Constants: A constant expression is ... a constant list literal. 1506 * 12.1 Constants: A constant expression is ... a constant list literal.
1485 */ 1507 */
1486 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = 1508 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL =
1487 const CompileTimeErrorCode('MISSING_CONST_IN_LIST_LITERAL', 1509 const CompileTimeErrorCode('MISSING_CONST_IN_LIST_LITERAL',
1488 "List literals must be prefixed with 'const' when used as a constant e xpression"); 1510 "List literals must be prefixed with 'const' when used as a constant e xpression");
1489 1511
1490 /** 1512 /**
1491 * 12.1 Constants: A constant expression is ... a constant map literal. 1513 * 12.1 Constants: A constant expression is ... a constant map literal.
1492 */ 1514 */
1493 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = 1515 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL =
1494 const CompileTimeErrorCode('MISSING_CONST_IN_MAP_LITERAL', 1516 const CompileTimeErrorCode('MISSING_CONST_IN_MAP_LITERAL',
1495 "Map literals must be prefixed with 'const' when used as a constant ex pression"); 1517 "Map literals must be prefixed with 'const' when used as a constant ex pression");
1496 1518
1497 /** 1519 /**
1498 * Enum proposal: It is a static warning if all of the following conditions 1520 * Enum proposal: It is a static warning if all of the following conditions
1499 * hold: 1521 * hold:
1500 * * The switch statement does not have a 'default' clause. 1522 * * The switch statement does not have a 'default' clause.
1501 * * The static type of <i>e</i> is an enumerated typed with elements 1523 * * The static type of <i>e</i> is an enumerated typed with elements
1502 * <i>id<sub>1</sub></i>, &hellip;, <i>id<sub>n</sub></i>. 1524 * <i>id<sub>1</sub></i>, &hellip;, <i>id<sub>n</sub></i>.
1503 * * The sets {<i>e<sub>1</sub></i>, &hellip;, <i>e<sub>k</sub></i>} and 1525 * * The sets {<i>e<sub>1</sub></i>, &hellip;, <i>e<sub>k</sub></i>} and
1504 * {<i>id<sub>1</sub></i>, &hellip;, <i>id<sub>n</sub></i>} are not the same . 1526 * {<i>id<sub>1</sub></i>, &hellip;, <i>id<sub>n</sub></i>} are not the
1527 * same.
1505 * 1528 *
1506 * @param constantName the name of the constant that is missing 1529 * Parameters:
1530 * 0: the name of the constant that is missing
1507 */ 1531 */
1508 static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = 1532 static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH =
1509 const CompileTimeErrorCode('MISSING_ENUM_CONSTANT_IN_SWITCH', 1533 const CompileTimeErrorCode('MISSING_ENUM_CONSTANT_IN_SWITCH',
1510 "Missing case clause for '{0}'", 1534 "Missing case clause for '{0}'",
1511 "Add a case clause for the missing constant or add a default clause.") ; 1535 "Add a case clause for the missing constant or add a default clause.") ;
1512 1536
1513 /** 1537 /**
1514 * 9 Mixins: It is a compile-time error if a declared or derived mixin 1538 * 9 Mixins: It is a compile-time error if a declared or derived mixin
1515 * explicitly declares a constructor. 1539 * explicitly declares a constructor.
1516 * 1540 *
1517 * @param typeName the name of the mixin that is invalid 1541 * Parameters:
1542 * 0: the name of the mixin that is invalid
1518 */ 1543 */
1519 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = 1544 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR =
1520 const CompileTimeErrorCode('MIXIN_DECLARES_CONSTRUCTOR', 1545 const CompileTimeErrorCode('MIXIN_DECLARES_CONSTRUCTOR',
1521 "The class '{0}' cannot be used as a mixin because it declares a const ructor"); 1546 "The class '{0}' cannot be used as a mixin because it declares a const ructor");
1522 1547
1523 /** 1548 /**
1524 * 9.1 Mixin Application: It is a compile-time error if the with clause of a 1549 * 9.1 Mixin Application: It is a compile-time error if the with clause of a
1525 * mixin application <i>C</i> includes a deferred type expression. 1550 * mixin application <i>C</i> includes a deferred type expression.
1526 * 1551 *
1527 * @param typeName the name of the type that cannot be extended 1552 * Parameters:
1553 * 0: the name of the type that cannot be extended
1554 *
1528 * See [EXTENDS_DEFERRED_CLASS], and [IMPLEMENTS_DEFERRED_CLASS]. 1555 * See [EXTENDS_DEFERRED_CLASS], and [IMPLEMENTS_DEFERRED_CLASS].
1529 */ 1556 */
1530 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = 1557 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS =
1531 const CompileTimeErrorCode('MIXIN_DEFERRED_CLASS', 1558 const CompileTimeErrorCode('MIXIN_DEFERRED_CLASS',
1532 "This class cannot mixin the deferred class '{0}'"); 1559 "This class cannot mixin the deferred class '{0}'");
1533 1560
1534 /** 1561 /**
1535 * Not yet in the spec, but consistent with VM behavior. It is a 1562 * Not yet in the spec, but consistent with VM behavior. It is a
1536 * compile-time error if all of the constructors of a mixin's base class have 1563 * compile-time error if all of the constructors of a mixin's base class have
1537 * at least one optional parameter (since only constructors that lack 1564 * at least one optional parameter (since only constructors that lack
1538 * optional parameters can be forwarded to the mixin). See 1565 * optional parameters can be forwarded to the mixin). See
1539 * https://code.google.com/p/dart/issues/detail?id=15101#c4 1566 * https://code.google.com/p/dart/issues/detail?id=15101#c4
1540 */ 1567 */
1541 static const CompileTimeErrorCode MIXIN_HAS_NO_CONSTRUCTORS = 1568 static const CompileTimeErrorCode MIXIN_HAS_NO_CONSTRUCTORS =
1542 const CompileTimeErrorCode('MIXIN_HAS_NO_CONSTRUCTORS', 1569 const CompileTimeErrorCode('MIXIN_HAS_NO_CONSTRUCTORS',
1543 "This mixin application is invalid because all of the constructors " 1570 "This mixin application is invalid because all of the constructors "
1544 "in the base class '{0}' have optional parameters."); 1571 "in the base class '{0}' have optional parameters.");
1545 1572
1546 /** 1573 /**
1547 * 9 Mixins: It is a compile-time error if a mixin is derived from a class 1574 * 9 Mixins: It is a compile-time error if a mixin is derived from a class
1548 * whose superclass is not Object. 1575 * whose superclass is not Object.
1549 * 1576 *
1550 * @param typeName the name of the mixin that is invalid 1577 * Parameters:
1578 * 0: the name of the mixin that is invalid
1551 */ 1579 */
1552 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = 1580 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT =
1553 const CompileTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', 1581 const CompileTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT',
1554 "The class '{0}' cannot be used as a mixin because it extends a class other than Object"); 1582 "The class '{0}' cannot be used as a mixin because it extends a class other than Object");
1555 1583
1556 /** 1584 /**
1557 * 12.2 Null: It is a compile-time error for a class to attempt to extend or 1585 * 12.2 Null: It is a compile-time error for a class to attempt to extend or
1558 * implement Null. 1586 * implement Null.
1559 * 1587 *
1560 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend 1588 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
1561 * or implement int. 1589 * or implement int.
1562 * 1590 *
1563 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend 1591 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
1564 * or implement double. 1592 * or implement double.
1565 * 1593 *
1566 * 12.3 Numbers: It is a compile-time error for any type other than the types 1594 * 12.3 Numbers: It is a compile-time error for any type other than the types
1567 * int and double to attempt to extend or implement num. 1595 * int and double to attempt to extend or implement num.
1568 * 1596 *
1569 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend 1597 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
1570 * or implement bool. 1598 * or implement bool.
1571 * 1599 *
1572 * 12.5 Strings: It is a compile-time error for a class to attempt to extend 1600 * 12.5 Strings: It is a compile-time error for a class to attempt to extend
1573 * or implement String. 1601 * or implement String.
1574 * 1602 *
1575 * @param typeName the name of the type that cannot be extended 1603 * Parameters:
1604 * 0: the name of the type that cannot be extended
1605 *
1576 * See [IMPLEMENTS_DISALLOWED_CLASS]. 1606 * See [IMPLEMENTS_DISALLOWED_CLASS].
1577 */ 1607 */
1578 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = 1608 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS =
1579 const CompileTimeErrorCode( 1609 const CompileTimeErrorCode(
1580 'MIXIN_OF_DISALLOWED_CLASS', "Classes cannot mixin '{0}'"); 1610 'MIXIN_OF_DISALLOWED_CLASS', "Classes cannot mixin '{0}'");
1581 1611
1582 /** 1612 /**
1583 * Enum proposal: It is a compile-time error to subclass, mix-in or implement 1613 * Enum proposal: It is a compile-time error to subclass, mix-in or implement
1584 * an enum. 1614 * an enum.
1585 */ 1615 */
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1820 'NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY', 1850 'NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY',
1821 "Constant values from a deferred library cannot be used as constant in itializers"); 1851 "Constant values from a deferred library cannot be used as constant in itializers");
1822 1852
1823 /** 1853 /**
1824 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> 1854 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i>
1825 * or if <i>m > n</i>. 1855 * or if <i>m > n</i>.
1826 * 1856 *
1827 * 12.11.2 Const: It is a compile-time error if evaluation of a constant 1857 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
1828 * object results in an uncaught exception being thrown. 1858 * object results in an uncaught exception being thrown.
1829 * 1859 *
1830 * @param requiredCount the expected number of required arguments 1860 * Parameters:
1831 * @param argumentCount the actual number of positional arguments given 1861 * 0: the expected number of required arguments
1862 * 1: the actual number of positional arguments given
1832 */ 1863 */
1833 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = 1864 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS =
1834 const CompileTimeErrorCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', 1865 const CompileTimeErrorCode('NOT_ENOUGH_REQUIRED_ARGUMENTS',
1835 "{0} required argument(s) expected, but {1} found"); 1866 "{0} required argument(s) expected, but {1} found");
1836 1867
1837 /** 1868 /**
1838 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the 1869 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
1839 * superinitializer appears and let <i>S</i> be the superclass of <i>C</i>. 1870 * superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
1840 * Let <i>k</i> be a generative constructor. It is a compile-time error if 1871 * Let <i>k</i> be a generative constructor. It is a compile-time error if
1841 * class <i>S</i> does not declare a generative constructor named <i>S</i> 1872 * class <i>S</i> does not declare a generative constructor named <i>S</i>
(...skipping 15 matching lines...) Expand all
1857 * parameter in an operator. 1888 * parameter in an operator.
1858 */ 1889 */
1859 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = 1890 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR =
1860 const CompileTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', 1891 const CompileTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR',
1861 "Optional parameters are not allowed when defining an operator"); 1892 "Optional parameters are not allowed when defining an operator");
1862 1893
1863 /** 1894 /**
1864 * 14.3 Parts: It is a compile time error if the contents of the URI are not a 1895 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
1865 * valid part declaration. 1896 * valid part declaration.
1866 * 1897 *
1867 * @param uri the uri pointing to a non-library declaration 1898 * Parameters:
1899 * 0: the uri pointing to a non-library declaration
1868 */ 1900 */
1869 static const CompileTimeErrorCode PART_OF_NON_PART = 1901 static const CompileTimeErrorCode PART_OF_NON_PART =
1870 const CompileTimeErrorCode('PART_OF_NON_PART', 1902 const CompileTimeErrorCode('PART_OF_NON_PART',
1871 "The included part '{0}' must have a part-of directive"); 1903 "The included part '{0}' must have a part-of directive");
1872 1904
1873 /** 1905 /**
1874 * 14.1 Imports: It is a compile-time error if the current library declares a 1906 * 14.1 Imports: It is a compile-time error if the current library declares a
1875 * top-level member named <i>p</i>. 1907 * top-level member named <i>p</i>.
1876 */ 1908 */
1877 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = 1909 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER =
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 /** 1951 /**
1920 * 7.10 Superinterfaces: It is a compile-time error if the interface of a 1952 * 7.10 Superinterfaces: It is a compile-time error if the interface of a
1921 * class <i>C</i> is a superinterface of itself. 1953 * class <i>C</i> is a superinterface of itself.
1922 * 1954 *
1923 * 8.1 Superinterfaces: It is a compile-time error if an interface is a 1955 * 8.1 Superinterfaces: It is a compile-time error if an interface is a
1924 * superinterface of itself. 1956 * superinterface of itself.
1925 * 1957 *
1926 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a 1958 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
1927 * superclass of itself. 1959 * superclass of itself.
1928 * 1960 *
1929 * @param className the name of the class that implements itself recursively 1961 * Parameters:
1930 * @param strImplementsPath a string representation of the implements loop 1962 * 0: the name of the class that implements itself recursively
1963 * 1: a string representation of the implements loop
1931 */ 1964 */
1932 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = 1965 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE =
1933 const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE', 1966 const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE',
1934 "'{0}' cannot be a superinterface of itself: {1}"); 1967 "'{0}' cannot be a superinterface of itself: {1}");
1935 1968
1936 /** 1969 /**
1937 * 7.10 Superinterfaces: It is a compile-time error if the interface of a 1970 * 7.10 Superinterfaces: It is a compile-time error if the interface of a
1938 * class <i>C</i> is a superinterface of itself. 1971 * class <i>C</i> is a superinterface of itself.
1939 * 1972 *
1940 * 8.1 Superinterfaces: It is a compile-time error if an interface is a 1973 * 8.1 Superinterfaces: It is a compile-time error if an interface is a
1941 * superinterface of itself. 1974 * superinterface of itself.
1942 * 1975 *
1943 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a 1976 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
1944 * superclass of itself. 1977 * superclass of itself.
1945 * 1978 *
1946 * @param className the name of the class that implements itself recursively 1979 * Parameters:
1980 * 0: the name of the class that implements itself recursively
1947 */ 1981 */
1948 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = 1982 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS =
1949 const CompileTimeErrorCode( 1983 const CompileTimeErrorCode(
1950 'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS', 1984 'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS',
1951 "'{0}' cannot extend itself"); 1985 "'{0}' cannot extend itself");
1952 1986
1953 /** 1987 /**
1954 * 7.10 Superinterfaces: It is a compile-time error if the interface of a 1988 * 7.10 Superinterfaces: It is a compile-time error if the interface of a
1955 * class <i>C</i> is a superinterface of itself. 1989 * class <i>C</i> is a superinterface of itself.
1956 * 1990 *
1957 * 8.1 Superinterfaces: It is a compile-time error if an interface is a 1991 * 8.1 Superinterfaces: It is a compile-time error if an interface is a
1958 * superinterface of itself. 1992 * superinterface of itself.
1959 * 1993 *
1960 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a 1994 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
1961 * superclass of itself. 1995 * superclass of itself.
1962 * 1996 *
1963 * @param className the name of the class that implements itself recursively 1997 * Parameters:
1998 * 0: the name of the class that implements itself recursively
1964 */ 1999 */
1965 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = 2000 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS =
1966 const CompileTimeErrorCode( 2001 const CompileTimeErrorCode(
1967 'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS', 2002 'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS',
1968 "'{0}' cannot implement itself"); 2003 "'{0}' cannot implement itself");
1969 2004
1970 /** 2005 /**
1971 * 7.10 Superinterfaces: It is a compile-time error if the interface of a 2006 * 7.10 Superinterfaces: It is a compile-time error if the interface of a
1972 * class <i>C</i> is a superinterface of itself. 2007 * class <i>C</i> is a superinterface of itself.
1973 * 2008 *
1974 * 8.1 Superinterfaces: It is a compile-time error if an interface is a 2009 * 8.1 Superinterfaces: It is a compile-time error if an interface is a
1975 * superinterface of itself. 2010 * superinterface of itself.
1976 * 2011 *
1977 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a 2012 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
1978 * superclass of itself. 2013 * superclass of itself.
1979 * 2014 *
1980 * @param className the name of the class that implements itself recursively 2015 * Parameters:
2016 * 0: the name of the class that implements itself recursively
1981 */ 2017 */
1982 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH = 2018 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH =
1983 const CompileTimeErrorCode( 2019 const CompileTimeErrorCode(
1984 'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH', 2020 'RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH',
1985 "'{0}' cannot use itself as a mixin"); 2021 "'{0}' cannot use itself as a mixin");
1986 2022
1987 /** 2023 /**
1988 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with 2024 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
1989 * the const modifier but <i>k'</i> is not a constant constructor. 2025 * the const modifier but <i>k'</i> is not a constant constructor.
1990 */ 2026 */
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 * arguments to a constructor of a generic type <i>G</i> invoked by a new 2138 * arguments to a constructor of a generic type <i>G</i> invoked by a new
2103 * expression or a constant object expression are not subtypes of the bounds 2139 * expression or a constant object expression are not subtypes of the bounds
2104 * of the corresponding formal type parameters of <i>G</i>. 2140 * of the corresponding formal type parameters of <i>G</i>.
2105 * 2141 *
2106 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if 2142 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if
2107 * T is mal-bounded a dynamic error occurs. 2143 * T is mal-bounded a dynamic error occurs.
2108 * 2144 *
2109 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time 2145 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
2110 * constant would raise an exception. 2146 * constant would raise an exception.
2111 * 2147 *
2112 * @param boundedTypeName the name of the type used in the instance creation 2148 * Parameters:
2113 * that should be limited by the bound as specified in the class 2149 * 0: the name of the type used in the instance creation that should be
2114 * declaration 2150 * limited by the bound as specified in the class declaration
2115 * @param boundingTypeName the name of the bounding type 2151 * 1: the name of the bounding type
2152 *
2116 * See [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]. 2153 * See [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
2117 */ 2154 */
2118 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = 2155 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS =
2119 const CompileTimeErrorCode( 2156 const CompileTimeErrorCode(
2120 'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'"); 2157 'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
2121 2158
2122 /** 2159 /**
2123 * 15.3.1 Typedef: Any self reference, either directly, or recursively via 2160 * 15.3.1 Typedef: Any self reference, either directly, or recursively via
2124 * another typedef, is a compile time error. 2161 * another typedef, is a compile time error.
2125 */ 2162 */
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2158 2195
2159 /** 2196 /**
2160 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, 2197 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
2161 * <i>1<=i<=l</i>, must have a corresponding named parameter in the set 2198 * <i>1<=i<=l</i>, must have a corresponding named parameter in the set
2162 * {<i>p<sub>n+1</sub></i> ... <i>p<sub>n+k</sub></i>} or a static warning 2199 * {<i>p<sub>n+1</sub></i> ... <i>p<sub>n+k</sub></i>} or a static warning
2163 * occurs. 2200 * occurs.
2164 * 2201 *
2165 * 12.11.2 Const: It is a compile-time error if evaluation of a constant 2202 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
2166 * object results in an uncaught exception being thrown. 2203 * object results in an uncaught exception being thrown.
2167 * 2204 *
2168 * @param name the name of the requested named parameter 2205 * Parameters:
2206 * 0: the name of the requested named parameter
2169 */ 2207 */
2170 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = 2208 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER =
2171 const CompileTimeErrorCode('UNDEFINED_NAMED_PARAMETER', 2209 const CompileTimeErrorCode('UNDEFINED_NAMED_PARAMETER',
2172 "The named parameter '{0}' is not defined"); 2210 "The named parameter '{0}' is not defined");
2173 2211
2174 /** 2212 /**
2175 * 14.2 Exports: It is a compile-time error if the compilation unit found at 2213 * 14.2 Exports: It is a compile-time error if the compilation unit found at
2176 * the specified URI is not a library declaration. 2214 * the specified URI is not a library declaration.
2177 * 2215 *
2178 * 14.1 Imports: It is a compile-time error if the compilation unit found at 2216 * 14.1 Imports: It is a compile-time error if the compilation unit found at
2179 * the specified URI is not a library declaration. 2217 * the specified URI is not a library declaration.
2180 * 2218 *
2181 * 14.3 Parts: It is a compile time error if the contents of the URI are not a 2219 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
2182 * valid part declaration. 2220 * valid part declaration.
2183 * 2221 *
2184 * @param uri the URI pointing to a non-existent file 2222 * Parameters:
2223 * 0: the URI pointing to a non-existent file
2224 *
2185 * See [INVALID_URI]. 2225 * See [INVALID_URI].
2186 */ 2226 */
2187 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = 2227 static const CompileTimeErrorCode URI_DOES_NOT_EXIST =
2188 const CompileTimeErrorCode( 2228 const CompileTimeErrorCode(
2189 'URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'"); 2229 'URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
2190 2230
2191 /** 2231 /**
2192 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time 2232 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time
2193 * constant, or if <i>x</i> involves string interpolation. 2233 * constant, or if <i>x</i> involves string interpolation.
2194 * 2234 *
(...skipping 10 matching lines...) Expand all
2205 2245
2206 /** 2246 /**
2207 * 7.1.1 Operators: It is a compile-time error if the arity of the 2247 * 7.1.1 Operators: It is a compile-time error if the arity of the
2208 * user-declared operator []= is not 2. It is a compile time error if the 2248 * user-declared operator []= is not 2. It is a compile time error if the
2209 * arity of a user-declared operator with one of the names: &lt;, &gt;, &lt;=, 2249 * arity of a user-declared operator with one of the names: &lt;, &gt;, &lt;=,
2210 * &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt;&gt;, [] is not 1. It is 2250 * &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt;&gt;, [] is not 1. It is
2211 * a compile time error if the arity of the user-declared operator - is not 0 2251 * a compile time error if the arity of the user-declared operator - is not 0
2212 * or 1. It is a compile time error if the arity of the user-declared operator 2252 * or 1. It is a compile time error if the arity of the user-declared operator
2213 * ~ is not 0. 2253 * ~ is not 0.
2214 * 2254 *
2215 * @param operatorName the name of the declared operator 2255 * Parameters:
2216 * @param expectedNumberOfParameters the number of parameters expected 2256 * 0: the name of the declared operator
2217 * @param actualNumberOfParameters the number of parameters found in the 2257 * 1: the number of parameters expected
2218 * operator declaration 2258 * 2: the number of parameters found in the operator declaration
2219 */ 2259 */
2220 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = 2260 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR =
2221 const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 2261 const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR',
2222 "Operator '{0}' should declare exactly {1} parameter(s), but {2} found "); 2262 "Operator '{0}' should declare exactly {1} parameter(s), but {2} found ");
2223 2263
2224 /** 2264 /**
2225 * 7.1.1 Operators: It is a compile time error if the arity of the 2265 * 7.1.1 Operators: It is a compile time error if the arity of the
2226 * user-declared operator - is not 0 or 1. 2266 * user-declared operator - is not 0 or 1.
2227 * 2267 *
2228 * @param actualNumberOfParameters the number of parameters found in the 2268 * Parameters:
2229 * operator declaration 2269 * 0: the number of parameters found in the operator declaration
2230 */ 2270 */
2231 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = 2271 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S =
2232 const CompileTimeErrorCode( 2272 const CompileTimeErrorCode(
2233 'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', 2273 'WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS',
2234 "Operator '-' should declare 0 or 1 parameter, but {0} found"); 2274 "Operator '-' should declare 0 or 1 parameter, but {0} found");
2235 2275
2236 /** 2276 /**
2237 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list 2277 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
2238 * does not include exactly one required formal parameter <i>p</i>. 2278 * does not include exactly one required formal parameter <i>p</i>.
2239 */ 2279 */
(...skipping 27 matching lines...) Expand all
2267 : super(name, message, correction); 2307 : super(name, message, correction);
2268 2308
2269 @override 2309 @override
2270 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; 2310 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;
2271 2311
2272 @override 2312 @override
2273 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; 2313 ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
2274 } 2314 }
2275 2315
2276 /** 2316 /**
2277 * An `ErrorCode` represents an error code associated with an [AnalysisError]. 2317 * An error code associated with an [AnalysisError].
2278 * 2318 *
2279 * Generally, we want to provide messages that consist of three sentences. From 2319 * Generally, we want to provide messages that consist of three sentences. From
2280 * the user's perspective these sentences should explain: 2320 * the user's perspective these sentences should explain:
2281 * 1. what is wrong, 2321 * 1. what is wrong,
2282 * 2. why is it wrong, and 2322 * 2. why is it wrong, and
2283 * 3. how do I fix it. 2323 * 3. how do I fix it.
2284 * However, we combine the first two in the [message] and the last in the 2324 * However, we combine the first two in the [message] and the last in the
2285 * [correction]. 2325 * [correction].
2286 */ 2326 */
2287 abstract class ErrorCode { 2327 abstract class ErrorCode {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2326 */ 2366 */
2327 ErrorType get type; 2367 ErrorType get type;
2328 2368
2329 /** 2369 /**
2330 * The unique name of this error code. 2370 * The unique name of this error code.
2331 */ 2371 */
2332 String get uniqueName => "$runtimeType.$name"; 2372 String get uniqueName => "$runtimeType.$name";
2333 } 2373 }
2334 2374
2335 /** 2375 /**
2336 * The enumeration `ErrorProperty` defines the properties that can be associated with an 2376 * The properties that can be associated with an [AnalysisError].
2337 * [AnalysisError].
2338 */ 2377 */
2339 class ErrorProperty extends Enum<ErrorProperty> { 2378 class ErrorProperty extends Enum<ErrorProperty> {
2340 /** 2379 /**
2341 * A property whose value is an array of [ExecutableElement] that should 2380 * A property whose value is an array of [ExecutableElement] that should
2342 * be but are not implemented by a concrete class. 2381 * be but are not implemented by a concrete class.
2343 */ 2382 */
2344 static const ErrorProperty UNIMPLEMENTED_METHODS = 2383 static const ErrorProperty UNIMPLEMENTED_METHODS =
2345 const ErrorProperty('UNIMPLEMENTED_METHODS', 0); 2384 const ErrorProperty('UNIMPLEMENTED_METHODS', 0);
2346 2385
2347 static const List<ErrorProperty> values = const [UNIMPLEMENTED_METHODS]; 2386 static const List<ErrorProperty> values = const [UNIMPLEMENTED_METHODS];
2348 2387
2349 const ErrorProperty(String name, int ordinal) : super(name, ordinal); 2388 const ErrorProperty(String name, int ordinal) : super(name, ordinal);
2350 } 2389 }
2351 2390
2352 /** 2391 /**
2353 * Instances of the class `ErrorReporter` wrap an error listener with utility me thods used to 2392 * An object used to create analysis errors and report then to an error
2354 * create the errors being reported. 2393 * listener.
2355 */ 2394 */
2356 class ErrorReporter { 2395 class ErrorReporter {
2357 /** 2396 /**
2358 * The error listener to which errors will be reported. 2397 * The error listener to which errors will be reported.
2359 */ 2398 */
2360 final AnalysisErrorListener _errorListener; 2399 final AnalysisErrorListener _errorListener;
2361 2400
2362 /** 2401 /**
2363 * The default source to be used when reporting errors. 2402 * The default source to be used when reporting errors.
2364 */ 2403 */
2365 final Source _defaultSource; 2404 final Source _defaultSource;
2366 2405
2367 /** 2406 /**
2368 * The source to be used when reporting errors. 2407 * The source to be used when reporting errors.
2369 */ 2408 */
2370 Source _source; 2409 Source _source;
2371 2410
2372 /** 2411 /**
2373 * Initialize a newly created error reporter that will report errors to the gi ven listener. 2412 * Initialize a newly created error reporter that will report errors to the
2374 * 2413 * given [_errorListener]. Errors will be reported against the
2375 * @param errorListener the error listener to which errors will be reported 2414 * [_defaultSource] unless another source is provided later.
2376 * @param defaultSource the default source to be used when reporting errors
2377 */ 2415 */
2378 ErrorReporter(this._errorListener, this._defaultSource) { 2416 ErrorReporter(this._errorListener, this._defaultSource) {
2379 if (_errorListener == null) { 2417 if (_errorListener == null) {
2380 throw new IllegalArgumentException("An error listener must be provided"); 2418 throw new IllegalArgumentException("An error listener must be provided");
2381 } else if (_defaultSource == null) { 2419 } else if (_defaultSource == null) {
2382 throw new IllegalArgumentException("A default source must be provided"); 2420 throw new IllegalArgumentException("A default source must be provided");
2383 } 2421 }
2384 this._source = _defaultSource; 2422 this._source = _defaultSource;
2385 } 2423 }
2386 2424
2387 Source get source => _source; 2425 Source get source => _source;
2388 2426
2389 /** 2427 /**
2390 * Set the source to be used when reporting errors. Setting the source to `nul l` will cause 2428 * Set the source to be used when reporting errors to the given [source].
2391 * the default source to be used. 2429 * Setting the source to `null` will cause the default source to be used.
2392 *
2393 * @param source the source to be used when reporting errors
2394 */ 2430 */
2395 void set source(Source source) { 2431 void set source(Source source) {
2396 this._source = source == null ? _defaultSource : source; 2432 this._source = source == null ? _defaultSource : source;
2397 } 2433 }
2398 2434
2399 /** 2435 /**
2400 * Creates an error with properties with the given error code and arguments. 2436 * Creates an error with properties with the given [errorCode] and
2401 * 2437 * [arguments]. The [node] is used to compute the location of the error.
2402 * @param errorCode the error code of the error to be reported
2403 * @param node the node specifying the location of the error
2404 * @param arguments the arguments to the error, used to compose the error mess age
2405 */ 2438 */
2406 AnalysisErrorWithProperties newErrorWithProperties( 2439 AnalysisErrorWithProperties newErrorWithProperties(
2407 ErrorCode errorCode, AstNode node, List<Object> arguments) => 2440 ErrorCode errorCode, AstNode node, List<Object> arguments) =>
2408 new AnalysisErrorWithProperties.con2( 2441 new AnalysisErrorWithProperties.con2(
2409 _source, node.offset, node.length, errorCode, arguments); 2442 _source, node.offset, node.length, errorCode, arguments);
2410 2443
2411 /** 2444 /**
2412 * Report a passed error. 2445 * Report the given [error].
2413 *
2414 * @param error the error to report
2415 */ 2446 */
2416 void reportError(AnalysisError error) { 2447 void reportError(AnalysisError error) {
2417 _errorListener.onError(error); 2448 _errorListener.onError(error);
2418 } 2449 }
2419 2450
2420 /** 2451 /**
2421 * Report an error with the given error code and arguments. 2452 * Report an error with the given [errorCode] and [arguments]. The [element]
2422 * 2453 * is used to compute the location of the error.
2423 * @param errorCode the error code of the error to be reported
2424 * @param element the element which name should be used as the location of the error
2425 * @param arguments the arguments to the error, used to compose the error mess age
2426 */ 2454 */
2427 void reportErrorForElement( 2455 void reportErrorForElement(
2428 ErrorCode errorCode, Element element, List<Object> arguments) { 2456 ErrorCode errorCode, Element element, List<Object> arguments) {
2429 reportErrorForOffset( 2457 reportErrorForOffset(
2430 errorCode, element.nameOffset, element.displayName.length, arguments); 2458 errorCode, element.nameOffset, element.displayName.length, arguments);
2431 } 2459 }
2432 2460
2433 /** 2461 /**
2434 * Report an error with the given error code and arguments. 2462 * Report an error with the given [errorCode] and [arguments]. The [node] is
2463 * used to compute the location of the error.
2435 * 2464 *
2436 * If the arguments contain the names of two or more types, the method 2465 * If the arguments contain the names of two or more types, the method
2437 * [reportTypeErrorForNode] should be used and the types 2466 * [reportTypeErrorForNode] should be used and the types
2438 * themselves (rather than their names) should be passed as arguments. 2467 * themselves (rather than their names) should be passed as arguments.
2439 *
2440 * @param errorCode the error code of the error to be reported
2441 * @param node the node specifying the location of the error
2442 * @param arguments the arguments to the error, used to compose the error mess age
2443 */ 2468 */
2444 void reportErrorForNode(ErrorCode errorCode, AstNode node, 2469 void reportErrorForNode(ErrorCode errorCode, AstNode node,
2445 [List<Object> arguments]) { 2470 [List<Object> arguments]) {
2446 reportErrorForOffset(errorCode, node.offset, node.length, arguments); 2471 reportErrorForOffset(errorCode, node.offset, node.length, arguments);
2447 } 2472 }
2448 2473
2449 /** 2474 /**
2450 * Report an error with the given error code and arguments. 2475 * Report an error with the given [errorCode] and [arguments]. The location of
2451 * 2476 * the error is specified by the given [offset] and [length].
2452 * @param errorCode the error code of the error to be reported
2453 * @param offset the offset of the location of the error
2454 * @param length the length of the location of the error
2455 * @param arguments the arguments to the error, used to compose the error mess age
2456 */ 2477 */
2457 void reportErrorForOffset(ErrorCode errorCode, int offset, int length, 2478 void reportErrorForOffset(ErrorCode errorCode, int offset, int length,
2458 [List<Object> arguments]) { 2479 [List<Object> arguments]) {
2459 _errorListener.onError( 2480 _errorListener.onError(
2460 new AnalysisError.con2(_source, offset, length, errorCode, arguments)); 2481 new AnalysisError.con2(_source, offset, length, errorCode, arguments));
2461 } 2482 }
2462 2483
2463 /** 2484 /**
2464 * Report an error with the given error code and arguments. 2485 * Report an error with the given [errorCode] and [arguments]. The [token] is
2465 * 2486 * used to compute the location of the error.
2466 * @param errorCode the error code of the error to be reported
2467 * @param token the token specifying the location of the error
2468 * @param arguments the arguments to the error, used to compose the error mess age
2469 */ 2487 */
2470 void reportErrorForToken(ErrorCode errorCode, Token token, 2488 void reportErrorForToken(ErrorCode errorCode, Token token,
2471 [List<Object> arguments]) { 2489 [List<Object> arguments]) {
2472 reportErrorForOffset(errorCode, token.offset, token.length, arguments); 2490 reportErrorForOffset(errorCode, token.offset, token.length, arguments);
2473 } 2491 }
2474 2492
2475 /** 2493 /**
2476 * Report an error with the given error code and arguments. The arguments are expected to contain 2494 * Report an error with the given [errorCode] and [arguments]. The [node] is
2477 * two or more types. Convert the types into strings by using the display name s of the types, 2495 * used to compute the location of the error. The arguments are expected to
2478 * unless there are two or more types with the same names, in which case the e xtended display 2496 * contain two or more types. Convert the types into strings by using the
2479 * names of the types will be used in order to clarify the message. 2497 * display names of the types, unless there are two or more types with the
2498 * same names, in which case the extended display names of the types will be
2499 * used in order to clarify the message.
2480 * 2500 *
2481 * If there are not two or more types in the argument list, the method 2501 * If there are not two or more types in the argument list, the method
2482 * [reportErrorForNode] should be used instead. 2502 * [reportErrorForNode] should be used instead.
2483 *
2484 * @param errorCode the error code of the error to be reported
2485 * @param node the node specifying the location of the error
2486 * @param arguments the arguments to the error, used to compose the error mess age
2487 */ 2503 */
2488 void reportTypeErrorForNode( 2504 void reportTypeErrorForNode(
2489 ErrorCode errorCode, AstNode node, List<Object> arguments) { 2505 ErrorCode errorCode, AstNode node, List<Object> arguments) {
2490 _convertTypeNames(arguments); 2506 _convertTypeNames(arguments);
2491 reportErrorForOffset(errorCode, node.offset, node.length, arguments); 2507 reportErrorForOffset(errorCode, node.offset, node.length, arguments);
2492 } 2508 }
2493 2509
2494 /** 2510 /**
2495 * Given an array of arguments that is expected to contain two or more types, convert the types 2511 * Given an array of [arguments] that is expected to contain two or more
2496 * into strings by using the display names of the types, unless there are two or more types with 2512 * types, convert the types into strings by using the display names of the
2497 * the same names, in which case the extended display names of the types will be used in order to 2513 * types, unless there are two or more types with the same names, in which
2514 * case the extended display names of the types will be used in order to
2498 * clarify the message. 2515 * clarify the message.
2499 *
2500 * @param arguments the arguments that are to be converted
2501 */ 2516 */
2502 void _convertTypeNames(List<Object> arguments) { 2517 void _convertTypeNames(List<Object> arguments) {
2503 if (_hasEqualTypeNames(arguments)) { 2518 if (_hasEqualTypeNames(arguments)) {
2504 int count = arguments.length; 2519 int count = arguments.length;
2505 for (int i = 0; i < count; i++) { 2520 for (int i = 0; i < count; i++) {
2506 Object argument = arguments[i]; 2521 Object argument = arguments[i];
2507 if (argument is DartType) { 2522 if (argument is DartType) {
2508 DartType type = argument; 2523 DartType type = argument;
2509 Element element = type.element; 2524 Element element = type.element;
2510 if (element == null) { 2525 if (element == null) {
2511 arguments[i] = type.displayName; 2526 arguments[i] = type.displayName;
2512 } else { 2527 } else {
2513 arguments[i] = element.getExtendedDisplayName(type.displayName); 2528 arguments[i] = element.getExtendedDisplayName(type.displayName);
2514 } 2529 }
2515 } 2530 }
2516 } 2531 }
2517 } else { 2532 } else {
2518 int count = arguments.length; 2533 int count = arguments.length;
2519 for (int i = 0; i < count; i++) { 2534 for (int i = 0; i < count; i++) {
2520 Object argument = arguments[i]; 2535 Object argument = arguments[i];
2521 if (argument is DartType) { 2536 if (argument is DartType) {
2522 arguments[i] = argument.displayName; 2537 arguments[i] = argument.displayName;
2523 } 2538 }
2524 } 2539 }
2525 } 2540 }
2526 } 2541 }
2527 2542
2528 /** 2543 /**
2529 * Return `true` if the given array of arguments contains two or more types wi th the same 2544 * Return `true` if the given array of [arguments] contains two or more types
2530 * display name. 2545 * with the same display name.
2531 *
2532 * @param arguments the arguments being tested
2533 * @return `true` if the array of arguments contains two or more types with th e same display
2534 * name
2535 */ 2546 */
2536 bool _hasEqualTypeNames(List<Object> arguments) { 2547 bool _hasEqualTypeNames(List<Object> arguments) {
2537 int count = arguments.length; 2548 int count = arguments.length;
2538 HashSet<String> typeNames = new HashSet<String>(); 2549 HashSet<String> typeNames = new HashSet<String>();
2539 for (int i = 0; i < count; i++) { 2550 for (int i = 0; i < count; i++) {
2540 if (arguments[i] is DartType && 2551 if (arguments[i] is DartType &&
2541 !typeNames.add((arguments[i] as DartType).displayName)) { 2552 !typeNames.add((arguments[i] as DartType).displayName)) {
2542 return true; 2553 return true;
2543 } 2554 }
2544 } 2555 }
2545 return false; 2556 return false;
2546 } 2557 }
2547 } 2558 }
2548 2559
2549 /** 2560 /**
2550 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er rorCode] 2561 * The severity of an [ErrorCode].
2551 * .
2552 */ 2562 */
2553 class ErrorSeverity extends Enum<ErrorSeverity> { 2563 class ErrorSeverity extends Enum<ErrorSeverity> {
2554 /** 2564 /**
2555 * The severity representing a non-error. This is never used for any error cod e, but is useful for 2565 * The severity representing a non-error. This is never used for any error
2556 * clients. 2566 * code, but is useful for clients.
2557 */ 2567 */
2558 static const ErrorSeverity NONE = const ErrorSeverity('NONE', 0, " ", "none"); 2568 static const ErrorSeverity NONE = const ErrorSeverity('NONE', 0, " ", "none");
2559 2569
2560 /** 2570 /**
2561 * The severity representing an informational level analysis issue. 2571 * The severity representing an informational level analysis issue.
2562 */ 2572 */
2563 static const ErrorSeverity INFO = const ErrorSeverity('INFO', 1, "I", "info"); 2573 static const ErrorSeverity INFO = const ErrorSeverity('INFO', 1, "I", "info");
2564 2574
2565 /** 2575 /**
2566 * The severity representing a warning. Warnings can become errors if the `-We rror` command 2576 * The severity representing a warning. Warnings can become errors if the `-We rror` command
(...skipping 16 matching lines...) Expand all
2583 final String machineCode; 2593 final String machineCode;
2584 2594
2585 /** 2595 /**
2586 * The name of the severity used when producing readable output. 2596 * The name of the severity used when producing readable output.
2587 */ 2597 */
2588 final String displayName; 2598 final String displayName;
2589 2599
2590 /** 2600 /**
2591 * Initialize a newly created severity with the given names. 2601 * Initialize a newly created severity with the given names.
2592 * 2602 *
2593 * @param machineCode the name of the severity used when producing machine out put 2603 * Parameters:
2594 * @param displayName the name of the severity used when producing readable ou tput 2604 * 0: the name of the severity used when producing machine output
2605 * 1: the name of the severity used when producing readable output
2595 */ 2606 */
2596 const ErrorSeverity( 2607 const ErrorSeverity(
2597 String name, int ordinal, this.machineCode, this.displayName) 2608 String name, int ordinal, this.machineCode, this.displayName)
2598 : super(name, ordinal); 2609 : super(name, ordinal);
2599 2610
2600 /** 2611 /**
2601 * Return the severity constant that represents the greatest severity. 2612 * Return the severity constant that represents the greatest severity.
2602 *
2603 * @param severity the severity being compared against
2604 * @return the most sever of this or the given severity
2605 */ 2613 */
2606 ErrorSeverity max(ErrorSeverity severity) => 2614 ErrorSeverity max(ErrorSeverity severity) =>
2607 this.ordinal >= severity.ordinal ? this : severity; 2615 this.ordinal >= severity.ordinal ? this : severity;
2608 } 2616 }
2609 2617
2610 /** 2618 /**
2611 * Instances of the enumeration `ErrorType` represent the type of an [ErrorCode] . 2619 * The type of an [ErrorCode].
2612 */ 2620 */
2613 class ErrorType extends Enum<ErrorType> { 2621 class ErrorType extends Enum<ErrorType> {
2614 /** 2622 /**
2615 * Task (todo) comments in user code. 2623 * Task (todo) comments in user code.
2616 */ 2624 */
2617 static const ErrorType TODO = const ErrorType('TODO', 0, ErrorSeverity.INFO); 2625 static const ErrorType TODO = const ErrorType('TODO', 0, ErrorSeverity.INFO);
2618 2626
2619 /** 2627 /**
2620 * Extra analysis run over the code to follow best practices, which are not in the Dart Language 2628 * Extra analysis run over the code to follow best practices, which are not in
2621 * Specification. 2629 * the Dart Language Specification.
2622 */ 2630 */
2623 static const ErrorType HINT = const ErrorType('HINT', 1, ErrorSeverity.INFO); 2631 static const ErrorType HINT = const ErrorType('HINT', 1, ErrorSeverity.INFO);
2624 2632
2625 /** 2633 /**
2626 * Compile-time errors are errors that preclude execution. A compile time erro r must be reported 2634 * Compile-time errors are errors that preclude execution. A compile time
2627 * by a Dart compiler before the erroneous code is executed. 2635 * error must be reported by a Dart compiler before the erroneous code is
2636 * executed.
2628 */ 2637 */
2629 static const ErrorType COMPILE_TIME_ERROR = 2638 static const ErrorType COMPILE_TIME_ERROR =
2630 const ErrorType('COMPILE_TIME_ERROR', 2, ErrorSeverity.ERROR); 2639 const ErrorType('COMPILE_TIME_ERROR', 2, ErrorSeverity.ERROR);
2631 2640
2632 /** 2641 /**
2633 * Checked mode compile-time errors are errors that preclude execution in chec ked mode. 2642 * Checked mode compile-time errors are errors that preclude execution in
2643 * checked mode.
2634 */ 2644 */
2635 static const ErrorType CHECKED_MODE_COMPILE_TIME_ERROR = const ErrorType( 2645 static const ErrorType CHECKED_MODE_COMPILE_TIME_ERROR = const ErrorType(
2636 'CHECKED_MODE_COMPILE_TIME_ERROR', 3, ErrorSeverity.ERROR); 2646 'CHECKED_MODE_COMPILE_TIME_ERROR', 3, ErrorSeverity.ERROR);
2637 2647
2638 /** 2648 /**
2639 * Static warnings are those warnings reported by the static checker. They hav e no effect on 2649 * Static warnings are those warnings reported by the static checker. They
2640 * execution. Static warnings must be provided by Dart compilers used during d evelopment. 2650 * have no effect on execution. Static warnings must be provided by Dart
2651 * compilers used during development.
2641 */ 2652 */
2642 static const ErrorType STATIC_WARNING = 2653 static const ErrorType STATIC_WARNING =
2643 const ErrorType('STATIC_WARNING', 4, ErrorSeverity.WARNING); 2654 const ErrorType('STATIC_WARNING', 4, ErrorSeverity.WARNING);
2644 2655
2645 /** 2656 /**
2646 * Many, but not all, static warnings relate to types, in which case they are known as static type 2657 * Many, but not all, static warnings relate to types, in which case they are
2647 * warnings. 2658 * known as static type warnings.
2648 */ 2659 */
2649 static const ErrorType STATIC_TYPE_WARNING = 2660 static const ErrorType STATIC_TYPE_WARNING =
2650 const ErrorType('STATIC_TYPE_WARNING', 5, ErrorSeverity.WARNING); 2661 const ErrorType('STATIC_TYPE_WARNING', 5, ErrorSeverity.WARNING);
2651 2662
2652 /** 2663 /**
2653 * Syntactic errors are errors produced as a result of input that does not con form to the grammar. 2664 * Syntactic errors are errors produced as a result of input that does not
2665 * conform to the grammar.
2654 */ 2666 */
2655 static const ErrorType SYNTACTIC_ERROR = 2667 static const ErrorType SYNTACTIC_ERROR =
2656 const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR); 2668 const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR);
2657 2669
2658 /** 2670 /**
2659 * Lint warnings describe style and best practice recommendations that can be used to formalize a project's style 2671 * Lint warnings describe style and best practice recommendations that can be
2660 * guidelines. 2672 * used to formalize a project's style guidelines.
2661 */ 2673 */
2662 static const ErrorType LINT = const ErrorType('LINT', 7, ErrorSeverity.INFO); 2674 static const ErrorType LINT = const ErrorType('LINT', 7, ErrorSeverity.INFO);
2663 2675
2664 static const List<ErrorType> values = const [ 2676 static const List<ErrorType> values = const [
2665 TODO, 2677 TODO,
2666 HINT, 2678 HINT,
2667 COMPILE_TIME_ERROR, 2679 COMPILE_TIME_ERROR,
2668 CHECKED_MODE_COMPILE_TIME_ERROR, 2680 CHECKED_MODE_COMPILE_TIME_ERROR,
2669 STATIC_WARNING, 2681 STATIC_WARNING,
2670 STATIC_TYPE_WARNING, 2682 STATIC_TYPE_WARNING,
2671 SYNTACTIC_ERROR, 2683 SYNTACTIC_ERROR,
2672 LINT 2684 LINT
2673 ]; 2685 ];
2674 2686
2675 /** 2687 /**
2676 * The severity of this type of error. 2688 * The severity of this type of error.
2677 */ 2689 */
2678 final ErrorSeverity severity; 2690 final ErrorSeverity severity;
2679 2691
2680 /** 2692 /**
2681 * Initialize a newly created error type to have the given severity. 2693 * Initialize a newly created error type to have the given [name] and
2682 * 2694 * [severity].
2683 * @param severity the severity of this type of error
2684 */ 2695 */
2685 const ErrorType(String name, int ordinal, this.severity) 2696 const ErrorType(String name, int ordinal, this.severity)
2686 : super(name, ordinal); 2697 : super(name, ordinal);
2687 2698
2688 String get displayName => name.toLowerCase().replaceAll('_', ' '); 2699 String get displayName => name.toLowerCase().replaceAll('_', ' ');
2689 } 2700 }
2690 2701
2691 /** 2702 /**
2692 * The class `HintCode` defines the hints and coding recommendations for best 2703 * The hints and coding recommendations for best practices which are not
2693 * practices which are not mentioned in the Dart Language Specification. 2704 * mentioned in the Dart Language Specification.
2694 */ 2705 */
2695 class HintCode extends ErrorCode { 2706 class HintCode extends ErrorCode {
2696 /** 2707 /**
2697 * This hint is generated anywhere where the 2708 * This hint is generated anywhere where the
2698 * [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated, 2709 * [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated,
2699 * if we used propagated information for the warnings. 2710 * if we used propagated information for the warnings.
2700 * 2711 *
2701 * @param actualType the name of the actual argument type 2712 * Parameters:
2702 * @param expectedType the name of the expected type 2713 * 0: the name of the actual argument type
2714 * 1: the name of the expected type
2703 */ 2715 */
2704 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode( 2716 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode(
2705 'ARGUMENT_TYPE_NOT_ASSIGNABLE', 2717 'ARGUMENT_TYPE_NOT_ASSIGNABLE',
2706 "The argument type '{0}' cannot be assigned to the parameter type '{1}'"); 2718 "The argument type '{0}' cannot be assigned to the parameter type '{1}'");
2707 2719
2708 /** 2720 /**
2709 * Dead code is code that is never reached, this can happen for instance if a 2721 * Dead code is code that is never reached, this can happen for instance if a
2710 * statement follows a return statement. 2722 * statement follows a return statement.
2711 */ 2723 */
2712 static const HintCode DEAD_CODE = const HintCode('DEAD_CODE', "Dead code"); 2724 static const HintCode DEAD_CODE = const HintCode('DEAD_CODE', "Dead code");
2713 2725
2714 /** 2726 /**
2715 * Dead code is code that is never reached. This case covers cases where the 2727 * Dead code is code that is never reached. This case covers cases where the
2716 * user has catch clauses after `catch (e)` or `on Object catch (e)`. 2728 * user has catch clauses after `catch (e)` or `on Object catch (e)`.
2717 */ 2729 */
2718 static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode( 2730 static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode(
2719 'DEAD_CODE_CATCH_FOLLOWING_CATCH', 2731 'DEAD_CODE_CATCH_FOLLOWING_CATCH',
2720 "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached"); 2732 "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
2721 2733
2722 /** 2734 /**
2723 * Dead code is code that is never reached. This case covers cases where the 2735 * Dead code is code that is never reached. This case covers cases where the
2724 * user has an on-catch clause such as `on A catch (e)`, where a supertype of 2736 * user has an on-catch clause such as `on A catch (e)`, where a supertype of
2725 * `A` was already caught. 2737 * `A` was already caught.
2726 * 2738 *
2727 * @param subtypeName name of the subtype 2739 * Parameters:
2728 * @param supertypeName name of the supertype 2740 * 0: name of the subtype
2741 * 1: name of the supertype
2729 */ 2742 */
2730 static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode( 2743 static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode(
2731 'DEAD_CODE_ON_CATCH_SUBTYPE', 2744 'DEAD_CODE_ON_CATCH_SUBTYPE',
2732 "Dead code, this on-catch block will never be executed since '{0}' is a su btype of '{1}'"); 2745 "Dead code, this on-catch block will never be executed since '{0}' is a su btype of '{1}'");
2733 2746
2734 /** 2747 /**
2735 * Deprecated members should not be invoked or used. 2748 * Deprecated members should not be invoked or used.
2736 * 2749 *
2737 * @param memberName the name of the member 2750 * Parameters:
2751 * 0: the name of the member
2738 */ 2752 */
2739 static const HintCode DEPRECATED_MEMBER_USE = 2753 static const HintCode DEPRECATED_MEMBER_USE =
2740 const HintCode('DEPRECATED_MEMBER_USE', "'{0}' is deprecated"); 2754 const HintCode('DEPRECATED_MEMBER_USE', "'{0}' is deprecated");
2741 2755
2742 /** 2756 /**
2743 * Duplicate imports. 2757 * Duplicate imports.
2744 */ 2758 */
2745 static const HintCode DUPLICATE_IMPORT = 2759 static const HintCode DUPLICATE_IMPORT =
2746 const HintCode('DUPLICATE_IMPORT', "Duplicate import"); 2760 const HintCode('DUPLICATE_IMPORT', "Duplicate import");
2747 2761
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 */ 2795 */
2782 static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintC ode( 2796 static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintC ode(
2783 'IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', 2797 'IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION',
2784 "The library '{0}' defines a top-level function named 'loadLibrary' which is hidden by deferring this library"); 2798 "The library '{0}' defines a top-level function named 'loadLibrary' which is hidden by deferring this library");
2785 2799
2786 /** 2800 /**
2787 * This hint is generated anywhere where the 2801 * This hint is generated anywhere where the
2788 * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we 2802 * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we
2789 * used propagated information for the warnings. 2803 * used propagated information for the warnings.
2790 * 2804 *
2791 * @param rhsTypeName the name of the right hand side type 2805 * Parameters:
2792 * @param lhsTypeName the name of the left hand side type 2806 * 0: the name of the right hand side type
2807 * 1: the name of the left hand side type
2793 */ 2808 */
2794 static const HintCode INVALID_ASSIGNMENT = const HintCode( 2809 static const HintCode INVALID_ASSIGNMENT = const HintCode(
2795 'INVALID_ASSIGNMENT', 2810 'INVALID_ASSIGNMENT',
2796 "A value of type '{0}' cannot be assigned to a variable of type '{1}'"); 2811 "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
2797 2812
2798 /** 2813 /**
2799 * Generate a hint for methods or functions that have a return type, but do 2814 * Generate a hint for methods or functions that have a return type, but do
2800 * not have a non-void return statement on all branches. At the end of methods 2815 * not have a non-void return statement on all branches. At the end of methods
2801 * or functions with no return, Dart implicitly returns `null`, avoiding these 2816 * or functions with no return, Dart implicitly returns `null`, avoiding these
2802 * implicit returns is considered a best practice. 2817 * implicit returns is considered a best practice.
2803 * 2818 *
2804 * @param returnType the name of the declared return type 2819 * Parameters:
2820 * 0: the name of the declared return type
2805 */ 2821 */
2806 static const HintCode MISSING_RETURN = const HintCode('MISSING_RETURN', 2822 static const HintCode MISSING_RETURN = const HintCode('MISSING_RETURN',
2807 "This function declares a return type of '{0}', but does not end with a re turn statement", 2823 "This function declares a return type of '{0}', but does not end with a re turn statement",
2808 "Either add a return statement or change the return type to 'void'"); 2824 "Either add a return statement or change the return type to 'void'");
2809 2825
2810 /** 2826 /**
2811 * A getter with the override annotation does not override an existing getter. 2827 * A getter with the override annotation does not override an existing getter.
2812 */ 2828 */
2813 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode( 2829 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode(
2814 'OVERRIDE_ON_NON_OVERRIDING_GETTER', 2830 'OVERRIDE_ON_NON_OVERRIDING_GETTER',
2815 "Getter does not override an inherited getter"); 2831 "Getter does not override an inherited getter");
2816 2832
2817 /** 2833 /**
2818 * A method with the override annotation does not override an existing method. 2834 * A method with the override annotation does not override an existing method.
2819 */ 2835 */
2820 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode( 2836 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode(
2821 'OVERRIDE_ON_NON_OVERRIDING_METHOD', 2837 'OVERRIDE_ON_NON_OVERRIDING_METHOD',
2822 "Method does not override an inherited method"); 2838 "Method does not override an inherited method");
2823 2839
2824 /** 2840 /**
2825 * A setter with the override annotation does not override an existing setter. 2841 * A setter with the override annotation does not override an existing setter.
2826 */ 2842 */
2827 static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode( 2843 static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode(
2828 'OVERRIDE_ON_NON_OVERRIDING_SETTER', 2844 'OVERRIDE_ON_NON_OVERRIDING_SETTER',
2829 "Setter does not override an inherited setter"); 2845 "Setter does not override an inherited setter");
2830 2846
2831 /** 2847 /**
2832 * Hint for classes that override equals, but not hashCode. 2848 * Hint for classes that override equals, but not hashCode.
2833 * 2849 *
2834 * @param className the name of the current class 2850 * Parameters:
2851 * 0: the name of the current class
2835 */ 2852 */
2836 static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode( 2853 static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode(
2837 'OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', 2854 'OVERRIDE_EQUALS_BUT_NOT_HASH_CODE',
2838 "The class '{0}' overrides 'operator==', but not 'get hashCode'"); 2855 "The class '{0}' overrides 'operator==', but not 'get hashCode'");
2839 2856
2840 /** 2857 /**
2841 * Type checks of the type `x is! Null` should be done with `x != null`. 2858 * Type checks of the type `x is! Null` should be done with `x != null`.
2842 */ 2859 */
2843 static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode( 2860 static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode(
2844 'TYPE_CHECK_IS_NOT_NULL', 2861 'TYPE_CHECK_IS_NOT_NULL',
2845 "Tests for non-null should be done with '!= null'"); 2862 "Tests for non-null should be done with '!= null'");
2846 2863
2847 /** 2864 /**
2848 * Type checks of the type `x is Null` should be done with `x == null`. 2865 * Type checks of the type `x is Null` should be done with `x == null`.
2849 */ 2866 */
2850 static const HintCode TYPE_CHECK_IS_NULL = const HintCode( 2867 static const HintCode TYPE_CHECK_IS_NULL = const HintCode(
2851 'TYPE_CHECK_IS_NULL', "Tests for null should be done with '== null'"); 2868 'TYPE_CHECK_IS_NULL', "Tests for null should be done with '== null'");
2852 2869
2853 /** 2870 /**
2854 * This hint is generated anywhere where the 2871 * This hint is generated anywhere where the
2855 * [StaticTypeWarningCode.UNDEFINED_GETTER] or 2872 * [StaticTypeWarningCode.UNDEFINED_GETTER] or
2856 * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used 2873 * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used
2857 * propagated information for the warnings. 2874 * propagated information for the warnings.
2858 * 2875 *
2859 * @param getterName the name of the getter 2876 * Parameters:
2860 * @param enclosingType the name of the enclosing type where the getter is 2877 * 0: the name of the getter
2861 * being looked for 2878 * 1: the name of the enclosing type where the getter is being looked for
2862 */ 2879 */
2863 static const HintCode UNDEFINED_GETTER = const HintCode('UNDEFINED_GETTER', 2880 static const HintCode UNDEFINED_GETTER = const HintCode('UNDEFINED_GETTER',
2864 "The getter '{0}' is not defined for the class '{1}'"); 2881 "The getter '{0}' is not defined for the class '{1}'");
2865 2882
2866 /** 2883 /**
2867 * This hint is generated anywhere where the 2884 * This hint is generated anywhere where the
2868 * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we 2885 * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we
2869 * used propagated information for the warnings. 2886 * used propagated information for the warnings.
2870 * 2887 *
2871 * @param methodName the name of the method that is undefined 2888 * Parameters:
2872 * @param typeName the resolved type name that the method lookup is happening 2889 * 0: the name of the method that is undefined
2873 * on 2890 * 1: the resolved type name that the method lookup is happening on
2874 */ 2891 */
2875 static const HintCode UNDEFINED_METHOD = const HintCode('UNDEFINED_METHOD', 2892 static const HintCode UNDEFINED_METHOD = const HintCode('UNDEFINED_METHOD',
2876 "The method '{0}' is not defined for the class '{1}'"); 2893 "The method '{0}' is not defined for the class '{1}'");
2877 2894
2878 /** 2895 /**
2879 * This hint is generated anywhere where the 2896 * This hint is generated anywhere where the
2880 * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we 2897 * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we
2881 * used propagated information for the warnings. 2898 * used propagated information for the warnings.
2882 * 2899 *
2883 * @param operator the name of the operator 2900 * Parameters:
2884 * @param enclosingType the name of the enclosing type where the operator is 2901 * 0: the name of the operator
2885 * being looked for 2902 * 1: the name of the enclosing type where the operator is being looked for
2886 */ 2903 */
2887 static const HintCode UNDEFINED_OPERATOR = const HintCode( 2904 static const HintCode UNDEFINED_OPERATOR = const HintCode(
2888 'UNDEFINED_OPERATOR', 2905 'UNDEFINED_OPERATOR',
2889 "The operator '{0}' is not defined for the class '{1}'"); 2906 "The operator '{0}' is not defined for the class '{1}'");
2890 2907
2891 /** 2908 /**
2892 * This hint is generated anywhere where the 2909 * This hint is generated anywhere where the
2893 * [StaticTypeWarningCode.UNDEFINED_SETTER] or 2910 * [StaticTypeWarningCode.UNDEFINED_SETTER] or
2894 * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used 2911 * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used
2895 * propagated information for the warnings. 2912 * propagated information for the warnings.
2896 * 2913 *
2897 * @param setterName the name of the setter 2914 * Parameters:
2898 * @param enclosingType the name of the enclosing type where the setter is 2915 * 0: the name of the setter
2899 * being looked for 2916 * 1: the name of the enclosing type where the setter is being looked for
2900 */ 2917 */
2901 static const HintCode UNDEFINED_SETTER = const HintCode('UNDEFINED_SETTER', 2918 static const HintCode UNDEFINED_SETTER = const HintCode('UNDEFINED_SETTER',
2902 "The setter '{0}' is not defined for the class '{1}'"); 2919 "The setter '{0}' is not defined for the class '{1}'");
2903 2920
2904 /** 2921 /**
2905 * Unnecessary cast. 2922 * Unnecessary cast.
2906 */ 2923 */
2907 static const HintCode UNNECESSARY_CAST = 2924 static const HintCode UNNECESSARY_CAST =
2908 const HintCode('UNNECESSARY_CAST', "Unnecessary cast"); 2925 const HintCode('UNNECESSARY_CAST', "Unnecessary cast");
2909 2926
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
2943 * Unused local variables are local varaibles which are never read. 2960 * Unused local variables are local varaibles which are never read.
2944 */ 2961 */
2945 static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode( 2962 static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode(
2946 'UNUSED_LOCAL_VARIABLE', 2963 'UNUSED_LOCAL_VARIABLE',
2947 "The value of the local variable '{0}' is not used"); 2964 "The value of the local variable '{0}' is not used");
2948 2965
2949 /** 2966 /**
2950 * Hint for cases where the source expects a method or function to return a 2967 * Hint for cases where the source expects a method or function to return a
2951 * non-void result, but the method or function signature returns void. 2968 * non-void result, but the method or function signature returns void.
2952 * 2969 *
2953 * @param name the name of the method or function that returns void 2970 * Parameters:
2971 * 0: the name of the method or function that returns void
2954 */ 2972 */
2955 static const HintCode USE_OF_VOID_RESULT = const HintCode( 2973 static const HintCode USE_OF_VOID_RESULT = const HintCode(
2956 'USE_OF_VOID_RESULT', 2974 'USE_OF_VOID_RESULT',
2957 "The result of '{0}' is being used, even though it is declared to be 'void '"); 2975 "The result of '{0}' is being used, even though it is declared to be 'void '");
2958 2976
2959 /** 2977 /**
2960 * It is a bad practice for a source file in a package "lib" directory 2978 * It is a bad practice for a source file in a package "lib" directory
2961 * hierarchy to traverse outside that directory hierarchy. For example, a 2979 * hierarchy to traverse outside that directory hierarchy. For example, a
2962 * source file in the "lib" directory should not contain a directive such as 2980 * source file in the "lib" directory should not contain a directive such as
2963 * `import '../web/some.dart'` which references a file outside the lib 2981 * `import '../web/some.dart'` which references a file outside the lib
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 : super(name, message, correction); 3016 : super(name, message, correction);
2999 3017
3000 @override 3018 @override
3001 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; 3019 ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
3002 3020
3003 @override 3021 @override
3004 ErrorType get type => ErrorType.HINT; 3022 ErrorType get type => ErrorType.HINT;
3005 } 3023 }
3006 3024
3007 /** 3025 /**
3008 * The enumeration `HtmlWarningCode` defines the error codes used for warnings 3026 * The error codes used for warnings in HTML files. The convention for this
3009 * in HTML files. The convention for this class is for the name of the error 3027 * class is for the name of the error code to indicate the problem that caused
3010 * code to indicate the problem that caused the error to be generated and for 3028 * the error to be generated and for the error message to explain what is wrong
3011 * the error message to explain what is wrong and, when appropriate, how the 3029 * and, when appropriate, how the problem can be corrected.
3012 * problem can be corrected.
3013 */ 3030 */
3014 class HtmlWarningCode extends ErrorCode { 3031 class HtmlWarningCode extends ErrorCode {
3015 /** 3032 /**
3016 * An error code indicating that the value of the 'src' attribute of a Dart 3033 * An error code indicating that the value of the 'src' attribute of a Dart
3017 * script tag is not a valid URI. 3034 * script tag is not a valid URI.
3018 * 3035 *
3019 * @param uri the URI that is invalid 3036 * Parameters:
3037 * 0: the URI that is invalid
3020 */ 3038 */
3021 static const HtmlWarningCode INVALID_URI = 3039 static const HtmlWarningCode INVALID_URI =
3022 const HtmlWarningCode('INVALID_URI', "Invalid URI syntax: '{0}'"); 3040 const HtmlWarningCode('INVALID_URI', "Invalid URI syntax: '{0}'");
3023 3041
3024 /** 3042 /**
3025 * An error code indicating that the value of the 'src' attribute of a Dart 3043 * An error code indicating that the value of the 'src' attribute of a Dart
3026 * script tag references a file that does not exist. 3044 * script tag references a file that does not exist.
3027 * 3045 *
3028 * @param uri the URI pointing to a non-existent file 3046 * Parameters:
3047 * 0: the URI pointing to a non-existent file
3029 */ 3048 */
3030 static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode( 3049 static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode(
3031 'URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'"); 3050 'URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
3032 3051
3033 /** 3052 /**
3034 * Initialize a newly created error code to have the given [name]. The message 3053 * Initialize a newly created error code to have the given [name]. The message
3035 * associated with the error will be created from the given [message] 3054 * associated with the error will be created from the given [message]
3036 * template. The correction associated with the error will be created from the 3055 * template. The correction associated with the error will be created from the
3037 * given [correction] template. 3056 * given [correction] template.
3038 */ 3057 */
3039 const HtmlWarningCode(String name, String message, [String correction]) 3058 const HtmlWarningCode(String name, String message, [String correction])
3040 : super(name, message, correction); 3059 : super(name, message, correction);
3041 3060
3042 @override 3061 @override
3043 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; 3062 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
3044 3063
3045 @override 3064 @override
3046 ErrorType get type => ErrorType.STATIC_WARNING; 3065 ErrorType get type => ErrorType.STATIC_WARNING;
3047 } 3066 }
3048 3067
3049 /** 3068 /**
3050 * Defines style and best practice recommendations. 3069 * Defines style and best practice recommendations.
3051 * 3070 *
3052 * Unlike [HintCode]s, which are akin to traditional static warnings from a comp iler, lint recommendations focus on 3071 * Unlike [HintCode]s, which are akin to traditional static warnings from a
3053 * matters of style and practices that might aggregated to define a project's st yle guide. 3072 * compiler, lint recommendations focus on matters of style and practices that
3073 * might aggregated to define a project's style guide.
3054 */ 3074 */
3055 class LintCode extends ErrorCode { 3075 class LintCode extends ErrorCode {
3056 const LintCode(String name, String message, [String correction]) 3076 const LintCode(String name, String message, [String correction])
3057 : super(name, message, correction); 3077 : super(name, message, correction);
3058 3078
3059 @override 3079 @override
3060 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 3080 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
3061 3081
3062 @override 3082 @override
3063 ErrorType get type => ErrorType.LINT; 3083 ErrorType get type => ErrorType.LINT;
3064 } 3084 }
3065 3085
3066 /** 3086 /**
3067 * The class `StaticTypeWarningCode` defines the error codes used for static 3087 * The error codes used for static type warnings. The convention for this class
3068 * type warnings. The convention for this class is for the name of the error 3088 * is for the name of the error code to indicate the problem that caused the
3069 * code to indicate the problem that caused the error to be generated and for 3089 * error to be generated and for the error message to explain what is wrong and,
3070 * the error message to explain what is wrong and, when appropriate, how the 3090 * when appropriate, how the problem can be corrected.
3071 * problem can be corrected.
3072 */ 3091 */
3073 class StaticTypeWarningCode extends ErrorCode { 3092 class StaticTypeWarningCode extends ErrorCode {
3074 /** 3093 /**
3075 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose 3094 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose
3076 * class implements the built-in class <i>List&lt;E></i> is allocated. 3095 * class implements the built-in class <i>List&lt;E></i> is allocated.
3077 * 3096 *
3078 * @param numTypeArgument the number of provided type arguments 3097 * Parameters:
3098 * 0: the number of provided type arguments
3079 */ 3099 */
3080 static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = 3100 static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS =
3081 const StaticTypeWarningCode('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 3101 const StaticTypeWarningCode('EXPECTED_ONE_LIST_TYPE_ARGUMENTS',
3082 "List literal requires exactly one type arguments or none, but {0} fou nd"); 3102 "List literal requires exactly one type arguments or none, but {0} fou nd");
3083 3103
3084 /** 3104 /**
3085 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class 3105 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class
3086 * implements the built-in class <i>Map&lt;K, V></i> is allocated. 3106 * implements the built-in class <i>Map&lt;K, V></i> is allocated.
3087 * 3107 *
3088 * @param numTypeArgument the number of provided type arguments 3108 * Parameters:
3109 * 0: the number of provided type arguments
3089 */ 3110 */
3090 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = 3111 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS =
3091 const StaticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 3112 const StaticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS',
3092 "Map literal requires exactly two type arguments or none, but {0} foun d"); 3113 "Map literal requires exactly two type arguments or none, but {0} foun d");
3093 3114
3094 /** 3115 /**
3095 * 9 Functions: It is a static warning if the declared return type of a 3116 * 9 Functions: It is a static warning if the declared return type of a
3096 * function marked async* may not be assigned to Stream. 3117 * function marked async* may not be assigned to Stream.
3097 */ 3118 */
3098 static const StaticTypeWarningCode ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE = 3119 static const StaticTypeWarningCode ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE =
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
3154 * m<sub>k</sub></i> is inherited. 3175 * m<sub>k</sub></i> is inherited.
3155 */ 3176 */
3156 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = 3177 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE =
3157 const StaticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', 3178 const StaticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE',
3158 "'{0}' is inherited by at least two interfaces inconsistently, from {1 }"); 3179 "'{0}' is inherited by at least two interfaces inconsistently, from {1 }");
3159 3180
3160 /** 3181 /**
3161 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does 3182 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
3162 * not have an accessible (3.2) instance member named <i>m</i>. 3183 * not have an accessible (3.2) instance member named <i>m</i>.
3163 * 3184 *
3164 * @param memberName the name of the static member 3185 * Parameters:
3186 * 0: the name of the static member
3187 *
3165 * See [UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]. 3188 * See [UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER].
3166 */ 3189 */
3167 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = 3190 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER =
3168 const StaticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', 3191 const StaticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER',
3169 "Static member '{0}' cannot be accessed using instance access"); 3192 "Static member '{0}' cannot be accessed using instance access");
3170 3193
3171 /** 3194 /**
3172 * 12.18 Assignment: It is a static type warning if the static type of 3195 * 12.18 Assignment: It is a static type warning if the static type of
3173 * <i>e</i> may not be assigned to the static type of <i>v</i>. The static 3196 * <i>e</i> may not be assigned to the static type of <i>v</i>. The static
3174 * type of the expression <i>v = e</i> is the static type of <i>e</i>. 3197 * type of the expression <i>v = e</i> is the static type of <i>e</i>.
3175 * 3198 *
3176 * 12.18 Assignment: It is a static type warning if the static type of 3199 * 12.18 Assignment: It is a static type warning if the static type of
3177 * <i>e</i> may not be assigned to the static type of <i>C.v</i>. The static 3200 * <i>e</i> may not be assigned to the static type of <i>C.v</i>. The static
3178 * type of the expression <i>C.v = e</i> is the static type of <i>e</i>. 3201 * type of the expression <i>C.v = e</i> is the static type of <i>e</i>.
3179 * 3202 *
3180 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. 3203 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
3181 * It is a static type warning if the static type of <i>e<sub>2</sub></i> may 3204 * It is a static type warning if the static type of <i>e<sub>2</sub></i> may
3182 * not be assigned to <i>T</i>. 3205 * not be assigned to <i>T</i>.
3183 * 3206 *
3184 * @param rhsTypeName the name of the right hand side type 3207 * Parameters:
3185 * @param lhsTypeName the name of the left hand side type 3208 * 0: the name of the right hand side type
3209 * 1: the name of the left hand side type
3186 */ 3210 */
3187 static const StaticTypeWarningCode INVALID_ASSIGNMENT = 3211 static const StaticTypeWarningCode INVALID_ASSIGNMENT =
3188 const StaticTypeWarningCode('INVALID_ASSIGNMENT', 3212 const StaticTypeWarningCode('INVALID_ASSIGNMENT',
3189 "A value of type '{0}' cannot be assigned to a variable of type '{1}'" ); 3213 "A value of type '{0}' cannot be assigned to a variable of type '{1}'" );
3190 3214
3191 /** 3215 /**
3192 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the 3216 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the
3193 * form <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: 3217 * form <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
3194 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. 3218 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
3195 * 3219 *
3196 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if 3220 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if
3197 * <i>T</i> does not have an accessible instance member named <i>m</i>. If 3221 * <i>T</i> does not have an accessible instance member named <i>m</i>. If
3198 * <i>T.m</i> exists, it is a static warning if the type <i>F</i> of 3222 * <i>T.m</i> exists, it is a static warning if the type <i>F</i> of
3199 * <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does not 3223 * <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does not
3200 * exist, or if <i>F</i> is not a function type, the static type of <i>i</i> 3224 * exist, or if <i>F</i> is not a function type, the static type of <i>i</i>
3201 * is dynamic. 3225 * is dynamic.
3202 * 3226 *
3203 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i> 3227 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i>
3204 * of <i>C.m</i> may not be assigned to a function type. 3228 * of <i>C.m</i> may not be assigned to a function type.
3205 * 3229 *
3206 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 3230 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
3207 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: 3231 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
3208 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If 3232 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If
3209 * <i>S.m</i> exists, it is a static warning if the type <i>F</i> of 3233 * <i>S.m</i> exists, it is a static warning if the type <i>F</i> of
3210 * <i>S.m</i> may not be assigned to a function type. 3234 * <i>S.m</i> may not be assigned to a function type.
3211 * 3235 *
3212 * @param nonFunctionIdentifier the name of the identifier that is not a 3236 * Parameters:
3213 * function type 3237 * 0: the name of the identifier that is not a function type
3214 */ 3238 */
3215 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = 3239 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION =
3216 const StaticTypeWarningCode( 3240 const StaticTypeWarningCode(
3217 'INVOCATION_OF_NON_FUNCTION', "'{0}' is not a method"); 3241 'INVOCATION_OF_NON_FUNCTION', "'{0}' is not a method");
3218 3242
3219 /** 3243 /**
3220 * 12.14.4 Function Expression Invocation: A function expression invocation 3244 * 12.14.4 Function Expression Invocation: A function expression invocation
3221 * <i>i</i> has the form <i>e<sub>f</sub>(a<sub>1</sub>, &hellip;, 3245 * <i>i</i> has the form <i>e<sub>f</sub>(a<sub>1</sub>, &hellip;,
3222 * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: 3246 * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>:
3223 * a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression. 3247 * a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
3263 */ 3287 */
3264 static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = 3288 static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION =
3265 const StaticTypeWarningCode('NON_BOOL_NEGATION_EXPRESSION', 3289 const StaticTypeWarningCode('NON_BOOL_NEGATION_EXPRESSION',
3266 "Negation argument must have a static type of 'bool'"); 3290 "Negation argument must have a static type of 'bool'");
3267 3291
3268 /** 3292 /**
3269 * 12.21 Logical Boolean Expressions: It is a static type warning if the 3293 * 12.21 Logical Boolean Expressions: It is a static type warning if the
3270 * static types of both of <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> may 3294 * static types of both of <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> may
3271 * not be assigned to bool. 3295 * not be assigned to bool.
3272 * 3296 *
3273 * @param operator the lexeme of the logical operator 3297 * Parameters:
3298 * 0: the lexeme of the logical operator
3274 */ 3299 */
3275 static const StaticTypeWarningCode NON_BOOL_OPERAND = 3300 static const StaticTypeWarningCode NON_BOOL_OPERAND =
3276 const StaticTypeWarningCode('NON_BOOL_OPERAND', 3301 const StaticTypeWarningCode('NON_BOOL_OPERAND',
3277 "The operands of the '{0}' operator must be assignable to 'bool'"); 3302 "The operands of the '{0}' operator must be assignable to 'bool'");
3278 3303
3279 /** 3304 /**
3280 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>, 3305 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>,
3281 * 1 &lt;= i &lt;= n</i> does not denote a type in the enclosing lexical scope . 3306 * 1 &lt;= i &lt;= n</i> does not denote a type in the enclosing lexical scope .
3282 */ 3307 */
3283 static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = 3308 static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT =
3284 const StaticTypeWarningCode('NON_TYPE_AS_TYPE_ARGUMENT', 3309 const StaticTypeWarningCode('NON_TYPE_AS_TYPE_ARGUMENT',
3285 "The name '{0}' is not a type and cannot be used as a parameterized ty pe"); 3310 "The name '{0}' is not a type and cannot be used as a parameterized ty pe");
3286 3311
3287 /** 3312 /**
3288 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not 3313 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not
3289 * be assigned to the declared return type of the immediately enclosing 3314 * be assigned to the declared return type of the immediately enclosing
3290 * function. 3315 * function.
3291 * 3316 *
3292 * @param actualReturnType the return type as declared in the return statement 3317 * Parameters:
3293 * @param expectedReturnType the expected return type as defined by the method 3318 * 0: the return type as declared in the return statement
3294 * @param methodName the name of the method 3319 * 1: the expected return type as defined by the method
3320 * 2: the name of the method
3295 */ 3321 */
3296 static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = 3322 static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE =
3297 const StaticTypeWarningCode('RETURN_OF_INVALID_TYPE', 3323 const StaticTypeWarningCode('RETURN_OF_INVALID_TYPE',
3298 "The return type '{0}' is not a '{1}', as defined by the method '{2}'" ); 3324 "The return type '{0}' is not a '{1}', as defined by the method '{2}'" );
3299 3325
3300 /** 3326 /**
3301 * 12.11 Instance Creation: It is a static type warning if any of the type 3327 * 12.11 Instance Creation: It is a static type warning if any of the type
3302 * arguments to a constructor of a generic type <i>G</i> invoked by a new 3328 * arguments to a constructor of a generic type <i>G</i> invoked by a new
3303 * expression or a constant object expression are not subtypes of the bounds 3329 * expression or a constant object expression are not subtypes of the bounds
3304 * of the corresponding formal type parameters of <i>G</i>. 3330 * of the corresponding formal type parameters of <i>G</i>.
3305 * 3331 *
3306 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member 3332 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member
3307 * <i>m</i> of <i>G</i>, then the static type of the member <i>m</i> of 3333 * <i>m</i> of <i>G</i>, then the static type of the member <i>m</i> of
3308 * <i>G&lt;A<sub>1</sub>, &hellip;, A<sub>n</sub>&gt;</i> is <i>[A<sub>1</sub> , 3334 * <i>G&lt;A<sub>1</sub>, &hellip;, A<sub>n</sub>&gt;</i> is <i>[A<sub>1</sub> ,
3309 * &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]S</i> where 3335 * &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]S</i> where
3310 * <i>T<sub>1</sub>, &hellip;, T<sub>n</sub></i> are the formal type 3336 * <i>T<sub>1</sub>, &hellip;, T<sub>n</sub></i> are the formal type
3311 * parameters of <i>G</i>. Let <i>B<sub>i</sub></i> be the bounds of 3337 * parameters of <i>G</i>. Let <i>B<sub>i</sub></i> be the bounds of
3312 * <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>. It is a static type warning if 3338 * <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>. It is a static type warning if
3313 * <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1</sub>, &hellip;, 3339 * <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1</sub>, &hellip;,
3314 * A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]B<sub>i</sub>, 1 &lt;= 3340 * A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]B<sub>i</sub>, 1 &lt;=
3315 * i &lt;= n</i>. 3341 * i &lt;= n</i>.
3316 * 3342 *
3317 * 7.6.2 Factories: It is a static type warning if any of the type arguments 3343 * 7.6.2 Factories: It is a static type warning if any of the type arguments
3318 * to <i>k'</i> are not subtypes of the bounds of the corresponding formal 3344 * to <i>k'</i> are not subtypes of the bounds of the corresponding formal
3319 * type parameters of type. 3345 * type parameters of type.
3320 * 3346 *
3321 * @param boundedTypeName the name of the type used in the instance creation 3347 * Parameters:
3322 * that should be limited by the bound as specified in the class 3348 * 0: the name of the type used in the instance creation that should be
3323 * declaration 3349 * limited by the bound as specified in the class declaration
3324 * @param boundingTypeName the name of the bounding type 3350 * 1: the name of the bounding type
3351 *
3325 * See [TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]. 3352 * See [TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND].
3326 */ 3353 */
3327 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = 3354 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS =
3328 const StaticTypeWarningCode( 3355 const StaticTypeWarningCode(
3329 'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'"); 3356 'TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
3330 3357
3331 /** 3358 /**
3332 * 10 Generics: It is a static type warning if a type parameter is a supertype 3359 * 10 Generics: It is a static type warning if a type parameter is a supertype
3333 * of its upper bound. 3360 * of its upper bound.
3334 * 3361 *
3335 * @param typeParameterName the name of the type parameter 3362 * Parameters:
3363 * 0: the name of the type parameter
3364 *
3336 * See [TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]. 3365 * See [TYPE_ARGUMENT_NOT_MATCHING_BOUNDS].
3337 */ 3366 */
3338 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = 3367 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND =
3339 const StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', 3368 const StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND',
3340 "'{0}' cannot be a supertype of its upper bound"); 3369 "'{0}' cannot be a supertype of its upper bound");
3341 3370
3342 /** 3371 /**
3343 * 12.17 Getter Invocation: It is a static warning if there is no class 3372 * 12.17 Getter Invocation: It is a static warning if there is no class
3344 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does 3373 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does
3345 * not declare, implicitly or explicitly, a getter named <i>m</i>. 3374 * not declare, implicitly or explicitly, a getter named <i>m</i>.
3346 * 3375 *
3347 * @param constantName the name of the enumeration constant that is not 3376 * Parameters:
3348 * defined 3377 * 0: the name of the enumeration constant that is not defined
3349 * @param enumName the name of the enumeration used to access the constant 3378 * 1: the name of the enumeration used to access the constant
3350 */ 3379 */
3351 static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = 3380 static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT =
3352 const StaticTypeWarningCode('UNDEFINED_ENUM_CONSTANT', 3381 const StaticTypeWarningCode('UNDEFINED_ENUM_CONSTANT',
3353 "There is no constant named '{0}' in '{1}'"); 3382 "There is no constant named '{0}' in '{1}'");
3354 3383
3355 /** 3384 /**
3356 * 12.15.3 Unqualified Invocation: If there exists a lexically visible 3385 * 12.15.3 Unqualified Invocation: If there exists a lexically visible
3357 * declaration named <i>id</i>, let <i>f<sub>id</sub></i> be the innermost 3386 * declaration named <i>id</i>, let <i>f<sub>id</sub></i> be the innermost
3358 * such declaration. Then: [skip]. Otherwise, <i>f<sub>id</sub></i> is 3387 * such declaration. Then: [skip]. Otherwise, <i>f<sub>id</sub></i> is
3359 * considered equivalent to the ordinary method invocation 3388 * considered equivalent to the ordinary method invocation
3360 * <b>this</b>.<i>id</i>(<i>a<sub>1</sub></i>, ..., <i>a<sub>n</sub></i>, 3389 * <b>this</b>.<i>id</i>(<i>a<sub>1</sub></i>, ..., <i>a<sub>n</sub></i>,
3361 * <i>x<sub>n+1</sub></i> : <i>a<sub>n+1</sub></i>, ..., 3390 * <i>x<sub>n+1</sub></i> : <i>a<sub>n+1</sub></i>, ...,
3362 * <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>). 3391 * <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>).
3363 * 3392 *
3364 * @param methodName the name of the method that is undefined 3393 * Parameters:
3394 * 0: the name of the method that is undefined
3365 */ 3395 */
3366 static const StaticTypeWarningCode UNDEFINED_FUNCTION = 3396 static const StaticTypeWarningCode UNDEFINED_FUNCTION =
3367 const StaticTypeWarningCode( 3397 const StaticTypeWarningCode(
3368 'UNDEFINED_FUNCTION', "The function '{0}' is not defined"); 3398 'UNDEFINED_FUNCTION', "The function '{0}' is not defined");
3369 3399
3370 /** 3400 /**
3371 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is 3401 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
3372 * a static type warning if <i>T</i> does not have a getter named <i>m</i>. 3402 * a static type warning if <i>T</i> does not have a getter named <i>m</i>.
3373 * 3403 *
3374 * @param getterName the name of the getter 3404 * Parameters:
3375 * @param enclosingType the name of the enclosing type where the getter is 3405 * 0: the name of the getter
3376 * being looked for 3406 * 1: the name of the enclosing type where the getter is being looked for
3377 */ 3407 */
3378 static const StaticTypeWarningCode UNDEFINED_GETTER = 3408 static const StaticTypeWarningCode UNDEFINED_GETTER =
3379 const StaticTypeWarningCode('UNDEFINED_GETTER', 3409 const StaticTypeWarningCode('UNDEFINED_GETTER',
3380 "The getter '{0}' is not defined for the class '{1}'"); 3410 "The getter '{0}' is not defined for the class '{1}'");
3381 3411
3382 /** 3412 /**
3383 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. 3413 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
3384 * It is a static type warning if <i>T</i> does not have an accessible 3414 * It is a static type warning if <i>T</i> does not have an accessible
3385 * instance member named <i>m</i>. 3415 * instance member named <i>m</i>.
3386 * 3416 *
3387 * @param methodName the name of the method that is undefined 3417 * Parameters:
3388 * @param typeName the resolved type name that the method lookup is happening 3418 * 0: the name of the method that is undefined
3389 * on 3419 * 1: the resolved type name that the method lookup is happening on
3390 */ 3420 */
3391 static const StaticTypeWarningCode UNDEFINED_METHOD = 3421 static const StaticTypeWarningCode UNDEFINED_METHOD =
3392 const StaticTypeWarningCode('UNDEFINED_METHOD', 3422 const StaticTypeWarningCode('UNDEFINED_METHOD',
3393 "The method '{0}' is not defined for the class '{1}'"); 3423 "The method '{0}' is not defined for the class '{1}'");
3394 3424
3395 /** 3425 /**
3396 * 12.18 Assignment: Evaluation of an assignment of the form 3426 * 12.18 Assignment: Evaluation of an assignment of the form
3397 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is 3427 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is
3398 * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e); 3428 * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e);
3399 * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>, 3429 * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>,
3400 * <i>e<sub>2</sub></i>). 3430 * <i>e<sub>2</sub></i>).
3401 * 3431 *
3402 * 12.29 Assignable Expressions: An assignable expression of the form 3432 * 12.29 Assignable Expressions: An assignable expression of the form
3403 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method 3433 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method
3404 * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument 3434 * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument
3405 * <i>e<sub>2</sub></i>. 3435 * <i>e<sub>2</sub></i>.
3406 * 3436 *
3407 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. 3437 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
3408 * It is a static type warning if <i>T</i> does not have an accessible 3438 * It is a static type warning if <i>T</i> does not have an accessible
3409 * instance member named <i>m</i>. 3439 * instance member named <i>m</i>.
3410 * 3440 *
3411 * @param operator the name of the operator 3441 * Parameters:
3412 * @param enclosingType the name of the enclosing type where the operator is 3442 * 0: the name of the operator
3413 * being looked for 3443 * 1: the name of the enclosing type where the operator is being looked for
3414 */ 3444 */
3415 static const StaticTypeWarningCode UNDEFINED_OPERATOR = 3445 static const StaticTypeWarningCode UNDEFINED_OPERATOR =
3416 const StaticTypeWarningCode('UNDEFINED_OPERATOR', 3446 const StaticTypeWarningCode('UNDEFINED_OPERATOR',
3417 "The operator '{0}' is not defined for the class '{1}'"); 3447 "The operator '{0}' is not defined for the class '{1}'");
3418 3448
3419 /** 3449 /**
3420 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. 3450 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
3421 * It is a static type warning if <i>T</i> does not have an accessible 3451 * It is a static type warning if <i>T</i> does not have an accessible
3422 * instance setter named <i>v=</i>. 3452 * instance setter named <i>v=</i>.
3423 * 3453 *
3424 * @param setterName the name of the setter 3454 * Parameters:
3425 * @param enclosingType the name of the enclosing type where the setter is 3455 * 0: the name of the setter
3426 * being looked for 3456 * 1: the name of the enclosing type where the setter is being looked for
3457 *
3427 * See [INACCESSIBLE_SETTER]. 3458 * See [INACCESSIBLE_SETTER].
3428 */ 3459 */
3429 static const StaticTypeWarningCode UNDEFINED_SETTER = 3460 static const StaticTypeWarningCode UNDEFINED_SETTER =
3430 const StaticTypeWarningCode('UNDEFINED_SETTER', 3461 const StaticTypeWarningCode('UNDEFINED_SETTER',
3431 "The setter '{0}' is not defined for the class '{1}'"); 3462 "The setter '{0}' is not defined for the class '{1}'");
3432 3463
3433 /** 3464 /**
3434 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is 3465 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
3435 * a static type warning if <i>T</i> does not have a getter named <i>m</i>. 3466 * a static type warning if <i>T</i> does not have a getter named <i>m</i>.
3436 * 3467 *
3437 * @param getterName the name of the getter 3468 * Parameters:
3438 * @param enclosingType the name of the enclosing type where the getter is 3469 * 0: the name of the getter
3439 * being looked for 3470 * 1: the name of the enclosing type where the getter is being looked for
3440 */ 3471 */
3441 static const StaticTypeWarningCode UNDEFINED_SUPER_GETTER = 3472 static const StaticTypeWarningCode UNDEFINED_SUPER_GETTER =
3442 const StaticTypeWarningCode('UNDEFINED_SUPER_GETTER', 3473 const StaticTypeWarningCode('UNDEFINED_SUPER_GETTER',
3443 "The getter '{0}' is not defined in a superclass of '{1}'"); 3474 "The getter '{0}' is not defined in a superclass of '{1}'");
3444 3475
3445 /** 3476 /**
3446 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 3477 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
3447 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: 3478 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
3448 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a 3479 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a
3449 * static type warning if <i>S</i> does not have an accessible instance member 3480 * static type warning if <i>S</i> does not have an accessible instance member
3450 * named <i>m</i>. 3481 * named <i>m</i>.
3451 * 3482 *
3452 * @param methodName the name of the method that is undefined 3483 * Parameters:
3453 * @param typeName the resolved type name that the method lookup is happening 3484 * 0: the name of the method that is undefined
3454 * on 3485 * 1: the resolved type name that the method lookup is happening on
3455 */ 3486 */
3456 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = 3487 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD =
3457 const StaticTypeWarningCode('UNDEFINED_SUPER_METHOD', 3488 const StaticTypeWarningCode('UNDEFINED_SUPER_METHOD',
3458 "The method '{0}' is not defined in a superclass of '{1}'"); 3489 "The method '{0}' is not defined in a superclass of '{1}'");
3459 3490
3460 /** 3491 /**
3461 * 12.18 Assignment: Evaluation of an assignment of the form 3492 * 12.18 Assignment: Evaluation of an assignment of the form
3462 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is 3493 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is
3463 * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e); 3494 * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e);
3464 * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>, 3495 * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>,
3465 * <i>e<sub>2</sub></i>). 3496 * <i>e<sub>2</sub></i>).
3466 * 3497 *
3467 * 12.29 Assignable Expressions: An assignable expression of the form 3498 * 12.29 Assignable Expressions: An assignable expression of the form
3468 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method 3499 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method
3469 * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument 3500 * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument
3470 * <i>e<sub>2</sub></i>. 3501 * <i>e<sub>2</sub></i>.
3471 * 3502 *
3472 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. 3503 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
3473 * It is a static type warning if <i>T</i> does not have an accessible 3504 * It is a static type warning if <i>T</i> does not have an accessible
3474 * instance member named <i>m</i>. 3505 * instance member named <i>m</i>.
3475 * 3506 *
3476 * @param operator the name of the operator 3507 * Parameters:
3477 * @param enclosingType the name of the enclosing type where the operator is 3508 * 0: the name of the operator
3478 * being looked for 3509 * 1: the name of the enclosing type where the operator is being looked for
3479 */ 3510 */
3480 static const StaticTypeWarningCode UNDEFINED_SUPER_OPERATOR = 3511 static const StaticTypeWarningCode UNDEFINED_SUPER_OPERATOR =
3481 const StaticTypeWarningCode('UNDEFINED_SUPER_OPERATOR', 3512 const StaticTypeWarningCode('UNDEFINED_SUPER_OPERATOR',
3482 "The operator '{0}' is not defined in a superclass of '{1}'"); 3513 "The operator '{0}' is not defined in a superclass of '{1}'");
3483 3514
3484 /** 3515 /**
3485 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. 3516 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
3486 * It is a static type warning if <i>T</i> does not have an accessible 3517 * It is a static type warning if <i>T</i> does not have an accessible
3487 * instance setter named <i>v=</i>. 3518 * instance setter named <i>v=</i>.
3488 * 3519 *
3489 * @param setterName the name of the setter 3520 * Parameters:
3490 * @param enclosingType the name of the enclosing type where the setter is 3521 * 0: the name of the setter
3491 * being looked for 3522 * 1: the name of the enclosing type where the setter is being looked for
3523 *
3492 * See [INACCESSIBLE_SETTER]. 3524 * See [INACCESSIBLE_SETTER].
3493 */ 3525 */
3494 static const StaticTypeWarningCode UNDEFINED_SUPER_SETTER = 3526 static const StaticTypeWarningCode UNDEFINED_SUPER_SETTER =
3495 const StaticTypeWarningCode('UNDEFINED_SUPER_SETTER', 3527 const StaticTypeWarningCode('UNDEFINED_SUPER_SETTER',
3496 "The setter '{0}' is not defined in a superclass of '{1}'"); 3528 "The setter '{0}' is not defined in a superclass of '{1}'");
3497 3529
3498 /** 3530 /**
3499 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does 3531 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
3500 * not have an accessible (3.2) instance member named <i>m</i>. 3532 * not have an accessible (3.2) instance member named <i>m</i>.
3501 * 3533 *
3502 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used 3534 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used
3503 * when we are able to find the name defined in a supertype. It exists to 3535 * when we are able to find the name defined in a supertype. It exists to
3504 * provide a more informative error message. 3536 * provide a more informative error message.
3505 */ 3537 */
3506 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER = 3538 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER =
3507 const StaticTypeWarningCode( 3539 const StaticTypeWarningCode(
3508 'UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER', 3540 'UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER',
3509 "Static members from supertypes must be qualified by the name of the d efining type"); 3541 "Static members from supertypes must be qualified by the name of the d efining type");
3510 3542
3511 /** 3543 /**
3512 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a 3544 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
3513 * generic type with exactly <i>n</i> type parameters. 3545 * generic type with exactly <i>n</i> type parameters.
3514 * 3546 *
3515 * @param typeName the name of the type being referenced (<i>G</i>) 3547 * Parameters:
3516 * @param parameterCount the number of type parameters that were declared 3548 * 0: the name of the type being referenced (<i>G</i>)
3517 * @param argumentCount the number of type arguments provided 3549 * 1: the number of type parameters that were declared
3550 * 2: the number of type arguments provided
3551 *
3518 * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and 3552 * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and
3519 * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS]. 3553 * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS].
3520 */ 3554 */
3521 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = 3555 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS =
3522 const StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 3556 const StaticTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS',
3523 "The type '{0}' is declared with {1} type parameters, but {2} type arg uments were given"); 3557 "The type '{0}' is declared with {1} type parameters, but {2} type arg uments were given");
3524 3558
3525 /** 3559 /**
3526 * 17.16.1 Yield: Let T be the static type of e [the expression to the right 3560 * 17.16.1 Yield: Let T be the static type of e [the expression to the right
3527 * of "yield"] and let f be the immediately enclosing function. It is a 3561 * of "yield"] and let f be the immediately enclosing function. It is a
(...skipping 26 matching lines...) Expand all
3554 : super(name, message, correction); 3588 : super(name, message, correction);
3555 3589
3556 @override 3590 @override
3557 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; 3591 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity;
3558 3592
3559 @override 3593 @override
3560 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; 3594 ErrorType get type => ErrorType.STATIC_TYPE_WARNING;
3561 } 3595 }
3562 3596
3563 /** 3597 /**
3564 * The enumeration `StaticWarningCode` defines the error codes used for static 3598 * The error codes used for static warnings. The convention for this class is
3565 * warnings. The convention for this class is for the name of the error code to 3599 * for the name of the error code to indicate the problem that caused the error
3566 * indicate the problem that caused the error to be generated and for the error 3600 * to be generated and for the error message to explain what is wrong and, when
3567 * message to explain what is wrong and, when appropriate, how the problem can 3601 * appropriate, how the problem can be corrected.
3568 * be corrected.
3569 */ 3602 */
3570 class StaticWarningCode extends ErrorCode { 3603 class StaticWarningCode extends ErrorCode {
3571 /** 3604 /**
3572 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and 3605 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and
3573 * <i>N</i> is introduced into the top level scope <i>L</i> by more than one 3606 * <i>N</i> is introduced into the top level scope <i>L</i> by more than one
3574 * import then: 3607 * import then:
3575 * 1. A static warning occurs. 3608 * 1. A static warning occurs.
3576 * 2. If <i>N</i> is referenced as a function, getter or setter, a 3609 * 2. If <i>N</i> is referenced as a function, getter or setter, a
3577 * <i>NoSuchMethodError</i> is raised. 3610 * <i>NoSuchMethodError</i> is raised.
3578 * 3. If <i>N</i> is referenced as a type, it is treated as a malformed type. 3611 * 3. If <i>N</i> is referenced as a type, it is treated as a malformed type.
3579 * 3612 *
3580 * @param ambiguousTypeName the name of the ambiguous type 3613 * Parameters:
3581 * @param firstLibraryName the name of the first library that the type is 3614 * 0: the name of the ambiguous type
3582 * found 3615 * 1: the name of the first library that the type is found
3583 * @param secondLibraryName the name of the second library that the type is 3616 * 2: the name of the second library that the type is found
3584 * found
3585 */ 3617 */
3586 static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode( 3618 static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode(
3587 'AMBIGUOUS_IMPORT', "The name '{0}' is defined in the libraries {1}", 3619 'AMBIGUOUS_IMPORT', "The name '{0}' is defined in the libraries {1}",
3588 "Consider using 'as prefix' for one of the import directives " 3620 "Consider using 'as prefix' for one of the import directives "
3589 "or hiding the name from all but one of the imports."); 3621 "or hiding the name from all but one of the imports.");
3590 3622
3591 /** 3623 /**
3592 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 3624 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>,
3593 * 1 &lt;= i &lt;= n+ k</i> may not be assigned to the type of the 3625 * 1 &lt;= i &lt;= n+ k</i> may not be assigned to the type of the
3594 * corresponding formal parameter of the constructor <i>T.id</i> (respectively 3626 * corresponding formal parameter of the constructor <i>T.id</i> (respectively
(...skipping 11 matching lines...) Expand all
3606 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 3638 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
3607 * &lt;= j &lt;= m</i>. 3639 * &lt;= j &lt;= m</i>.
3608 * 3640 *
3609 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 3641 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1
3610 * &lt;= i &lt;= l</i>, must have a corresponding named parameter in the set 3642 * &lt;= i &lt;= l</i>, must have a corresponding named parameter in the set
3611 * <i>{p<sub>n+1</sub>, &hellip; p<sub>n+k</sub>}</i> or a static warning 3643 * <i>{p<sub>n+1</sub>, &hellip; p<sub>n+k</sub>}</i> or a static warning
3612 * occurs. It is a static warning if <i>T<sub>m+j</sub></i> may not be 3644 * occurs. It is a static warning if <i>T<sub>m+j</sub></i> may not be
3613 * assigned to <i>S<sub>r</sub></i>, where <i>r = q<sub>j</sub>, 1 &lt;= j 3645 * assigned to <i>S<sub>r</sub></i>, where <i>r = q<sub>j</sub>, 1 &lt;= j
3614 * &lt;= l</i>. 3646 * &lt;= l</i>.
3615 * 3647 *
3616 * @param actualType the name of the actual argument type 3648 * Parameters:
3617 * @param expectedType the name of the expected type 3649 * 0: the name of the actual argument type
3650 * 1: the name of the expected type
3618 */ 3651 */
3619 static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = 3652 static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE =
3620 const StaticWarningCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', 3653 const StaticWarningCode('ARGUMENT_TYPE_NOT_ASSIGNABLE',
3621 "The argument type '{0}' cannot be assigned to the parameter type '{1} '"); 3654 "The argument type '{0}' cannot be assigned to the parameter type '{1} '");
3622 3655
3623 /** 3656 /**
3624 * 5 Variables: Attempting to assign to a final variable elsewhere will cause 3657 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
3625 * a NoSuchMethodError to be thrown, because no setter is defined for it. The 3658 * a NoSuchMethodError to be thrown, because no setter is defined for it. The
3626 * assignment will also give rise to a static warning for the same reason. 3659 * assignment will also give rise to a static warning for the same reason.
3627 * 3660 *
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
3692 "'{0}' must have a method body because '{1}' is not abstract"); 3725 "'{0}' must have a method body because '{1}' is not abstract");
3693 3726
3694 /** 3727 /**
3695 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and 3728 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and
3696 * <i>N</i> would be introduced into the top level scope of <i>L</i> by an 3729 * <i>N</i> would be introduced into the top level scope of <i>L</i> by an
3697 * import from a library whose URI begins with <i>dart:</i> and an import from 3730 * import from a library whose URI begins with <i>dart:</i> and an import from
3698 * a library whose URI does not begin with <i>dart:</i>: 3731 * a library whose URI does not begin with <i>dart:</i>:
3699 * * The import from <i>dart:</i> is implicitly extended by a hide N clause. 3732 * * The import from <i>dart:</i> is implicitly extended by a hide N clause.
3700 * * A static warning is issued. 3733 * * A static warning is issued.
3701 * 3734 *
3702 * @param ambiguousName the ambiguous name 3735 * Parameters:
3703 * @param sdkLibraryName the name of the dart: library that the element is 3736 * 0: the ambiguous name
3704 * found 3737 * 1: the name of the dart: library in which the element is found
3705 * @param otherLibraryName the name of the non-dart: library that the element 3738 * 1: the name of the non-dart: library in which the element is found
3706 * is found
3707 */ 3739 */
3708 static const StaticWarningCode CONFLICTING_DART_IMPORT = 3740 static const StaticWarningCode CONFLICTING_DART_IMPORT =
3709 const StaticWarningCode('CONFLICTING_DART_IMPORT', 3741 const StaticWarningCode('CONFLICTING_DART_IMPORT',
3710 "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'"); 3742 "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'");
3711 3743
3712 /** 3744 /**
3713 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an 3745 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an
3714 * instance getter named <i>v</i> and an accessible static member named 3746 * instance getter named <i>v</i> and an accessible static member named
3715 * <i>v</i> or <i>v=</i> is declared in a superclass of <i>C</i>. 3747 * <i>v</i> or <i>v=</i> is declared in a superclass of <i>C</i>.
3716 * 3748 *
3717 * @param superName the name of the super class declaring a static member 3749 * Parameters:
3750 * 0: the name of the super class declaring a static member
3718 */ 3751 */
3719 static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER = 3752 static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER =
3720 const StaticWarningCode( 3753 const StaticWarningCode(
3721 'CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER', 3754 'CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER',
3722 "Superclass '{0}' declares static member with the same name"); 3755 "Superclass '{0}' declares static member with the same name");
3723 3756
3724 /** 3757 /**
3725 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares 3758 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
3726 * an instance method named <i>n</i> and has a setter named <i>n=</i>. 3759 * an instance method named <i>n</i> and has a setter named <i>n=</i>.
3727 */ 3760 */
3728 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = 3761 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER =
3729 const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER', 3762 const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER',
3730 "Class '{0}' declares instance method '{1}', but also has a setter wit h the same name from '{2}'"); 3763 "Class '{0}' declares instance method '{1}', but also has a setter wit h the same name from '{2}'");
3731 3764
3732 /** 3765 /**
3733 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares 3766 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
3734 * an instance method named <i>n</i> and has a setter named <i>n=</i>. 3767 * an instance method named <i>n</i> and has a setter named <i>n=</i>.
3735 */ 3768 */
3736 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = 3769 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 =
3737 const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER2', 3770 const StaticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER2',
3738 "Class '{0}' declares the setter '{1}', but also has an instance metho d in the same class"); 3771 "Class '{0}' declares the setter '{1}', but also has an instance metho d in the same class");
3739 3772
3740 /** 3773 /**
3741 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an 3774 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an
3742 * instance setter named <i>v=</i> and an accessible static member named 3775 * instance setter named <i>v=</i> and an accessible static member named
3743 * <i>v=</i> or <i>v</i> is declared in a superclass of <i>C</i>. 3776 * <i>v=</i> or <i>v</i> is declared in a superclass of <i>C</i>.
3744 * 3777 *
3745 * @param superName the name of the super class declaring a static member 3778 * Parameters:
3779 * 0: the name of the super class declaring a static member
3746 */ 3780 */
3747 static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER = 3781 static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER =
3748 const StaticWarningCode( 3782 const StaticWarningCode(
3749 'CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER', 3783 'CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER',
3750 "Superclass '{0}' declares static member with the same name"); 3784 "Superclass '{0}' declares static member with the same name");
3751 3785
3752 /** 3786 /**
3753 * 7.2 Getters: It is a static warning if a class declares a static getter 3787 * 7.2 Getters: It is a static warning if a class declares a static getter
3754 * named <i>v</i> and also has a non-static setter named <i>v=</i>. 3788 * named <i>v</i> and also has a non-static setter named <i>v=</i>.
3755 */ 3789 */
(...skipping 23 matching lines...) Expand all
3779 * 12.7 Maps: It is a static warning if the values of any two keys in a map 3813 * 12.7 Maps: It is a static warning if the values of any two keys in a map
3780 * literal are equal. 3814 * literal are equal.
3781 */ 3815 */
3782 static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode( 3816 static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode(
3783 'EQUAL_KEYS_IN_MAP', "Keys in a map cannot be equal"); 3817 'EQUAL_KEYS_IN_MAP', "Keys in a map cannot be equal");
3784 3818
3785 /** 3819 /**
3786 * 14.2 Exports: It is a static warning to export two different libraries with 3820 * 14.2 Exports: It is a static warning to export two different libraries with
3787 * the same name. 3821 * the same name.
3788 * 3822 *
3789 * @param uri1 the uri pointing to a first library 3823 * Parameters:
3790 * @param uri2 the uri pointing to a second library 3824 * 0: the uri pointing to a first library
3791 * @param name the shared name of the exported libraries 3825 * 1: the uri pointing to a second library
3826 * 2:e the shared name of the exported libraries
3792 */ 3827 */
3793 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAMED = 3828 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAMED =
3794 const StaticWarningCode('EXPORT_DUPLICATED_LIBRARY_NAMED', 3829 const StaticWarningCode('EXPORT_DUPLICATED_LIBRARY_NAMED',
3795 "The exported libraries '{0}' and '{1}' cannot have the same name '{2} '"); 3830 "The exported libraries '{0}' and '{1}' cannot have the same name '{2} '");
3796 3831
3797 /** 3832 /**
3798 * 14.2 Exports: It is a static warning to export two different libraries with 3833 * 14.2 Exports: It is a static warning to export two different libraries with
3799 * the same name. 3834 * the same name.
3800 * 3835 *
3801 * @param uri1 the uri pointing to a first library 3836 * Parameters:
3802 * @param uri2 the uri pointing to a second library 3837 * 0: the uri pointing to a first library
3838 * 1: the uri pointing to a second library
3803 */ 3839 */
3804 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_UNNAMED = 3840 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_UNNAMED =
3805 const StaticWarningCode('EXPORT_DUPLICATED_LIBRARY_UNNAMED', 3841 const StaticWarningCode('EXPORT_DUPLICATED_LIBRARY_UNNAMED',
3806 "The exported libraries '{0}' and '{1}' cannot both be unnamed"); 3842 "The exported libraries '{0}' and '{1}' cannot both be unnamed");
3807 3843
3808 /** 3844 /**
3809 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; 3845 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
3810 * h</i> or if <i>m &gt; n</i>. 3846 * h</i> or if <i>m &gt; n</i>.
3811 * 3847 *
3812 * @param requiredCount the maximum number of positional arguments 3848 * Parameters:
3813 * @param argumentCount the actual number of positional arguments given 3849 * 0: the maximum number of positional arguments
3850 * 1: the actual number of positional arguments given
3851 *
3814 * See [NOT_ENOUGH_REQUIRED_ARGUMENTS]. 3852 * See [NOT_ENOUGH_REQUIRED_ARGUMENTS].
3815 */ 3853 */
3816 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = 3854 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS =
3817 const StaticWarningCode('EXTRA_POSITIONAL_ARGUMENTS', 3855 const StaticWarningCode('EXTRA_POSITIONAL_ARGUMENTS',
3818 "{0} positional arguments expected, but {1} found"); 3856 "{0} positional arguments expected, but {1} found");
3819 3857
3820 /** 3858 /**
3821 * 5. Variables: It is a static warning if a final instance variable that has 3859 * 5. Variables: It is a static warning if a final instance variable that has
3822 * been initialized at its point of declaration is also initialized in a 3860 * been initialized at its point of declaration is also initialized in a
3823 * constructor. 3861 * constructor.
3824 */ 3862 */
3825 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO N = 3863 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO N =
3826 const StaticWarningCode( 3864 const StaticWarningCode(
3827 'FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', 3865 'FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION',
3828 "Values cannot be set in the constructor if they are final, and have a lready been set"); 3866 "Values cannot be set in the constructor if they are final, and have a lready been set");
3829 3867
3830 /** 3868 /**
3831 * 5. Variables: It is a static warning if a final instance variable that has 3869 * 5. Variables: It is a static warning if a final instance variable that has
3832 * been initialized at its point of declaration is also initialized in a 3870 * been initialized at its point of declaration is also initialized in a
3833 * constructor. 3871 * constructor.
3834 * 3872 *
3835 * @param name the name of the field in question 3873 * Parameters:
3874 * 0: the name of the field in question
3836 */ 3875 */
3837 static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO R = 3876 static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO R =
3838 const StaticWarningCode( 3877 const StaticWarningCode(
3839 'FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', 3878 'FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR',
3840 "'{0}' is final and was given a value when it was declared, so it cann ot be set to a new value"); 3879 "'{0}' is final and was given a value when it was declared, so it cann ot be set to a new value");
3841 3880
3842 /** 3881 /**
3843 * 7.6.1 Generative Constructors: Execution of an initializer of the form 3882 * 7.6.1 Generative Constructors: Execution of an initializer of the form
3844 * <b>this</b>.<i>v</i> = <i>e</i> proceeds as follows: First, the expression 3883 * <b>this</b>.<i>v</i> = <i>e</i> proceeds as follows: First, the expression
3845 * <i>e</i> is evaluated to an object <i>o</i>. Then, the instance variable 3884 * <i>e</i> is evaluated to an object <i>o</i>. Then, the instance variable
3846 * <i>v</i> of the object denoted by this is bound to <i>o</i>. 3885 * <i>v</i> of the object denoted by this is bound to <i>o</i>.
3847 * 3886 *
3848 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static 3887 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
3849 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of 3888 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
3850 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be 3889 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
3851 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static 3890 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
3852 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 3891 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
3853 * &lt;= j &lt;= m</i>. 3892 * &lt;= j &lt;= m</i>.
3854 * 3893 *
3855 * @param initializerType the name of the type of the initializer expression 3894 * Parameters:
3856 * @param fieldType the name of the type of the field 3895 * 0: the name of the type of the initializer expression
3896 * 1: the name of the type of the field
3857 */ 3897 */
3858 static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = 3898 static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE =
3859 const StaticWarningCode('FIELD_INITIALIZER_NOT_ASSIGNABLE', 3899 const StaticWarningCode('FIELD_INITIALIZER_NOT_ASSIGNABLE',
3860 "The initializer type '{0}' cannot be assigned to the field type '{1}' "); 3900 "The initializer type '{0}' cannot be assigned to the field type '{1}' ");
3861 3901
3862 /** 3902 /**
3863 * 7.6.1 Generative Constructors: An initializing formal has the form 3903 * 7.6.1 Generative Constructors: An initializing formal has the form
3864 * <i>this.id</i>. It is a static warning if the static type of <i>id</i> is 3904 * <i>this.id</i>. It is a static warning if the static type of <i>id</i> is
3865 * not assignable to <i>T<sub>id</sub></i>. 3905 * not assignable to <i>T<sub>id</sub></i>.
3866 * 3906 *
3867 * @param parameterType the name of the type of the field formal parameter 3907 * Parameters:
3868 * @param fieldType the name of the type of the field 3908 * 0: the name of the type of the field formal parameter
3909 * 1: the name of the type of the field
3869 */ 3910 */
3870 static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = 3911 static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE =
3871 const StaticWarningCode('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 3912 const StaticWarningCode('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE',
3872 "The parameter type '{0}' is incompatable with the field type '{1}'"); 3913 "The parameter type '{0}' is incompatable with the field type '{1}'");
3873 3914
3874 /** 3915 /**
3875 * 5 Variables: It is a static warning if a library, static or local variable 3916 * 5 Variables: It is a static warning if a library, static or local variable
3876 * <i>v</i> is final and <i>v</i> is not initialized at its point of 3917 * <i>v</i> is final and <i>v</i> is not initialized at its point of
3877 * declaration. 3918 * declaration.
3878 * 3919 *
3879 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> 3920 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i>
3880 * declared in the immediately enclosing class must have an initializer in 3921 * declared in the immediately enclosing class must have an initializer in
3881 * <i>k</i>'s initializer list unless it has already been initialized by one 3922 * <i>k</i>'s initializer list unless it has already been initialized by one
3882 * of the following means: 3923 * of the following means:
3883 * * Initialization at the declaration of <i>f</i>. 3924 * * Initialization at the declaration of <i>f</i>.
3884 * * Initialization by means of an initializing formal of <i>k</i>. 3925 * * Initialization by means of an initializing formal of <i>k</i>.
3885 * or a static warning occurs. 3926 * or a static warning occurs.
3886 * 3927 *
3887 * @param name the name of the uninitialized final variable 3928 * Parameters:
3929 * 0: the name of the uninitialized final variable
3888 */ 3930 */
3889 static const StaticWarningCode FINAL_NOT_INITIALIZED = 3931 static const StaticWarningCode FINAL_NOT_INITIALIZED =
3890 const StaticWarningCode('FINAL_NOT_INITIALIZED', 3932 const StaticWarningCode('FINAL_NOT_INITIALIZED',
3891 "The final variable '{0}' must be initialized"); 3933 "The final variable '{0}' must be initialized");
3892 3934
3893 /** 3935 /**
3894 * 15.5 Function Types: It is a static warning if a concrete class implements 3936 * 15.5 Function Types: It is a static warning if a concrete class implements
3895 * Function and does not have a concrete method named call(). 3937 * Function and does not have a concrete method named call().
3896 */ 3938 */
3897 static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode ( 3939 static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode (
3898 'FUNCTION_WITHOUT_CALL', 3940 'FUNCTION_WITHOUT_CALL',
3899 "Concrete classes that implement Function must implement the method call() "); 3941 "Concrete classes that implement Function must implement the method call() ");
3900 3942
3901 /** 3943 /**
3902 * 14.1 Imports: It is a static warning to import two different libraries with 3944 * 14.1 Imports: It is a static warning to import two different libraries with
3903 * the same name. 3945 * the same name.
3904 * 3946 *
3905 * @param uri1 the uri pointing to a first library 3947 * Parameters:
3906 * @param uri2 the uri pointing to a second library 3948 * 0: the uri pointing to a first library
3907 * @param name the shared name of the imported libraries 3949 * 1: the uri pointing to a second library
3950 * 2: the shared name of the imported libraries
3908 */ 3951 */
3909 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAMED = 3952 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAMED =
3910 const StaticWarningCode('IMPORT_DUPLICATED_LIBRARY_NAMED', 3953 const StaticWarningCode('IMPORT_DUPLICATED_LIBRARY_NAMED',
3911 "The imported libraries '{0}' and '{1}' cannot have the same name '{2} '"); 3954 "The imported libraries '{0}' and '{1}' cannot have the same name '{2} '");
3912 3955
3913 /** 3956 /**
3914 * 14.1 Imports: It is a static warning to import two different libraries with 3957 * 14.1 Imports: It is a static warning to import two different libraries with
3915 * the same name. 3958 * the same name.
3916 * 3959 *
3917 * @param uri1 the uri pointing to a first library 3960 * Parameters:
3918 * @param uri2 the uri pointing to a second library 3961 * 0: the uri pointing to a first library
3962 * 1: the uri pointing to a second library
3919 */ 3963 */
3920 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_UNNAMED = 3964 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_UNNAMED =
3921 const StaticWarningCode('IMPORT_DUPLICATED_LIBRARY_UNNAMED', 3965 const StaticWarningCode('IMPORT_DUPLICATED_LIBRARY_UNNAMED',
3922 "The imported libraries '{0}' and '{1}' cannot both be unnamed"); 3966 "The imported libraries '{0}' and '{1}' cannot both be unnamed");
3923 3967
3924 /** 3968 /**
3925 * 14.1 Imports: It is a static warning if the specified URI of a deferred 3969 * 14.1 Imports: It is a static warning if the specified URI of a deferred
3926 * import does not refer to a library declaration. 3970 * import does not refer to a library declaration.
3927 * 3971 *
3928 * @param uri the uri pointing to a non-library declaration 3972 * Parameters:
3973 * 0: the uri pointing to a non-library declaration
3974 *
3929 * See [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]. 3975 * See [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY].
3930 */ 3976 */
3931 static const StaticWarningCode IMPORT_OF_NON_LIBRARY = 3977 static const StaticWarningCode IMPORT_OF_NON_LIBRARY =
3932 const StaticWarningCode('IMPORT_OF_NON_LIBRARY', 3978 const StaticWarningCode('IMPORT_OF_NON_LIBRARY',
3933 "The imported library '{0}' must not have a part-of directive"); 3979 "The imported library '{0}' must not have a part-of directive");
3934 3980
3935 /** 3981 /**
3936 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause 3982 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
3937 * multiple members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the 3983 * multiple members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the
3938 * same name <i>n</i> that would be inherited (because identically named 3984 * same name <i>n</i> that would be inherited (because identically named
3939 * members existed in several superinterfaces) then at most one member is 3985 * members existed in several superinterfaces) then at most one member is
3940 * inherited. 3986 * inherited.
3941 * 3987 *
3942 * If some but not all of the <i>m<sub>i</sub>, 1 &lt;= i &lt;= k</i> are 3988 * If some but not all of the <i>m<sub>i</sub>, 1 &lt;= i &lt;= k</i> are
3943 * getters none of the <i>m<sub>i</sub></i> are inherited, and a static 3989 * getters none of the <i>m<sub>i</sub></i> are inherited, and a static
3944 * warning is issued. 3990 * warning is issued.
3945 */ 3991 */
3946 static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD = 3992 static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD =
3947 const StaticWarningCode( 3993 const StaticWarningCode(
3948 'INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD', 3994 'INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD',
3949 "'{0}' is inherited as a getter and also a method"); 3995 "'{0}' is inherited as a getter and also a method");
3950 3996
3951 /** 3997 /**
3952 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares 3998 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
3953 * an instance method named <i>n</i> and an accessible static member named 3999 * an instance method named <i>n</i> and an accessible static member named
3954 * <i>n</i> is declared in a superclass of <i>C</i>. 4000 * <i>n</i> is declared in a superclass of <i>C</i>.
3955 * 4001 *
3956 * @param memberName the name of the member with the name conflict 4002 * Parameters:
3957 * @param superclassName the name of the enclosing class that has the static 4003 * 0: the name of the member with the name conflict
3958 * member 4004 * 1: the name of the enclosing class that has the static member
3959 */ 4005 */
3960 static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC = 4006 static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC =
3961 const StaticWarningCode( 4007 const StaticWarningCode(
3962 'INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC', 4008 'INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC',
3963 "'{0}' collides with a static member in the superclass '{1}'"); 4009 "'{0}' collides with a static member in the superclass '{1}'");
3964 4010
3965 /** 4011 /**
3966 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a 4012 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a
3967 * getter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of 4013 * getter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of
3968 * <i>m2</i>. 4014 * <i>m2</i>.
3969 * 4015 *
3970 * @param actualReturnTypeName the name of the expected return type 4016 * Parameters:
3971 * @param expectedReturnType the name of the actual return type, not 4017 * 0: the name of the actual return type
3972 * assignable to the actualReturnTypeName 4018 * 1: the name of the expected return type, not assignable to the actual
3973 * @param className the name of the class where the overridden getter is 4019 * return type
3974 * declared 4020 * 2: the name of the class where the overridden getter is declared
4021 *
3975 * See [INVALID_METHOD_OVERRIDE_RETURN_TYPE]. 4022 * See [INVALID_METHOD_OVERRIDE_RETURN_TYPE].
3976 */ 4023 */
3977 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = 4024 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE =
3978 const StaticWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 4025 const StaticWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE',
3979 "The return type '{0}' is not assignable to '{1}' as required by the g etter it is overriding from '{2}'"); 4026 "The return type '{0}' is not assignable to '{1}' as required by the g etter it is overriding from '{2}'");
3980 4027
3981 /** 4028 /**
3982 * 7.1 Instance Methods: It is a static warning if an instance method 4029 * 7.1 Instance Methods: It is a static warning if an instance method
3983 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> 4030 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
3984 * is not a subtype of the type of <i>m2</i>. 4031 * is not a subtype of the type of <i>m2</i>.
3985 * 4032 *
3986 * @param actualParamTypeName the name of the expected parameter type 4033 * Parameters:
3987 * @param expectedParamType the name of the actual parameter type, not 4034 * 0: the name of the actual parameter type
3988 * assignable to the actualParamTypeName 4035 * 1: the name of the expected parameter type, not assignable to the actual
3989 * @param className the name of the class where the overridden method is 4036 * parameter type
3990 * declared 4037 * 2: the name of the class where the overridden method is declared
3991 */ 4038 */
3992 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = 4039 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE =
3993 const StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 4040 const StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE',
3994 "The parameter type '{0}' is not assignable to '{1}' as required by th e method it is overriding from '{2}'"); 4041 "The parameter type '{0}' is not assignable to '{1}' as required by th e method it is overriding from '{2}'");
3995 4042
3996 /** 4043 /**
3997 * 7.1 Instance Methods: It is a static warning if an instance method 4044 * 7.1 Instance Methods: It is a static warning if an instance method
3998 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> 4045 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
3999 * is not a subtype of the type of <i>m2</i>. 4046 * is not a subtype of the type of <i>m2</i>.
4000 * 4047 *
4001 * @param actualParamTypeName the name of the expected parameter type 4048 * Parameters:
4002 * @param expectedParamType the name of the actual parameter type, not 4049 * 0: the name of the actual parameter type
4003 * assignable to the actualParamTypeName 4050 * 1: the name of the expected parameter type, not assignable to the actual
4004 * @param className the name of the class where the overridden method is 4051 * parameter type
4005 * declared 4052 * 2: the name of the class where the overridden method is declared
4006 * See [INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]. 4053 * See [INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE].
4007 */ 4054 */
4008 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = 4055 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE =
4009 const StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 4056 const StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE',
4010 "The parameter type '{0}' is not assignable to '{1}' as required by th e method it is overriding from '{2}'"); 4057 "The parameter type '{0}' is not assignable to '{1}' as required by th e method it is overriding from '{2}'");
4011 4058
4012 /** 4059 /**
4013 * 7.1 Instance Methods: It is a static warning if an instance method 4060 * 7.1 Instance Methods: It is a static warning if an instance method
4014 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> 4061 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
4015 * is not a subtype of the type of <i>m2</i>. 4062 * is not a subtype of the type of <i>m2</i>.
4016 * 4063 *
4017 * @param actualParamTypeName the name of the expected parameter type 4064 * Parameters:
4018 * @param expectedParamType the name of the actual parameter type, not 4065 * 0: the name of the actual parameter type
4019 * assignable to the actualParamTypeName 4066 * 1: the name of the expected parameter type, not assignable to the actual
4020 * @param className the name of the class where the overridden method is 4067 * parameter type
4021 * declared 4068 * 2: the name of the class where the overridden method is declared
4022 */ 4069 */
4023 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = 4070 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE =
4024 const StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 4071 const StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE',
4025 "The parameter type '{0}' is not assignable to '{1}' as required by th e method it is overriding from '{2}'"); 4072 "The parameter type '{0}' is not assignable to '{1}' as required by th e method it is overriding from '{2}'");
4026 4073
4027 /** 4074 /**
4028 * 7.1 Instance Methods: It is a static warning if an instance method 4075 * 7.1 Instance Methods: It is a static warning if an instance method
4029 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> 4076 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
4030 * is not a subtype of the type of <i>m2</i>. 4077 * is not a subtype of the type of <i>m2</i>.
4031 * 4078 *
4032 * @param actualReturnTypeName the name of the expected return type 4079 * Parameters:
4033 * @param expectedReturnType the name of the actual return type, not 4080 * 0: the name of the actual return type
4034 * assignable to the actualReturnTypeName 4081 * 1: the name of the expected return type, not assignable to the actual
4035 * @param className the name of the class where the overridden method is 4082 * return type
4036 * declared 4083 * 2: the name of the class where the overridden method is declared
4084 *
4037 * See [INVALID_GETTER_OVERRIDE_RETURN_TYPE]. 4085 * See [INVALID_GETTER_OVERRIDE_RETURN_TYPE].
4038 */ 4086 */
4039 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = 4087 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE =
4040 const StaticWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 4088 const StaticWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE',
4041 "The return type '{0}' is not assignable to '{1}' as required by the m ethod it is overriding from '{2}'"); 4089 "The return type '{0}' is not assignable to '{1}' as required by the m ethod it is overriding from '{2}'");
4042 4090
4043 /** 4091 /**
4044 * 7.1 Instance Methods: It is a static warning if an instance method 4092 * 7.1 Instance Methods: It is a static warning if an instance method
4045 * <i>m1</i> overrides an instance member <i>m2</i>, the signature of 4093 * <i>m1</i> overrides an instance member <i>m2</i>, the signature of
4046 * <i>m2</i> explicitly specifies a default value for a formal parameter 4094 * <i>m2</i> explicitly specifies a default value for a formal parameter
(...skipping 14 matching lines...) Expand all
4061 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL = 4109 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL =
4062 const StaticWarningCode( 4110 const StaticWarningCode(
4063 'INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL', 4111 'INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL',
4064 "Parameters cannot override default values, this method overrides '{0} .{1}' where this positional parameter has a different value"); 4112 "Parameters cannot override default values, this method overrides '{0} .{1}' where this positional parameter has a different value");
4065 4113
4066 /** 4114 /**
4067 * 7.1 Instance Methods: It is a static warning if an instance method 4115 * 7.1 Instance Methods: It is a static warning if an instance method
4068 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> does not 4116 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> does not
4069 * declare all the named parameters declared by <i>m2</i>. 4117 * declare all the named parameters declared by <i>m2</i>.
4070 * 4118 *
4071 * @param paramCount the number of named parameters in the overridden member 4119 * Parameters:
4072 * @param className the name of the class from the overridden method 4120 * 0: the number of named parameters in the overridden member
4121 * 1: the name of the class from the overridden method
4073 */ 4122 */
4074 static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCod e( 4123 static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCod e(
4075 'INVALID_OVERRIDE_NAMED', 4124 'INVALID_OVERRIDE_NAMED',
4076 "Missing the named parameter '{0}' to match the overridden method from '{1 }'"); 4125 "Missing the named parameter '{0}' to match the overridden method from '{1 }'");
4077 4126
4078 /** 4127 /**
4079 * 7.1 Instance Methods: It is a static warning if an instance method 4128 * 7.1 Instance Methods: It is a static warning if an instance method
4080 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> has fewer 4129 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> has fewer
4081 * positional parameters than <i>m2</i>. 4130 * positional parameters than <i>m2</i>.
4082 * 4131 *
4083 * @param paramCount the number of positional parameters in the overridden 4132 * Parameters:
4084 * member 4133 * 0: the number of positional parameters in the overridden member
4085 * @param className the name of the class from the overridden method 4134 * 1: the name of the class from the overridden method
4086 */ 4135 */
4087 static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = 4136 static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL =
4088 const StaticWarningCode('INVALID_OVERRIDE_POSITIONAL', 4137 const StaticWarningCode('INVALID_OVERRIDE_POSITIONAL',
4089 "Must have at least {0} parameters to match the overridden method from '{1}'"); 4138 "Must have at least {0} parameters to match the overridden method from '{1}'");
4090 4139
4091 /** 4140 /**
4092 * 7.1 Instance Methods: It is a static warning if an instance method 4141 * 7.1 Instance Methods: It is a static warning if an instance method
4093 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> has a 4142 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> has a
4094 * greater number of required parameters than <i>m2</i>. 4143 * greater number of required parameters than <i>m2</i>.
4095 * 4144 *
4096 * @param paramCount the number of required parameters in the overridden 4145 * Parameters:
4097 * member 4146 * 0: the number of required parameters in the overridden member
4098 * @param className the name of the class from the overridden method 4147 * 1: the name of the class from the overridden method
4099 */ 4148 */
4100 static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = 4149 static const StaticWarningCode INVALID_OVERRIDE_REQUIRED =
4101 const StaticWarningCode('INVALID_OVERRIDE_REQUIRED', 4150 const StaticWarningCode('INVALID_OVERRIDE_REQUIRED',
4102 "Must have {0} required parameters or less to match the overridden met hod from '{1}'"); 4151 "Must have {0} required parameters or less to match the overridden met hod from '{1}'");
4103 4152
4104 /** 4153 /**
4105 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a 4154 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a
4106 * setter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of 4155 * setter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of
4107 * <i>m2</i>. 4156 * <i>m2</i>.
4108 * 4157 *
4109 * @param actualParamTypeName the name of the expected parameter type 4158 * Parameters:
4110 * @param expectedParamType the name of the actual parameter type, not 4159 * 0: the name of the actual parameter type
4111 * assignable to the actualParamTypeName 4160 * 1: the name of the expected parameter type, not assignable to the actual
4112 * @param className the name of the class where the overridden setter is 4161 * parameter type
4113 * declared 4162 * 2: the name of the class where the overridden setter is declared
4163 *
4114 * See [INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]. 4164 * See [INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE].
4115 */ 4165 */
4116 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = 4166 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE =
4117 const StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 4167 const StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE',
4118 "The parameter type '{0}' is not assignable to '{1}' as required by th e setter it is overriding from '{2}'"); 4168 "The parameter type '{0}' is not assignable to '{1}' as required by th e setter it is overriding from '{2}'");
4119 4169
4120 /** 4170 /**
4121 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> 4171 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
4122 * &hellip; <i>e<sub>n</sub></i>] is evaluated as follows: 4172 * &hellip; <i>e<sub>n</sub></i>] is evaluated as follows:
4123 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and 4173 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
4205 * abstract class and <i>q</i> is not a factory constructor. 4255 * abstract class and <i>q</i> is not a factory constructor.
4206 */ 4256 */
4207 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = 4257 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS =
4208 const StaticWarningCode('NEW_WITH_ABSTRACT_CLASS', 4258 const StaticWarningCode('NEW_WITH_ABSTRACT_CLASS',
4209 "Abstract classes cannot be created with a 'new' expression"); 4259 "Abstract classes cannot be created with a 'new' expression");
4210 4260
4211 /** 4261 /**
4212 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a 4262 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a
4213 * static warning. 4263 * static warning.
4214 * 4264 *
4215 * @param typeName the name of the type being referenced (<i>S</i>) 4265 * Parameters:
4216 * @param parameterCount the number of type parameters that were declared 4266 * 0: the name of the type being referenced (<i>S</i>)
4217 * @param argumentCount the number of type arguments provided 4267 * 1: the number of type parameters that were declared
4268 * 2: the number of type arguments provided
4269 *
4218 * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and 4270 * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and
4219 * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]. 4271 * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS].
4220 */ 4272 */
4221 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = 4273 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS =
4222 const StaticWarningCode('NEW_WITH_INVALID_TYPE_PARAMETERS', 4274 const StaticWarningCode('NEW_WITH_INVALID_TYPE_PARAMETERS',
4223 "The type '{0}' is declared with {1} type parameters, but {2} type arg uments were given"); 4275 "The type '{0}' is declared with {1} type parameters, but {2} type arg uments were given");
4224 4276
4225 /** 4277 /**
4226 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible 4278 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible
4227 * in the current scope, optionally followed by type arguments. 4279 * in the current scope, optionally followed by type arguments.
4228 * 4280 *
4229 * @param name the name of the non-type element 4281 * Parameters:
4282 * 0: the name of the non-type element
4230 */ 4283 */
4231 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode( 4284 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode(
4232 'NEW_WITH_NON_TYPE', "The name '{0}' is not a class"); 4285 'NEW_WITH_NON_TYPE', "The name '{0}' is not a class");
4233 4286
4234 /** 4287 /**
4235 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the 4288 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
4236 * current scope then: 4289 * current scope then:
4237 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, 4290 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;,
4238 * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, 4291 * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;,
4239 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a static warning if 4292 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a static warning if
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
4271 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not 4324 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
4272 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the 4325 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
4273 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type 4326 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
4274 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance 4327 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
4275 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 4328 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
4276 * 4329 *
4277 * 7.4 Abstract Instance Members: It is a static warning if an abstract member 4330 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
4278 * is declared or inherited in a concrete class unless that member overrides a 4331 * is declared or inherited in a concrete class unless that member overrides a
4279 * concrete one. 4332 * concrete one.
4280 * 4333 *
4281 * @param memberName the name of the first member 4334 * Parameters:
4282 * @param memberName the name of the second member 4335 * 0: the name of the first member
4283 * @param memberName the name of the third member 4336 * 1: the name of the second member
4284 * @param memberName the name of the fourth member 4337 * 2: the name of the third member
4285 * @param additionalCount the number of additional missing members that aren't 4338 * 3: the name of the fourth member
4286 * listed 4339 * 4: the number of additional missing members that aren't listed
4287 */ 4340 */
4288 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV E_PLUS = 4341 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV E_PLUS =
4289 const StaticWarningCode( 4342 const StaticWarningCode(
4290 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS', 4343 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS',
4291 "Missing concrete implementation of {0}, {1}, {2}, {3} and {4} more"); 4344 "Missing concrete implementation of {0}, {1}, {2}, {3} and {4} more");
4292 4345
4293 /** 4346 /**
4294 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract 4347 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
4295 * class inherits an abstract method. 4348 * class inherits an abstract method.
4296 * 4349 *
4297 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not 4350 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
4298 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the 4351 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
4299 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type 4352 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
4300 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance 4353 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
4301 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 4354 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
4302 * 4355 *
4303 * 7.4 Abstract Instance Members: It is a static warning if an abstract member 4356 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
4304 * is declared or inherited in a concrete class unless that member overrides a 4357 * is declared or inherited in a concrete class unless that member overrides a
4305 * concrete one. 4358 * concrete one.
4306 * 4359 *
4307 * @param memberName the name of the first member 4360 * Parameters:
4308 * @param memberName the name of the second member 4361 * 0: the name of the first member
4309 * @param memberName the name of the third member 4362 * 1: the name of the second member
4310 * @param memberName the name of the fourth member 4363 * 2: the name of the third member
4364 * 3: the name of the fourth member
4311 */ 4365 */
4312 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU R = 4366 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU R =
4313 const StaticWarningCode( 4367 const StaticWarningCode(
4314 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', 4368 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR',
4315 "Missing concrete implementation of {0}, {1}, {2} and {3}"); 4369 "Missing concrete implementation of {0}, {1}, {2} and {3}");
4316 4370
4317 /** 4371 /**
4318 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract 4372 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
4319 * class inherits an abstract method. 4373 * class inherits an abstract method.
4320 * 4374 *
4321 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not 4375 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
4322 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the 4376 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
4323 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type 4377 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
4324 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance 4378 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
4325 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 4379 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
4326 * 4380 *
4327 * 7.4 Abstract Instance Members: It is a static warning if an abstract member 4381 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
4328 * is declared or inherited in a concrete class unless that member overrides a 4382 * is declared or inherited in a concrete class unless that member overrides a
4329 * concrete one. 4383 * concrete one.
4330 * 4384 *
4331 * @param memberName the name of the member 4385 * Parameters:
4386 * 0: the name of the member
4332 */ 4387 */
4333 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = 4388 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE =
4334 const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', 4389 const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE',
4335 "Missing concrete implementation of {0}"); 4390 "Missing concrete implementation of {0}");
4336 4391
4337 /** 4392 /**
4338 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract 4393 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
4339 * class inherits an abstract method. 4394 * class inherits an abstract method.
4340 * 4395 *
4341 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not 4396 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
4342 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the 4397 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
4343 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type 4398 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
4344 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance 4399 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
4345 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 4400 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
4346 * 4401 *
4347 * 7.4 Abstract Instance Members: It is a static warning if an abstract member 4402 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
4348 * is declared or inherited in a concrete class unless that member overrides a 4403 * is declared or inherited in a concrete class unless that member overrides a
4349 * concrete one. 4404 * concrete one.
4350 * 4405 *
4351 * @param memberName the name of the first member 4406 * Parameters:
4352 * @param memberName the name of the second member 4407 * 0: the name of the first member
4353 * @param memberName the name of the third member 4408 * 1: the name of the second member
4409 * 2: the name of the third member
4354 */ 4410 */
4355 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE = 4411 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE =
4356 const StaticWarningCode( 4412 const StaticWarningCode(
4357 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE', 4413 'NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE',
4358 "Missing concrete implementation of {0}, {1} and {2}"); 4414 "Missing concrete implementation of {0}, {1} and {2}");
4359 4415
4360 /** 4416 /**
4361 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract 4417 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
4362 * class inherits an abstract method. 4418 * class inherits an abstract method.
4363 * 4419 *
4364 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not 4420 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
4365 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the 4421 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
4366 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type 4422 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
4367 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance 4423 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
4368 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 4424 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
4369 * 4425 *
4370 * 7.4 Abstract Instance Members: It is a static warning if an abstract member 4426 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
4371 * is declared or inherited in a concrete class unless that member overrides a 4427 * is declared or inherited in a concrete class unless that member overrides a
4372 * concrete one. 4428 * concrete one.
4373 * 4429 *
4374 * @param memberName the name of the first member 4430 * Parameters:
4375 * @param memberName the name of the second member 4431 * 0: the name of the first member
4432 * 1: the name of the second member
4376 */ 4433 */
4377 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = 4434 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO =
4378 const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', 4435 const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO',
4379 "Missing concrete implementation of {0} and {1}"); 4436 "Missing concrete implementation of {0} and {1}");
4380 4437
4381 /** 4438 /**
4382 * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, 4439 * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>,
4383 * p<sub>2</sub>) s</i> or <i>on T s</i> matches an object <i>o</i> if the 4440 * p<sub>2</sub>) s</i> or <i>on T s</i> matches an object <i>o</i> if the
4384 * type of <i>o</i> is a subtype of <i>T</i>. It is a static warning if 4441 * type of <i>o</i> is a subtype of <i>T</i>. It is a static warning if
4385 * <i>T</i> does not denote a type available in the lexical scope of the 4442 * <i>T</i> does not denote a type available in the lexical scope of the
4386 * catch clause. 4443 * catch clause.
4387 * 4444 *
4388 * @param name the name of the non-type element 4445 * Parameters:
4446 * 0: the name of the non-type element
4389 */ 4447 */
4390 static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = 4448 static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE =
4391 const StaticWarningCode('NON_TYPE_IN_CATCH_CLAUSE', 4449 const StaticWarningCode('NON_TYPE_IN_CATCH_CLAUSE',
4392 "The name '{0}' is not a type and cannot be used in an on-catch clause "); 4450 "The name '{0}' is not a type and cannot be used in an on-catch clause ");
4393 4451
4394 /** 4452 /**
4395 * 7.1.1 Operators: It is a static warning if the return type of the 4453 * 7.1.1 Operators: It is a static warning if the return type of the
4396 * user-declared operator []= is explicitly declared and not void. 4454 * user-declared operator []= is explicitly declared and not void.
4397 */ 4455 */
4398 static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = 4456 static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR =
(...skipping 13 matching lines...) Expand all
4412 * * <i>T</i> has the form <i>id</i> or the form <i>prefix.id</i>, and in the 4470 * * <i>T</i> has the form <i>id</i> or the form <i>prefix.id</i>, and in the
4413 * enclosing lexical scope, the name <i>id</i> (respectively 4471 * enclosing lexical scope, the name <i>id</i> (respectively
4414 * <i>prefix.id</i>) does not denote a type. 4472 * <i>prefix.id</i>) does not denote a type.
4415 * * <i>T</i> denotes a type parameter in the enclosing lexical scope, but 4473 * * <i>T</i> denotes a type parameter in the enclosing lexical scope, but
4416 * occurs in the signature or body of a static member. 4474 * occurs in the signature or body of a static member.
4417 * * <i>T</i> is a parameterized type of the form <i>G&lt;S<sub>1</sub>, .., 4475 * * <i>T</i> is a parameterized type of the form <i>G&lt;S<sub>1</sub>, ..,
4418 * S<sub>n</sub>&gt;</i>, 4476 * S<sub>n</sub>&gt;</i>,
4419 * 4477 *
4420 * Any use of a malformed type gives rise to a static warning. 4478 * Any use of a malformed type gives rise to a static warning.
4421 * 4479 *
4422 * @param nonTypeName the name that is not a type 4480 * Parameters:
4481 * 0: the name that is not a type
4423 */ 4482 */
4424 static const StaticWarningCode NOT_A_TYPE = 4483 static const StaticWarningCode NOT_A_TYPE =
4425 const StaticWarningCode('NOT_A_TYPE', "{0} is not a type"); 4484 const StaticWarningCode('NOT_A_TYPE', "{0} is not a type");
4426 4485
4427 /** 4486 /**
4428 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; 4487 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
4429 * h</i> or if <i>m &gt; n</i>. 4488 * h</i> or if <i>m &gt; n</i>.
4430 * 4489 *
4431 * @param requiredCount the expected number of required arguments 4490 * Parameters:
4432 * @param argumentCount the actual number of positional arguments given 4491 * 0: the expected number of required arguments
4492 * 1: the actual number of positional arguments given
4493 *
4433 * See [EXTRA_POSITIONAL_ARGUMENTS]. 4494 * See [EXTRA_POSITIONAL_ARGUMENTS].
4434 */ 4495 */
4435 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = 4496 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS =
4436 const StaticWarningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', 4497 const StaticWarningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS',
4437 "{0} required argument(s) expected, but {1} found"); 4498 "{0} required argument(s) expected, but {1} found");
4438 4499
4439 /** 4500 /**
4440 * 14.3 Parts: It is a static warning if the referenced part declaration 4501 * 14.3 Parts: It is a static warning if the referenced part declaration
4441 * <i>p</i> names a library other than the current library as the library to 4502 * <i>p</i> names a library other than the current library as the library to
4442 * which <i>p</i> belongs. 4503 * which <i>p</i> belongs.
4443 * 4504 *
4444 * @param expectedLibraryName the name of expected library name 4505 * Parameters:
4445 * @param actualLibraryName the non-matching actual library name from the 4506 * 0: the name of expected library name
4446 * "part of" declaration 4507 * 1: the non-matching actual library name from the "part of" declaration
4447 */ 4508 */
4448 static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = 4509 static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY =
4449 const StaticWarningCode('PART_OF_DIFFERENT_LIBRARY', 4510 const StaticWarningCode('PART_OF_DIFFERENT_LIBRARY',
4450 "Expected this library to be part of '{0}', not '{1}'"); 4511 "Expected this library to be part of '{0}', not '{1}'");
4451 4512
4452 /** 4513 /**
4453 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> 4514 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
4454 * is not a subtype of the type of <i>k</i>. 4515 * is not a subtype of the type of <i>k</i>.
4455 * 4516 *
4456 * @param redirectedName the name of the redirected constructor 4517 * Parameters:
4457 * @param redirectingName the name of the redirecting constructor 4518 * 0: the name of the redirected constructor
4519 * 1: the name of the redirecting constructor
4458 */ 4520 */
4459 static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = 4521 static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE =
4460 const StaticWarningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE', 4522 const StaticWarningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE',
4461 "The redirected constructor '{0}' has incompatible parameters with '{1 }'"); 4523 "The redirected constructor '{0}' has incompatible parameters with '{1 }'");
4462 4524
4463 /** 4525 /**
4464 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> 4526 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
4465 * is not a subtype of the type of <i>k</i>. 4527 * is not a subtype of the type of <i>k</i>.
4466 * 4528 *
4467 * @param redirectedName the name of the redirected constructor return type 4529 * Parameters:
4468 * @param redirectingName the name of the redirecting constructor return type 4530 * 0: the name of the redirected constructor return type
4531 * 1: the name of the redirecting constructor return type
4469 */ 4532 */
4470 static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = 4533 static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE =
4471 const StaticWarningCode('REDIRECT_TO_INVALID_RETURN_TYPE', 4534 const StaticWarningCode('REDIRECT_TO_INVALID_RETURN_TYPE',
4472 "The return type '{0}' of the redirected constructor is not assignable to '{1}'"); 4535 "The return type '{0}' of the redirected constructor is not assignable to '{1}'");
4473 4536
4474 /** 4537 /**
4475 * 7.6.2 Factories: It is a static warning if type does not denote a class 4538 * 7.6.2 Factories: It is a static warning if type does not denote a class
4476 * accessible in the current scope; if type does denote such a class <i>C</i> 4539 * accessible in the current scope; if type does denote such a class <i>C</i>
4477 * it is a static warning if the referenced constructor (be it <i>type</i> or 4540 * it is a static warning if the referenced constructor (be it <i>type</i> or
4478 * <i>type.id</i>) is not a constructor of <i>C</i>. 4541 * <i>type.id</i>) is not a constructor of <i>C</i>.
(...skipping 19 matching lines...) Expand all
4498 * * <i>f</i> is not a generative constructor. 4561 * * <i>f</i> is not a generative constructor.
4499 * * The return type of <i>f</i> may not be assigned to void. 4562 * * The return type of <i>f</i> may not be assigned to void.
4500 */ 4563 */
4501 static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode( 4564 static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode(
4502 'RETURN_WITHOUT_VALUE', "Missing return value after 'return'"); 4565 'RETURN_WITHOUT_VALUE', "Missing return value after 'return'");
4503 4566
4504 /** 4567 /**
4505 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not 4568 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
4506 * declare a static method or getter <i>m</i>. 4569 * declare a static method or getter <i>m</i>.
4507 * 4570 *
4508 * @param memberName the name of the instance member 4571 * Parameters:
4572 * 0: the name of the instance member
4509 */ 4573 */
4510 static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = 4574 static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER =
4511 const StaticWarningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER', 4575 const StaticWarningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER',
4512 "Instance member '{0}' cannot be accessed using static access"); 4576 "Instance member '{0}' cannot be accessed using static access");
4513 4577
4514 /** 4578 /**
4515 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be 4579 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be
4516 * assigned to the type of <i>e<sub>k</sub></i>. 4580 * assigned to the type of <i>e<sub>k</sub></i>.
4517 */ 4581 */
4518 static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = 4582 static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE =
4519 const StaticWarningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 4583 const StaticWarningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE',
4520 "Type '{0}' of the switch expression is not assignable to the type '{1 }' of case expressions"); 4584 "Type '{0}' of the switch expression is not assignable to the type '{1 }' of case expressions");
4521 4585
4522 /** 4586 /**
4523 * 15.1 Static Types: It is a static warning to use a deferred type in a type 4587 * 15.1 Static Types: It is a static warning to use a deferred type in a type
4524 * annotation. 4588 * annotation.
4525 * 4589 *
4526 * @param name the name of the type that is deferred and being used in a type 4590 * Parameters:
4527 * annotation 4591 * 0: the name of the type that is deferred and being used in a type
4592 * annotation
4528 */ 4593 */
4529 static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS = 4594 static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS =
4530 const StaticWarningCode('TYPE_ANNOTATION_DEFERRED_CLASS', 4595 const StaticWarningCode('TYPE_ANNOTATION_DEFERRED_CLASS',
4531 "The deferred type '{0}' cannot be used in a declaration, cast or type test"); 4596 "The deferred type '{0}' cannot be used in a declaration, cast or type test");
4532 4597
4533 /** 4598 /**
4534 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type 4599 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
4535 * available in the current lexical scope. 4600 * available in the current lexical scope.
4536 */ 4601 */
4537 static const StaticWarningCode TYPE_TEST_WITH_NON_TYPE = const StaticWarningCo de( 4602 static const StaticWarningCode TYPE_TEST_WITH_NON_TYPE = const StaticWarningCo de(
(...skipping 19 matching lines...) Expand all
4557 static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = 4622 static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC =
4558 const StaticWarningCode('TYPE_PARAMETER_REFERENCED_BY_STATIC', 4623 const StaticWarningCode('TYPE_PARAMETER_REFERENCED_BY_STATIC',
4559 "Static members cannot reference type parameters"); 4624 "Static members cannot reference type parameters");
4560 4625
4561 /** 4626 /**
4562 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form 4627 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form
4563 * <i>C.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: 4628 * <i>C.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
4564 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a 4629 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a
4565 * static warning if <i>C</i> does not denote a class in the current scope. 4630 * static warning if <i>C</i> does not denote a class in the current scope.
4566 * 4631 *
4567 * @param undefinedClassName the name of the undefined class 4632 * Parameters:
4633 * 0: the name of the undefined class
4568 */ 4634 */
4569 static const StaticWarningCode UNDEFINED_CLASS = 4635 static const StaticWarningCode UNDEFINED_CLASS =
4570 const StaticWarningCode('UNDEFINED_CLASS', "Undefined class '{0}'"); 4636 const StaticWarningCode('UNDEFINED_CLASS', "Undefined class '{0}'");
4571 4637
4572 /** 4638 /**
4573 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". 4639 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool".
4574 */ 4640 */
4575 static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = 4641 static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN =
4576 const StaticWarningCode('UNDEFINED_CLASS_BOOLEAN', 4642 const StaticWarningCode('UNDEFINED_CLASS_BOOLEAN',
4577 "Undefined class 'boolean'; did you mean 'bool'?"); 4643 "Undefined class 'boolean'; did you mean 'bool'?");
4578 4644
4579 /** 4645 /**
4580 * 12.17 Getter Invocation: It is a static warning if there is no class 4646 * 12.17 Getter Invocation: It is a static warning if there is no class
4581 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does 4647 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does
4582 * not declare, implicitly or explicitly, a getter named <i>m</i>. 4648 * not declare, implicitly or explicitly, a getter named <i>m</i>.
4583 * 4649 *
4584 * @param getterName the name of the getter 4650 * Parameters:
4585 * @param enclosingType the name of the enclosing type where the getter is 4651 * 0: the name of the getter
4586 * being looked for 4652 * 1: the name of the enclosing type where the getter is being looked for
4587 */ 4653 */
4588 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode( 4654 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode(
4589 'UNDEFINED_GETTER', 4655 'UNDEFINED_GETTER',
4590 "The getter '{0}' is not defined for the class '{1}'"); 4656 "The getter '{0}' is not defined for the class '{1}'");
4591 4657
4592 /** 4658 /**
4593 * 12.30 Identifier Reference: It is as static warning if an identifier 4659 * 12.30 Identifier Reference: It is as static warning if an identifier
4594 * expression of the form <i>id</i> occurs inside a top level or static 4660 * expression of the form <i>id</i> occurs inside a top level or static
4595 * function (be it function, method, getter, or setter) or variable 4661 * function (be it function, method, getter, or setter) or variable
4596 * initializer and there is no declaration <i>d</i> with name <i>id</i> in the 4662 * initializer and there is no declaration <i>d</i> with name <i>id</i> in the
4597 * lexical scope enclosing the expression. 4663 * lexical scope enclosing the expression.
4598 * 4664 *
4599 * @param name the name of the identifier 4665 * Parameters:
4666 * 0: the name of the identifier
4600 */ 4667 */
4601 static const StaticWarningCode UNDEFINED_IDENTIFIER = 4668 static const StaticWarningCode UNDEFINED_IDENTIFIER =
4602 const StaticWarningCode('UNDEFINED_IDENTIFIER', "Undefined name '{0}'"); 4669 const StaticWarningCode('UNDEFINED_IDENTIFIER', "Undefined name '{0}'");
4603 4670
4604 /** 4671 /**
4605 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, 4672 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
4606 * <i>1<=i<=l</i>, must have a corresponding named parameter in the set 4673 * <i>1<=i<=l</i>, must have a corresponding named parameter in the set
4607 * {<i>p<sub>n+1</sub></i> &hellip; <i>p<sub>n+k</sub></i>} or a static 4674 * {<i>p<sub>n+1</sub></i> &hellip; <i>p<sub>n+k</sub></i>} or a static
4608 * warning occurs. 4675 * warning occurs.
4609 * 4676 *
4610 * @param name the name of the requested named parameter 4677 * Parameters:
4678 * 0: the name of the requested named parameter
4611 */ 4679 */
4612 static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = 4680 static const StaticWarningCode UNDEFINED_NAMED_PARAMETER =
4613 const StaticWarningCode('UNDEFINED_NAMED_PARAMETER', 4681 const StaticWarningCode('UNDEFINED_NAMED_PARAMETER',
4614 "The named parameter '{0}' is not defined"); 4682 "The named parameter '{0}' is not defined");
4615 4683
4616 /** 4684 /**
4617 * 12.18 Assignment: It is as static warning if an assignment of the form 4685 * 12.18 Assignment: It is as static warning if an assignment of the form
4618 * <i>v = e</i> occurs inside a top level or static function (be it function, 4686 * <i>v = e</i> occurs inside a top level or static function (be it function,
4619 * method, getter, or setter) or variable initializer and there is no 4687 * method, getter, or setter) or variable initializer and there is no
4620 * declaration <i>d</i> with name <i>v=</i> in the lexical scope enclosing the 4688 * declaration <i>d</i> with name <i>v=</i> in the lexical scope enclosing the
4621 * assignment. 4689 * assignment.
4622 * 4690 *
4623 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in 4691 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in
4624 * the enclosing lexical scope of the assignment, or if <i>C</i> does not 4692 * the enclosing lexical scope of the assignment, or if <i>C</i> does not
4625 * declare, implicitly or explicitly, a setter <i>v=</i>. 4693 * declare, implicitly or explicitly, a setter <i>v=</i>.
4626 * 4694 *
4627 * @param setterName the name of the getter 4695 * Parameters:
4628 * @param enclosingType the name of the enclosing type where the setter is 4696 * 0: the name of the getter
4629 * being looked for 4697 * 1: the name of the enclosing type where the setter is being looked for
4630 */ 4698 */
4631 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode( 4699 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode(
4632 'UNDEFINED_SETTER', 4700 'UNDEFINED_SETTER',
4633 "The setter '{0}' is not defined for the class '{1}'"); 4701 "The setter '{0}' is not defined for the class '{1}'");
4634 4702
4635 /** 4703 /**
4636 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not 4704 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
4637 * declare a static method or getter <i>m</i>. 4705 * declare a static method or getter <i>m</i>.
4638 * 4706 *
4639 * @param methodName the name of the method 4707 * Parameters:
4640 * @param enclosingType the name of the enclosing type where the method is 4708 * 0: the name of the method
4641 * being looked for 4709 * 1: the name of the enclosing type where the method is being looked for
4642 */ 4710 */
4643 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = 4711 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER =
4644 const StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', 4712 const StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER',
4645 "The static method, getter or setter '{0}' is not defined for the clas s '{1}'"); 4713 "The static method, getter or setter '{0}' is not defined for the clas s '{1}'");
4646 4714
4647 /** 4715 /**
4648 * 12.17 Getter Invocation: It is a static warning if there is no class 4716 * 12.17 Getter Invocation: It is a static warning if there is no class
4649 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does 4717 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does
4650 * not declare, implicitly or explicitly, a getter named <i>m</i>. 4718 * not declare, implicitly or explicitly, a getter named <i>m</i>.
4651 * 4719 *
4652 * @param getterName the name of the getter 4720 * Parameters:
4653 * @param enclosingType the name of the enclosing type where the getter is 4721 * 0: the name of the getter
4654 * being looked for 4722 * 1: the name of the enclosing type where the getter is being looked for
4655 */ 4723 */
4656 static const StaticWarningCode UNDEFINED_SUPER_GETTER = 4724 static const StaticWarningCode UNDEFINED_SUPER_GETTER =
4657 const StaticWarningCode('UNDEFINED_SUPER_GETTER', 4725 const StaticWarningCode('UNDEFINED_SUPER_GETTER',
4658 "The getter '{0}' is not defined in a superclass of '{1}'"); 4726 "The getter '{0}' is not defined in a superclass of '{1}'");
4659 4727
4660 /** 4728 /**
4661 * 12.18 Assignment: It is as static warning if an assignment of the form 4729 * 12.18 Assignment: It is as static warning if an assignment of the form
4662 * <i>v = e</i> occurs inside a top level or static function (be it function, 4730 * <i>v = e</i> occurs inside a top level or static function (be it function,
4663 * method, getter, or setter) or variable initializer and there is no 4731 * method, getter, or setter) or variable initializer and there is no
4664 * declaration <i>d</i> with name <i>v=</i> in the lexical scope enclosing the 4732 * declaration <i>d</i> with name <i>v=</i> in the lexical scope enclosing the
4665 * assignment. 4733 * assignment.
4666 * 4734 *
4667 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in 4735 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in
4668 * the enclosing lexical scope of the assignment, or if <i>C</i> does not 4736 * the enclosing lexical scope of the assignment, or if <i>C</i> does not
4669 * declare, implicitly or explicitly, a setter <i>v=</i>. 4737 * declare, implicitly or explicitly, a setter <i>v=</i>.
4670 * 4738 *
4671 * @param setterName the name of the getter 4739 * Parameters:
4672 * @param enclosingType the name of the enclosing type where the setter is 4740 * 0: the name of the getter
4673 * being looked for 4741 * 1: the name of the enclosing type where the setter is being looked for
4674 */ 4742 */
4675 static const StaticWarningCode UNDEFINED_SUPER_SETTER = 4743 static const StaticWarningCode UNDEFINED_SUPER_SETTER =
4676 const StaticWarningCode('UNDEFINED_SUPER_SETTER', 4744 const StaticWarningCode('UNDEFINED_SUPER_SETTER',
4677 "The setter '{0}' is not defined in a superclass of '{1}'"); 4745 "The setter '{0}' is not defined in a superclass of '{1}'");
4678 4746
4679 /** 4747 /**
4680 * 7.2 Getters: It is a static warning if the return type of a getter is void. 4748 * 7.2 Getters: It is a static warning if the return type of a getter is void.
4681 */ 4749 */
4682 static const StaticWarningCode VOID_RETURN_FOR_GETTER = 4750 static const StaticWarningCode VOID_RETURN_FOR_GETTER =
4683 const StaticWarningCode('VOID_RETURN_FOR_GETTER', 4751 const StaticWarningCode('VOID_RETURN_FOR_GETTER',
4684 "The return type of the getter must not be 'void'"); 4752 "The return type of the getter must not be 'void'");
4685 4753
4686 /** 4754 /**
4687 * Initialize a newly created error code to have the given [name]. The message 4755 * Initialize a newly created error code to have the given [name]. The message
4688 * associated with the error will be created from the given [message] 4756 * associated with the error will be created from the given [message]
4689 * template. The correction associated with the error will be created from the 4757 * template. The correction associated with the error will be created from the
4690 * given [correction] template. 4758 * given [correction] template.
4691 */ 4759 */
4692 const StaticWarningCode(String name, String message, [String correction]) 4760 const StaticWarningCode(String name, String message, [String correction])
4693 : super(name, message, correction); 4761 : super(name, message, correction);
4694 4762
4695 @override 4763 @override
4696 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; 4764 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity;
4697 4765
4698 @override 4766 @override
4699 ErrorType get type => ErrorType.STATIC_WARNING; 4767 ErrorType get type => ErrorType.STATIC_WARNING;
4700 } 4768 }
4701 4769
4702 /** 4770 /**
4703 * The class `TodoCode` defines the single TODO error code. 4771 * The error code indicating a marker in code for work that needs to be finished
4772 * or revisited.
4704 */ 4773 */
4705 class TodoCode extends ErrorCode { 4774 class TodoCode extends ErrorCode {
4706 /** 4775 /**
4707 * The single enum of TodoCode. 4776 * The single enum of TodoCode.
4708 */ 4777 */
4709 static const TodoCode TODO = const TodoCode('TODO'); 4778 static const TodoCode TODO = const TodoCode('TODO');
4710 4779
4711 /** 4780 /**
4712 * This matches the two common Dart task styles 4781 * This matches the two common Dart task styles
4713 * 4782 *
(...skipping 14 matching lines...) Expand all
4728 * Initialize a newly created error code to have the given [name]. 4797 * Initialize a newly created error code to have the given [name].
4729 */ 4798 */
4730 const TodoCode(String name) : super(name, "{0}"); 4799 const TodoCode(String name) : super(name, "{0}");
4731 4800
4732 @override 4801 @override
4733 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 4802 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
4734 4803
4735 @override 4804 @override
4736 ErrorType get type => ErrorType.TODO; 4805 ErrorType get type => ErrorType.TODO;
4737 } 4806 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698