OLD | NEW |
1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
3 library engine.error; | 3 library engine.error; |
4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
5 import 'source.dart'; | 5 import 'source.dart'; |
6 import 'ast.dart' show ASTNode; | 6 import 'ast.dart' show ASTNode; |
7 import 'scanner.dart' show Token; | 7 import 'scanner.dart' show Token; |
8 /** | 8 /** |
9 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er
rorCode] | 9 * Instances of the enumeration `ErrorSeverity` represent the severity of an [Er
rorCode] |
10 * . | 10 * . |
11 * | 11 * |
12 * @coverage dart.engine.error | 12 * @coverage dart.engine.error |
13 */ | 13 */ |
14 class ErrorSeverity implements Enum<ErrorSeverity> { | 14 class ErrorSeverity extends Enum<ErrorSeverity> { |
15 | 15 |
16 /** | 16 /** |
17 * The severity representing a non-error. This is never used for any error cod
e, but is useful for | 17 * The severity representing a non-error. This is never used for any error cod
e, but is useful for |
18 * clients. | 18 * clients. |
19 */ | 19 */ |
20 static final ErrorSeverity NONE = new ErrorSeverity('NONE', 0, " ", "none"); | 20 static final ErrorSeverity NONE = new ErrorSeverity('NONE', 0, " ", "none"); |
21 | 21 |
22 /** | 22 /** |
23 * The severity representing a suggestion. Suggestions are not specified in th
e Dart language | 23 * The severity representing a suggestion. Suggestions are not specified in th
e Dart language |
24 * specification, but provide information about best practices. | 24 * specification, but provide information about best practices. |
25 */ | 25 */ |
26 static final ErrorSeverity SUGGESTION = new ErrorSeverity('SUGGESTION', 1, "S"
, "suggestion"); | 26 static final ErrorSeverity SUGGESTION = new ErrorSeverity('SUGGESTION', 1, "S"
, "suggestion"); |
27 | 27 |
28 /** | 28 /** |
29 * The severity representing a warning. Warnings can become errors if the `-We
rror` command | 29 * The severity representing a warning. Warnings can become errors if the `-We
rror` command |
30 * line flag is specified. | 30 * line flag is specified. |
31 */ | 31 */ |
32 static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 2, "W", "war
ning"); | 32 static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 2, "W", "war
ning"); |
33 | 33 |
34 /** | 34 /** |
35 * The severity representing an error. | 35 * The severity representing an error. |
36 */ | 36 */ |
37 static final ErrorSeverity ERROR = new ErrorSeverity('ERROR', 3, "E", "error")
; | 37 static final ErrorSeverity ERROR = new ErrorSeverity('ERROR', 3, "E", "error")
; |
38 static final List<ErrorSeverity> values = [NONE, SUGGESTION, WARNING, ERROR]; | 38 static final List<ErrorSeverity> values = [NONE, SUGGESTION, WARNING, ERROR]; |
39 | 39 |
40 /// The name of this enum constant, as declared in the enum declaration. | |
41 final String name; | |
42 | |
43 /// The position in the enum declaration. | |
44 final int ordinal; | |
45 | |
46 /** | 40 /** |
47 * The name of the severity used when producing machine output. | 41 * The name of the severity used when producing machine output. |
48 */ | 42 */ |
49 String _machineCode; | 43 String _machineCode; |
50 | 44 |
51 /** | 45 /** |
52 * The name of the severity used when producing readable output. | 46 * The name of the severity used when producing readable output. |
53 */ | 47 */ |
54 String _displayName; | 48 String _displayName; |
55 | 49 |
56 /** | 50 /** |
57 * Initialize a newly created severity with the given names. | 51 * Initialize a newly created severity with the given names. |
58 * | 52 * |
59 * @param machineCode the name of the severity used when producing machine out
put | 53 * @param machineCode the name of the severity used when producing machine out
put |
60 * @param displayName the name of the severity used when producing readable ou
tput | 54 * @param displayName the name of the severity used when producing readable ou
tput |
61 */ | 55 */ |
62 ErrorSeverity(this.name, this.ordinal, String machineCode, String displayName)
{ | 56 ErrorSeverity(String name, int ordinal, String machineCode, String displayName
) : super(name, ordinal) { |
63 this._machineCode = machineCode; | 57 this._machineCode = machineCode; |
64 this._displayName = displayName; | 58 this._displayName = displayName; |
65 } | 59 } |
66 | 60 |
67 /** | 61 /** |
68 * Return the name of the severity used when producing readable output. | 62 * Return the name of the severity used when producing readable output. |
69 * | 63 * |
70 * @return the name of the severity used when producing readable output | 64 * @return the name of the severity used when producing readable output |
71 */ | 65 */ |
72 String get displayName => _displayName; | 66 String get displayName => _displayName; |
73 | 67 |
74 /** | 68 /** |
75 * Return the name of the severity used when producing machine output. | 69 * Return the name of the severity used when producing machine output. |
76 * | 70 * |
77 * @return the name of the severity used when producing machine output | 71 * @return the name of the severity used when producing machine output |
78 */ | 72 */ |
79 String get machineCode => _machineCode; | 73 String get machineCode => _machineCode; |
80 | 74 |
81 /** | 75 /** |
82 * Return the severity constant that represents the greatest severity. | 76 * Return the severity constant that represents the greatest severity. |
83 * | 77 * |
84 * @param severity the severity being compared against | 78 * @param severity the severity being compared against |
85 * @return the most sever of this or the given severity | 79 * @return the most sever of this or the given severity |
86 */ | 80 */ |
87 ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal
? this : severity; | 81 ErrorSeverity max(ErrorSeverity severity) => this.ordinal >= severity.ordinal
? this : severity; |
88 int compareTo(ErrorSeverity other) => ordinal - other.ordinal; | |
89 int get hashCode => ordinal; | |
90 String toString() => name; | |
91 } | 82 } |
92 /** | 83 /** |
93 * Instances of the class `AnalysisErrorWithProperties` | 84 * Instances of the class `AnalysisErrorWithProperties` |
94 */ | 85 */ |
95 class AnalysisErrorWithProperties extends AnalysisError { | 86 class AnalysisErrorWithProperties extends AnalysisError { |
96 | 87 |
97 /** | 88 /** |
98 * The properties associated with this error. | 89 * The properties associated with this error. |
99 */ | 90 */ |
100 Map<ErrorProperty, Object> _propertyMap = new Map<ErrorProperty, Object>(); | 91 Map<ErrorProperty, Object> _propertyMap = new Map<ErrorProperty, Object>(); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 * The error code associated with the error. | 267 * The error code associated with the error. |
277 */ | 268 */ |
278 ErrorCode _errorCode; | 269 ErrorCode _errorCode; |
279 | 270 |
280 /** | 271 /** |
281 * The localized error message. | 272 * The localized error message. |
282 */ | 273 */ |
283 String _message; | 274 String _message; |
284 | 275 |
285 /** | 276 /** |
| 277 * The correction to be displayed for this error, or `null` if there is no cor
rection |
| 278 * information for this error. |
| 279 */ |
| 280 String _correction; |
| 281 |
| 282 /** |
286 * The source in which the error occurred, or `null` if unknown. | 283 * The source in which the error occurred, or `null` if unknown. |
287 */ | 284 */ |
288 Source _source; | 285 Source _source; |
289 | 286 |
290 /** | 287 /** |
291 * The character offset from the beginning of the source (zero based) where th
e error occurred. | 288 * The character offset from the beginning of the source (zero based) where th
e error occurred. |
292 */ | 289 */ |
293 int _offset = 0; | 290 int _offset = 0; |
294 | 291 |
295 /** | 292 /** |
296 * The number of characters from the offset to the end of the source which enc
ompasses the | 293 * The number of characters from the offset to the end of the source which enc
ompasses the |
297 * compilation error. | 294 * compilation error. |
298 */ | 295 */ |
299 int _length = 0; | 296 int _length = 0; |
300 | 297 |
301 /** | 298 /** |
| 299 * A flag indicating whether this error can be shown to be a non-issue because
of the result of |
| 300 * type propagation. |
| 301 */ |
| 302 bool _isStaticOnly2 = false; |
| 303 |
| 304 /** |
302 * Initialize a newly created analysis error for the specified source. The err
or has no location | 305 * Initialize a newly created analysis error for the specified source. The err
or has no location |
303 * information. | 306 * information. |
304 * | 307 * |
305 * @param source the source for which the exception occurred | 308 * @param source the source for which the exception occurred |
306 * @param errorCode the error code to be associated with this error | 309 * @param errorCode the error code to be associated with this error |
307 * @param arguments the arguments used to build the error message | 310 * @param arguments the arguments used to build the error message |
308 */ | 311 */ |
309 AnalysisError.con1(Source source, ErrorCode errorCode, List<Object> arguments)
{ | 312 AnalysisError.con1(Source source, ErrorCode errorCode, List<Object> arguments)
{ |
310 this._source = source; | 313 this._source = source; |
311 this._errorCode = errorCode; | 314 this._errorCode = errorCode; |
312 this._message = JavaString.format(errorCode.message, arguments); | 315 this._message = JavaString.format(errorCode.message, arguments); |
313 } | 316 } |
314 | 317 |
315 /** | 318 /** |
316 * Initialize a newly created analysis error for the specified source at the g
iven location. | 319 * Initialize a newly created analysis error for the specified source at the g
iven location. |
317 * | 320 * |
318 * @param source the source for which the exception occurred | 321 * @param source the source for which the exception occurred |
319 * @param offset the offset of the location of the error | 322 * @param offset the offset of the location of the error |
320 * @param length the length of the location of the error | 323 * @param length the length of the location of the error |
321 * @param errorCode the error code to be associated with this error | 324 * @param errorCode the error code to be associated with this error |
322 * @param arguments the arguments used to build the error message | 325 * @param arguments the arguments used to build the error message |
323 */ | 326 */ |
324 AnalysisError.con2(Source source, int offset, int length, ErrorCode errorCode,
List<Object> arguments) { | 327 AnalysisError.con2(Source source, int offset, int length, ErrorCode errorCode,
List<Object> arguments) { |
325 this._source = source; | 328 this._source = source; |
326 this._offset = offset; | 329 this._offset = offset; |
327 this._length = length; | 330 this._length = length; |
328 this._errorCode = errorCode; | 331 this._errorCode = errorCode; |
329 this._message = JavaString.format(errorCode.message, arguments); | 332 this._message = JavaString.format(errorCode.message, arguments); |
| 333 String correctionTemplate = errorCode.correction; |
| 334 if (correctionTemplate != null) { |
| 335 this._correction = JavaString.format(correctionTemplate, arguments); |
| 336 } |
330 } | 337 } |
331 | 338 |
332 /** | 339 /** |
| 340 * Return the correction to be displayed for this error, or `null` if there is
no correction |
| 341 * information for this error. The correction should indicate how the user can
fix the error. |
| 342 * |
| 343 * @return the template used to create the correction to be displayed for this
error |
| 344 */ |
| 345 String get correction => _correction; |
| 346 |
| 347 /** |
333 * Return the error code associated with the error. | 348 * Return the error code associated with the error. |
334 * | 349 * |
335 * @return the error code associated with the error | 350 * @return the error code associated with the error |
336 */ | 351 */ |
337 ErrorCode get errorCode => _errorCode; | 352 ErrorCode get errorCode => _errorCode; |
338 | 353 |
339 /** | 354 /** |
340 * Return the number of characters from the offset to the end of the source wh
ich encompasses the | 355 * Return the number of characters from the offset to the end of the source wh
ich encompasses the |
341 * compilation error. | 356 * compilation error. |
342 * | 357 * |
343 * @return the length of the error location | 358 * @return the length of the error location |
344 */ | 359 */ |
345 int get length => _length; | 360 int get length => _length; |
346 | 361 |
347 /** | 362 /** |
348 * Return the localized error message. | 363 * Return the message to be displayed for this error. The message should indic
ate what is wrong |
| 364 * and why it is wrong. |
349 * | 365 * |
350 * @return the localized error message | 366 * @return the message to be displayed for this error |
351 */ | 367 */ |
352 String get message => _message; | 368 String get message => _message; |
353 | 369 |
354 /** | 370 /** |
355 * Return the character offset from the beginning of the source (zero based) w
here the error | 371 * Return the character offset from the beginning of the source (zero based) w
here the error |
356 * occurred. | 372 * occurred. |
357 * | 373 * |
358 * @return the offset to the start of the error location | 374 * @return the offset to the start of the error location |
359 */ | 375 */ |
360 int get offset => _offset; | 376 int get offset => _offset; |
(...skipping 14 matching lines...) Expand all Loading... |
375 */ | 391 */ |
376 Source get source => _source; | 392 Source get source => _source; |
377 int get hashCode { | 393 int get hashCode { |
378 int hashCode = _offset; | 394 int hashCode = _offset; |
379 hashCode ^= (_message != null) ? _message.hashCode : 0; | 395 hashCode ^= (_message != null) ? _message.hashCode : 0; |
380 hashCode ^= (_source != null) ? _source.hashCode : 0; | 396 hashCode ^= (_source != null) ? _source.hashCode : 0; |
381 return hashCode; | 397 return hashCode; |
382 } | 398 } |
383 | 399 |
384 /** | 400 /** |
| 401 * Return `true` if this error can be shown to be a non-issue because of the r
esult of type |
| 402 * propagation. |
| 403 * |
| 404 * @return `true` if this error can be shown to be a non-issue |
| 405 */ |
| 406 bool get isStaticOnly => _isStaticOnly2; |
| 407 |
| 408 /** |
| 409 * Set whether this error can be shown to be a non-issue because of the result
of type propagation |
| 410 * to the given value. |
| 411 * |
| 412 * @param isStaticOnly `true` if this error can be shown to be a non-issue |
| 413 */ |
| 414 void set isStaticOnly(bool isStaticOnly2) { |
| 415 this._isStaticOnly2 = isStaticOnly2; |
| 416 } |
| 417 |
| 418 /** |
385 * Set the source in which the error occurred to the given source. | 419 * Set the source in which the error occurred to the given source. |
386 * | 420 * |
387 * @param source the source in which the error occurred | 421 * @param source the source in which the error occurred |
388 */ | 422 */ |
389 void set source(Source source2) { | 423 void set source(Source source2) { |
390 this._source = source2; | 424 this._source = source2; |
391 } | 425 } |
392 String toString() { | 426 String toString() { |
393 JavaStringBuilder builder = new JavaStringBuilder(); | 427 JavaStringBuilder builder = new JavaStringBuilder(); |
394 builder.append((_source != null) ? _source.fullName : "<unknown source>"); | 428 builder.append((_source != null) ? _source.fullName : "<unknown source>"); |
395 builder.append("("); | 429 builder.append("("); |
396 builder.append(_offset); | 430 builder.append(_offset); |
397 builder.append(".."); | 431 builder.append(".."); |
398 builder.append(_offset + _length - 1); | 432 builder.append(_offset + _length - 1); |
399 builder.append("): "); | 433 builder.append("): "); |
400 builder.append(_message); | 434 builder.append(_message); |
401 return builder.toString(); | 435 return builder.toString(); |
402 } | 436 } |
403 } | 437 } |
404 /** | 438 /** |
405 * The enumeration `ErrorProperty` defines the properties that can be associated
with an | 439 * The enumeration `ErrorProperty` defines the properties that can be associated
with an |
406 * [AnalysisError]. | 440 * [AnalysisError]. |
407 */ | 441 */ |
408 class ErrorProperty implements Enum<ErrorProperty> { | 442 class ErrorProperty extends Enum<ErrorProperty> { |
409 | 443 |
410 /** | 444 /** |
411 * A property whose value is an array of [ExecutableElement] that should | 445 * A property whose value is an array of [ExecutableElement] that should |
412 * be but are not implemented by a concrete class. | 446 * be but are not implemented by a concrete class. |
413 */ | 447 */ |
414 static final ErrorProperty UNIMPLEMENTED_METHODS = new ErrorProperty('UNIMPLEM
ENTED_METHODS', 0); | 448 static final ErrorProperty UNIMPLEMENTED_METHODS = new ErrorProperty('UNIMPLEM
ENTED_METHODS', 0); |
415 static final List<ErrorProperty> values = [UNIMPLEMENTED_METHODS]; | 449 static final List<ErrorProperty> values = [UNIMPLEMENTED_METHODS]; |
416 | 450 ErrorProperty(String name, int ordinal) : super(name, ordinal); |
417 /// The name of this enum constant, as declared in the enum declaration. | |
418 final String name; | |
419 | |
420 /// The position in the enum declaration. | |
421 final int ordinal; | |
422 ErrorProperty(this.name, this.ordinal); | |
423 int compareTo(ErrorProperty other) => ordinal - other.ordinal; | |
424 int get hashCode => ordinal; | |
425 String toString() => name; | |
426 } | 451 } |
427 /** | 452 /** |
428 * The enumeration `HintCode` defines the hints and coding recommendations for b
est practices | 453 * The enumeration `HintCode` defines the hints and coding recommendations for b
est practices |
429 * which are not mentioned in the Dart Language Specification. | 454 * which are not mentioned in the Dart Language Specification. |
430 */ | 455 */ |
431 class HintCode implements Enum<HintCode>, ErrorCode { | 456 class HintCode extends Enum<HintCode> implements ErrorCode { |
432 | 457 |
433 /** | 458 /** |
434 * Dead code is code that is never reached, this can happen for instance if a
statement follows a | 459 * Dead code is code that is never reached, this can happen for instance if a
statement follows a |
435 * return statement. | 460 * return statement. |
436 */ | 461 */ |
437 static final HintCode DEAD_CODE = new HintCode('DEAD_CODE', 0, "Dead code"); | 462 static final HintCode DEAD_CODE = new HintCode.con1('DEAD_CODE', 0, "Dead code
"); |
438 | 463 |
439 /** | 464 /** |
440 * Dead code is code that is never reached. This case covers cases where the u
ser has catch | 465 * Dead code is code that is never reached. This case covers cases where the u
ser has catch |
441 * clauses after `catch (e)` or `on Object catch (e)`. | 466 * clauses after `catch (e)` or `on Object catch (e)`. |
442 */ | 467 */ |
443 static final HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = new HintCode('DEAD_COD
E_CATCH_FOLLOWING_CATCH', 1, "Dead code, catch clauses after a 'catch (e)' or an
'on Object catch (e)' are never reached"); | 468 static final HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = new HintCode.con1('DEA
D_CODE_CATCH_FOLLOWING_CATCH', 1, "Dead code, catch clauses after a 'catch (e)'
or an 'on Object catch (e)' are never reached"); |
444 | 469 |
445 /** | 470 /** |
446 * Dead code is code that is never reached. This case covers cases where the u
ser has an on-catch | 471 * Dead code is code that is never reached. This case covers cases where the u
ser has an on-catch |
447 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh
t. | 472 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh
t. |
448 * | 473 * |
449 * @param subtypeName name of the subtype | 474 * @param subtypeName name of the subtype |
450 * @param supertypeName name of the supertype | 475 * @param supertypeName name of the supertype |
451 */ | 476 */ |
452 static final HintCode DEAD_CODE_ON_CATCH_SUBTYPE = new HintCode('DEAD_CODE_ON_
CATCH_SUBTYPE', 2, "Dead code, this on-catch block will never be executed since
'%s' is a subtype of '%s'"); | 477 static final HintCode DEAD_CODE_ON_CATCH_SUBTYPE = new HintCode.con1('DEAD_COD
E_ON_CATCH_SUBTYPE', 2, "Dead code, this on-catch block will never be executed s
ince '%s' is a subtype of '%s'"); |
453 | 478 |
454 /** | 479 /** |
455 * Unused imports are imports which are never not used. | 480 * Unused imports are imports which are never not used. |
456 */ | 481 */ |
457 static final HintCode UNUSED_IMPORT = new HintCode('UNUSED_IMPORT', 3, "Unused
import"); | 482 static final HintCode UNUSED_IMPORT = new HintCode.con1('UNUSED_IMPORT', 3, "U
nused import"); |
458 static final List<HintCode> values = [ | 483 static final List<HintCode> values = [ |
459 DEAD_CODE, | 484 DEAD_CODE, |
460 DEAD_CODE_CATCH_FOLLOWING_CATCH, | 485 DEAD_CODE_CATCH_FOLLOWING_CATCH, |
461 DEAD_CODE_ON_CATCH_SUBTYPE, | 486 DEAD_CODE_ON_CATCH_SUBTYPE, |
462 UNUSED_IMPORT]; | 487 UNUSED_IMPORT]; |
463 | 488 |
464 /// The name of this enum constant, as declared in the enum declaration. | 489 /** |
465 final String name; | 490 * The template used to create the message to be displayed for this error. |
466 | 491 */ |
467 /// The position in the enum declaration. | 492 String _message; |
468 final int ordinal; | |
469 | 493 |
470 /** | 494 /** |
471 * The message template used to create the message to be displayed for this er
ror. | 495 * The template used to create the correction to be displayed for this error,
or `null` if |
| 496 * there is no correction information for this error. |
472 */ | 497 */ |
473 String _message; | 498 String correction3; |
474 | 499 |
475 /** | 500 /** |
476 * Initialize a newly created error code to have the given message. | 501 * Initialize a newly created error code to have the given message. |
477 * | 502 * |
478 * @param message the message template used to create the message to be displa
yed for the error | 503 * @param message the message template used to create the message to be displa
yed for the error |
479 */ | 504 */ |
480 HintCode(this.name, this.ordinal, String message) { | 505 HintCode.con1(String name, int ordinal, String message) : super(name, ordinal)
{ |
481 this._message = message; | 506 this._message = message; |
482 } | 507 } |
| 508 |
| 509 /** |
| 510 * Initialize a newly created error code to have the given message and correct
ion. |
| 511 * |
| 512 * @param message the template used to create the message to be displayed for
the error |
| 513 * @param correction the template used to create the correction to be displaye
d for the error |
| 514 */ |
| 515 HintCode.con2(String name, int ordinal, String message, String correction) : s
uper(name, ordinal) { |
| 516 this._message = message; |
| 517 this.correction3 = correction; |
| 518 } |
| 519 String get correction => correction3; |
483 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; | 520 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; |
484 String get message => _message; | 521 String get message => _message; |
485 ErrorType get type => ErrorType.HINT; | 522 ErrorType get type => ErrorType.HINT; |
486 int compareTo(HintCode other) => ordinal - other.ordinal; | |
487 int get hashCode => ordinal; | |
488 String toString() => name; | |
489 } | 523 } |
490 /** | 524 /** |
491 * The interface `ErrorCode` defines the behavior common to objects representing
error codes | 525 * The interface `ErrorCode` defines the behavior common to objects representing
error codes |
492 * associated with [AnalysisError]. | 526 * associated with [AnalysisError]. |
493 * | 527 * |
| 528 * Generally, we want to provide messages that consist of three sentences: 1. wh
at is wrong, 2. why |
| 529 * is it wrong, and 3. how do I fix it. However, we combine the first two in the
result of |
| 530 * [getMessage] and the last in the result of [getCorrection]. |
| 531 * |
494 * @coverage dart.engine.error | 532 * @coverage dart.engine.error |
495 */ | 533 */ |
496 abstract class ErrorCode { | 534 abstract class ErrorCode { |
497 | 535 |
498 /** | 536 /** |
| 537 * Return the template used to create the correction to be displayed for this
error, or |
| 538 * `null` if there is no correction information for this error. The correction
should |
| 539 * indicate how the user can fix the error. |
| 540 * |
| 541 * @return the template used to create the correction to be displayed for this
error |
| 542 */ |
| 543 String get correction; |
| 544 |
| 545 /** |
499 * Return the severity of this error. | 546 * Return the severity of this error. |
500 * | 547 * |
501 * @return the severity of this error | 548 * @return the severity of this error |
502 */ | 549 */ |
503 ErrorSeverity get errorSeverity; | 550 ErrorSeverity get errorSeverity; |
504 | 551 |
505 /** | 552 /** |
506 * Return the message template used to create the message to be displayed for
this error. | 553 * Return the template used to create the message to be displayed for this err
or. The message |
| 554 * should indicate what is wrong and why it is wrong. |
507 * | 555 * |
508 * @return the message template used to create the message to be displayed for
this error | 556 * @return the template used to create the message to be displayed for this er
ror |
509 */ | 557 */ |
510 String get message; | 558 String get message; |
511 | 559 |
512 /** | 560 /** |
513 * Return the type of the error. | 561 * Return the type of the error. |
514 * | 562 * |
515 * @return the type of the error | 563 * @return the type of the error |
516 */ | 564 */ |
517 ErrorType get type; | 565 ErrorType get type; |
518 } | 566 } |
519 /** | 567 /** |
520 * Instances of the enumeration `ErrorType` represent the type of an [ErrorCode]
. | 568 * Instances of the enumeration `ErrorType` represent the type of an [ErrorCode]
. |
521 * | 569 * |
522 * @coverage dart.engine.error | 570 * @coverage dart.engine.error |
523 */ | 571 */ |
524 class ErrorType implements Enum<ErrorType> { | 572 class ErrorType extends Enum<ErrorType> { |
525 | 573 |
526 /** | 574 /** |
527 * Extra analysis run over the code to follow best practices, which are not in
the Dart Language | 575 * Extra analysis run over the code to follow best practices, which are not in
the Dart Language |
528 * Specification. | 576 * Specification. |
529 */ | 577 */ |
530 static final ErrorType HINT = new ErrorType('HINT', 0, ErrorSeverity.SUGGESTIO
N); | 578 static final ErrorType HINT = new ErrorType('HINT', 0, ErrorSeverity.SUGGESTIO
N); |
531 | 579 |
532 /** | 580 /** |
533 * Compile-time errors are errors that preclude execution. A compile time erro
r must be reported | 581 * Compile-time errors are errors that preclude execution. A compile time erro
r must be reported |
534 * by a Dart compiler before the erroneous code is executed. | 582 * by a Dart compiler before the erroneous code is executed. |
(...skipping 23 matching lines...) Expand all Loading... |
558 */ | 606 */ |
559 static final ErrorType SYNTACTIC_ERROR = new ErrorType('SYNTACTIC_ERROR', 5, E
rrorSeverity.ERROR); | 607 static final ErrorType SYNTACTIC_ERROR = new ErrorType('SYNTACTIC_ERROR', 5, E
rrorSeverity.ERROR); |
560 static final List<ErrorType> values = [ | 608 static final List<ErrorType> values = [ |
561 HINT, | 609 HINT, |
562 COMPILE_TIME_ERROR, | 610 COMPILE_TIME_ERROR, |
563 PUB_SUGGESTION, | 611 PUB_SUGGESTION, |
564 STATIC_WARNING, | 612 STATIC_WARNING, |
565 STATIC_TYPE_WARNING, | 613 STATIC_TYPE_WARNING, |
566 SYNTACTIC_ERROR]; | 614 SYNTACTIC_ERROR]; |
567 | 615 |
568 /// The name of this enum constant, as declared in the enum declaration. | |
569 final String name; | |
570 | |
571 /// The position in the enum declaration. | |
572 final int ordinal; | |
573 | |
574 /** | 616 /** |
575 * The severity of this type of error. | 617 * The severity of this type of error. |
576 */ | 618 */ |
577 ErrorSeverity _severity; | 619 ErrorSeverity _severity; |
578 | 620 |
579 /** | 621 /** |
580 * Initialize a newly created error type to have the given severity. | 622 * Initialize a newly created error type to have the given severity. |
581 * | 623 * |
582 * @param severity the severity of this type of error | 624 * @param severity the severity of this type of error |
583 */ | 625 */ |
584 ErrorType(this.name, this.ordinal, ErrorSeverity severity) { | 626 ErrorType(String name, int ordinal, ErrorSeverity severity) : super(name, ordi
nal) { |
585 this._severity = severity; | 627 this._severity = severity; |
586 } | 628 } |
587 | 629 |
588 /** | 630 /** |
589 * Return the severity of this type of error. | 631 * Return the severity of this type of error. |
590 * | 632 * |
591 * @return the severity of this type of error | 633 * @return the severity of this type of error |
592 */ | 634 */ |
593 ErrorSeverity get severity => _severity; | 635 ErrorSeverity get severity => _severity; |
594 int compareTo(ErrorType other) => ordinal - other.ordinal; | |
595 int get hashCode => ordinal; | |
596 String toString() => name; | |
597 } | 636 } |
598 /** | 637 /** |
599 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi
le time | 638 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi
le time |
600 * errors. The convention for this class is for the name of the error code to in
dicate the problem | 639 * errors. The convention for this class is for the name of the error code to in
dicate the problem |
601 * that caused the error to be generated and for the error message to explain wh
at is wrong and, | 640 * that caused the error to be generated and for the error message to explain wh
at is wrong and, |
602 * when appropriate, how the problem can be corrected. | 641 * when appropriate, how the problem can be corrected. |
603 * | 642 * |
604 * @coverage dart.engine.error | 643 * @coverage dart.engine.error |
605 */ | 644 */ |
606 class CompileTimeErrorCode implements Enum<CompileTimeErrorCode>, ErrorCode { | 645 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo
de { |
607 | 646 |
608 /** | 647 /** |
609 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
by a library | 648 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
by a library |
610 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b
y more than one | 649 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b
y more than one |
611 * export. | 650 * export. |
612 * | 651 * |
613 * @param ambiguousElementName the name of the ambiguous element | 652 * @param ambiguousElementName the name of the ambiguous element |
614 * @param firstLibraryName the name of the first library that the type is foun
d | 653 * @param firstLibraryName the name of the first library that the type is foun
d |
615 * @param secondLibraryName the name of the second library that the type is fo
und | 654 * @param secondLibraryName the name of the second library that the type is fo
und |
616 */ | 655 */ |
617 static final CompileTimeErrorCode AMBIGUOUS_EXPORT = new CompileTimeErrorCode(
'AMBIGUOUS_EXPORT', 0, "The element '%s' is defined in the libraries '%s' and '%
s'"); | 656 static final CompileTimeErrorCode AMBIGUOUS_EXPORT = new CompileTimeErrorCode.
con1('AMBIGUOUS_EXPORT', 0, "The element '%s' is defined in the libraries '%s' a
nd '%s'"); |
618 | 657 |
619 /** | 658 /** |
620 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
not denote a formal | 659 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
not denote a formal |
621 * parameter. | 660 * parameter. |
622 * | 661 * |
623 * @param the name of the identifier in the argument definition test that is n
ot a parameter | 662 * @param the name of the identifier in the argument definition test that is n
ot a parameter |
624 */ | 663 */ |
625 static final CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = new
CompileTimeErrorCode('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 1, "'%s' is not
a parameter"); | 664 static final CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = new
CompileTimeErrorCode.con1('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 1, "'%s' is
not a parameter"); |
626 | 665 |
627 /** | 666 /** |
628 * 12.14.2 Binding Actuals to Formals: In checked mode, it is a dynamic type e
rror if | 667 * 12.14.2 Binding Actuals to Formals: In checked mode, it is a dynamic type e
rror if |
629 * <i>o<sub>i</sub></i> is not <b>null</b> and the actual type of <i>p<sub>i</
sub></i> is not a | 668 * <i>o<sub>i</sub></i> is not <b>null</b> and the actual type of <i>p<sub>i</
sub></i> is not a |
630 * supertype of the type of <i>o<sub>i</sub></i>, i = 1..m. | 669 * supertype of the type of <i>o<sub>i</sub></i>, i = 1..m. |
631 * | 670 * |
632 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | 671 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an |
633 * uncaught exception being thrown. | 672 * uncaught exception being thrown. |
634 * | 673 * |
635 * @param requiredCount the maximum number of positional arguments | 674 * @param requiredCount the maximum number of positional arguments |
636 * @param argumentCount the actual number of positional arguments given | 675 * @param argumentCount the actual number of positional arguments given |
637 */ | 676 */ |
638 static final CompileTimeErrorCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new CompileTi
meErrorCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', 2, "The argument type '%s' cannot be
assigned to the parameter type '%s'"); | 677 static final CompileTimeErrorCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new CompileTi
meErrorCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 2, "The argument type '%s' cann
ot be assigned to the parameter type '%s'"); |
639 | 678 |
640 /** | 679 /** |
641 * 12.30 Identifier Reference: It is a compile-time error to use a built-in id
entifier other than | 680 * 12.30 Identifier Reference: It is a compile-time error to use a built-in id
entifier other than |
642 * dynamic as a type annotation. | 681 * dynamic as a type annotation. |
643 */ | 682 */ |
644 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = new CompileTim
eErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE', 3, "The built-in identifier '%s' canno
t be as a type"); | 683 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = new CompileTim
eErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE', 3, "The built-in identifier '%s'
cannot be as a type"); |
645 | 684 |
646 /** | 685 /** |
647 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the | 686 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the |
648 * declared name of a class, type parameter or type alias. | 687 * declared name of a class, type parameter or type alias. |
649 */ | 688 */ |
650 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = new Compi
leTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 4, "The built-in identifier
'%s' cannot be used as a type name"); | 689 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = new Compi
leTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 4, "The built-in identi
fier '%s' cannot be used as a type name"); |
651 | 690 |
652 /** | 691 /** |
653 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the | 692 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the |
654 * declared name of a class, type parameter or type alias. | 693 * declared name of a class, type parameter or type alias. |
655 */ | 694 */ |
656 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = new Co
mpileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 5, "The built-in ident
ifier '%s' cannot be used as a type alias name"); | 695 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = new Co
mpileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 5, "The built-in
identifier '%s' cannot be used as a type alias name"); |
657 | 696 |
658 /** | 697 /** |
659 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the | 698 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi
fier is used as the |
660 * declared name of a class, type parameter or type alias. | 699 * declared name of a class, type parameter or type alias. |
661 */ | 700 */ |
662 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME =
new CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME', 6, "The bu
ilt-in identifier '%s' cannot be used as a type variable name"); | 701 static final CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME =
new CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME', 6, "T
he built-in identifier '%s' cannot be used as a type variable name"); |
663 | 702 |
664 /** | 703 /** |
665 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements th
e operator | 704 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements th
e operator |
666 * <i>==</i>. | 705 * <i>==</i>. |
667 */ | 706 */ |
668 static final CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = new
CompileTimeErrorCode('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 7, "The switch c
ase expression type '%s' cannot override the == operator"); | 707 static final CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = new
CompileTimeErrorCode.con1('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 7, "The swi
tch case expression type '%s' cannot override the == operator"); |
669 | 708 |
670 /** | 709 /** |
671 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
constant would raise | 710 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
constant would raise |
672 * an exception. | 711 * an exception. |
673 */ | 712 */ |
674 static final CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = new
CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 8, ""); | 713 static final CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = new
CompileTimeErrorCode.con1('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 8, ""); |
675 | 714 |
676 /** | 715 /** |
677 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same | 716 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same |
678 * name. This restriction holds regardless of whether the getter is defined ex
plicitly or | 717 * name. This restriction holds regardless of whether the getter is defined ex
plicitly or |
679 * implicitly, or whether the getter or the method are inherited or not. | 718 * implicitly, or whether the getter or the method are inherited or not. |
680 */ | 719 */ |
681 static final CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = new CompileT
imeErrorCode('CONFLICTING_GETTER_AND_METHOD', 9, "Class '%s' cannot have both ge
tter '%s.%s' and method with the same name"); | 720 static final CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = new CompileT
imeErrorCode.con1('CONFLICTING_GETTER_AND_METHOD', 9, "Class '%s' cannot have bo
th getter '%s.%s' and method with the same name"); |
682 | 721 |
683 /** | 722 /** |
684 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same | 723 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same |
685 * name. This restriction holds regardless of whether the getter is defined ex
plicitly or | 724 * name. This restriction holds regardless of whether the getter is defined ex
plicitly or |
686 * implicitly, or whether the getter or the method are inherited or not. | 725 * implicitly, or whether the getter or the method are inherited or not. |
687 */ | 726 */ |
688 static final CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = new CompileT
imeErrorCode('CONFLICTING_METHOD_AND_GETTER', 10, "Class '%s' cannot have both m
ethod '%s.%s' and getter with the same name"); | 727 static final CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = new CompileT
imeErrorCode.con1('CONFLICTING_METHOD_AND_GETTER', 10, "Class '%s' cannot have b
oth method '%s.%s' and getter with the same name"); |
689 | 728 |
690 /** | 729 /** |
691 * 7.6 Constructors: A constructor name always begins with the name of its imm
ediately enclosing | 730 * 7.6 Constructors: A constructor name always begins with the name of its imm
ediately enclosing |
692 * class, and may optionally be followed by a dot and an identifier <i>id</i>.
It is a | 731 * class, and may optionally be followed by a dot and an identifier <i>id</i>.
It is a |
693 * compile-time error if <i>id</i> is the name of a member declared in the imm
ediately enclosing | 732 * compile-time error if <i>id</i> is the name of a member declared in the imm
ediately enclosing |
694 * class. | 733 * class. |
695 */ | 734 */ |
696 static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = new
CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 11, "'%s' cannot
be used to name a constructor and a field in this class"); | 735 static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = new
CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 11, "'%s' c
annot be used to name a constructor and a field in this class"); |
697 | 736 |
698 /** | 737 /** |
699 * 7.6 Constructors: A constructor name always begins with the name of its imm
ediately enclosing | 738 * 7.6 Constructors: A constructor name always begins with the name of its imm
ediately enclosing |
700 * class, and may optionally be followed by a dot and an identifier <i>id</i>.
It is a | 739 * class, and may optionally be followed by a dot and an identifier <i>id</i>.
It is a |
701 * compile-time error if <i>id</i> is the name of a member declared in the imm
ediately enclosing | 740 * compile-time error if <i>id</i> is the name of a member declared in the imm
ediately enclosing |
702 * class. | 741 * class. |
703 */ | 742 */ |
704 static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = ne
w CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 12, "'%s' cann
ot be used to name a constructor and a method in this class"); | 743 static final CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = ne
w CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 12, "'%s'
cannot be used to name a constructor and a method in this class"); |
705 | 744 |
706 /** | 745 /** |
707 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | 746 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an |
708 * uncaught exception being thrown. | 747 * uncaught exception being thrown. |
709 */ | 748 */ |
710 static final CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = new Com
pileTimeErrorCode('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 13, "'const' constructor
s cannot throw exceptions"); | 749 static final CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = new Com
pileTimeErrorCode.con1('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 13, "'const' constr
uctors cannot throw exceptions"); |
711 | 750 |
712 /** | 751 /** |
713 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
or implicitly, in | 752 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
or implicitly, in |
714 * the initializer list of a constant constructor must specify a constant cons
tructor of the | 753 * the initializer list of a constant constructor must specify a constant cons
tructor of the |
715 * superclass of the immediately enclosing class or a compile-time error occur
s. | 754 * superclass of the immediately enclosing class or a compile-time error occur
s. |
716 */ | 755 */ |
717 static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = new
CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 14, "Constant co
nstructor cannot call non-constant super constructor"); | 756 static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = new
CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 14, "Consta
nt constructor cannot call non-constant super constructor"); |
718 | 757 |
719 /** | 758 /** |
720 * 7.6.3 Constant Constructors: It is a compile-time error if a constant const
ructor is declared | 759 * 7.6.3 Constant Constructors: It is a compile-time error if a constant const
ructor is declared |
721 * by a class that has a non-final instance variable. | 760 * by a class that has a non-final instance variable. |
722 * | 761 * |
723 * The above refers to both locally declared and inherited instance variables. | 762 * The above refers to both locally declared and inherited instance variables. |
724 */ | 763 */ |
725 static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = new
CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 15, "Cannot defi
ne the 'const' constructor for a class with non-final fields"); | 764 static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = new
CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 15, "Cannot
define the 'const' constructor for a class with non-final fields"); |
726 | 765 |
727 /** | 766 /** |
728 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error
if o is not | 767 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error
if o is not |
729 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of
the static type of | 768 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of
the static type of |
730 * the field <i>v</i>. | 769 * the field <i>v</i>. |
731 * | 770 * |
732 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | 771 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an |
733 * uncaught exception being thrown. | 772 * uncaught exception being thrown. |
734 * | 773 * |
735 * @param initializerType the name of the type of the initializer expression | 774 * @param initializerType the name of the type of the initializer expression |
736 * @param fieldType the name of the type of the field | 775 * @param fieldType the name of the type of the field |
737 */ | 776 */ |
738 static final CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = new
CompileTimeErrorCode('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 16, "The initial
izer type '%s' cannot be assigned to the field type '%s'"); | 777 static final CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = new
CompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 16, "The in
itializer type '%s' cannot be assigned to the field type '%s'"); |
739 | 778 |
740 /** | 779 /** |
741 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is
declared as a | 780 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is
declared as a |
742 * constant variable. | 781 * constant variable. |
743 */ | 782 */ |
744 static final CompileTimeErrorCode CONST_FORMAL_PARAMETER = new CompileTimeErro
rCode('CONST_FORMAL_PARAMETER', 17, "Parameters cannot be 'const'"); | 783 static final CompileTimeErrorCode CONST_FORMAL_PARAMETER = new CompileTimeErro
rCode.con1('CONST_FORMAL_PARAMETER', 17, "Parameters cannot be 'const'"); |
745 | 784 |
746 /** | 785 /** |
747 * 5 Variables: A constant variable must be initialized to a compile-time cons
tant or a | 786 * 5 Variables: A constant variable must be initialized to a compile-time cons
tant or a |
748 * compile-time error occurs. | 787 * compile-time error occurs. |
749 */ | 788 */ |
750 static final CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE =
new CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 18, "'cons
t' variables must be constant value"); | 789 static final CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE =
new CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 18, "
'const' variables must be constant value"); |
751 | 790 |
752 /** | 791 /** |
753 * 7.5 Instance Variables: It is a compile-time error if an instance variable
is declared to be | 792 * 7.5 Instance Variables: It is a compile-time error if an instance variable
is declared to be |
754 * constant. | 793 * constant. |
755 */ | 794 */ |
756 static final CompileTimeErrorCode CONST_INSTANCE_FIELD = new CompileTimeErrorC
ode('CONST_INSTANCE_FIELD', 19, "Only static fields can be declared as 'const'")
; | 795 static final CompileTimeErrorCode CONST_INSTANCE_FIELD = new CompileTimeErrorC
ode.con1('CONST_INSTANCE_FIELD', 19, "Only static fields can be declared as 'con
st'"); |
757 | 796 |
758 /** | 797 /** |
759 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
where e, e1 and e2 | 798 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
where e, e1 and e2 |
760 * are constant expressions that evaluate to a boolean value. | 799 * are constant expressions that evaluate to a boolean value. |
761 */ | 800 */ |
762 static final CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = new CompileTimeErrorC
ode('CONST_EVAL_TYPE_BOOL', 20, "An expression of type 'bool' was expected"); | 801 static final CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = new CompileTimeErrorC
ode.con1('CONST_EVAL_TYPE_BOOL', 20, "An expression of type 'bool' was expected"
); |
763 | 802 |
764 /** | 803 /** |
765 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where
e1 and e2 are | 804 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where
e1 and e2 are |
766 * constant expressions that evaluate to a numeric, string or boolean value or
to null. | 805 * constant expressions that evaluate to a numeric, string or boolean value or
to null. |
767 */ | 806 */ |
768 static final CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = new Compil
eTimeErrorCode('CONST_EVAL_TYPE_BOOL_NUM_STRING', 21, "An expression of type 'bo
ol', 'num', 'String' or 'null' was expected"); | 807 static final CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = new Compil
eTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 21, "An expression of typ
e 'bool', 'num', 'String' or 'null' was expected"); |
769 | 808 |
770 /** | 809 /** |
771 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 |
e2, e1 >> e2 or e1 | 810 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 |
e2, e1 >> e2 or e1 |
772 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte
ger value or to | 811 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte
ger value or to |
773 * null. | 812 * null. |
774 */ | 813 */ |
775 static final CompileTimeErrorCode CONST_EVAL_TYPE_INT = new CompileTimeErrorCo
de('CONST_EVAL_TYPE_INT', 22, "An expression of type 'int' was expected"); | 814 static final CompileTimeErrorCode CONST_EVAL_TYPE_INT = new CompileTimeErrorCo
de.con1('CONST_EVAL_TYPE_INT', 22, "An expression of type 'int' was expected"); |
776 | 815 |
777 /** | 816 /** |
778 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 *
e2, e1 / e2, e1 ~/ | 817 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 *
e2, e1 / e2, e1 ~/ |
779 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are
constant | 818 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are
constant |
780 * expressions that evaluate to a numeric value or to null.. | 819 * expressions that evaluate to a numeric value or to null.. |
781 */ | 820 */ |
782 static final CompileTimeErrorCode CONST_EVAL_TYPE_NUM = new CompileTimeErrorCo
de('CONST_EVAL_TYPE_NUM', 23, "An expression of type 'num' was expected"); | 821 static final CompileTimeErrorCode CONST_EVAL_TYPE_NUM = new CompileTimeErrorCo
de.con1('CONST_EVAL_TYPE_NUM', 23, "An expression of type 'num' was expected"); |
783 | 822 |
784 /** | 823 /** |
785 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | 824 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an |
786 * uncaught exception being thrown. | 825 * uncaught exception being thrown. |
787 */ | 826 */ |
788 static final CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = new CompileTim
eErrorCode('CONST_EVAL_THROWS_EXCEPTION', 24, "Evaluation of this constant expre
ssion causes exception"); | 827 static final CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = new CompileTim
eErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 24, "Evaluation of this constant
expression causes exception"); |
789 | 828 |
790 /** | 829 /** |
791 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | 830 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an |
792 * uncaught exception being thrown. | 831 * uncaught exception being thrown. |
793 */ | 832 */ |
794 static final CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = new CompileTimeErr
orCode('CONST_EVAL_THROWS_IDBZE', 25, "Evaluation of this constant expression th
rows IntegerDivisionByZeroException"); | 833 static final CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = new CompileTimeErr
orCode.con1('CONST_EVAL_THROWS_IDBZE', 25, "Evaluation of this constant expressi
on throws IntegerDivisionByZeroException"); |
795 | 834 |
796 /** | 835 /** |
797 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S<U<sub>1</sub>, &
hellip;, | 836 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S<U<sub>1</sub>, &
hellip;, |
798 * U<sub>m</sub>></i>, let <i>R = S</i>; It is a compile time error if <i>S
</i> is not a | 837 * U<sub>m</sub>></i>, let <i>R = S</i>; It is a compile time error if <i>S
</i> is not a |
799 * generic type with <i>m</i> type parameters. | 838 * generic type with <i>m</i> type parameters. |
800 * | 839 * |
801 * @param typeName the name of the type being referenced (<i>S</i>) | 840 * @param typeName the name of the type being referenced (<i>S</i>) |
802 * @param parameterCount the number of type parameters that were declared | 841 * @param parameterCount the number of type parameters that were declared |
803 * @param argumentCount the number of type arguments provided | 842 * @param argumentCount the number of type arguments provided |
804 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS | 843 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS |
805 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS | 844 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS |
806 */ | 845 */ |
807 static final CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = new Com
pileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', 26, "The type '%s' is de
clared with %d type parameters, but %d type arguments were given"); | 846 static final CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = new Com
pileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 26, "The type '%s'
is declared with %d type parameters, but %d type arguments were given"); |
808 | 847 |
809 /** | 848 /** |
810 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip
;, a<sub>n</sub>, | 849 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip
;, a<sub>n</sub>, |
811 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a | 850 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a |
812 * compile-time error if the type <i>T</i> does not declare a constant constru
ctor with the same | 851 * compile-time error if the type <i>T</i> does not declare a constant constru
ctor with the same |
813 * name as the declaration of <i>T</i>. | 852 * name as the declaration of <i>T</i>. |
814 */ | 853 */ |
815 static final CompileTimeErrorCode CONST_WITH_NON_CONST = new CompileTimeErrorC
ode('CONST_WITH_NON_CONST', 27, "The constructor being called is not a 'const' c
onstructor"); | 854 static final CompileTimeErrorCode CONST_WITH_NON_CONST = new CompileTimeErrorC
ode.con1('CONST_WITH_NON_CONST', 27, "The constructor being called is not a 'con
st' constructor"); |
816 | 855 |
817 /** | 856 /** |
818 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i>
a<sub>i</sub>, 1 | 857 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i>
a<sub>i</sub>, 1 |
819 * <= i <= n + k</i>, is not a compile-time constant expression. | 858 * <= i <= n + k</i>, is not a compile-time constant expression. |
820 */ | 859 */ |
821 static final CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = new Compi
leTimeErrorCode('CONST_WITH_NON_CONSTANT_ARGUMENT', 28, "Arguments of a constant
creation must be constant expressions"); | 860 static final CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = new Compi
leTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 28, "Arguments of a con
stant creation must be constant expressions"); |
822 | 861 |
823 /** | 862 /** |
824 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access
ible in the current | 863 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access
ible in the current |
825 * scope, optionally followed by type arguments. | 864 * scope, optionally followed by type arguments. |
826 * | 865 * |
827 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, &hel
lip;, a<sub>n</sub>, | 866 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, &hel
lip;, a<sub>n</sub>, |
828 * x<sub>n+1</sub>: a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub>
)</i> it is a | 867 * x<sub>n+1</sub>: a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub>
)</i> it is a |
829 * compile-time error if <i>T</i> is not a class accessible in the current sco
pe, optionally | 868 * compile-time error if <i>T</i> is not a class accessible in the current sco
pe, optionally |
830 * followed by type arguments. | 869 * followed by type arguments. |
831 * | 870 * |
832 * @param name the name of the non-type element | 871 * @param name the name of the non-type element |
833 */ | 872 */ |
834 static final CompileTimeErrorCode CONST_WITH_NON_TYPE = new CompileTimeErrorCo
de('CONST_WITH_NON_TYPE', 29, "The name '%s' is not a class"); | 873 static final CompileTimeErrorCode CONST_WITH_NON_TYPE = new CompileTimeErrorCo
de.con1('CONST_WITH_NON_TYPE', 29, "The name '%s' is not a class"); |
835 | 874 |
836 /** | 875 /** |
837 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par
ameters. | 876 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par
ameters. |
838 */ | 877 */ |
839 static final CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = new CompileTime
ErrorCode('CONST_WITH_TYPE_PARAMETERS', 30, "The constant creation cannot use a
type parameter"); | 878 static final CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = new CompileTime
ErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 30, "The constant creation cannot u
se a type parameter"); |
840 | 879 |
841 /** | 880 /** |
842 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
a constant | 881 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
a constant |
843 * constructor declared by the type <i>T</i>. | 882 * constructor declared by the type <i>T</i>. |
844 * | 883 * |
845 * @param typeName the name of the type | 884 * @param typeName the name of the type |
846 * @param constructorName the name of the requested constant constructor | 885 * @param constructorName the name of the requested constant constructor |
847 */ | 886 */ |
848 static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = new Compi
leTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR', 31, "The class '%s' does not
have a constant constructor '%s'"); | 887 static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = new Compi
leTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 31, "The class '%s' doe
s not have a constant constructor '%s'"); |
849 | 888 |
850 /** | 889 /** |
851 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
a constant | 890 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
a constant |
852 * constructor declared by the type <i>T</i>. | 891 * constructor declared by the type <i>T</i>. |
853 * | 892 * |
854 * @param typeName the name of the type | 893 * @param typeName the name of the type |
855 */ | 894 */ |
856 static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = n
ew CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 32, "The cla
ss '%s' does not have a default constant constructor"); | 895 static final CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = n
ew CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 32, "Th
e class '%s' does not have a default constant constructor"); |
857 | 896 |
858 /** | 897 /** |
859 * 15.3.1 Typedef: It is a compile-time error if any default values are specif
ied in the signature | 898 * 15.3.1 Typedef: It is a compile-time error if any default values are specif
ied in the signature |
860 * of a function type alias. | 899 * of a function type alias. |
861 */ | 900 */ |
862 static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = new C
ompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 33, "Default values
aren't allowed in typedefs"); | 901 static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = new C
ompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 33, "Default va
lues aren't allowed in typedefs"); |
863 | 902 |
864 /** | 903 /** |
865 * 6.2.1 Required Formals: By means of a function signature that names the par
ameter and describes | 904 * 6.2.1 Required Formals: By means of a function signature that names the par
ameter and describes |
866 * its type as a function type. It is a compile-time error if any default valu
es are specified in | 905 * its type as a function type. It is a compile-time error if any default valu
es are specified in |
867 * the signature of such a function type. | 906 * the signature of such a function type. |
868 */ | 907 */ |
869 static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER =
new CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 34, "Defau
lt values aren't allowed in function type parameters"); | 908 static final CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER =
new CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 34, "
Default values aren't allowed in function type parameters"); |
870 | 909 |
871 /** | 910 /** |
872 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi
th the same name | 911 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi
th the same name |
873 * declared in the same scope. | 912 * declared in the same scope. |
874 */ | 913 */ |
875 static final CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = new CompileT
imeErrorCode('DUPLICATE_CONSTRUCTOR_DEFAULT', 35, "The default constructor is al
ready defined"); | 914 static final CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = new CompileT
imeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 35, "The default constructor
is already defined"); |
876 | 915 |
877 /** | 916 /** |
878 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi
th the same name | 917 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi
th the same name |
879 * declared in the same scope. | 918 * declared in the same scope. |
880 * | 919 * |
881 * @param duplicateName the name of the duplicate entity | 920 * @param duplicateName the name of the duplicate entity |
882 */ | 921 */ |
883 static final CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = new CompileTime
ErrorCode('DUPLICATE_CONSTRUCTOR_NAME', 36, "The constructor with name '%s' is a
lready defined"); | 922 static final CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = new CompileTime
ErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 36, "The constructor with name '%s'
is already defined"); |
884 | 923 |
885 /** | 924 /** |
886 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi
th the same name | 925 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi
th the same name |
887 * declared in the same scope. | 926 * declared in the same scope. |
888 * | 927 * |
889 * 7 Classes: It is a compile-time error if a class declares two members of th
e same name. | 928 * 7 Classes: It is a compile-time error if a class declares two members of th
e same name. |
890 * | 929 * |
891 * 7 Classes: It is a compile-time error if a class has an instance member and
a static member | 930 * 7 Classes: It is a compile-time error if a class has an instance member and
a static member |
892 * with the same name. | 931 * with the same name. |
893 * | 932 * |
894 * @param duplicateName the name of the duplicate entity | 933 * @param duplicateName the name of the duplicate entity |
895 */ | 934 */ |
896 static final CompileTimeErrorCode DUPLICATE_DEFINITION = new CompileTimeErrorC
ode('DUPLICATE_DEFINITION', 37, "The name '%s' is already defined"); | 935 static final CompileTimeErrorCode DUPLICATE_DEFINITION = new CompileTimeErrorC
ode.con1('DUPLICATE_DEFINITION', 37, "The name '%s' is already defined"); |
897 | 936 |
898 /** | 937 /** |
899 * 7. Classes: It is a compile-time error if a class has an instance member an
d a static member | 938 * 7. Classes: It is a compile-time error if a class has an instance member an
d a static member |
900 * with the same name. | 939 * with the same name. |
901 * | 940 * |
902 * This covers the additional duplicate definition cases where inheritance has
to be considered. | 941 * This covers the additional duplicate definition cases where inheritance has
to be considered. |
903 * | 942 * |
904 * @param className the name of the class that has conflicting instance/static
members | 943 * @param className the name of the class that has conflicting instance/static
members |
905 * @param name the name of the conflicting members | 944 * @param name the name of the conflicting members |
906 * @see #DUPLICATE_DEFINITION | 945 * @see #DUPLICATE_DEFINITION |
907 */ | 946 */ |
908 static final CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = new Compi
leTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE', 38, "The name '%s' is alread
y defined in '%s'"); | 947 static final CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = new Compi
leTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 38, "The name '%s' is a
lready defined in '%s'"); |
909 | 948 |
910 /** | 949 /** |
911 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub>
i</sub> = | 950 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub>
i</sub> = |
912 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the
label for a named | 951 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the
label for a named |
913 * argument]. | 952 * argument]. |
914 */ | 953 */ |
915 static final CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = new CompileTimeEr
rorCode('DUPLICATE_NAMED_ARGUMENT', 39, "The argument for the named parameter '%
s' was already specified"); | 954 static final CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = new CompileTimeEr
rorCode.con1('DUPLICATE_NAMED_ARGUMENT', 39, "The argument for the named paramet
er '%s' was already specified"); |
916 | 955 |
917 /** | 956 /** |
918 * SDK implementation libraries can be exported only by other SDK libraries. | 957 * SDK implementation libraries can be exported only by other SDK libraries. |
919 * | 958 * |
920 * @param uri the uri pointing to a library | 959 * @param uri the uri pointing to a library |
921 */ | 960 */ |
922 static final CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = new CompileTimeErr
orCode('EXPORT_INTERNAL_LIBRARY', 40, "The library '%s' is internal and cannot b
e exported"); | 961 static final CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = new CompileTimeErr
orCode.con1('EXPORT_INTERNAL_LIBRARY', 40, "The library '%s' is internal and can
not be exported"); |
923 | 962 |
924 /** | 963 /** |
925 * 14.2 Exports: It is a compile-time error if the compilation unit found at t
he specified URI is | 964 * 14.2 Exports: It is a compile-time error if the compilation unit found at t
he specified URI is |
926 * not a library declaration. | 965 * not a library declaration. |
927 * | 966 * |
928 * @param uri the uri pointing to a non-library declaration | 967 * @param uri the uri pointing to a non-library declaration |
929 */ | 968 */ |
930 static final CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = new CompileTimeError
Code('EXPORT_OF_NON_LIBRARY', 41, "The exported library '%s' must not have a par
t-of directive"); | 969 static final CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = new CompileTimeError
Code.con1('EXPORT_OF_NON_LIBRARY', 41, "The exported library '%s' must not have
a part-of directive"); |
931 | 970 |
932 /** | 971 /** |
933 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla
ss <i>C</i> includes | 972 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla
ss <i>C</i> includes |
934 * a type expression that does not denote a class available in the lexical sco
pe of <i>C</i>. | 973 * a type expression that does not denote a class available in the lexical sco
pe of <i>C</i>. |
935 * | 974 * |
936 * @param typeName the name of the superclass that was not found | 975 * @param typeName the name of the superclass that was not found |
937 */ | 976 */ |
938 static final CompileTimeErrorCode EXTENDS_NON_CLASS = new CompileTimeErrorCode
('EXTENDS_NON_CLASS', 42, "Classes can only extend other classes"); | 977 static final CompileTimeErrorCode EXTENDS_NON_CLASS = new CompileTimeErrorCode
.con1('EXTENDS_NON_CLASS', 42, "Classes can only extend other classes"); |
939 | 978 |
940 /** | 979 /** |
941 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i
mplement Null. | 980 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i
mplement Null. |
942 * | 981 * |
943 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement int. | 982 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement int. |
944 * | 983 * |
945 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement double. | 984 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement double. |
946 * | 985 * |
947 * 12.3 Numbers: It is a compile-time error for any type other than the types
int and double to | 986 * 12.3 Numbers: It is a compile-time error for any type other than the types
int and double to |
948 * attempt to extend or implement num. | 987 * attempt to extend or implement num. |
949 * | 988 * |
950 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
or implement bool. | 989 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
or implement bool. |
951 * | 990 * |
952 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o
r implement String. | 991 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o
r implement String. |
953 * | 992 * |
954 * @param typeName the name of the type that cannot be extended | 993 * @param typeName the name of the type that cannot be extended |
955 * @see #IMPLEMENTS_DISALLOWED_CLASS | 994 * @see #IMPLEMENTS_DISALLOWED_CLASS |
956 */ | 995 */ |
957 static final CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = new CompileTimeEr
rorCode('EXTENDS_DISALLOWED_CLASS', 43, "Classes cannot extend '%s'"); | 996 static final CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = new CompileTimeEr
rorCode.con1('EXTENDS_DISALLOWED_CLASS', 43, "Classes cannot extend '%s'"); |
958 | 997 |
959 /** | 998 /** |
960 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > | 999 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > |
961 * n</i>. | 1000 * n</i>. |
962 * | 1001 * |
963 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | 1002 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an |
964 * uncaught exception being thrown. | 1003 * uncaught exception being thrown. |
965 * | 1004 * |
966 * @param requiredCount the maximum number of positional arguments | 1005 * @param requiredCount the maximum number of positional arguments |
967 * @param argumentCount the actual number of positional arguments given | 1006 * @param argumentCount the actual number of positional arguments given |
968 */ | 1007 */ |
969 static final CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = new CompileTime
ErrorCode('EXTRA_POSITIONAL_ARGUMENTS', 44, "%d positional arguments expected, b
ut %d found"); | 1008 static final CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = new CompileTime
ErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 44, "%d positional arguments expect
ed, but %d found"); |
970 | 1009 |
971 /** | 1010 /** |
972 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile time | 1011 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile time |
973 * error if more than one initializer corresponding to a given instance variab
le appears in | 1012 * error if more than one initializer corresponding to a given instance variab
le appears in |
974 * <i>k</i>'s list. | 1013 * <i>k</i>'s list. |
975 */ | 1014 */ |
976 static final CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS =
new CompileTimeErrorCode('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 45, "The
field '%s' cannot be initialized twice in the same constructor"); | 1015 static final CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS =
new CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 45,
"The field '%s' cannot be initialized twice in the same constructor"); |
977 | 1016 |
978 /** | 1017 /** |
979 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile time | 1018 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile time |
980 * error if <i>k</i>'s initializer list contains an initializer for a variable
that is initialized | 1019 * error if <i>k</i>'s initializer list contains an initializer for a variable
that is initialized |
981 * by means of an initializing formal of <i>k</i>. | 1020 * by means of an initializing formal of <i>k</i>. |
982 */ | 1021 */ |
983 static final CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ
ER = new CompileTimeErrorCode('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER',
46, "Fields cannot be initialized in both the parameter list and the initializer
s"); | 1022 static final CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ
ER = new CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ
ER', 46, "Fields cannot be initialized in both the parameter list and the initia
lizers"); |
984 | 1023 |
985 /** | 1024 /** |
986 * 5 Variables: It is a compile-time error if a final instance variable that h
as is initialized by | 1025 * 5 Variables: It is a compile-time error if a final instance variable that h
as is initialized by |
987 * means of an initializing formal of a constructor is also initialized elsewh
ere in the same | 1026 * means of an initializing formal of a constructor is also initialized elsewh
ere in the same |
988 * constructor. | 1027 * constructor. |
989 * | 1028 * |
990 * @param name the name of the field in question | 1029 * @param name the name of the field in question |
991 */ | 1030 */ |
992 static final CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = new Compi
leTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES', 47, "'%s' is a final field a
nd so can only be set once"); | 1031 static final CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = new Compi
leTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 47, "'%s' is a final fi
eld and so can only be set once"); |
993 | 1032 |
994 /** | 1033 /** |
995 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin
g formal is used by | 1034 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin
g formal is used by |
996 * a function other than a non-redirecting generative constructor. | 1035 * a function other than a non-redirecting generative constructor. |
997 */ | 1036 */ |
998 static final CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = new
CompileTimeErrorCode('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 48, "Initializing
formal fields cannot be used in factory constructors"); | 1037 static final CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = new
CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 48, "Initiali
zing formal fields cannot be used in factory constructors"); |
999 | 1038 |
1000 /** | 1039 /** |
1001 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin
g formal is used by | 1040 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin
g formal is used by |
1002 * a function other than a non-redirecting generative constructor. | 1041 * a function other than a non-redirecting generative constructor. |
1003 */ | 1042 */ |
1004 static final CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new
CompileTimeErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 49, "Initializing
formal fields can only be used in constructors"); | 1043 static final CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = new
CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 49, "Initiali
zing formal fields can only be used in constructors"); |
1005 | 1044 |
1006 /** | 1045 /** |
1007 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
in which case its | 1046 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
in which case its |
1008 * only action is to invoke another generative constructor. | 1047 * only action is to invoke another generative constructor. |
1009 * | 1048 * |
1010 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin
g formal is used by | 1049 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin
g formal is used by |
1011 * a function other than a non-redirecting generative constructor. | 1050 * a function other than a non-redirecting generative constructor. |
1012 */ | 1051 */ |
1013 static final CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR =
new CompileTimeErrorCode('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 50, "The r
edirecting constructor cannot have a field initializer"); | 1052 static final CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR =
new CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 50, "
The redirecting constructor cannot have a field initializer"); |
1014 | 1053 |
1015 /** | 1054 /** |
1016 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same | 1055 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same |
1017 * name. | 1056 * name. |
1018 * | 1057 * |
1019 * @param name the conflicting name of the getter and method | 1058 * @param name the conflicting name of the getter and method |
1020 */ | 1059 */ |
1021 static final CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = new Compi
leTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', 51, "'%s' cannot be used to
name a getter, there is already a method with the same name"); | 1060 static final CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = new Compi
leTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 51, "'%s' cannot be use
d to name a getter, there is already a method with the same name"); |
1022 | 1061 |
1023 /** | 1062 /** |
1024 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i
mplement Null. | 1063 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i
mplement Null. |
1025 * | 1064 * |
1026 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement int. | 1065 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement int. |
1027 * | 1066 * |
1028 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement double. | 1067 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement double. |
1029 * | 1068 * |
1030 * 12.3 Numbers: It is a compile-time error for any type other than the types
int and double to | 1069 * 12.3 Numbers: It is a compile-time error for any type other than the types
int and double to |
1031 * attempt to extend or implement num. | 1070 * attempt to extend or implement num. |
1032 * | 1071 * |
1033 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
or implement bool. | 1072 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
or implement bool. |
1034 * | 1073 * |
1035 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o
r implement String. | 1074 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o
r implement String. |
1036 * | 1075 * |
1037 * @param typeName the name of the type that cannot be implemented | 1076 * @param typeName the name of the type that cannot be implemented |
1038 * @see #EXTENDS_DISALLOWED_CLASS | 1077 * @see #EXTENDS_DISALLOWED_CLASS |
1039 */ | 1078 */ |
1040 static final CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = new CompileTim
eErrorCode('IMPLEMENTS_DISALLOWED_CLASS', 52, "Classes cannot implement '%s'"); | 1079 static final CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = new CompileTim
eErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 52, "Classes cannot implement '%s
'"); |
1041 | 1080 |
1042 /** | 1081 /** |
1043 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o
f a class includes | 1082 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o
f a class includes |
1044 * type dynamic. | 1083 * type dynamic. |
1045 */ | 1084 */ |
1046 static final CompileTimeErrorCode IMPLEMENTS_DYNAMIC = new CompileTimeErrorCod
e('IMPLEMENTS_DYNAMIC', 53, "Classes cannot implement 'dynamic'"); | 1085 static final CompileTimeErrorCode IMPLEMENTS_DYNAMIC = new CompileTimeErrorCod
e.con1('IMPLEMENTS_DYNAMIC', 53, "Classes cannot implement 'dynamic'"); |
1047 | 1086 |
1048 /** | 1087 /** |
1049 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o
f a class <i>C</i> | 1088 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o
f a class <i>C</i> |
1050 * includes a type expression that does not denote a class available in the le
xical scope of | 1089 * includes a type expression that does not denote a class available in the le
xical scope of |
1051 * <i>C</i>. | 1090 * <i>C</i>. |
1052 * | 1091 * |
1053 * @param typeName the name of the interface that was not found | 1092 * @param typeName the name of the interface that was not found |
1054 */ | 1093 */ |
1055 static final CompileTimeErrorCode IMPLEMENTS_NON_CLASS = new CompileTimeErrorC
ode('IMPLEMENTS_NON_CLASS', 54, "Classes can only implement other classes"); | 1094 static final CompileTimeErrorCode IMPLEMENTS_NON_CLASS = new CompileTimeErrorC
ode.con1('IMPLEMENTS_NON_CLASS', 54, "Classes can only implement other classes")
; |
1056 | 1095 |
1057 /** | 1096 /** |
1058 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears
more than once in | 1097 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears
more than once in |
1059 * the implements clause of a class. | 1098 * the implements clause of a class. |
1060 * | 1099 * |
1061 * @param className the name of the class that is implemented more than once | 1100 * @param className the name of the class that is implemented more than once |
1062 */ | 1101 */ |
1063 static final CompileTimeErrorCode IMPLEMENTS_REPEATED = new CompileTimeErrorCo
de('IMPLEMENTS_REPEATED', 55, "'%s' can only be implemented once"); | 1102 static final CompileTimeErrorCode IMPLEMENTS_REPEATED = new CompileTimeErrorCo
de.con1('IMPLEMENTS_REPEATED', 55, "'%s' can only be implemented once"); |
1064 | 1103 |
1065 /** | 1104 /** |
1066 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla
ss <i>C</i> appears | 1105 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla
ss <i>C</i> appears |
1067 * in the implements clause of <i>C</i>. | 1106 * in the implements clause of <i>C</i>. |
1068 * | 1107 * |
1069 * @param className the name of the class that appears in both "extends" and "
implements" clauses | 1108 * @param className the name of the class that appears in both "extends" and "
implements" clauses |
1070 */ | 1109 */ |
1071 static final CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = new CompileTimeErro
rCode('IMPLEMENTS_SUPER_CLASS', 56, "'%s' cannot be used in both 'extends' and '
implements' clauses"); | 1110 static final CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = new CompileTimeErro
rCode.con1('IMPLEMENTS_SUPER_CLASS', 56, "'%s' cannot be used in both 'extends'
and 'implements' clauses"); |
1072 | 1111 |
1073 /** | 1112 /** |
1074 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the
right hand side of | 1113 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the
right hand side of |
1075 * an initializer. | 1114 * an initializer. |
1076 * | 1115 * |
1077 * 12.10 This: It is a compile-time error if this appears in a top-level funct
ion or variable | 1116 * 12.10 This: It is a compile-time error if this appears in a top-level funct
ion or variable |
1078 * initializer, in a factory constructor, or in a static method or variable in
itializer, or in the | 1117 * initializer, in a factory constructor, or in a static method or variable in
itializer, or in the |
1079 * initializer of an instance variable. | 1118 * initializer of an instance variable. |
1080 * | 1119 * |
1081 * @param name the name of the type in question | 1120 * @param name the name of the type in question |
1082 */ | 1121 */ |
1083 static final CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = new
CompileTimeErrorCode('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 57, "The 'this'
expression cannot be implicitly used in initializers"); | 1122 static final CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = new
CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 57, "The 't
his' expression cannot be implicitly used in initializers"); |
1084 | 1123 |
1085 /** | 1124 /** |
1086 * SDK implementation libraries can be imported only by other SDK libraries. | 1125 * SDK implementation libraries can be imported only by other SDK libraries. |
1087 * | 1126 * |
1088 * @param uri the uri pointing to a library | 1127 * @param uri the uri pointing to a library |
1089 */ | 1128 */ |
1090 static final CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = new CompileTimeErr
orCode('IMPORT_INTERNAL_LIBRARY', 58, "The library '%s' is internal and cannot b
e imported"); | 1129 static final CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = new CompileTimeErr
orCode.con1('IMPORT_INTERNAL_LIBRARY', 58, "The library '%s' is internal and can
not be imported"); |
1091 | 1130 |
1092 /** | 1131 /** |
1093 * 14.1 Imports: It is a compile-time error if the compilation unit found at t
he specified URI is | 1132 * 14.1 Imports: It is a compile-time error if the compilation unit found at t
he specified URI is |
1094 * not a library declaration. | 1133 * not a library declaration. |
1095 * | 1134 * |
1096 * @param uri the uri pointing to a non-library declaration | 1135 * @param uri the uri pointing to a non-library declaration |
1097 */ | 1136 */ |
1098 static final CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = new CompileTimeError
Code('IMPORT_OF_NON_LIBRARY', 59, "The imported library '%s' must not have a par
t-of directive"); | 1137 static final CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = new CompileTimeError
Code.con1('IMPORT_OF_NON_LIBRARY', 59, "The imported library '%s' must not have
a part-of directive"); |
1099 | 1138 |
1100 /** | 1139 /** |
1101 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s
ub>k</sub></i> are | 1140 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s
ub>k</sub></i> are |
1102 * not instances of the same class <i>C</i>, for all <i>1 <= k <= n</i>. | 1141 * not instances of the same class <i>C</i>, for all <i>1 <= k <= n</i>. |
1103 * | 1142 * |
1104 * @param expressionSource the expression source code that is the unexpected t
ype | 1143 * @param expressionSource the expression source code that is the unexpected t
ype |
1105 * @param expectedType the name of the expected type | 1144 * @param expectedType the name of the expected type |
1106 */ | 1145 */ |
1107 static final CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = new Com
pileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES', 60, "Case expressions mu
st have the same types, '%s' is not a %s'"); | 1146 static final CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = new Com
pileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 60, "Case expressio
ns must have the same types, '%s' is not a %s'"); |
1108 | 1147 |
1109 /** | 1148 /** |
1110 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time | 1149 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time |
1111 * error if <i>k</i>'s initializer list contains an initializer for a variable
that is not an | 1150 * error if <i>k</i>'s initializer list contains an initializer for a variable
that is not an |
1112 * instance variable declared in the immediately surrounding class. | 1151 * instance variable declared in the immediately surrounding class. |
1113 * | 1152 * |
1114 * @param id the name of the initializing formal that is not an instance varia
ble in the | 1153 * @param id the name of the initializing formal that is not an instance varia
ble in the |
1115 * immediately enclosing class | 1154 * immediately enclosing class |
1116 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD | 1155 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD |
1117 */ | 1156 */ |
1118 static final CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = new Com
pileTimeErrorCode('INITIALIZER_FOR_NON_EXISTANT_FIELD', 61, "'%s' is not a varia
ble in the enclosing class"); | 1157 static final CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = new Com
pileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTANT_FIELD', 61, "'%s' is not a
variable in the enclosing class"); |
1119 | 1158 |
1120 /** | 1159 /** |
1121 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time | 1160 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time |
1122 * error if <i>k</i>'s initializer list contains an initializer for a variable
that is not an | 1161 * error if <i>k</i>'s initializer list contains an initializer for a variable
that is not an |
1123 * instance variable declared in the immediately surrounding class. | 1162 * instance variable declared in the immediately surrounding class. |
1124 * | 1163 * |
1125 * @param id the name of the initializing formal that is a static variable in
the immediately | 1164 * @param id the name of the initializing formal that is a static variable in
the immediately |
1126 * enclosing class | 1165 * enclosing class |
1127 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD | 1166 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD |
1128 */ | 1167 */ |
1129 static final CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = new CompileTi
meErrorCode('INITIALIZER_FOR_STATIC_FIELD', 62, "'%s' is a static variable in th
e enclosing class, variables initialized in a constructor cannot be static"); | 1168 static final CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = new CompileTi
meErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 62, "'%s' is a static variable
in the enclosing class, variables initialized in a constructor cannot be static"
); |
1130 | 1169 |
1131 /** | 1170 /** |
1132 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a | 1171 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a |
1133 * compile-time error if <i>id</i> is not the name of an instance variable of
the immediately | 1172 * compile-time error if <i>id</i> is not the name of an instance variable of
the immediately |
1134 * enclosing class. | 1173 * enclosing class. |
1135 * | 1174 * |
1136 * @param id the name of the initializing formal that is not an instance varia
ble in the | 1175 * @param id the name of the initializing formal that is not an instance varia
ble in the |
1137 * immediately enclosing class | 1176 * immediately enclosing class |
1138 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD | 1177 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD |
1139 * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD | 1178 * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD |
1140 */ | 1179 */ |
1141 static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD =
new CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 63, "'%s
' is not a variable in the enclosing class"); | 1180 static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD =
new CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 63,
"'%s' is not a variable in the enclosing class"); |
1142 | 1181 |
1143 /** | 1182 /** |
1144 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a | 1183 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a |
1145 * compile-time error if <i>id</i> is not the name of an instance variable of
the immediately | 1184 * compile-time error if <i>id</i> is not the name of an instance variable of
the immediately |
1146 * enclosing class. | 1185 * enclosing class. |
1147 * | 1186 * |
1148 * @param id the name of the initializing formal that is a static variable in
the immediately | 1187 * @param id the name of the initializing formal that is a static variable in
the immediately |
1149 * enclosing class | 1188 * enclosing class |
1150 * @see #INITIALIZER_FOR_STATIC_FIELD | 1189 * @see #INITIALIZER_FOR_STATIC_FIELD |
1151 */ | 1190 */ |
1152 static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = new C
ompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 64, "'%s' is a stati
c variable in the enclosing class, variables initialized in a constructor cannot
be static"); | 1191 static final CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = new C
ompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 64, "'%s' is a
static variable in the enclosing class, variables initialized in a constructor c
annot be static"); |
1153 | 1192 |
1154 /** | 1193 /** |
1155 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr
action | 1194 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr
action |
1156 * <b>this</b>.<i>id</i>. | 1195 * <b>this</b>.<i>id</i>. |
1157 */ | 1196 */ |
1158 static final CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = new Com
pileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 65, "Instance member can
not be accessed from static method"); | 1197 static final CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = new Com
pileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 65, "Instance membe
r cannot be accessed from static method"); |
1159 | 1198 |
1160 /** | 1199 /** |
1161 * 11 Metadata: Metadata consists of a series of annotations, each of which be
gin with the | 1200 * 11 Metadata: Metadata consists of a series of annotations, each of which be
gin with the |
1162 * character @, followed by a constant expression that must be either a refere
nce to a | 1201 * character @, followed by a constant expression that must be either a refere
nce to a |
1163 * compile-time constant variable, or a call to a constant constructor. | 1202 * compile-time constant variable, or a call to a constant constructor. |
1164 */ | 1203 */ |
1165 static final CompileTimeErrorCode INVALID_ANNOTATION = new CompileTimeErrorCod
e('INVALID_ANNOTATION', 66, "Annotation can be only constant variable or constan
t constructor invocation"); | 1204 static final CompileTimeErrorCode INVALID_ANNOTATION = new CompileTimeErrorCod
e.con1('INVALID_ANNOTATION', 66, "Annotation can be only constant variable or co
nstant constructor invocation"); |
1166 | 1205 |
1167 /** | 1206 /** |
1168 * TODO(brianwilkerson) Remove this when we have decided on how to report erro
rs in compile-time | 1207 * TODO(brianwilkerson) Remove this when we have decided on how to report erro
rs in compile-time |
1169 * constants. Until then, this acts as a placeholder for more informative erro
rs. | 1208 * constants. Until then, this acts as a placeholder for more informative erro
rs. |
1170 * | 1209 * |
1171 * See TODOs in ConstantVisitor | 1210 * See TODOs in ConstantVisitor |
1172 */ | 1211 */ |
1173 static final CompileTimeErrorCode INVALID_CONSTANT = new CompileTimeErrorCode(
'INVALID_CONSTANT', 67, "Invalid constant value"); | 1212 static final CompileTimeErrorCode INVALID_CONSTANT = new CompileTimeErrorCode.
con1('INVALID_CONSTANT', 67, "Invalid constant value"); |
1174 | 1213 |
1175 /** | 1214 /** |
1176 * 7.6 Constructors: It is a compile-time error if the name of a constructor i
s not a constructor | 1215 * 7.6 Constructors: It is a compile-time error if the name of a constructor i
s not a constructor |
1177 * name. | 1216 * name. |
1178 */ | 1217 */ |
1179 static final CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = new CompileTimeEr
rorCode('INVALID_CONSTRUCTOR_NAME', 68, "Invalid constructor name"); | 1218 static final CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = new CompileTimeEr
rorCode.con1('INVALID_CONSTRUCTOR_NAME', 68, "Invalid constructor name"); |
1180 | 1219 |
1181 /** | 1220 /** |
1182 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of
the immediately | 1221 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of
the immediately |
1183 * enclosing class. | 1222 * enclosing class. |
1184 */ | 1223 */ |
1185 static final CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = new Compi
leTimeErrorCode('INVALID_FACTORY_NAME_NOT_A_CLASS', 69, "The name of the immedia
tely enclosing class expected"); | 1224 static final CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = new Compi
leTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 69, "The name of the im
mediately enclosing class expected"); |
1186 | 1225 |
1187 /** | 1226 /** |
1188 * 12.10 This: It is a compile-time error if this appears in a top-level funct
ion or variable | 1227 * 12.10 This: It is a compile-time error if this appears in a top-level funct
ion or variable |
1189 * initializer, in a factory constructor, or in a static method or variable in
itializer, or in the | 1228 * initializer, in a factory constructor, or in a static method or variable in
itializer, or in the |
1190 * initializer of an instance variable. | 1229 * initializer of an instance variable. |
1191 */ | 1230 */ |
1192 static final CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = new CompileTimeE
rrorCode('INVALID_REFERENCE_TO_THIS', 70, "Invalid reference to 'this' expressio
n"); | 1231 static final CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = new CompileTimeE
rrorCode.con1('INVALID_REFERENCE_TO_THIS', 70, "Invalid reference to 'this' expr
ession"); |
1193 | 1232 |
1194 /** | 1233 /** |
1195 * 12.6 Lists: It is a compile time error if the type argument of a constant l
ist literal includes | 1234 * 12.6 Lists: It is a compile time error if the type argument of a constant l
ist literal includes |
1196 * a type parameter. | 1235 * a type parameter. |
1197 * | 1236 * |
1198 * @name the name of the type parameter | 1237 * @name the name of the type parameter |
1199 */ | 1238 */ |
1200 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new Co
mpileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 71, "Constant list lit
erals cannot include a type parameter as a type argument, such as '%s'"); | 1239 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = new Co
mpileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 71, "Constant lis
t literals cannot include a type parameter as a type argument, such as '%s'"); |
1201 | 1240 |
1202 /** | 1241 /** |
1203 * 12.7 Maps: It is a compile time error if the type arguments of a constant m
ap literal include a | 1242 * 12.7 Maps: It is a compile time error if the type arguments of a constant m
ap literal include a |
1204 * type parameter. | 1243 * type parameter. |
1205 * | 1244 * |
1206 * @name the name of the type parameter | 1245 * @name the name of the type parameter |
1207 */ | 1246 */ |
1208 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new Com
pileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 72, "Constant map litera
ls cannot include a type parameter as a type argument, such as '%s'"); | 1247 static final CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = new Com
pileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 72, "Constant map l
iterals cannot include a type parameter as a type argument, such as '%s'"); |
1209 | 1248 |
1210 /** | 1249 /** |
1211 * 14.2 Exports: It is a compile-time error if the compilation unit found at t
he specified URI is | 1250 * 14.2 Exports: It is a compile-time error if the compilation unit found at t
he specified URI is |
1212 * not a library declaration. | 1251 * not a library declaration. |
1213 * | 1252 * |
1214 * 14.1 Imports: It is a compile-time error if the compilation unit found at t
he specified URI is | 1253 * 14.1 Imports: It is a compile-time error if the compilation unit found at t
he specified URI is |
1215 * not a library declaration. | 1254 * not a library declaration. |
1216 * | 1255 * |
1217 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
valid part | 1256 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
valid part |
1218 * declaration. | 1257 * declaration. |
1219 * | 1258 * |
1220 * @param uri the URI that is invalid | 1259 * @param uri the URI that is invalid |
1221 * @see #URI_DOES_NOT_EXIST | 1260 * @see #URI_DOES_NOT_EXIST |
1222 */ | 1261 */ |
1223 static final CompileTimeErrorCode INVALID_URI = new CompileTimeErrorCode('INVA
LID_URI', 73, "Invalid URI syntax: '%s'"); | 1262 static final CompileTimeErrorCode INVALID_URI = new CompileTimeErrorCode.con1(
'INVALID_URI', 73, "Invalid URI syntax: '%s'"); |
1224 | 1263 |
1225 /** | 1264 /** |
1226 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su
b></i> exists within | 1265 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su
b></i> exists within |
1227 * the innermost function in which <i>s<sub>b</sub></i> occurs. | 1266 * the innermost function in which <i>s<sub>b</sub></i> occurs. |
1228 * | 1267 * |
1229 * 13.14 Continue: It is a compile-time error if no such statement or case cla
use | 1268 * 13.14 Continue: It is a compile-time error if no such statement or case cla
use |
1230 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub
>c</sub></i> occurs. | 1269 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub
>c</sub></i> occurs. |
1231 * | 1270 * |
1232 * @param labelName the name of the unresolvable label | 1271 * @param labelName the name of the unresolvable label |
1233 */ | 1272 */ |
1234 static final CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = new CompileTimeErrorC
ode('LABEL_IN_OUTER_SCOPE', 74, "Cannot reference label '%s' declared in an oute
r method"); | 1273 static final CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = new CompileTimeErrorC
ode.con1('LABEL_IN_OUTER_SCOPE', 74, "Cannot reference label '%s' declared in an
outer method"); |
1235 | 1274 |
1236 /** | 1275 /** |
1237 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su
b></i> exists within | 1276 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su
b></i> exists within |
1238 * the innermost function in which <i>s<sub>b</sub></i> occurs. | 1277 * the innermost function in which <i>s<sub>b</sub></i> occurs. |
1239 * | 1278 * |
1240 * 13.14 Continue: It is a compile-time error if no such statement or case cla
use | 1279 * 13.14 Continue: It is a compile-time error if no such statement or case cla
use |
1241 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub
>c</sub></i> occurs. | 1280 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub
>c</sub></i> occurs. |
1242 * | 1281 * |
1243 * @param labelName the name of the unresolvable label | 1282 * @param labelName the name of the unresolvable label |
1244 */ | 1283 */ |
1245 static final CompileTimeErrorCode LABEL_UNDEFINED = new CompileTimeErrorCode('
LABEL_UNDEFINED', 75, "Cannot reference undefined label '%s'"); | 1284 static final CompileTimeErrorCode LABEL_UNDEFINED = new CompileTimeErrorCode.c
on1('LABEL_UNDEFINED', 75, "Cannot reference undefined label '%s'"); |
1246 | 1285 |
1247 /** | 1286 /** |
1248 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i>
... | 1287 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i>
... |
1249 * <i>e<sub>n</sub></i>] is evaluated as follows: | 1288 * <i>e<sub>n</sub></i>] is evaluated as follows: |
1250 * | 1289 * |
1251 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
second argument | 1290 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
second argument |
1252 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> | 1291 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> |
1253 * | 1292 * |
1254 * | 1293 * |
1255 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 1294 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
1256 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 1295 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
1257 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. | 1296 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. |
1258 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 1297 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
1259 * j <= m</i>. | 1298 * j <= m</i>. |
1260 */ | 1299 */ |
1261 static final CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new Compi
leTimeErrorCode('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 76, "The element type '%s' c
annot be assigned to the list type '%s'"); | 1300 static final CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new Compi
leTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 76, "The element type '
%s' cannot be assigned to the list type '%s'"); |
1262 | 1301 |
1263 /** | 1302 /** |
1264 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : | 1303 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : |
1265 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: | 1304 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: |
1266 * | 1305 * |
1267 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second | 1306 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second |
1268 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 1307 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
1269 * | 1308 * |
1270 * | 1309 * |
1271 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 1310 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
1272 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 1311 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
1273 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. | 1312 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. |
1274 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 1313 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
1275 * j <= m</i>. | 1314 * j <= m</i>. |
1276 */ | 1315 */ |
1277 static final CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new CompileTim
eErrorCode('MAP_KEY_TYPE_NOT_ASSIGNABLE', 77, "The element type '%s' cannot be a
ssigned to the map key type '%s'"); | 1316 static final CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new CompileTim
eErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 77, "The element type '%s' cannot
be assigned to the map key type '%s'"); |
1278 | 1317 |
1279 /** | 1318 /** |
1280 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : | 1319 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : |
1281 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: | 1320 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: |
1282 * | 1321 * |
1283 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second | 1322 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second |
1284 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 1323 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
1285 * | 1324 * |
1286 * | 1325 * |
1287 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 1326 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
1288 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 1327 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
1289 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. | 1328 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. |
1290 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 1329 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
1291 * j <= m</i>. | 1330 * j <= m</i>. |
1292 */ | 1331 */ |
1293 static final CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new CompileT
imeErrorCode('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 78, "The element type '%s' cannot
be assigned to the map value type '%s'"); | 1332 static final CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new CompileT
imeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 78, "The element type '%s' ca
nnot be assigned to the map value type '%s'"); |
1294 | 1333 |
1295 /** | 1334 /** |
1296 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member
with the same name | 1335 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member
with the same name |
1297 * as <i>C</i>. | 1336 * as <i>C</i>. |
1298 */ | 1337 */ |
1299 static final CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = new CompileTimeErro
rCode('MEMBER_WITH_CLASS_NAME', 79, "Class members cannot have the same name as
the enclosing class"); | 1338 static final CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = new CompileTimeErro
rCode.con1('MEMBER_WITH_CLASS_NAME', 79, "Class members cannot have the same nam
e as the enclosing class"); |
1300 | 1339 |
1301 /** | 1340 /** |
1302 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same | 1341 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
method with the same |
1303 * name. | 1342 * name. |
1304 * | 1343 * |
1305 * @param name the conflicting name of the getter and method | 1344 * @param name the conflicting name of the getter and method |
1306 */ | 1345 */ |
1307 static final CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = new Compi
leTimeErrorCode('METHOD_AND_GETTER_WITH_SAME_NAME', 80, "'%s' cannot be used to
name a method, there is already a getter with the same name"); | 1346 static final CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = new Compi
leTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 80, "'%s' cannot be use
d to name a method, there is already a getter with the same name"); |
1308 | 1347 |
1309 /** | 1348 /** |
1310 * 12.1 Constants: A constant expression is ... a constant list literal. | 1349 * 12.1 Constants: A constant expression is ... a constant list literal. |
1311 */ | 1350 */ |
1312 static final CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = new CompileT
imeErrorCode('MISSING_CONST_IN_LIST_LITERAL', 81, "List literals must be prefixe
d with 'const' when used as a constant expression"); | 1351 static final CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = new CompileT
imeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 81, "List literals must be pr
efixed with 'const' when used as a constant expression"); |
1313 | 1352 |
1314 /** | 1353 /** |
1315 * 12.1 Constants: A constant expression is ... a constant map literal. | 1354 * 12.1 Constants: A constant expression is ... a constant map literal. |
1316 */ | 1355 */ |
1317 static final CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = new CompileTi
meErrorCode('MISSING_CONST_IN_MAP_LITERAL', 82, "Map literals must be prefixed w
ith 'const' when used as a constant expression"); | 1356 static final CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = new CompileTi
meErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 82, "Map literals must be prefi
xed with 'const' when used as a constant expression"); |
1318 | 1357 |
1319 /** | 1358 /** |
1320 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici
tly declares a | 1359 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici
tly declares a |
1321 * constructor. | 1360 * constructor. |
1322 * | 1361 * |
1323 * @param typeName the name of the mixin that is invalid | 1362 * @param typeName the name of the mixin that is invalid |
1324 */ | 1363 */ |
1325 static final CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = new CompileTime
ErrorCode('MIXIN_DECLARES_CONSTRUCTOR', 83, "The class '%s' cannot be used as a
mixin because it declares a constructor"); | 1364 static final CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = new CompileTime
ErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 83, "The class '%s' cannot be used
as a mixin because it declares a constructor"); |
1326 | 1365 |
1327 /** | 1366 /** |
1328 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who
se superclass is not | 1367 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who
se superclass is not |
1329 * Object. | 1368 * Object. |
1330 * | 1369 * |
1331 * @param typeName the name of the mixin that is invalid | 1370 * @param typeName the name of the mixin that is invalid |
1332 */ | 1371 */ |
1333 static final CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = new Compile
TimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', 84, "The class '%s' cannot be us
ed as a mixin because it extends a class other than Object"); | 1372 static final CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = new Compile
TimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 84, "The class '%s' cannot
be used as a mixin because it extends a class other than Object"); |
1334 | 1373 |
1335 /** | 1374 /** |
1336 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i
mplement Null. | 1375 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i
mplement Null. |
1337 * | 1376 * |
1338 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement int. | 1377 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement int. |
1339 * | 1378 * |
1340 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement double. | 1379 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o
r implement double. |
1341 * | 1380 * |
1342 * 12.3 Numbers: It is a compile-time error for any type other than the types
int and double to | 1381 * 12.3 Numbers: It is a compile-time error for any type other than the types
int and double to |
1343 * attempt to extend or implement num. | 1382 * attempt to extend or implement num. |
1344 * | 1383 * |
1345 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
or implement bool. | 1384 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
or implement bool. |
1346 * | 1385 * |
1347 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o
r implement String. | 1386 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o
r implement String. |
1348 * | 1387 * |
1349 * @param typeName the name of the type that cannot be extended | 1388 * @param typeName the name of the type that cannot be extended |
1350 * @see #IMPLEMENTS_DISALLOWED_CLASS | 1389 * @see #IMPLEMENTS_DISALLOWED_CLASS |
1351 */ | 1390 */ |
1352 static final CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = new CompileTimeE
rrorCode('MIXIN_OF_DISALLOWED_CLASS', 85, "Classes cannot mixin '%s'"); | 1391 static final CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = new CompileTimeE
rrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 85, "Classes cannot mixin '%s'"); |
1353 | 1392 |
1354 /** | 1393 /** |
1355 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno
te a class or mixin | 1394 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno
te a class or mixin |
1356 * available in the immediately enclosing scope. | 1395 * available in the immediately enclosing scope. |
1357 */ | 1396 */ |
1358 static final CompileTimeErrorCode MIXIN_OF_NON_CLASS = new CompileTimeErrorCod
e('MIXIN_OF_NON_CLASS', 86, "Classes can only mixin other classes"); | 1397 static final CompileTimeErrorCode MIXIN_OF_NON_CLASS = new CompileTimeErrorCod
e.con1('MIXIN_OF_NON_CLASS', 86, "Classes can only mixin other classes"); |
1359 | 1398 |
1360 /** | 1399 /** |
1361 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers
to super. | 1400 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers
to super. |
1362 */ | 1401 */ |
1363 static final CompileTimeErrorCode MIXIN_REFERENCES_SUPER = new CompileTimeErro
rCode('MIXIN_REFERENCES_SUPER', 87, "The class '%s' cannot be used as a mixin be
cause it references 'super'"); | 1402 static final CompileTimeErrorCode MIXIN_REFERENCES_SUPER = new CompileTimeErro
rCode.con1('MIXIN_REFERENCES_SUPER', 87, "The class '%s' cannot be used as a mix
in because it references 'super'"); |
1364 | 1403 |
1365 /** | 1404 /** |
1366 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno
te a class available | 1405 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno
te a class available |
1367 * in the immediately enclosing scope. | 1406 * in the immediately enclosing scope. |
1368 */ | 1407 */ |
1369 static final CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = new Compil
eTimeErrorCode('MIXIN_WITH_NON_CLASS_SUPERCLASS', 88, "Mixin can only be applied
to class"); | 1408 static final CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = new Compil
eTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 88, "Mixin can only be ap
plied to class"); |
1370 | 1409 |
1371 /** | 1410 /** |
1372 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
in which case its | 1411 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
in which case its |
1373 * only action is to invoke another generative constructor. | 1412 * only action is to invoke another generative constructor. |
1374 */ | 1413 */ |
1375 static final CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS
= new CompileTimeErrorCode('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', 89,
"Constructor may have at most one 'this' redirection"); | 1414 static final CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS
= new CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS',
89, "Constructor may have at most one 'this' redirection"); |
1376 | 1415 |
1377 /** | 1416 /** |
1378 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th
en <i>k</i> may | 1417 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th
en <i>k</i> may |
1379 * include at most one superinitializer in its initializer list or a compile t
ime error occurs. | 1418 * include at most one superinitializer in its initializer list or a compile t
ime error occurs. |
1380 */ | 1419 */ |
1381 static final CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = new CompileTim
eErrorCode('MULTIPLE_SUPER_INITIALIZERS', 90, "Constructor may have at most one
'super' initializer"); | 1420 static final CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = new CompileTim
eErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 90, "Constructor may have at most
one 'super' initializer"); |
1382 | 1421 |
1383 /** | 1422 /** |
1384 * 11 Metadata: Metadata consists of a series of annotations, each of which be
gin with the | 1423 * 11 Metadata: Metadata consists of a series of annotations, each of which be
gin with the |
1385 * character @, followed by a constant expression that must be either a refere
nce to a | 1424 * character @, followed by a constant expression that must be either a refere
nce to a |
1386 * compile-time constant variable, or a call to a constant constructor. | 1425 * compile-time constant variable, or a call to a constant constructor. |
1387 */ | 1426 */ |
1388 static final CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = new Co
mpileTimeErrorCode('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 91, "Annotation creati
on must have arguments"); | 1427 static final CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = new Co
mpileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 91, "Annotation c
reation must have arguments"); |
1389 | 1428 |
1390 /** | 1429 /** |
1391 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli
cit superinitializer | 1430 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli
cit superinitializer |
1392 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li
st, unless the | 1431 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li
st, unless the |
1393 * enclosing class is class <i>Object</i>. | 1432 * enclosing class is class <i>Object</i>. |
1394 * | 1433 * |
1395 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
does not declare a | 1434 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
does not declare a |
1396 * generative constructor named <i>S</i> (respectively <i>S.id</i>) | 1435 * generative constructor named <i>S</i> (respectively <i>S.id</i>) |
1397 */ | 1436 */ |
1398 static final CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = new
CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 92, "The class '%s
' does not have a default constructor"); | 1437 static final CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = new
CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 92, "The clas
s '%s' does not have a default constructor"); |
1399 | 1438 |
1400 /** | 1439 /** |
1401 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it
implicitly has a | 1440 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it
implicitly has a |
1402 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj
ect</i>. | 1441 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj
ect</i>. |
1403 * | 1442 * |
1404 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
does not declare a | 1443 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
does not declare a |
1405 * generative constructor named <i>S</i> (respectively <i>S.id</i>) | 1444 * generative constructor named <i>S</i> (respectively <i>S.id</i>) |
1406 */ | 1445 */ |
1407 static final CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = new
CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 93, "The class '%s
' does not have a default constructor"); | 1446 static final CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = new
CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 93, "The clas
s '%s' does not have a default constructor"); |
1408 | 1447 |
1409 /** | 1448 /** |
1410 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma
p literal that has | 1449 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma
p literal that has |
1411 * no explicit type arguments appears in a place where a statement is expected
. | 1450 * no explicit type arguments appears in a place where a statement is expected
. |
1412 */ | 1451 */ |
1413 static final CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = new
CompileTimeErrorCode('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 94, "A non-constan
t map literal without type arguments cannot be used as an expression statement")
; | 1452 static final CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = new
CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 94, "A non-co
nstant map literal without type arguments cannot be used as an expression statem
ent"); |
1414 | 1453 |
1415 /** | 1454 /** |
1416 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub
>11</sub> … | 1455 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub
>11</sub> … |
1417 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> … label<sub>n1
</sub> … | 1456 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> … label<sub>n1
</sub> … |
1418 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s
ub>}</i> or the form | 1457 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s
ub>}</i> or the form |
1419 * <i>switch (e) { label<sub>11</sub> … label<sub>1j1</sub> case e<sub>
1</sub>: | 1458 * <i>switch (e) { label<sub>11</sub> … label<sub>1j1</sub> case e<sub>
1</sub>: |
1420 * s<sub>1</sub> … label<sub>n1</sub> … label<sub>njn</sub> case
e<sub>n</sub>: | 1459 * s<sub>1</sub> … label<sub>n1</sub> … label<sub>njn</sub> case
e<sub>n</sub>: |
1421 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub>
k</sub></i> are not | 1460 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub>
k</sub></i> are not |
1422 * compile-time constants, for all <i>1 <= k <= n</i>. | 1461 * compile-time constants, for all <i>1 <= k <= n</i>. |
1423 */ | 1462 */ |
1424 static final CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = new CompileTi
meErrorCode('NON_CONSTANT_CASE_EXPRESSION', 95, "Case expressions must be consta
nt"); | 1463 static final CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = new CompileTi
meErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 95, "Case expressions must be c
onstant"); |
1425 | 1464 |
1426 /** | 1465 /** |
1427 * 6.2.2 Optional Formals: It is a compile-time error if the default value of
an optional | 1466 * 6.2.2 Optional Formals: It is a compile-time error if the default value of
an optional |
1428 * parameter is not a compile-time constant. | 1467 * parameter is not a compile-time constant. |
1429 */ | 1468 */ |
1430 static final CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = new CompileTime
ErrorCode('NON_CONSTANT_DEFAULT_VALUE', 96, "Default values of an optional param
eter must be constant"); | 1469 static final CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = new CompileTime
ErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 96, "Default values of an optional
parameter must be constant"); |
1431 | 1470 |
1432 /** | 1471 /** |
1433 * 12.6 Lists: It is a compile time error if an element of a constant list lit
eral is not a | 1472 * 12.6 Lists: It is a compile time error if an element of a constant list lit
eral is not a |
1434 * compile-time constant. | 1473 * compile-time constant. |
1435 */ | 1474 */ |
1436 static final CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = new CompileTimeE
rrorCode('NON_CONSTANT_LIST_ELEMENT', 97, "'const' lists must have all constant
values"); | 1475 static final CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = new CompileTimeE
rrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 97, "'const' lists must have all cons
tant values"); |
1437 | 1476 |
1438 /** | 1477 /** |
1439 * 12.7 Maps: It is a compile time error if either a key or a value of an entr
y in a constant map | 1478 * 12.7 Maps: It is a compile time error if either a key or a value of an entr
y in a constant map |
1440 * literal is not a compile-time constant. | 1479 * literal is not a compile-time constant. |
1441 */ | 1480 */ |
1442 static final CompileTimeErrorCode NON_CONSTANT_MAP_KEY = new CompileTimeErrorC
ode('NON_CONSTANT_MAP_KEY', 98, "The keys in a map must be constant"); | 1481 static final CompileTimeErrorCode NON_CONSTANT_MAP_KEY = new CompileTimeErrorC
ode.con1('NON_CONSTANT_MAP_KEY', 98, "The keys in a map must be constant"); |
1443 | 1482 |
1444 /** | 1483 /** |
1445 * 12.7 Maps: It is a compile time error if either a key or a value of an entr
y in a constant map | 1484 * 12.7 Maps: It is a compile time error if either a key or a value of an entr
y in a constant map |
1446 * literal is not a compile-time constant. | 1485 * literal is not a compile-time constant. |
1447 */ | 1486 */ |
1448 static final CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = new CompileTimeErro
rCode('NON_CONSTANT_MAP_VALUE', 99, "The values in a 'const' map must be constan
t"); | 1487 static final CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = new CompileTimeErro
rCode.con1('NON_CONSTANT_MAP_VALUE', 99, "The values in a 'const' map must be co
nstant"); |
1449 | 1488 |
1450 /** | 1489 /** |
1451 * 11 Metadata: Metadata consists of a series of annotations, each of which be
gin with the | 1490 * 11 Metadata: Metadata consists of a series of annotations, each of which be
gin with the |
1452 * character @, followed by a constant expression that must be either a refere
nce to a | 1491 * character @, followed by a constant expression that must be either a refere
nce to a |
1453 * compile-time constant variable, or a call to a constant constructor. | 1492 * compile-time constant variable, or a call to a constant constructor. |
1454 */ | 1493 */ |
1455 static final CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = new Co
mpileTimeErrorCode('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 100, "Annotation creat
ion can use only 'const' constructor"); | 1494 static final CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = new Co
mpileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 100, "Annotation
creation can use only 'const' constructor"); |
1456 | 1495 |
1457 /** | 1496 /** |
1458 * 7.6.3 Constant Constructors: Any expression that appears within the initial
izer list of a | 1497 * 7.6.3 Constant Constructors: Any expression that appears within the initial
izer list of a |
1459 * constant constructor must be a potentially constant expression, or a compil
e-time error occurs. | 1498 * constant constructor must be a potentially constant expression, or a compil
e-time error occurs. |
1460 */ | 1499 */ |
1461 static final CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = new Comp
ileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', 101, "Initializer expressi
ons in constant constructors must be constants"); | 1500 static final CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = new Comp
ileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 101, "Initializer exp
ressions in constant constructors must be constants"); |
1462 | 1501 |
1463 /** | 1502 /** |
1464 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i>
or if <i>m > n</i>. | 1503 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i>
or if <i>m > n</i>. |
1465 * | 1504 * |
1466 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | 1505 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an |
1467 * uncaught exception being thrown. | 1506 * uncaught exception being thrown. |
1468 * | 1507 * |
1469 * @param requiredCount the expected number of required arguments | 1508 * @param requiredCount the expected number of required arguments |
1470 * @param argumentCount the actual number of positional arguments given | 1509 * @param argumentCount the actual number of positional arguments given |
1471 */ | 1510 */ |
1472 static final CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new CompileT
imeErrorCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', 102, "%d required argument(s) expe
cted, but %d found"); | 1511 static final CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new CompileT
imeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 102, "%d required argument(s)
expected, but %d found"); |
1473 | 1512 |
1474 /** | 1513 /** |
1475 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super
initializer appears | 1514 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super
initializer appears |
1476 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ
e constructor. It is | 1515 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ
e constructor. It is |
1477 * a compile-time error if class <i>S</i> does not declare a generative constr
uctor named <i>S</i> | 1516 * a compile-time error if class <i>S</i> does not declare a generative constr
uctor named <i>S</i> |
1478 * (respectively <i>S.id</i>) | 1517 * (respectively <i>S.id</i>) |
1479 */ | 1518 */ |
1480 static final CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = new CompileTime
ErrorCode('NON_GENERATIVE_CONSTRUCTOR', 103, "The generative constructor '%s' ex
pected, but factory found"); | 1519 static final CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = new CompileTime
ErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 103, "The generative constructor '%
s' expected, but factory found"); |
1481 | 1520 |
1482 /** | 1521 /** |
1483 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f
or class Object. | 1522 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f
or class Object. |
1484 */ | 1523 */ |
1485 static final CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = new Com
pileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 104, ""); | 1524 static final CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = new Com
pileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 104, ""); |
1486 | 1525 |
1487 /** | 1526 /** |
1488 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete
r in an operator. | 1527 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete
r in an operator. |
1489 */ | 1528 */ |
1490 static final CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = new Compile
TimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', 105, "Optional parameters are no
t allowed when defining an operator"); | 1529 static final CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = new Compile
TimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 105, "Optional parameters a
re not allowed when defining an operator"); |
1491 | 1530 |
1492 /** | 1531 /** |
1493 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
valid part | 1532 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
valid part |
1494 * declaration. | 1533 * declaration. |
1495 * | 1534 * |
1496 * @param uri the uri pointing to a non-library declaration | 1535 * @param uri the uri pointing to a non-library declaration |
1497 */ | 1536 */ |
1498 static final CompileTimeErrorCode PART_OF_NON_PART = new CompileTimeErrorCode(
'PART_OF_NON_PART', 106, "The included part '%s' must have a part-of directive")
; | 1537 static final CompileTimeErrorCode PART_OF_NON_PART = new CompileTimeErrorCode.
con1('PART_OF_NON_PART', 106, "The included part '%s' must have a part-of direct
ive"); |
1499 | 1538 |
1500 /** | 1539 /** |
1501 * 14.1 Imports: It is a compile-time error if the current library declares a
top-level member | 1540 * 14.1 Imports: It is a compile-time error if the current library declares a
top-level member |
1502 * named <i>p</i>. | 1541 * named <i>p</i>. |
1503 */ | 1542 */ |
1504 static final CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = new
CompileTimeErrorCode('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 107, "The name '%s
' is already used as an import prefix and cannot be used to name a top-level ele
ment"); | 1543 static final CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = new
CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 107, "The nam
e '%s' is already used as an import prefix and cannot be used to name a top-leve
l element"); |
1505 | 1544 |
1506 /** | 1545 /** |
1507 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o
ptional parameter | 1546 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o
ptional parameter |
1508 * begins with an '_' character. | 1547 * begins with an '_' character. |
1509 */ | 1548 */ |
1510 static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTime
ErrorCode('PRIVATE_OPTIONAL_PARAMETER', 108, "Named optional parameters cannot s
tart with an underscore"); | 1549 static final CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = new CompileTime
ErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 108, "Named optional parameters can
not start with an underscore"); |
1511 | 1550 |
1512 /** | 1551 /** |
1513 * 12.1 Constants: It is a compile-time error if the value of a compile-time c
onstant expression | 1552 * 12.1 Constants: It is a compile-time error if the value of a compile-time c
onstant expression |
1514 * depends on itself. | 1553 * depends on itself. |
1515 */ | 1554 */ |
1516 static final CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = new Compil
eTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT', 109, ""); | 1555 static final CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = new Compil
eTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 109, ""); |
1517 | 1556 |
1518 /** | 1557 /** |
1519 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
in which case its | 1558 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
in which case its |
1520 * only action is to invoke another generative constructor. | 1559 * only action is to invoke another generative constructor. |
1521 * | 1560 * |
1522 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti
me error" in | 1561 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti
me error" in |
1523 * specification. But it was added to the co19 and there is same error for fac
tories. | 1562 * specification. But it was added to the co19 and there is same error for fac
tories. |
1524 * | 1563 * |
1525 * https://code.google.com/p/dart/issues/detail?id=954 | 1564 * https://code.google.com/p/dart/issues/detail?id=954 |
1526 */ | 1565 */ |
1527 static final CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = new Compile
TimeErrorCode('RECURSIVE_CONSTRUCTOR_REDIRECT', 110, "Cycle in redirecting gener
ative constructors"); | 1566 static final CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = new Compile
TimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 110, "Cycle in redirecting
generative constructors"); |
1528 | 1567 |
1529 /** | 1568 /** |
1530 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr
uctor redirects to | 1569 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr
uctor redirects to |
1531 * itself, either directly or indirectly via a sequence of redirections. | 1570 * itself, either directly or indirectly via a sequence of redirections. |
1532 */ | 1571 */ |
1533 static final CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = new CompileTime
ErrorCode('RECURSIVE_FACTORY_REDIRECT', 111, "Cycle in redirecting factory const
ructors"); | 1572 static final CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = new CompileTime
ErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 111, "Cycle in redirecting factory
constructors"); |
1534 | 1573 |
1535 /** | 1574 /** |
1536 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas
s <i>C</i> is a | 1575 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas
s <i>C</i> is a |
1537 * superinterface of itself. | 1576 * superinterface of itself. |
1538 * | 1577 * |
1539 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi
nterface of itself. | 1578 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi
nterface of itself. |
1540 * | 1579 * |
1541 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super
class of itself. | 1580 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super
class of itself. |
1542 * | 1581 * |
1543 * @param className the name of the class that implements itself recursively | 1582 * @param className the name of the class that implements itself recursively |
1544 * @param strImplementsPath a string representation of the implements loop | 1583 * @param strImplementsPath a string representation of the implements loop |
1545 */ | 1584 */ |
1546 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = new Compil
eTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE', 112, "'%s' cannot be a superin
terface of itself: %s"); | 1585 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = new Compil
eTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 112, "'%s' cannot be a su
perinterface of itself: %s"); |
1547 | 1586 |
1548 /** | 1587 /** |
1549 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas
s <i>C</i> is a | 1588 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas
s <i>C</i> is a |
1550 * superinterface of itself. | 1589 * superinterface of itself. |
1551 * | 1590 * |
1552 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi
nterface of itself. | 1591 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi
nterface of itself. |
1553 * | 1592 * |
1554 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super
class of itself. | 1593 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super
class of itself. |
1555 * | 1594 * |
1556 * @param className the name of the class that implements itself recursively | 1595 * @param className the name of the class that implements itself recursively |
1557 */ | 1596 */ |
1558 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX
TENDS = new CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTE
NDS', 113, "'%s' cannot extend itself"); | 1597 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX
TENDS = new CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE
_EXTENDS', 113, "'%s' cannot extend itself"); |
1559 | 1598 |
1560 /** | 1599 /** |
1561 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas
s <i>C</i> is a | 1600 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas
s <i>C</i> is a |
1562 * superinterface of itself. | 1601 * superinterface of itself. |
1563 * | 1602 * |
1564 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi
nterface of itself. | 1603 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi
nterface of itself. |
1565 * | 1604 * |
1566 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super
class of itself. | 1605 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super
class of itself. |
1567 * | 1606 * |
1568 * @param className the name of the class that implements itself recursively | 1607 * @param className the name of the class that implements itself recursively |
1569 */ | 1608 */ |
1570 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM
PLEMENTS = new CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_I
MPLEMENTS', 114, "'%s' cannot implement itself"); | 1609 static final CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM
PLEMENTS = new CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_C
ASE_IMPLEMENTS', 114, "'%s' cannot implement itself"); |
1571 | 1610 |
1572 /** | 1611 /** |
1573 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th
e const modifier but | 1612 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th
e const modifier but |
1574 * <i>k'</i> is not a constant constructor. | 1613 * <i>k'</i> is not a constant constructor. |
1575 */ | 1614 */ |
1576 static final CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = new Comp
ileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 115, "Constant factory con
structor cannot delegate to a non-constant constructor"); | 1615 static final CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = new Comp
ileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 115, "Constant factor
y constructor cannot delegate to a non-constant constructor"); |
1577 | 1616 |
1578 /** | 1617 /** |
1579 * 13.3 Local Variable Declaration: It is a compile-time error if <i>e</i> ref
ers to the name | 1618 * 13.3 Local Variable Declaration: It is a compile-time error if <i>e</i> ref
ers to the name |
1580 * <i>v</i> or the name <i>v=</i>. | 1619 * <i>v</i> or the name <i>v=</i>. |
1581 */ | 1620 */ |
1582 static final CompileTimeErrorCode REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZE
R = new CompileTimeErrorCode('REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER', 11
6, "The name '%s' cannot be referenced in the initializer of a variable with the
same name"); | 1621 static final CompileTimeErrorCode REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZE
R = new CompileTimeErrorCode.con1('REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER
', 116, "The name '%s' cannot be referenced in the initializer of a variable wit
h the same name"); |
1583 | 1622 |
1584 /** | 1623 /** |
1585 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i>
rethrow;</i> is not | 1624 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i>
rethrow;</i> is not |
1586 * enclosed within a on-catch clause. | 1625 * enclosed within a on-catch clause. |
1587 */ | 1626 */ |
1588 static final CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = new CompileTimeError
Code('RETHROW_OUTSIDE_CATCH', 117, "rethrow must be inside of a catch clause"); | 1627 static final CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = new CompileTimeError
Code.con1('RETHROW_OUTSIDE_CATCH', 117, "rethrow must be inside of a catch claus
e"); |
1589 | 1628 |
1590 /** | 1629 /** |
1591 * 13.11 Return: It is a compile-time error if a return statement of the form
<i>return e;</i> | 1630 * 13.11 Return: It is a compile-time error if a return statement of the form
<i>return e;</i> |
1592 * appears in a generative constructor. | 1631 * appears in a generative constructor. |
1593 */ | 1632 */ |
1594 static final CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = new Compi
leTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', 118, "Constructors cannot re
turn a value"); | 1633 static final CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = new Compi
leTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 118, "Constructors cann
ot return a value"); |
1595 | 1634 |
1596 /** | 1635 /** |
1597 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | 1636 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form |
1598 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … | 1637 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … |
1599 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe
r method invocation | 1638 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe
r method invocation |
1600 * occurs in a top-level function or variable initializer, in an instance vari
able initializer or | 1639 * occurs in a top-level function or variable initializer, in an instance vari
able initializer or |
1601 * initializer list, in class Object, in a factory constructor, or in a static
method or variable | 1640 * initializer list, in class Object, in a factory constructor, or in a static
method or variable |
1602 * initializer. | 1641 * initializer. |
1603 */ | 1642 */ |
1604 static final CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = new CompileTimeEr
rorCode('SUPER_IN_INVALID_CONTEXT', 119, "Invalid context for 'super' invocation
"); | 1643 static final CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = new CompileTimeEr
rorCode.con1('SUPER_IN_INVALID_CONTEXT', 119, "Invalid context for 'super' invoc
ation"); |
1605 | 1644 |
1606 /** | 1645 /** |
1607 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
in which case its | 1646 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
in which case its |
1608 * only action is to invoke another generative constructor. | 1647 * only action is to invoke another generative constructor. |
1609 */ | 1648 */ |
1610 static final CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = new Compi
leTimeErrorCode('SUPER_IN_REDIRECTING_CONSTRUCTOR', 120, "The redirecting constr
uctor cannot have a 'super' initializer"); | 1649 static final CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = new Compi
leTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 120, "The redirecting c
onstructor cannot have a 'super' initializer"); |
1611 | 1650 |
1612 /** | 1651 /** |
1613 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time | 1652 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
is a compile-time |
1614 * error if a generative constructor of class Object includes a superinitializ
er. | 1653 * error if a generative constructor of class Object includes a superinitializ
er. |
1615 */ | 1654 */ |
1616 static final CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = new CompileTim
eErrorCode('SUPER_INITIALIZER_IN_OBJECT', 121, ""); | 1655 static final CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = new CompileTim
eErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 121, ""); |
1617 | 1656 |
1618 /** | 1657 /** |
1619 * 12.11 Instance Creation: It is a static type warning if any of the type arg
uments to a | 1658 * 12.11 Instance Creation: It is a static type warning if any of the type arg
uments to a |
1620 * constructor of a generic type <i>G</i> invoked by a new expression or a con
stant object | 1659 * constructor of a generic type <i>G</i> invoked by a new expression or a con
stant object |
1621 * expression are not subtypes of the bounds of the corresponding formal type
parameters of | 1660 * expression are not subtypes of the bounds of the corresponding formal type
parameters of |
1622 * <i>G</i>. | 1661 * <i>G</i>. |
1623 * | 1662 * |
1624 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if
T is mal-bounded a | 1663 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if
T is mal-bounded a |
1625 * dynamic error occurs. | 1664 * dynamic error occurs. |
1626 * | 1665 * |
1627 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
constant would raise | 1666 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
constant would raise |
1628 * an exception. | 1667 * an exception. |
1629 * | 1668 * |
1630 * @param boundedTypeName the name of the type used in the instance creation t
hat should be | 1669 * @param boundedTypeName the name of the type used in the instance creation t
hat should be |
1631 * limited by the bound as specified in the class declaration | 1670 * limited by the bound as specified in the class declaration |
1632 * @param boundingTypeName the name of the bounding type | 1671 * @param boundingTypeName the name of the bounding type |
1633 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS | 1672 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS |
1634 */ | 1673 */ |
1635 static final CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new Comp
ileTimeErrorCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 122, "'%s' does not extend
'%s'"); | 1674 static final CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new Comp
ileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 122, "'%s' does not e
xtend '%s'"); |
1636 | 1675 |
1637 /** | 1676 /** |
1638 * 15.3.1 Typedef: It is a compile-time error if a typedef refers to itself vi
a a chain of | 1677 * 15.3.1 Typedef: It is a compile-time error if a typedef refers to itself vi
a a chain of |
1639 * references that does not include a class declaration. | 1678 * references that does not include a class declaration. |
1640 */ | 1679 */ |
1641 static final CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = new Com
pileTimeErrorCode('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 123, "Type alias can ref
erence itself only via the bounds of its generic parameters"); | 1680 static final CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = new Com
pileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 123, "Type alias ca
n reference itself only via the bounds of its generic parameters"); |
1642 | 1681 |
1643 /** | 1682 /** |
1644 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access
ible in the current | 1683 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access
ible in the current |
1645 * scope, optionally followed by type arguments. | 1684 * scope, optionally followed by type arguments. |
1646 */ | 1685 */ |
1647 static final CompileTimeErrorCode UNDEFINED_CLASS = new CompileTimeErrorCode('
UNDEFINED_CLASS', 124, "Undefined class '%s'"); | 1686 static final CompileTimeErrorCode UNDEFINED_CLASS = new CompileTimeErrorCode.c
on1('UNDEFINED_CLASS', 124, "Undefined class '%s'"); |
1648 | 1687 |
1649 /** | 1688 /** |
1650 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super
initializer appears | 1689 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super
initializer appears |
1651 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ
e constructor. It is | 1690 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ
e constructor. It is |
1652 * a compile-time error if class <i>S</i> does not declare a generative constr
uctor named <i>S</i> | 1691 * a compile-time error if class <i>S</i> does not declare a generative constr
uctor named <i>S</i> |
1653 * (respectively <i>S.id</i>) | 1692 * (respectively <i>S.id</i>) |
1654 */ | 1693 */ |
1655 static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new C
ompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 125, "The class '%s'
does not have a generative constructor '%s'"); | 1694 static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new C
ompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 125, "The class
'%s' does not have a generative constructor '%s'"); |
1656 | 1695 |
1657 /** | 1696 /** |
1658 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super
initializer appears | 1697 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super
initializer appears |
1659 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ
e constructor. It is | 1698 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ
e constructor. It is |
1660 * a compile-time error if class <i>S</i> does not declare a generative constr
uctor named <i>S</i> | 1699 * a compile-time error if class <i>S</i> does not declare a generative constr
uctor named <i>S</i> |
1661 * (respectively <i>S.id</i>) | 1700 * (respectively <i>S.id</i>) |
1662 */ | 1701 */ |
1663 static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT
= new CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', 126,
"The class '%s' does not have a default generative constructor"); | 1702 static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT
= new CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT',
126, "The class '%s' does not have a default generative constructor"); |
1664 | 1703 |
1665 /** | 1704 /** |
1666 * 12.14.3 Unqualified Invocation: If there exists a lexically visible declara
tion named | 1705 * 12.14.3 Unqualified Invocation: If there exists a lexically visible declara
tion named |
1667 * <i>id</i>, let <i>f<sub>id</sub></i> be the innermost such declaration. The
n: [skip]. | 1706 * <i>id</i>, let <i>f<sub>id</sub></i> be the innermost such declaration. The
n: [skip]. |
1668 * Otherwise, <i>i</i> is equivalent to <b>this</b>.<i>id</i>(<i>a<sub>1</sub>
</i>; ... | 1707 * Otherwise, <i>i</i> is equivalent to <b>this</b>.<i>id</i>(<i>a<sub>1</sub>
</i>; ... |
1669 * <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>). | 1708 * <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>). |
1670 * | 1709 * |
1671 * @param methodName the name of the method that is undefined | 1710 * @param methodName the name of the method that is undefined |
1672 */ | 1711 */ |
1673 static final CompileTimeErrorCode UNDEFINED_FUNCTION = new CompileTimeErrorCod
e('UNDEFINED_FUNCTION', 127, "The function '%s' is not defined"); | 1712 static final CompileTimeErrorCode UNDEFINED_FUNCTION = new CompileTimeErrorCod
e.con1('UNDEFINED_FUNCTION', 127, "The function '%s' is not defined"); |
1674 | 1713 |
1675 /** | 1714 /** |
1676 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
<i>1<=i<=l</i>, | 1715 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
<i>1<=i<=l</i>, |
1677 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i
> ... | 1716 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i
> ... |
1678 * <i>p<sub>n+k</sub></i>} or a static warning occurs. | 1717 * <i>p<sub>n+k</sub></i>} or a static warning occurs. |
1679 * | 1718 * |
1680 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an | 1719 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec
t results in an |
1681 * uncaught exception being thrown. | 1720 * uncaught exception being thrown. |
1682 * | 1721 * |
1683 * @param name the name of the requested named parameter | 1722 * @param name the name of the requested named parameter |
1684 */ | 1723 */ |
1685 static final CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = new CompileTimeE
rrorCode('UNDEFINED_NAMED_PARAMETER', 128, "The named parameter '%s' is not defi
ned"); | 1724 static final CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = new CompileTimeE
rrorCode.con1('UNDEFINED_NAMED_PARAMETER', 128, "The named parameter '%s' is not
defined"); |
1686 | 1725 |
1687 /** | 1726 /** |
1688 * 14.2 Exports: It is a compile-time error if the compilation unit found at t
he specified URI is | 1727 * 14.2 Exports: It is a compile-time error if the compilation unit found at t
he specified URI is |
1689 * not a library declaration. | 1728 * not a library declaration. |
1690 * | 1729 * |
1691 * 14.1 Imports: It is a compile-time error if the compilation unit found at t
he specified URI is | 1730 * 14.1 Imports: It is a compile-time error if the compilation unit found at t
he specified URI is |
1692 * not a library declaration. | 1731 * not a library declaration. |
1693 * | 1732 * |
1694 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
valid part | 1733 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
valid part |
1695 * declaration. | 1734 * declaration. |
1696 * | 1735 * |
1697 * @param uri the URI pointing to a non-existent file | 1736 * @param uri the URI pointing to a non-existent file |
1698 * @see #INVALID_URI | 1737 * @see #INVALID_URI |
1699 */ | 1738 */ |
1700 static final CompileTimeErrorCode URI_DOES_NOT_EXIST = new CompileTimeErrorCod
e('URI_DOES_NOT_EXIST', 129, "Target of URI does not exist: '%s'"); | 1739 static final CompileTimeErrorCode URI_DOES_NOT_EXIST = new CompileTimeErrorCod
e.con1('URI_DOES_NOT_EXIST', 129, "Target of URI does not exist: '%s'"); |
1701 | 1740 |
1702 /** | 1741 /** |
1703 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time
constant, or if | 1742 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time
constant, or if |
1704 * <i>x</i> involves string interpolation. | 1743 * <i>x</i> involves string interpolation. |
1705 * | 1744 * |
1706 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co
nstant, or if | 1745 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co
nstant, or if |
1707 * <i>s</i> involves string interpolation. | 1746 * <i>s</i> involves string interpolation. |
1708 * | 1747 * |
1709 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d
escribes a URI is | 1748 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d
escribes a URI is |
1710 * not a compile-time constant, or if <i>x</i> involves string interpolation. | 1749 * not a compile-time constant, or if <i>x</i> involves string interpolation. |
1711 */ | 1750 */ |
1712 static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErro
rCode('URI_WITH_INTERPOLATION', 130, "URIs cannot use string interpolation"); | 1751 static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErro
rCode.con1('URI_WITH_INTERPOLATION', 130, "URIs cannot use string interpolation"
); |
1713 | 1752 |
1714 /** | 1753 /** |
1715 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar
ed operator []= is | 1754 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar
ed operator []= is |
1716 * not 2. It is a compile time error if the arity of a user-declared operator
with one of the | 1755 * not 2. It is a compile time error if the arity of a user-declared operator
with one of the |
1717 * names: <, >, <=, >=, ==, +, /, ~/, *, %, |, ^, &, <<, >
;>, [] is not 1. | 1756 * names: <, >, <=, >=, ==, +, /, ~/, *, %, |, ^, &, <<, >
;>, [] is not 1. |
1718 * It is a compile time error if the arity of the user-declared operator - is
not 0 or 1. It is a | 1757 * It is a compile time error if the arity of the user-declared operator - is
not 0 or 1. It is a |
1719 * compile time error if the arity of the user-declared operator ~ is not 0. | 1758 * compile time error if the arity of the user-declared operator ~ is not 0. |
1720 * | 1759 * |
1721 * @param operatorName the name of the declared operator | 1760 * @param operatorName the name of the declared operator |
1722 * @param expectedNumberOfParameters the number of parameters expected | 1761 * @param expectedNumberOfParameters the number of parameters expected |
1723 * @param actualNumberOfParameters the number of parameters found in the opera
tor declaration | 1762 * @param actualNumberOfParameters the number of parameters found in the opera
tor declaration |
1724 */ | 1763 */ |
1725 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = ne
w CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 131, "Operator
'%s' should declare exactly %d parameter(s), but %d found"); | 1764 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = ne
w CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 131, "Ope
rator '%s' should declare exactly %d parameter(s), but %d found"); |
1726 | 1765 |
1727 /** | 1766 /** |
1728 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar
ed operator - is not | 1767 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar
ed operator - is not |
1729 * 0 or 1. | 1768 * 0 or 1. |
1730 * | 1769 * |
1731 * @param actualNumberOfParameters the number of parameters found in the opera
tor declaration | 1770 * @param actualNumberOfParameters the number of parameters found in the opera
tor declaration |
1732 */ | 1771 */ |
1733 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU
S = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', 13
2, "Operator '-' should declare 0 or 1 parameter, but %d found"); | 1772 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU
S = new CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS
', 132, "Operator '-' should declare 0 or 1 parameter, but %d found"); |
1734 | 1773 |
1735 /** | 1774 /** |
1736 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
does not include | 1775 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
does not include |
1737 * exactly one required formal parameter <i>p</i>. | 1776 * exactly one required formal parameter <i>p</i>. |
1738 */ | 1777 */ |
1739 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new
CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 133, "Setters shou
ld declare exactly one required parameter"); | 1778 static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new
CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 133, "Setters
should declare exactly one required parameter"); |
1740 static final List<CompileTimeErrorCode> values = [ | 1779 static final List<CompileTimeErrorCode> values = [ |
1741 AMBIGUOUS_EXPORT, | 1780 AMBIGUOUS_EXPORT, |
1742 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, | 1781 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, |
1743 ARGUMENT_TYPE_NOT_ASSIGNABLE, | 1782 ARGUMENT_TYPE_NOT_ASSIGNABLE, |
1744 BUILT_IN_IDENTIFIER_AS_TYPE, | 1783 BUILT_IN_IDENTIFIER_AS_TYPE, |
1745 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, | 1784 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, |
1746 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, | 1785 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, |
1747 BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME, | 1786 BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME, |
1748 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, | 1787 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, |
1749 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, | 1788 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1866 UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, | 1905 UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, |
1867 UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, | 1906 UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, |
1868 UNDEFINED_FUNCTION, | 1907 UNDEFINED_FUNCTION, |
1869 UNDEFINED_NAMED_PARAMETER, | 1908 UNDEFINED_NAMED_PARAMETER, |
1870 URI_DOES_NOT_EXIST, | 1909 URI_DOES_NOT_EXIST, |
1871 URI_WITH_INTERPOLATION, | 1910 URI_WITH_INTERPOLATION, |
1872 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, | 1911 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, |
1873 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, | 1912 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, |
1874 WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]; | 1913 WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER]; |
1875 | 1914 |
1876 /// The name of this enum constant, as declared in the enum declaration. | 1915 /** |
1877 final String name; | 1916 * The template used to create the message to be displayed for this error. |
1878 | 1917 */ |
1879 /// The position in the enum declaration. | 1918 String _message; |
1880 final int ordinal; | |
1881 | 1919 |
1882 /** | 1920 /** |
1883 * The message template used to create the message to be displayed for this er
ror. | 1921 * The template used to create the correction to be displayed for this error,
or `null` if |
| 1922 * there is no correction information for this error. |
1884 */ | 1923 */ |
1885 String _message; | 1924 String correction2; |
1886 | 1925 |
1887 /** | 1926 /** |
1888 * Initialize a newly created error code to have the given message. | 1927 * Initialize a newly created error code to have the given message. |
1889 * | 1928 * |
1890 * @param message the message template used to create the message to be displa
yed for the error | 1929 * @param message the message template used to create the message to be displa
yed for the error |
1891 */ | 1930 */ |
1892 CompileTimeErrorCode(this.name, this.ordinal, String message) { | 1931 CompileTimeErrorCode.con1(String name, int ordinal, String message) : super(na
me, ordinal) { |
1893 this._message = message; | 1932 this._message = message; |
1894 } | 1933 } |
| 1934 |
| 1935 /** |
| 1936 * Initialize a newly created error code to have the given message and correct
ion. |
| 1937 * |
| 1938 * @param message the template used to create the message to be displayed for
the error |
| 1939 * @param correction the template used to create the correction to be displaye
d for the error |
| 1940 */ |
| 1941 CompileTimeErrorCode.con2(String name, int ordinal, String message, String cor
rection) : super(name, ordinal) { |
| 1942 this._message = message; |
| 1943 this.correction2 = correction; |
| 1944 } |
| 1945 String get correction => correction2; |
1895 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; | 1946 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; |
1896 String get message => _message; | 1947 String get message => _message; |
1897 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; | 1948 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; |
1898 int compareTo(CompileTimeErrorCode other) => ordinal - other.ordinal; | |
1899 int get hashCode => ordinal; | |
1900 String toString() => name; | |
1901 } | 1949 } |
1902 /** | 1950 /** |
1903 * The enumeration `PubSuggestionCode` defines the suggestions used for reportin
g deviations | 1951 * The enumeration `PubSuggestionCode` defines the suggestions used for reportin
g deviations |
1904 * from pub best practices. The convention for this class is for the name of the
bad practice to | 1952 * from pub best practices. The convention for this class is for the name of the
bad practice to |
1905 * indicate the problem that caused the suggestion to be generated and for the m
essage to explain | 1953 * indicate the problem that caused the suggestion to be generated and for the m
essage to explain |
1906 * what is wrong and, when appropriate, how the situation can be corrected. | 1954 * what is wrong and, when appropriate, how the situation can be corrected. |
1907 */ | 1955 */ |
1908 class PubSuggestionCode implements Enum<PubSuggestionCode>, ErrorCode { | 1956 class PubSuggestionCode extends Enum<PubSuggestionCode> implements ErrorCode { |
1909 | 1957 |
1910 /** | 1958 /** |
1911 * It is a bad practice for a source file in a package "lib" directory hierarc
hy to traverse | 1959 * It is a bad practice for a source file in a package "lib" directory hierarc
hy to traverse |
1912 * outside that directory hierarchy. For example, a source file in the "lib" d
irectory should not | 1960 * outside that directory hierarchy. For example, a source file in the "lib" d
irectory should not |
1913 * contain a directive such as `import '../web/some.dart'` which references a
file outside | 1961 * contain a directive such as `import '../web/some.dart'` which references a
file outside |
1914 * the lib directory. | 1962 * the lib directory. |
1915 */ | 1963 */ |
1916 static final PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE
= new PubSuggestionCode('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 0, "A
file in the 'lib' directory hierarchy should not reference a file outside that h
ierarchy"); | 1964 static final PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE
= new PubSuggestionCode.con1('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 0
, "A file in the 'lib' directory hierarchy should not reference a file outside t
hat hierarchy"); |
1917 | 1965 |
1918 /** | 1966 /** |
1919 * It is a bad practice for a source file ouside a package "lib" directory hie
rarchy to traverse | 1967 * It is a bad practice for a source file ouside a package "lib" directory hie
rarchy to traverse |
1920 * into that directory hierarchy. For example, a source file in the "web" dire
ctory should not | 1968 * into that directory hierarchy. For example, a source file in the "web" dire
ctory should not |
1921 * contain a directive such as `import '../lib/some.dart'` which references a
file inside | 1969 * contain a directive such as `import '../lib/some.dart'` which references a
file inside |
1922 * the lib directory. | 1970 * the lib directory. |
1923 */ | 1971 */ |
1924 static final PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE
= new PubSuggestionCode('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 1, "A
file outside the 'lib' directory hierarchy should not reference a file inside th
at hierarchy. Use a package: reference instead."); | 1972 static final PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE
= new PubSuggestionCode.con1('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 1
, "A file outside the 'lib' directory hierarchy should not reference a file insi
de that hierarchy. Use a package: reference instead."); |
1925 | 1973 |
1926 /** | 1974 /** |
1927 * It is a bad practice for a package import to reference anything outside the
given package, or | 1975 * It is a bad practice for a package import to reference anything outside the
given package, or |
1928 * more generally, it is bad practice for a package import to contain a "..".
For example, a | 1976 * more generally, it is bad practice for a package import to contain a "..".
For example, a |
1929 * source file should not contain a directive such as `import 'package:foo/../
some.dart'`. | 1977 * source file should not contain a directive such as `import 'package:foo/../
some.dart'`. |
1930 */ | 1978 */ |
1931 static final PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = new PubSugges
tionCode('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should not cont
ain '..'"); | 1979 static final PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = new PubSugges
tionCode.con1('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should not
contain '..'"); |
1932 static final List<PubSuggestionCode> values = [ | 1980 static final List<PubSuggestionCode> values = [ |
1933 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, | 1981 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, |
1934 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, | 1982 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, |
1935 PACKAGE_IMPORT_CONTAINS_DOT_DOT]; | 1983 PACKAGE_IMPORT_CONTAINS_DOT_DOT]; |
1936 | 1984 |
1937 /// The name of this enum constant, as declared in the enum declaration. | 1985 /** |
1938 final String name; | 1986 * The template used to create the message to be displayed for this error. |
1939 | 1987 */ |
1940 /// The position in the enum declaration. | 1988 String _message; |
1941 final int ordinal; | |
1942 | 1989 |
1943 /** | 1990 /** |
1944 * The message template used to create the message to be displayed for this er
ror. | 1991 * The template used to create the correction to be displayed for this error,
or `null` if |
| 1992 * there is no correction information for this error. |
1945 */ | 1993 */ |
1946 String _message; | 1994 String correction5; |
1947 | 1995 |
1948 /** | 1996 /** |
1949 * Initialize a newly created error code to have the given message. | 1997 * Initialize a newly created error code to have the given message. |
1950 * | 1998 * |
1951 * @param message the message template used to create the message to be displa
yed for the error | 1999 * @param message the message template used to create the message to be displa
yed for the error |
1952 */ | 2000 */ |
1953 PubSuggestionCode(this.name, this.ordinal, String message) { | 2001 PubSuggestionCode.con1(String name, int ordinal, String message) : super(name,
ordinal) { |
1954 this._message = message; | 2002 this._message = message; |
1955 } | 2003 } |
| 2004 |
| 2005 /** |
| 2006 * Initialize a newly created error code to have the given message and correct
ion. |
| 2007 * |
| 2008 * @param message the template used to create the message to be displayed for
the error |
| 2009 * @param correction the template used to create the correction to be displaye
d for the error |
| 2010 */ |
| 2011 PubSuggestionCode.con2(String name, int ordinal, String message, String correc
tion) : super(name, ordinal) { |
| 2012 this._message = message; |
| 2013 this.correction5 = correction; |
| 2014 } |
| 2015 String get correction => correction5; |
1956 ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity; | 2016 ErrorSeverity get errorSeverity => ErrorType.PUB_SUGGESTION.severity; |
1957 String get message => _message; | 2017 String get message => _message; |
1958 ErrorType get type => ErrorType.PUB_SUGGESTION; | 2018 ErrorType get type => ErrorType.PUB_SUGGESTION; |
1959 int compareTo(PubSuggestionCode other) => ordinal - other.ordinal; | |
1960 int get hashCode => ordinal; | |
1961 String toString() => name; | |
1962 } | 2019 } |
1963 /** | 2020 /** |
1964 * The enumeration `StaticWarningCode` defines the error codes used for static w
arnings. The | 2021 * The enumeration `StaticWarningCode` defines the error codes used for static w
arnings. The |
1965 * convention for this class is for the name of the error code to indicate the p
roblem that caused | 2022 * convention for this class is for the name of the error code to indicate the p
roblem that caused |
1966 * the error to be generated and for the error message to explain what is wrong
and, when | 2023 * the error to be generated and for the error message to explain what is wrong
and, when |
1967 * appropriate, how the problem can be corrected. | 2024 * appropriate, how the problem can be corrected. |
1968 * | 2025 * |
1969 * @coverage dart.engine.error | 2026 * @coverage dart.engine.error |
1970 */ | 2027 */ |
1971 class StaticWarningCode implements Enum<StaticWarningCode>, ErrorCode { | 2028 class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode { |
1972 | 2029 |
1973 /** | 2030 /** |
1974 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i
>N</i> is introduced | 2031 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i
>N</i> is introduced |
1975 * into the top level scope <i>L</i> by more than one import then: | 2032 * into the top level scope <i>L</i> by more than one import then: |
1976 * <ol> | 2033 * <ol> |
1977 * * A static warning occurs. | 2034 * * A static warning occurs. |
1978 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet
hodError</i> is | 2035 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet
hodError</i> is |
1979 * raised. | 2036 * raised. |
1980 * * If <i>N</i> is referenced as a type, it is treated as a malformed type. | 2037 * * If <i>N</i> is referenced as a type, it is treated as a malformed type. |
1981 * </ol> | 2038 * </ol> |
1982 * | 2039 * |
1983 * @param ambiguousTypeName the name of the ambiguous type | 2040 * @param ambiguousTypeName the name of the ambiguous type |
1984 * @param firstLibraryName the name of the first library that the type is foun
d | 2041 * @param firstLibraryName the name of the first library that the type is foun
d |
1985 * @param secondLibraryName the name of the second library that the type is fo
und | 2042 * @param secondLibraryName the name of the second library that the type is fo
und |
1986 */ | 2043 */ |
1987 static final StaticWarningCode AMBIGUOUS_IMPORT = new StaticWarningCode('AMBIG
UOUS_IMPORT', 0, "The type '%s' is defined in the libraries '%s' and '%s'"); | 2044 static final StaticWarningCode AMBIGUOUS_IMPORT = new StaticWarningCode.con1('
AMBIGUOUS_IMPORT', 0, "The type '%s' is defined in the libraries '%s' and '%s'")
; |
1988 | 2045 |
1989 /** | 2046 /** |
1990 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>,
1 <= i <= n+ | 2047 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>,
1 <= i <= n+ |
1991 * k</i> may not be assigned to the type of the corresponding formal parameter
of the constructor | 2048 * k</i> may not be assigned to the type of the corresponding formal parameter
of the constructor |
1992 * <i>T.id</i> (respectively <i>T</i>). | 2049 * <i>T.id</i> (respectively <i>T</i>). |
1993 * | 2050 * |
1994 * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub
>, 1 <= i <= | 2051 * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub
>, 1 <= i <= |
1995 * n+ k</i> may not be assigned to the type of the corresponding formal parame
ter of the | 2052 * n+ k</i> may not be assigned to the type of the corresponding formal parame
ter of the |
1996 * constructor <i>T.id</i> (respectively <i>T</i>). | 2053 * constructor <i>T.id</i> (respectively <i>T</i>). |
1997 * | 2054 * |
1998 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 2055 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
1999 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 2056 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
2000 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. | 2057 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. |
2001 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2058 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
2002 * j <= m</i>. | 2059 * j <= m</i>. |
2003 * | 2060 * |
2004 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 &
lt;= i <= l</i>, | 2061 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 &
lt;= i <= l</i>, |
2005 * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, &
hellip; | 2062 * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, &
hellip; |
2006 * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if | 2063 * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if |
2007 * <i>T<sub>m+j</sub></i> may not be assigned to <i>S<sub>r</sub></i>, where <
i>r = q<sub>j</sub>, | 2064 * <i>T<sub>m+j</sub></i> may not be assigned to <i>S<sub>r</sub></i>, where <
i>r = q<sub>j</sub>, |
2008 * 1 <= j <= l</i>. | 2065 * 1 <= j <= l</i>. |
2009 */ | 2066 */ |
2010 static final StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new StaticWarnin
gCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '%s' cannot be assig
ned to the parameter type '%s'"); | 2067 static final StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = new StaticWarnin
gCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '%s' cannot be
assigned to the parameter type '%s'"); |
2011 | 2068 |
2012 /** | 2069 /** |
2013 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
a NoSuchMethodError | 2070 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
a NoSuchMethodError |
2014 * to be thrown, because no setter is defined for it. The assignment will also
give rise to a | 2071 * to be thrown, because no setter is defined for it. The assignment will also
give rise to a |
2015 * static warning for the same reason. | 2072 * static warning for the same reason. |
2016 * | 2073 * |
2017 * A constant variable is always implicitly final. | 2074 * A constant variable is always implicitly final. |
2018 */ | 2075 */ |
2019 static final StaticWarningCode ASSIGNMENT_TO_CONST = new StaticWarningCode('AS
SIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value"); | 2076 static final StaticWarningCode ASSIGNMENT_TO_CONST = new StaticWarningCode.con
1('ASSIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value"); |
2020 | 2077 |
2021 /** | 2078 /** |
2022 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
a NoSuchMethodError | 2079 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
a NoSuchMethodError |
2023 * to be thrown, because no setter is defined for it. The assignment will also
give rise to a | 2080 * to be thrown, because no setter is defined for it. The assignment will also
give rise to a |
2024 * static warning for the same reason. | 2081 * static warning for the same reason. |
2025 */ | 2082 */ |
2026 static final StaticWarningCode ASSIGNMENT_TO_FINAL = new StaticWarningCode('AS
SIGNMENT_TO_FINAL', 3, "Final variables cannot be assigned a value"); | 2083 static final StaticWarningCode ASSIGNMENT_TO_FINAL = new StaticWarningCode.con
1('ASSIGNMENT_TO_FINAL', 3, "Final variables cannot be assigned a value"); |
2027 | 2084 |
2028 /** | 2085 /** |
2029 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type | 2086 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type |
2030 * warning if <i>T</i> does not have an accessible instance setter named <i>v
=</i>. | 2087 * warning if <i>T</i> does not have an accessible instance setter named <i>v
=</i>. |
2031 */ | 2088 */ |
2032 static final StaticWarningCode ASSIGNMENT_TO_METHOD = new StaticWarningCode('A
SSIGNMENT_TO_METHOD', 4, "Methods cannot be assigned a value"); | 2089 static final StaticWarningCode ASSIGNMENT_TO_METHOD = new StaticWarningCode.co
n1('ASSIGNMENT_TO_METHOD', 4, "Methods cannot be assigned a value"); |
2033 | 2090 |
2034 /** | 2091 /** |
2035 * 13.9 Switch: It is a static warning if the last statement of the statement
sequence | 2092 * 13.9 Switch: It is a static warning if the last statement of the statement
sequence |
2036 * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement. | 2093 * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement. |
2037 */ | 2094 */ |
2038 static final StaticWarningCode CASE_BLOCK_NOT_TERMINATED = new StaticWarningCo
de('CASE_BLOCK_NOT_TERMINATED', 5, "The last statement of the 'case' should be '
break', 'continue', 'return' or 'throw'"); | 2095 static final StaticWarningCode CASE_BLOCK_NOT_TERMINATED = new StaticWarningCo
de.con1('CASE_BLOCK_NOT_TERMINATED', 5, "The last statement of the 'case' should
be 'break', 'continue', 'return' or 'throw'"); |
2039 | 2096 |
2040 /** | 2097 /** |
2041 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type
available in the | 2098 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type
available in the |
2042 * current lexical scope. | 2099 * current lexical scope. |
2043 */ | 2100 */ |
2044 static final StaticWarningCode CAST_TO_NON_TYPE = new StaticWarningCode('CAST_
TO_NON_TYPE', 6, "The name '%s' is not a type and cannot be used in an 'as' expr
ession"); | 2101 static final StaticWarningCode CAST_TO_NON_TYPE = new StaticWarningCode.con1('
CAST_TO_NON_TYPE', 6, "The name '%s' is not a type and cannot be used in an 'as'
expression"); |
2045 | 2102 |
2046 /** | 2103 /** |
2047 * 16.1.2 Comments: A token of the form <i>[new c](uri)</i> will be replaced b
y a link in the | 2104 * 16.1.2 Comments: A token of the form <i>[new c](uri)</i> will be replaced b
y a link in the |
2048 * formatted output. The link will point at the constructor named <i>c</i> in
<i>L</i>. The title | 2105 * formatted output. The link will point at the constructor named <i>c</i> in
<i>L</i>. The title |
2049 * of the link will be <i>c</i>. It is a static warning if uri is not the URI
of a dart library | 2106 * of the link will be <i>c</i>. It is a static warning if uri is not the URI
of a dart library |
2050 * <i>L</i>, or if <i>c</i> is not the name of a constructor of a class declar
ed in the exported | 2107 * <i>L</i>, or if <i>c</i> is not the name of a constructor of a class declar
ed in the exported |
2051 * namespace of <i>L</i>. | 2108 * namespace of <i>L</i>. |
2052 */ | 2109 */ |
2053 static final StaticWarningCode COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE = new
StaticWarningCode('COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE', 7, ""); | 2110 static final StaticWarningCode COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE = new
StaticWarningCode.con1('COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE', 7, ""); |
2054 | 2111 |
2055 /** | 2112 /** |
2056 * 16.1.2 Comments: A token of the form <i>[id](uri)</i> will be replaced by a
link in the | 2113 * 16.1.2 Comments: A token of the form <i>[id](uri)</i> will be replaced by a
link in the |
2057 * formatted output. The link will point at the declaration named <i>id</i> in
<i>L</i>. The title | 2114 * formatted output. The link will point at the declaration named <i>id</i> in
<i>L</i>. The title |
2058 * of the link will be <i>id</i>. It is a static warning if uri is not the URI
of a dart library | 2115 * of the link will be <i>id</i>. It is a static warning if uri is not the URI
of a dart library |
2059 * <i>L</i>, or if <i>id</i> is not a name declared in the exported namespace
of <i>L</i>. | 2116 * <i>L</i>, or if <i>id</i> is not a name declared in the exported namespace
of <i>L</i>. |
2060 */ | 2117 */ |
2061 static final StaticWarningCode COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE = new
StaticWarningCode('COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE', 8, ""); | 2118 static final StaticWarningCode COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE = new
StaticWarningCode.con1('COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE', 8, ""); |
2062 | 2119 |
2063 /** | 2120 /** |
2064 * 16.1.2 Comments: It is a static warning if <i>c</i> does not denote a const
ructor that | 2121 * 16.1.2 Comments: It is a static warning if <i>c</i> does not denote a const
ructor that |
2065 * available in the scope of the documentation comment. | 2122 * available in the scope of the documentation comment. |
2066 */ | 2123 */ |
2067 static final StaticWarningCode COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR = new
StaticWarningCode('COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR', 9, ""); | 2124 static final StaticWarningCode COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR = new
StaticWarningCode.con1('COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR', 9, ""); |
2068 | 2125 |
2069 /** | 2126 /** |
2070 * 16.1.2 Comments: It is a static warning if <i>id</i> does not denote a decl
aration that | 2127 * 16.1.2 Comments: It is a static warning if <i>id</i> does not denote a decl
aration that |
2071 * available in the scope of the documentation comment. | 2128 * available in the scope of the documentation comment. |
2072 */ | 2129 */ |
2073 static final StaticWarningCode COMMENT_REFERENCE_UNDECLARED_IDENTIFIER = new S
taticWarningCode('COMMENT_REFERENCE_UNDECLARED_IDENTIFIER', 10, ""); | 2130 static final StaticWarningCode COMMENT_REFERENCE_UNDECLARED_IDENTIFIER = new S
taticWarningCode.con1('COMMENT_REFERENCE_UNDECLARED_IDENTIFIER', 10, ""); |
2074 | 2131 |
2075 /** | 2132 /** |
2076 * 16.1.2 Comments: A token of the form <i>[id](uri)</i> will be replaced by a
link in the | 2133 * 16.1.2 Comments: A token of the form <i>[id](uri)</i> will be replaced by a
link in the |
2077 * formatted output. The link will point at the declaration named <i>id</i> in
<i>L</i>. The title | 2134 * formatted output. The link will point at the declaration named <i>id</i> in
<i>L</i>. The title |
2078 * of the link will be <i>id</i>. It is a static warning if uri is not the URI
of a dart library | 2135 * of the link will be <i>id</i>. It is a static warning if uri is not the URI
of a dart library |
2079 * <i>L</i>, or if <i>id</i> is not a name declared in the exported namespace
of <i>L</i>. | 2136 * <i>L</i>, or if <i>id</i> is not a name declared in the exported namespace
of <i>L</i>. |
2080 */ | 2137 */ |
2081 static final StaticWarningCode COMMENT_REFERENCE_URI_NOT_LIBRARY = new StaticW
arningCode('COMMENT_REFERENCE_URI_NOT_LIBRARY', 11, ""); | 2138 static final StaticWarningCode COMMENT_REFERENCE_URI_NOT_LIBRARY = new StaticW
arningCode.con1('COMMENT_REFERENCE_URI_NOT_LIBRARY', 11, ""); |
2082 | 2139 |
2083 /** | 2140 /** |
2084 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2141 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
2085 * inherited in a concrete class. | 2142 * inherited in a concrete class. |
2086 */ | 2143 */ |
2087 static final StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = new Stati
cWarningCode('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 12, "'%s' must have a method
body because '%s' is not abstract"); | 2144 static final StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = new Stati
cWarningCode.con1('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 12, "'%s' must have a m
ethod body because '%s' is not abstract"); |
2088 | 2145 |
2089 /** | 2146 /** |
2090 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc
e getter named | 2147 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc
e getter named |
2091 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec
lared in a | 2148 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec
lared in a |
2092 * superclass of <i>C</i>. | 2149 * superclass of <i>C</i>. |
2093 * | 2150 * |
2094 * @param superName the name of the super class declaring a static member | 2151 * @param superName the name of the super class declaring a static member |
2095 */ | 2152 */ |
2096 static final StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB
ER = new StaticWarningCode('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER',
13, "Superclass '%s' declares static member with the same name"); | 2153 static final StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB
ER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB
ER', 13, "Superclass '%s' declares static member with the same name"); |
2097 | 2154 |
2098 /** | 2155 /** |
2099 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc
e setter named | 2156 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc
e setter named |
2100 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de
clared in a | 2157 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de
clared in a |
2101 * superclass of <i>C</i>. | 2158 * superclass of <i>C</i>. |
2102 * | 2159 * |
2103 * @param superName the name of the super class declaring a static member | 2160 * @param superName the name of the super class declaring a static member |
2104 */ | 2161 */ |
2105 static final StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB
ER = new StaticWarningCode('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER',
14, "Superclass '%s' declares static member with the same name"); | 2162 static final StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB
ER = new StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB
ER', 14, "Superclass '%s' declares static member with the same name"); |
2106 | 2163 |
2107 /** | 2164 /** |
2108 * 7.2 Getters: It is a static warning if a class declares a static getter nam
ed <i>v</i> and also | 2165 * 7.2 Getters: It is a static warning if a class declares a static getter nam
ed <i>v</i> and also |
2109 * has a non-static setter named <i>v=</i>. | 2166 * has a non-static setter named <i>v=</i>. |
2110 */ | 2167 */ |
2111 static final StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER =
new StaticWarningCode('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 15, "Cla
ss '%s' declares non-static setter with the same name"); | 2168 static final StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER =
new StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 15,
"Class '%s' declares non-static setter with the same name"); |
2112 | 2169 |
2113 /** | 2170 /** |
2114 * 7.3 Setters: It is a static warning if a class declares a static setter nam
ed <i>v=</i> and | 2171 * 7.3 Setters: It is a static warning if a class declares a static setter nam
ed <i>v=</i> and |
2115 * also has a non-static member named <i>v</i>. | 2172 * also has a non-static member named <i>v</i>. |
2116 */ | 2173 */ |
2117 static final StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER =
new StaticWarningCode('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 16, "Cla
ss '%s' declares non-static member with the same name"); | 2174 static final StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER =
new StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 16,
"Class '%s' declares non-static member with the same name"); |
2118 | 2175 |
2119 /** | 2176 /** |
2120 * 12.11.2 Const: Given an instance creation expression of the form <i>const q
(a<sub>1</sub>, | 2177 * 12.11.2 Const: Given an instance creation expression of the form <i>const q
(a<sub>1</sub>, |
2121 * … a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const
ructor of an | 2178 * … a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const
ructor of an |
2122 * abstract class but <i>q</i> is not a factory constructor. | 2179 * abstract class but <i>q</i> is not a factory constructor. |
2123 */ | 2180 */ |
2124 static final StaticWarningCode CONST_WITH_ABSTRACT_CLASS = new StaticWarningCo
de('CONST_WITH_ABSTRACT_CLASS', 17, "Abstract classes cannot be created with a '
const' expression"); | 2181 static final StaticWarningCode CONST_WITH_ABSTRACT_CLASS = new StaticWarningCo
de.con1('CONST_WITH_ABSTRACT_CLASS', 17, "Abstract classes cannot be created wit
h a 'const' expression"); |
2125 | 2182 |
2126 /** | 2183 /** |
2127 * 12.7 Maps: It is a static warning if the values of any two keys in a map li
teral are equal. | 2184 * 12.7 Maps: It is a static warning if the values of any two keys in a map li
teral are equal. |
2128 */ | 2185 */ |
2129 static final StaticWarningCode EQUAL_KEYS_IN_MAP = new StaticWarningCode('EQUA
L_KEYS_IN_MAP', 18, "Keys in a map cannot be equal"); | 2186 static final StaticWarningCode EQUAL_KEYS_IN_MAP = new StaticWarningCode.con1(
'EQUAL_KEYS_IN_MAP', 18, "Keys in a map cannot be equal"); |
2130 | 2187 |
2131 /** | 2188 /** |
2132 * 14.2 Exports: It is a static warning to export two different libraries with
the same name. | 2189 * 14.2 Exports: It is a static warning to export two different libraries with
the same name. |
2133 * | 2190 * |
2134 * @param uri1 the uri pointing to a first library | 2191 * @param uri1 the uri pointing to a first library |
2135 * @param uri2 the uri pointing to a second library | 2192 * @param uri2 the uri pointing to a second library |
2136 * @param name the shared name of the exported libraries | 2193 * @param name the shared name of the exported libraries |
2137 */ | 2194 */ |
2138 static final StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn
ingCode('EXPORT_DUPLICATED_LIBRARY_NAME', 19, "The exported libraries '%s' and '
%s' should not have the same name '%s'"); | 2195 static final StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn
ingCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 19, "The exported libraries '%s'
and '%s' should not have the same name '%s'"); |
2139 | 2196 |
2140 /** | 2197 /** |
2141 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > | 2198 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > |
2142 * n</i>. | 2199 * n</i>. |
2143 * | 2200 * |
2144 * @param requiredCount the maximum number of positional arguments | 2201 * @param requiredCount the maximum number of positional arguments |
2145 * @param argumentCount the actual number of positional arguments given | 2202 * @param argumentCount the actual number of positional arguments given |
2146 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS | 2203 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS |
2147 */ | 2204 */ |
2148 static final StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = new StaticWarningC
ode('EXTRA_POSITIONAL_ARGUMENTS', 20, "%d positional arguments expected, but %d
found"); | 2205 static final StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = new StaticWarningC
ode.con1('EXTRA_POSITIONAL_ARGUMENTS', 20, "%d positional arguments expected, bu
t %d found"); |
2149 | 2206 |
2150 /** | 2207 /** |
2151 * 5. Variables: It is a static warning if a final instance variable that has
been initialized at | 2208 * 5. Variables: It is a static warning if a final instance variable that has
been initialized at |
2152 * its point of declaration is also initialized in a constructor. | 2209 * its point of declaration is also initialized in a constructor. |
2153 */ | 2210 */ |
2154 static final StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO
N = new StaticWarningCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', 21
, "Values cannot be set in the constructor if they are final, and have already b
een set"); | 2211 static final StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO
N = new StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION
', 21, "Values cannot be set in the constructor if they are final, and have alre
ady been set"); |
2155 | 2212 |
2156 /** | 2213 /** |
2157 * 5. Variables: It is a static warning if a final instance variable that has
been initialized at | 2214 * 5. Variables: It is a static warning if a final instance variable that has
been initialized at |
2158 * its point of declaration is also initialized in a constructor. | 2215 * its point of declaration is also initialized in a constructor. |
2159 * | 2216 * |
2160 * @param name the name of the field in question | 2217 * @param name the name of the field in question |
2161 */ | 2218 */ |
2162 static final StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO
R = new StaticWarningCode('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', 22
, "'%s' is final and was given a value when it was declared, so it cannot be set
to a new value"); | 2219 static final StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO
R = new StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
', 22, "'%s' is final and was given a value when it was declared, so it cannot b
e set to a new value"); |
2163 | 2220 |
2164 /** | 2221 /** |
2165 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t
his</b>.<i>v</i> = | 2222 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t
his</b>.<i>v</i> = |
2166 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t
o an object | 2223 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t
o an object |
2167 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi
s is bound to | 2224 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi
s is bound to |
2168 * <i>o</i>. | 2225 * <i>o</i>. |
2169 * | 2226 * |
2170 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 2227 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
2171 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 2228 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
2172 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. | 2229 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. |
2173 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2230 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
2174 * j <= m</i>. | 2231 * j <= m</i>. |
2175 * | 2232 * |
2176 * @param initializerType the name of the type of the initializer expression | 2233 * @param initializerType the name of the type of the initializer expression |
2177 * @param fieldType the name of the type of the field | 2234 * @param fieldType the name of the type of the field |
2178 */ | 2235 */ |
2179 static final StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = new StaticWa
rningCode('FIELD_INITIALIZER_NOT_ASSIGNABLE', 23, "The initializer type '%s' can
not be assigned to the field type '%s'"); | 2236 static final StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 23, "The initializer type '%s
' cannot be assigned to the field type '%s'"); |
2180 | 2237 |
2181 /** | 2238 /** |
2182 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a | 2239 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this.
id</i>. It is a |
2183 * static warning if the static type of <i>id</i> is not assignable to <i>T<su
b>id</sub></i>. | 2240 * static warning if the static type of <i>id</i> is not assignable to <i>T<su
b>id</sub></i>. |
2184 * | 2241 * |
2185 * @param parameterType the name of the type of the field formal parameter | 2242 * @param parameterType the name of the type of the field formal parameter |
2186 * @param fieldType the name of the type of the field | 2243 * @param fieldType the name of the type of the field |
2187 */ | 2244 */ |
2188 static final StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = new
StaticWarningCode('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 24, "The parameter
type '%s' is incompatable with the field type '%s'"); | 2245 static final StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = new
StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 24, "The para
meter type '%s' is incompatable with the field type '%s'"); |
2189 | 2246 |
2190 /** | 2247 /** |
2191 * 5 Variables: It is a static warning if a library, static or local variable
<i>v</i> is final | 2248 * 5 Variables: It is a static warning if a library, static or local variable
<i>v</i> is final |
2192 * and <i>v</i> is not initialized at its point of declaration. | 2249 * and <i>v</i> is not initialized at its point of declaration. |
2193 * | 2250 * |
2194 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar
ed in the | 2251 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar
ed in the |
2195 * immediately enclosing class must have an initializer in <i>k</i>'s initiali
zer list unless it | 2252 * immediately enclosing class must have an initializer in <i>k</i>'s initiali
zer list unless it |
2196 * has already been initialized by one of the following means: | 2253 * has already been initialized by one of the following means: |
2197 * | 2254 * |
2198 * * Initialization at the declaration of <i>f</i>. | 2255 * * Initialization at the declaration of <i>f</i>. |
2199 * * Initialization by means of an initializing formal of <i>k</i>. | 2256 * * Initialization by means of an initializing formal of <i>k</i>. |
2200 * | 2257 * |
2201 * or a static warning occurs. | 2258 * or a static warning occurs. |
2202 * | 2259 * |
2203 * @param name the name of the uninitialized final variable | 2260 * @param name the name of the uninitialized final variable |
2204 */ | 2261 */ |
2205 static final StaticWarningCode FINAL_NOT_INITIALIZED = new StaticWarningCode('
FINAL_NOT_INITIALIZED', 25, "The final variable '%s' must be initialized"); | 2262 static final StaticWarningCode FINAL_NOT_INITIALIZED = new StaticWarningCode.c
on1('FINAL_NOT_INITIALIZED', 25, "The final variable '%s' must be initialized"); |
2206 | 2263 |
2207 /** | 2264 /** |
2208 * 14.1 Imports: It is a static warning to import two different libraries with
the same name. | 2265 * 14.1 Imports: It is a static warning to import two different libraries with
the same name. |
2209 * | 2266 * |
2210 * @param uri1 the uri pointing to a first library | 2267 * @param uri1 the uri pointing to a first library |
2211 * @param uri2 the uri pointing to a second library | 2268 * @param uri2 the uri pointing to a second library |
2212 * @param name the shared name of the imported libraries | 2269 * @param name the shared name of the imported libraries |
2213 */ | 2270 */ |
2214 static final StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn
ingCode('IMPORT_DUPLICATED_LIBRARY_NAME', 26, "The imported libraries '%s' and '
%s' should not have the same name '%s'"); | 2271 static final StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = new StaticWarn
ingCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 26, "The imported libraries '%s'
and '%s' should not have the same name '%s'"); |
2215 | 2272 |
2216 /** | 2273 /** |
2217 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i
>m<sub>1</sub>, | 2274 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i
>m<sub>1</sub>, |
2218 * … m<sub>k</sub></i> with the same name <i>n</i> that would be inheri
ted (because | 2275 * … m<sub>k</sub></i> with the same name <i>n</i> that would be inheri
ted (because |
2219 * identically named members existed in several superinterfaces) then at most
one member is | 2276 * identically named members existed in several superinterfaces) then at most
one member is |
2220 * inherited. | 2277 * inherited. |
2221 * | 2278 * |
2222 * If some but not all of the <i>m<sub>i</sub>, 1 <= i <= k</i>, are get
ters, or if some but | 2279 * If some but not all of the <i>m<sub>i</sub>, 1 <= i <= k</i>, are get
ters, or if some but |
2223 * not all of the <i>m<sub>i</sub></i> are setters, none of the <i>m<sub>i</su
b></i> are | 2280 * not all of the <i>m<sub>i</sub></i> are setters, none of the <i>m<sub>i</su
b></i> are |
2224 * inherited, and a static warning is issued. | 2281 * inherited, and a static warning is issued. |
2225 */ | 2282 */ |
2226 static final StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH
OD = new StaticWarningCode('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD',
27, "'%s' is inherited as a getter and also a method"); | 2283 static final StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH
OD = new StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH
OD', 27, "'%s' is inherited as a getter and also a method"); |
2227 | 2284 |
2228 /** | 2285 /** |
2229 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a
n instance method | 2286 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a
n instance method |
2230 * named <i>n</i> and an accessible static member named <i>n</i> is declared i
n a superclass of | 2287 * named <i>n</i> and an accessible static member named <i>n</i> is declared i
n a superclass of |
2231 * <i>C</i>. | 2288 * <i>C</i>. |
2232 * | 2289 * |
2233 * @param memberName the name of the member with the name conflict | 2290 * @param memberName the name of the member with the name conflict |
2234 * @param superclassName the name of the enclosing class that has the static m
ember | 2291 * @param superclassName the name of the enclosing class that has the static m
ember |
2235 */ | 2292 */ |
2236 static final StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S
TATIC = new StaticWarningCode('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STA
TIC', 28, "'%s' collides with a static member in the superclass '%s'"); | 2293 static final StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S
TATIC = new StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLAS
S_STATIC', 28, "'%s' collides with a static member in the superclass '%s'"); |
2237 | 2294 |
2238 /** | 2295 /** |
2239 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette
r <i>m2</i> and the | 2296 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette
r <i>m2</i> and the |
2240 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 2297 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
2241 * | 2298 * |
2242 * @param actualReturnTypeName the name of the expected return type | 2299 * @param actualReturnTypeName the name of the expected return type |
2243 * @param expectedReturnType the name of the actual return type, not assignabl
e to the | 2300 * @param expectedReturnType the name of the actual return type, not assignabl
e to the |
2244 * actualReturnTypeName | 2301 * actualReturnTypeName |
2245 * @param className the name of the class where the overridden getter is decla
red | 2302 * @param className the name of the class where the overridden getter is decla
red |
2246 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE | 2303 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE |
2247 */ | 2304 */ |
2248 static final StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = new Stati
cWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 29, "The return type '%s' is
not assignable to '%s' as required by the getter it is overriding from '%s'"); | 2305 static final StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = new Stati
cWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 29, "The return type '%
s' is not assignable to '%s' as required by the getter it is overriding from '%s
'"); |
2249 | 2306 |
2250 /** | 2307 /** |
2251 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2308 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2252 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | 2309 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. |
2253 * | 2310 * |
2254 * @param actualParamTypeName the name of the expected parameter type | 2311 * @param actualParamTypeName the name of the expected parameter type |
2255 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the | 2312 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the |
2256 * actualParamTypeName | 2313 * actualParamTypeName |
2257 * @param className the name of the class where the overridden method is decla
red | 2314 * @param className the name of the class where the overridden method is decla
red |
2258 */ | 2315 */ |
2259 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = new
StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 30, "The parameter
type '%s' is not assignable to '%s' as required by the method it is overriding
from '%s'"); | 2316 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 30, "The para
meter type '%s' is not assignable to '%s' as required by the method it is overri
ding from '%s'"); |
2260 | 2317 |
2261 /** | 2318 /** |
2262 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2319 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2263 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | 2320 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. |
2264 * | 2321 * |
2265 * @param actualParamTypeName the name of the expected parameter type | 2322 * @param actualParamTypeName the name of the expected parameter type |
2266 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the | 2323 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the |
2267 * actualParamTypeName | 2324 * actualParamTypeName |
2268 * @param className the name of the class where the overridden method is decla
red | 2325 * @param className the name of the class where the overridden method is decla
red |
2269 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE | 2326 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE |
2270 */ | 2327 */ |
2271 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = new
StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 31, "The paramet
er type '%s' is not assignable to '%s' as required by the method it is overridin
g from '%s'"); | 2328 static final StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 31, "The pa
rameter type '%s' is not assignable to '%s' as required by the method it is over
riding from '%s'"); |
2272 | 2329 |
2273 /** | 2330 /** |
2274 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2331 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2275 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | 2332 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. |
2276 * | 2333 * |
2277 * @param actualParamTypeName the name of the expected parameter type | 2334 * @param actualParamTypeName the name of the expected parameter type |
2278 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the | 2335 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the |
2279 * actualParamTypeName | 2336 * actualParamTypeName |
2280 * @param className the name of the class where the overridden method is decla
red | 2337 * @param className the name of the class where the overridden method is decla
red |
2281 */ | 2338 */ |
2282 static final StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = n
ew StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 32, "The par
ameter type '%s' is not assignable to '%s' as required by the method it is overr
iding from '%s'"); | 2339 static final StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = n
ew StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 32, "Th
e parameter type '%s' is not assignable to '%s' as required by the method it is
overriding from '%s'"); |
2283 | 2340 |
2284 /** | 2341 /** |
2285 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2342 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2286 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. | 2343 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the
type of <i>m2</i>. |
2287 * | 2344 * |
2288 * @param actualReturnTypeName the name of the expected return type | 2345 * @param actualReturnTypeName the name of the expected return type |
2289 * @param expectedReturnType the name of the actual return type, not assignabl
e to the | 2346 * @param expectedReturnType the name of the actual return type, not assignabl
e to the |
2290 * actualReturnTypeName | 2347 * actualReturnTypeName |
2291 * @param className the name of the class where the overridden method is decla
red | 2348 * @param className the name of the class where the overridden method is decla
red |
2292 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE | 2349 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE |
2293 */ | 2350 */ |
2294 static final StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = new Stati
cWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 33, "The return type '%s' is
not assignable to '%s' as required by the method it is overriding from '%s'"); | 2351 static final StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = new Stati
cWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 33, "The return type '%
s' is not assignable to '%s' as required by the method it is overriding from '%s
'"); |
2295 | 2352 |
2296 /** | 2353 /** |
2297 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2354 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2298 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for | 2355 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for |
2299 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value | 2356 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value |
2300 * for <i>p</i>. | 2357 * for <i>p</i>. |
2301 */ | 2358 */ |
2302 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED
= new StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', 34,
"Parameters cannot override default values, this method overrides '%s.%s' where
'%s' has a different value"); | 2359 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED
= new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED',
34, "Parameters cannot override default values, this method overrides '%s.%s' w
here '%s' has a different value"); |
2303 | 2360 |
2304 /** | 2361 /** |
2305 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2362 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2306 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for | 2363 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies
a default value for |
2307 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value | 2364 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff
erent default value |
2308 * for <i>p</i>. | 2365 * for <i>p</i>. |
2309 */ | 2366 */ |
2310 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT
IONAL = new StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIO
NAL', 35, "Parameters cannot override default values, this method overrides '%s.
%s' where this positional parameter has a different value"); | 2367 static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT
IONAL = new StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_PO
SITIONAL', 35, "Parameters cannot override default values, this method overrides
'%s.%s' where this positional parameter has a different value"); |
2311 | 2368 |
2312 /** | 2369 /** |
2313 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2370 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2314 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para
meters declared by | 2371 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para
meters declared by |
2315 * <i>m2</i>. | 2372 * <i>m2</i>. |
2316 * | 2373 * |
2317 * @param paramCount the number of named parameters in the overridden member | 2374 * @param paramCount the number of named parameters in the overridden member |
2318 * @param className the name of the class from the overridden method | 2375 * @param className the name of the class from the overridden method |
2319 */ | 2376 */ |
2320 static final StaticWarningCode INVALID_OVERRIDE_NAMED = new StaticWarningCode(
'INVALID_OVERRIDE_NAMED', 36, "Missing the named parameter '%s' to match the ove
rridden method from '%s'"); | 2377 static final StaticWarningCode INVALID_OVERRIDE_NAMED = new StaticWarningCode.
con1('INVALID_OVERRIDE_NAMED', 36, "Missing the named parameter '%s' to match th
e overridden method from '%s'"); |
2321 | 2378 |
2322 /** | 2379 /** |
2323 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2380 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2324 * instance member <i>m2</i> and <i>m1</i> has fewer optional positional param
eters than | 2381 * instance member <i>m2</i> and <i>m1</i> has fewer optional positional param
eters than |
2325 * <i>m2</i>. | 2382 * <i>m2</i>. |
2326 * | 2383 * |
2327 * @param paramCount the number of positional parameters in the overridden mem
ber | 2384 * @param paramCount the number of positional parameters in the overridden mem
ber |
2328 * @param className the name of the class from the overridden method | 2385 * @param className the name of the class from the overridden method |
2329 */ | 2386 */ |
2330 static final StaticWarningCode INVALID_OVERRIDE_POSITIONAL = new StaticWarning
Code('INVALID_OVERRIDE_POSITIONAL', 37, "Must have at least %d optional paramete
rs to match the overridden method from '%s'"); | 2387 static final StaticWarningCode INVALID_OVERRIDE_POSITIONAL = new StaticWarning
Code.con1('INVALID_OVERRIDE_POSITIONAL', 37, "Must have at least %d optional par
ameters to match the overridden method from '%s'"); |
2331 | 2388 |
2332 /** | 2389 /** |
2333 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an | 2390 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i
> overrides an |
2334 * instance member <i>m2</i> and <i>m1</i> has a different number of required
parameters than | 2391 * instance member <i>m2</i> and <i>m1</i> has a different number of required
parameters than |
2335 * <i>m2</i>. | 2392 * <i>m2</i>. |
2336 * | 2393 * |
2337 * @param paramCount the number of required parameters in the overridden membe
r | 2394 * @param paramCount the number of required parameters in the overridden membe
r |
2338 * @param className the name of the class from the overridden method | 2395 * @param className the name of the class from the overridden method |
2339 */ | 2396 */ |
2340 static final StaticWarningCode INVALID_OVERRIDE_REQUIRED = new StaticWarningCo
de('INVALID_OVERRIDE_REQUIRED', 38, "Must have exactly %d required parameters to
match the overridden method from '%s'"); | 2397 static final StaticWarningCode INVALID_OVERRIDE_REQUIRED = new StaticWarningCo
de.con1('INVALID_OVERRIDE_REQUIRED', 38, "Must have exactly %d required paramete
rs to match the overridden method from '%s'"); |
2341 | 2398 |
2342 /** | 2399 /** |
2343 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette
r <i>m2</i> and the | 2400 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette
r <i>m2</i> and the |
2344 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. | 2401 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. |
2345 * | 2402 * |
2346 * @param actualParamTypeName the name of the expected parameter type | 2403 * @param actualParamTypeName the name of the expected parameter type |
2347 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the | 2404 * @param expectedParamType the name of the actual parameter type, not assigna
ble to the |
2348 * actualParamTypeName | 2405 * actualParamTypeName |
2349 * @param className the name of the class where the overridden setter is decla
red | 2406 * @param className the name of the class where the overridden setter is decla
red |
2350 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE | 2407 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE |
2351 */ | 2408 */ |
2352 static final StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = new
StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 39, "The paramet
er type '%s' is not assignable to '%s' as required by the setter it is overridin
g from '%s'"); | 2409 static final StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = new
StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 39, "The pa
rameter type '%s' is not assignable to '%s' as required by the setter it is over
riding from '%s'"); |
2353 | 2410 |
2354 /** | 2411 /** |
2355 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i>
... | 2412 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i>
... |
2356 * <i>e<sub>n</sub></i>] is evaluated as follows: | 2413 * <i>e<sub>n</sub></i>] is evaluated as follows: |
2357 * | 2414 * |
2358 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
second argument | 2415 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
second argument |
2359 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> | 2416 * <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> |
2360 * | 2417 * |
2361 * | 2418 * |
2362 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 2419 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
2363 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 2420 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
2364 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. | 2421 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. |
2365 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2422 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
2366 * j <= m</i>. | 2423 * j <= m</i>. |
2367 */ | 2424 */ |
2368 static final StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new StaticWa
rningCode('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 40, "The element type '%s' cannot
be assigned to the list type '%s'"); | 2425 static final StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 40, "The element type '%s' ca
nnot be assigned to the list type '%s'"); |
2369 | 2426 |
2370 /** | 2427 /** |
2371 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : | 2428 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : |
2372 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: | 2429 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: |
2373 * | 2430 * |
2374 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second | 2431 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second |
2375 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 2432 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
2376 * | 2433 * |
2377 * | 2434 * |
2378 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 2435 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
2379 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 2436 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
2380 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. | 2437 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. |
2381 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2438 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
2382 * j <= m</i>. | 2439 * j <= m</i>. |
2383 */ | 2440 */ |
2384 static final StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new StaticWarning
Code('MAP_KEY_TYPE_NOT_ASSIGNABLE', 41, "The element type '%s' cannot be assigne
d to the map key type '%s'"); | 2441 static final StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = new StaticWarning
Code.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 41, "The element type '%s' cannot be as
signed to the map key type '%s'"); |
2385 | 2442 |
2386 /** | 2443 /** |
2387 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : | 2444 * 12.7 Map: A run-time map literal <<i>K</i>, <i>V</i>> [<i>k<sub>1</su
b></i> : |
2388 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: | 2445 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev
aluated as follows: |
2389 * | 2446 * |
2390 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second | 2447 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s
ub></i> and second |
2391 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> | 2448 * argument <i>e<sub>i</sub></i><i>, 1 <= i <= n</i> |
2392 * | 2449 * |
2393 * | 2450 * |
2394 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of | 2451 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
type of |
2395 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= | 2452 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s
ub>, 1 <= i <= |
2396 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. | 2453 * n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>
q</i> of <i>f</i>. |
2397 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= | 2454 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<
sub>j</sub>, 1 <= |
2398 * j <= m</i>. | 2455 * j <= m</i>. |
2399 */ | 2456 */ |
2400 static final StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new StaticWarni
ngCode('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 42, "The element type '%s' cannot be ass
igned to the map value type '%s'"); | 2457 static final StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = new StaticWarni
ngCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 42, "The element type '%s' cannot b
e assigned to the map value type '%s'"); |
2401 | 2458 |
2402 /** | 2459 /** |
2403 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
with argument type | 2460 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
with argument type |
2404 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i
> may not be | 2461 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i
> may not be |
2405 * assigned to <i>S</i>. | 2462 * assigned to <i>S</i>. |
2406 */ | 2463 */ |
2407 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new Static
WarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES', 43, "The parameter type for se
tter '%s' is '%s' which is not assignable to its getter (of type '%s')"); | 2464 static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new Static
WarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 43, "The parameter type f
or setter '%s' is '%s' which is not assignable to its getter (of type '%s')"); |
2408 | 2465 |
2409 /** | 2466 /** |
2410 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst
ract class and | 2467 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst
ract class and |
2411 * <i>q</i> is not a factory constructor. | 2468 * <i>q</i> is not a factory constructor. |
2412 */ | 2469 */ |
2413 static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode
('NEW_WITH_ABSTRACT_CLASS', 44, "Abstract classes cannot be created with a 'new'
expression"); | 2470 static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode
.con1('NEW_WITH_ABSTRACT_CLASS', 44, "Abstract classes cannot be created with a
'new' expression"); |
2414 | 2471 |
2415 /** | 2472 /** |
2416 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat
ic warning. | 2473 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat
ic warning. |
2417 * | 2474 * |
2418 * @param typeName the name of the type being referenced (<i>S</i>) | 2475 * @param typeName the name of the type being referenced (<i>S</i>) |
2419 * @param parameterCount the number of type parameters that were declared | 2476 * @param parameterCount the number of type parameters that were declared |
2420 * @param argumentCount the number of type arguments provided | 2477 * @param argumentCount the number of type arguments provided |
2421 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS | 2478 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS |
2422 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS | 2479 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS |
2423 */ | 2480 */ |
2424 static final StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = new StaticWa
rningCode('NEW_WITH_INVALID_TYPE_PARAMETERS', 45, "The type '%s' is declared wit
h %d type parameters, but %d type arguments were given"); | 2481 static final StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = new StaticWa
rningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 45, "The type '%s' is declare
d with %d type parameters, but %d type arguments were given"); |
2425 | 2482 |
2426 /** | 2483 /** |
2427 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i
n the current scope, | 2484 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i
n the current scope, |
2428 * optionally followed by type arguments. | 2485 * optionally followed by type arguments. |
2429 * | 2486 * |
2430 * @param name the name of the non-type element | 2487 * @param name the name of the non-type element |
2431 */ | 2488 */ |
2432 static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode('NEW_
WITH_NON_TYPE', 46, "The name '%s' is not a class"); | 2489 static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode.con1(
'NEW_WITH_NON_TYPE', 46, "The name '%s' is not a class"); |
2433 | 2490 |
2434 /** | 2491 /** |
2435 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: | 2492 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: |
2436 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, | 2493 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, |
2437 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a | 2494 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a |
2438 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. | 2495 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. |
2439 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: | 2496 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: |
2440 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the | 2497 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the |
2441 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. | 2498 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. |
2442 */ | 2499 */ |
2443 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarn
ingCode('NEW_WITH_UNDEFINED_CONSTRUCTOR', 47, "The class '%s' does not have a co
nstructor '%s'"); | 2500 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarn
ingCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 47, "The class '%s' does not have
a constructor '%s'"); |
2444 | 2501 |
2445 /** | 2502 /** |
2446 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: | 2503 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
current scope then: |
2447 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, | 2504 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, …, a<sub>n<
/sub>, |
2448 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a | 2505 * x<sub>n+1</sub>: a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub
>)</i> it is a |
2449 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. | 2506 * static warning if <i>T.id</i> is not the name of a constructor declared by
the type <i>T</i>. |
2450 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: | 2507 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, …, a<sub>n</sub>, x<
sub>n+1</sub>: |
2451 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the | 2508 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a sta
tic warning if the |
2452 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. | 2509 * type <i>T</i> does not declare a constructor with the same name as the decl
aration of <i>T</i>. |
2453 */ | 2510 */ |
2454 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new St
aticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 48, "The class '%s' do
es not have a default constructor"); | 2511 static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new St
aticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 48, "The class '%
s' does not have a default constructor"); |
2455 | 2512 |
2456 /** | 2513 /** |
2457 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2514 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
2458 * abstract method. | 2515 * abstract method. |
2459 * | 2516 * |
2460 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2517 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
2461 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2518 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
2462 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2519 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
2463 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2520 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
2464 * | 2521 * |
2465 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2522 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
2466 * inherited in a concrete class unless that member overrides a concrete one. | 2523 * inherited in a concrete class unless that member overrides a concrete one. |
2467 * | 2524 * |
2468 * @param memberName the name of the first member | 2525 * @param memberName the name of the first member |
2469 * @param memberName the name of the second member | 2526 * @param memberName the name of the second member |
2470 * @param memberName the name of the third member | 2527 * @param memberName the name of the third member |
2471 * @param memberName the name of the fourth member | 2528 * @param memberName the name of the fourth member |
2472 * @param additionalCount the number of additional missing members that aren't
listed | 2529 * @param additionalCount the number of additional missing members that aren't
listed |
2473 */ | 2530 */ |
2474 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV
E_PLUS = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE
_PLUS', 49, "Missing inherited members: '%s', '%s', '%s', '%s' and %d more"); | 2531 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV
E_PLUS = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER
_FIVE_PLUS', 49, "Missing inherited members: '%s', '%s', '%s', '%s' and %d more"
); |
2475 | 2532 |
2476 /** | 2533 /** |
2477 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2534 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
2478 * abstract method. | 2535 * abstract method. |
2479 * | 2536 * |
2480 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2537 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
2481 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2538 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
2482 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2539 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
2483 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2540 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
2484 * | 2541 * |
2485 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2542 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
2486 * inherited in a concrete class unless that member overrides a concrete one. | 2543 * inherited in a concrete class unless that member overrides a concrete one. |
2487 * | 2544 * |
2488 * @param memberName the name of the first member | 2545 * @param memberName the name of the first member |
2489 * @param memberName the name of the second member | 2546 * @param memberName the name of the second member |
2490 * @param memberName the name of the third member | 2547 * @param memberName the name of the third member |
2491 * @param memberName the name of the fourth member | 2548 * @param memberName the name of the fourth member |
2492 */ | 2549 */ |
2493 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU
R = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', 50
, "Missing inherited members: '%s', '%s', '%s' and '%s'"); | 2550 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU
R = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR
', 50, "Missing inherited members: '%s', '%s', '%s' and '%s'"); |
2494 | 2551 |
2495 /** | 2552 /** |
2496 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2553 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
2497 * abstract method. | 2554 * abstract method. |
2498 * | 2555 * |
2499 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2556 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
2500 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2557 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
2501 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2558 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
2502 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2559 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
2503 * | 2560 * |
2504 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2561 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
2505 * inherited in a concrete class unless that member overrides a concrete one. | 2562 * inherited in a concrete class unless that member overrides a concrete one. |
2506 * | 2563 * |
2507 * @param memberName the name of the member | 2564 * @param memberName the name of the member |
2508 */ | 2565 */ |
2509 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE
= new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', 51,
"Missing inherited member '%s'"); | 2566 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE
= new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE',
51, "Missing inherited member '%s'"); |
2510 | 2567 |
2511 /** | 2568 /** |
2512 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2569 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
2513 * abstract method. | 2570 * abstract method. |
2514 * | 2571 * |
2515 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2572 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
2516 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2573 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
2517 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2574 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
2518 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2575 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
2519 * | 2576 * |
2520 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2577 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
2521 * inherited in a concrete class unless that member overrides a concrete one. | 2578 * inherited in a concrete class unless that member overrides a concrete one. |
2522 * | 2579 * |
2523 * @param memberName the name of the first member | 2580 * @param memberName the name of the first member |
2524 * @param memberName the name of the second member | 2581 * @param memberName the name of the second member |
2525 * @param memberName the name of the third member | 2582 * @param memberName the name of the third member |
2526 */ | 2583 */ |
2527 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR
EE = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE',
52, "Missing inherited members: '%s', '%s' and '%s'"); | 2584 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR
EE = new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR
EE', 52, "Missing inherited members: '%s', '%s' and '%s'"); |
2528 | 2585 |
2529 /** | 2586 /** |
2530 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an | 2587 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
class inherits an |
2531 * abstract method. | 2588 * abstract method. |
2532 * | 2589 * |
2533 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own | 2590 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar
e its own |
2534 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> | 2591 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf
ace of <i>C</i> |
2535 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit | 2592 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not
declare or inherit |
2536 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. | 2593 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F'
<: F</i>. |
2537 * | 2594 * |
2538 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or | 2595 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
is declared or |
2539 * inherited in a concrete class unless that member overrides a concrete one. | 2596 * inherited in a concrete class unless that member overrides a concrete one. |
2540 * | 2597 * |
2541 * @param memberName the name of the first member | 2598 * @param memberName the name of the first member |
2542 * @param memberName the name of the second member | 2599 * @param memberName the name of the second member |
2543 */ | 2600 */ |
2544 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO
= new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', 53,
"Missing inherited members: '%s' and '%s'"); | 2601 static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO
= new StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO',
53, "Missing inherited members: '%s' and '%s'"); |
2545 | 2602 |
2546 /** | 2603 /** |
2547 * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, p<s
ub>2</sub>) s</i> or | 2604 * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, p<s
ub>2</sub>) s</i> or |
2548 * <i>on T s</i> matches an object <i>o</i> if the type of <i>o</i> is a subty
pe of <i>T</i>. It | 2605 * <i>on T s</i> matches an object <i>o</i> if the type of <i>o</i> is a subty
pe of <i>T</i>. It |
2549 * is a static warning if <i>T</i> does not denote a type available in the lex
ical scope of the | 2606 * is a static warning if <i>T</i> does not denote a type available in the lex
ical scope of the |
2550 * catch clause. | 2607 * catch clause. |
2551 * | 2608 * |
2552 * @param name the name of the non-type element | 2609 * @param name the name of the non-type element |
2553 */ | 2610 */ |
2554 static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCod
e('NON_TYPE_IN_CATCH_CLAUSE', 54, "The name '%s' is not a type and cannot be use
d in an on-catch clause"); | 2611 static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCod
e.con1('NON_TYPE_IN_CATCH_CLAUSE', 54, "The name '%s' is not a type and cannot b
e used in an on-catch clause"); |
2555 | 2612 |
2556 /** | 2613 /** |
2557 * 7.1.1 Operators: It is a static warning if the return type of the user-decl
ared operator []= is | 2614 * 7.1.1 Operators: It is a static warning if the return type of the user-decl
ared operator []= is |
2558 * explicitly declared and not void. | 2615 * explicitly declared and not void. |
2559 */ | 2616 */ |
2560 static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarnin
gCode('NON_VOID_RETURN_FOR_OPERATOR', 55, "The return type of the operator []= m
ust be 'void'"); | 2617 static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarnin
gCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 55, "The return type of the operator
[]= must be 'void'"); |
2561 | 2618 |
2562 /** | 2619 /** |
2563 * 7.3 Setters: It is a static warning if a setter declares a return type othe
r than void. | 2620 * 7.3 Setters: It is a static warning if a setter declares a return type othe
r than void. |
2564 */ | 2621 */ |
2565 static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningC
ode('NON_VOID_RETURN_FOR_SETTER', 56, "The return type of the setter must be 'vo
id'"); | 2622 static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningC
ode.con1('NON_VOID_RETURN_FOR_SETTER', 56, "The return type of the setter must b
e 'void'"); |
2566 | 2623 |
2567 /** | 2624 /** |
2568 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for
m <i>id</i> or the | 2625 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for
m <i>id</i> or the |
2569 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</
i> (respectively | 2626 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</
i> (respectively |
2570 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type variabl
e in the | 2627 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type variabl
e in the |
2571 * enclosing lexical scope, but occurs in the signature or body of a static me
mber. * | 2628 * enclosing lexical scope, but occurs in the signature or body of a static me
mber. * |
2572 * <i>T</i> is a parameterized type of the form <i>G<S<sub>1</sub>, .., S<s
ub>n</sub>></i>, | 2629 * <i>T</i> is a parameterized type of the form <i>G<S<sub>1</sub>, .., S<s
ub>n</sub>></i>, |
2573 * and <i>G</i> is malformed. | 2630 * and <i>G</i> is malformed. |
2574 * | 2631 * |
2575 * Any use of a malformed type gives rise to a static warning. | 2632 * Any use of a malformed type gives rise to a static warning. |
2576 * | 2633 * |
2577 * @param nonTypeName the name that is not a type | 2634 * @param nonTypeName the name that is not a type |
2578 */ | 2635 */ |
2579 static final StaticWarningCode NOT_A_TYPE = new StaticWarningCode('NOT_A_TYPE'
, 57, "%s is not a type"); | 2636 static final StaticWarningCode NOT_A_TYPE = new StaticWarningCode.con1('NOT_A_
TYPE', 57, "%s is not a type"); |
2580 | 2637 |
2581 /** | 2638 /** |
2582 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > | 2639 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</
i> or if <i>m > |
2583 * n</i>. | 2640 * n</i>. |
2584 * | 2641 * |
2585 * @param requiredCount the expected number of required arguments | 2642 * @param requiredCount the expected number of required arguments |
2586 * @param argumentCount the actual number of positional arguments given | 2643 * @param argumentCount the actual number of positional arguments given |
2587 * @see #EXTRA_POSITIONAL_ARGUMENTS | 2644 * @see #EXTRA_POSITIONAL_ARGUMENTS |
2588 */ | 2645 */ |
2589 static final StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new StaticWarni
ngCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', 58, "%d required argument(s) expected, b
ut %d found"); | 2646 static final StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new StaticWarni
ngCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 58, "%d required argument(s) expect
ed, but %d found"); |
2590 | 2647 |
2591 /** | 2648 /** |
2592 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p<
/i> names a library | 2649 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p<
/i> names a library |
2593 * other than the current library as the library to which <i>p</i> belongs. | 2650 * other than the current library as the library to which <i>p</i> belongs. |
2594 * | 2651 * |
2595 * @param expectedLibraryName the name of expected library name | 2652 * @param expectedLibraryName the name of expected library name |
2596 * @param actualLibraryName the non-matching actual library name from the "par
t of" declaration | 2653 * @param actualLibraryName the non-matching actual library name from the "par
t of" declaration |
2597 */ | 2654 */ |
2598 static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCo
de('PART_OF_DIFFERENT_LIBRARY', 59, "Expected this library to be part of '%s', n
ot '%s'"); | 2655 static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCo
de.con1('PART_OF_DIFFERENT_LIBRARY', 59, "Expected this library to be part of '%
s', not '%s'"); |
2599 | 2656 |
2600 /** | 2657 /** |
2601 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i
s not a subtype of | 2658 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i
s not a subtype of |
2602 * the type of <i>k</i>. | 2659 * the type of <i>k</i>. |
2603 * | 2660 * |
2604 * @param redirectedName the name of the redirected constructor | 2661 * @param redirectedName the name of the redirected constructor |
2605 * @param redirectingName the name of the redirecting constructor | 2662 * @param redirectingName the name of the redirecting constructor |
2606 */ | 2663 */ |
2607 static final StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = new StaticW
arningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE', 60, "The redirected constructor
'%s' has incompatible parameters with '%s'"); | 2664 static final StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = new StaticW
arningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 60, "The redirected constru
ctor '%s' has incompatible parameters with '%s'"); |
2608 | 2665 |
2609 /** | 2666 /** |
2610 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i
s not a subtype of | 2667 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i
s not a subtype of |
2611 * the type of <i>k</i>. | 2668 * the type of <i>k</i>. |
2612 * | 2669 * |
2613 * @param redirectedName the name of the redirected constructor return type | 2670 * @param redirectedName the name of the redirected constructor return type |
2614 * @param redirectingName the name of the redirecting constructor return type | 2671 * @param redirectingName the name of the redirecting constructor return type |
2615 */ | 2672 */ |
2616 static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWar
ningCode('REDIRECT_TO_INVALID_RETURN_TYPE', 61, "The return type '%s' of the red
irected constructor is not a subclass of '%s'"); | 2673 static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWar
ningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 61, "The return type '%s' of th
e redirected constructor is not a subclass of '%s'"); |
2617 | 2674 |
2618 /** | 2675 /** |
2619 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the | 2676 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the |
2620 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the | 2677 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the |
2621 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. | 2678 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. |
2622 */ | 2679 */ |
2623 static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWar
ningCode('REDIRECT_TO_MISSING_CONSTRUCTOR', 62, "The constructor '%s' could not
be found in '%s'"); | 2680 static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWar
ningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 62, "The constructor '%s' could
not be found in '%s'"); |
2624 | 2681 |
2625 /** | 2682 /** |
2626 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the | 2683 * 7.6.2 Factories: It is a static warning if type does not denote a class acc
essible in the |
2627 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the | 2684 * current scope; if type does denote such a class <i>C</i> it is a static war
ning if the |
2628 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. | 2685 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const
ructor of <i>C</i>. |
2629 */ | 2686 */ |
2630 static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode('
REDIRECT_TO_NON_CLASS', 63, "The name '%s' is not a type and cannot be used in a
redirected constructor"); | 2687 static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode.c
on1('REDIRECT_TO_NON_CLASS', 63, "The name '%s' is not a type and cannot be used
in a redirected constructor"); |
2631 | 2688 |
2632 /** | 2689 /** |
2633 * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return s
tatement of the form | 2690 * 13.11 Return: Let <i>f</i> be the function immediately enclosing a return s
tatement of the form |
2634 * <i>return;</i> It is a static warning if both of the following conditions h
old: | 2691 * <i>return;</i> It is a static warning if both of the following conditions h
old: |
2635 * <ol> | 2692 * <ol> |
2636 * * <i>f</i> is not a generative constructor. | 2693 * * <i>f</i> is not a generative constructor. |
2637 * * The return type of <i>f</i> may not be assigned to void. | 2694 * * The return type of <i>f</i> may not be assigned to void. |
2638 * </ol> | 2695 * </ol> |
2639 */ | 2696 */ |
2640 static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode('R
ETURN_WITHOUT_VALUE', 64, "Missing return value after 'return'"); | 2697 static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode.co
n1('RETURN_WITHOUT_VALUE', 64, "Missing return value after 'return'"); |
2641 | 2698 |
2642 /** | 2699 /** |
2643 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method | 2700 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method |
2644 * or getter <i>m</i>. | 2701 * or getter <i>m</i>. |
2645 * | 2702 * |
2646 * @param memberName the name of the instance member | 2703 * @param memberName the name of the instance member |
2647 */ | 2704 */ |
2648 static final StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = new StaticWa
rningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER', 65, "Instance member '%s' cannot b
e accessed using static access"); | 2705 static final StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = new StaticWa
rningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 65, "Instance member '%s' can
not be accessed using static access"); |
2649 | 2706 |
2650 /** | 2707 /** |
2651 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi
gned to the type of | 2708 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi
gned to the type of |
2652 * <i>e<sub>k</sub></i>. | 2709 * <i>e<sub>k</sub></i>. |
2653 */ | 2710 */ |
2654 static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWa
rningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 66, "Type '%s' of the switch expre
ssion is not assignable to the type '%s' of case expressions"); | 2711 static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWa
rningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 66, "Type '%s' of the switch
expression is not assignable to the type '%s' of case expressions"); |
2655 | 2712 |
2656 /** | 2713 /** |
2657 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
available in the | 2714 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
available in the |
2658 * current lexical scope. | 2715 * current lexical scope. |
2659 */ | 2716 */ |
2660 static final StaticWarningCode TYPE_TEST_NON_TYPE = new StaticWarningCode('TYP
E_TEST_NON_TYPE', 67, "The name '%s' is not a type and cannot be used in an 'is'
expression"); | 2717 static final StaticWarningCode TYPE_TEST_NON_TYPE = new StaticWarningCode.con1
('TYPE_TEST_NON_TYPE', 67, "The name '%s' is not a type and cannot be used in an
'is' expression"); |
2661 | 2718 |
2662 /** | 2719 /** |
2663 * 10 Generics: However, a type parameter is considered to be a malformed type
when referenced by | 2720 * 10 Generics: However, a type parameter is considered to be a malformed type
when referenced by |
2664 * a static member. | 2721 * a static member. |
2665 * | 2722 * |
2666 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni
ng. A malformed type | 2723 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni
ng. A malformed type |
2667 * is then interpreted as dynamic by the static type checker and the runtime. | 2724 * is then interpreted as dynamic by the static type checker and the runtime. |
2668 */ | 2725 */ |
2669 static final StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = new Stati
cWarningCode('TYPE_PARAMETER_REFERENCED_BY_STATIC', 68, "Static members cannot r
eference type parameters"); | 2726 static final StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = new Stati
cWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 68, "Static members can
not reference type parameters"); |
2670 | 2727 |
2671 /** | 2728 /** |
2672 * 12.15.3 Static Invocation: A static method invocation <i>i</i> has the form | 2729 * 12.15.3 Static Invocation: A static method invocation <i>i</i> has the form |
2673 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … | 2730 * <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … |
2674 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> d
oes not denote a | 2731 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> d
oes not denote a |
2675 * class in the current scope. | 2732 * class in the current scope. |
2676 * | 2733 * |
2677 * @param undefinedClassName the name of the undefined class | 2734 * @param undefinedClassName the name of the undefined class |
2678 */ | 2735 */ |
2679 static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode('UNDEFI
NED_CLASS', 69, "Undefined class '%s'"); | 2736 static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode.con1('U
NDEFINED_CLASS', 69, "Undefined class '%s'"); |
2680 | 2737 |
2681 /** | 2738 /** |
2682 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". | 2739 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". |
2683 */ | 2740 */ |
2684 static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode
('UNDEFINED_CLASS_BOOLEAN', 70, "Undefined class 'boolean'; did you mean 'bool'?
"); | 2741 static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode
.con1('UNDEFINED_CLASS_BOOLEAN', 70, "Undefined class 'boolean'; did you mean 'b
ool'?"); |
2685 | 2742 |
2686 /** | 2743 /** |
2687 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</
i> in the enclosing | 2744 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</
i> in the enclosing |
2688 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e
xplicitly, a getter | 2745 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e
xplicitly, a getter |
2689 * named <i>m</i>. | 2746 * named <i>m</i>. |
2690 * | 2747 * |
2691 * @param getterName the name of the getter | 2748 * @param getterName the name of the getter |
2692 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for | 2749 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for |
2693 */ | 2750 */ |
2694 static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode('UNDEF
INED_GETTER', 71, "There is no such getter '%s' in '%s'"); | 2751 static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode.con1('
UNDEFINED_GETTER', 71, "There is no such getter '%s' in '%s'"); |
2695 | 2752 |
2696 /** | 2753 /** |
2697 * 12.30 Identifier Reference: It is as static warning if an identifier expres
sion of the form | 2754 * 12.30 Identifier Reference: It is as static warning if an identifier expres
sion of the form |
2698 * <i>id</i> occurs inside a top level or static function (be it function, met
hod, getter, or | 2755 * <i>id</i> occurs inside a top level or static function (be it function, met
hod, getter, or |
2699 * setter) or variable initializer and there is no declaration <i>d</i> with n
ame <i>id</i> in the | 2756 * setter) or variable initializer and there is no declaration <i>d</i> with n
ame <i>id</i> in the |
2700 * lexical scope enclosing the expression. | 2757 * lexical scope enclosing the expression. |
2701 */ | 2758 */ |
2702 static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode('U
NDEFINED_IDENTIFIER', 72, "Undefined name '%s'"); | 2759 static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode.co
n1('UNDEFINED_IDENTIFIER', 72, "Undefined name '%s'"); |
2703 | 2760 |
2704 /** | 2761 /** |
2705 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
<i>1<=i<=l</i>, | 2762 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
<i>1<=i<=l</i>, |
2706 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i
> ... | 2763 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i
> ... |
2707 * <i>p<sub>n+k</sub></i>} or a static warning occurs. | 2764 * <i>p<sub>n+k</sub></i>} or a static warning occurs. |
2708 * | 2765 * |
2709 * @param name the name of the requested named parameter | 2766 * @param name the name of the requested named parameter |
2710 */ | 2767 */ |
2711 static final StaticWarningCode UNDEFINED_NAMED_PARAMETER = new StaticWarningCo
de('UNDEFINED_NAMED_PARAMETER', 73, "The named parameter '%s' is not defined"); | 2768 static final StaticWarningCode UNDEFINED_NAMED_PARAMETER = new StaticWarningCo
de.con1('UNDEFINED_NAMED_PARAMETER', 73, "The named parameter '%s' is not define
d"); |
2712 | 2769 |
2713 /** | 2770 /** |
2714 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v
= e</i> occurs | 2771 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v
= e</i> occurs |
2715 * inside a top level or static function (be it function, method, getter, or s
etter) or variable | 2772 * inside a top level or static function (be it function, method, getter, or s
etter) or variable |
2716 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the
lexical scope | 2773 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the
lexical scope |
2717 * enclosing the assignment. | 2774 * enclosing the assignment. |
2718 * | 2775 * |
2719 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t
he enclosing lexical | 2776 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t
he enclosing lexical |
2720 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp
licitly, a setter | 2777 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp
licitly, a setter |
2721 * <i>v=</i>. | 2778 * <i>v=</i>. |
2722 * | 2779 * |
2723 * @param setterName the name of the getter | 2780 * @param setterName the name of the getter |
2724 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for | 2781 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for |
2725 */ | 2782 */ |
2726 static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode('UNDEF
INED_SETTER', 74, "There is no such setter '%s' in '%s'"); | 2783 static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode.con1('
UNDEFINED_SETTER', 74, "There is no such setter '%s' in '%s'"); |
2727 | 2784 |
2728 /** | 2785 /** |
2729 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method | 2786 * 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not decl
are a static method |
2730 * or getter <i>m</i>. | 2787 * or getter <i>m</i>. |
2731 * | 2788 * |
2732 * @param methodName the name of the method | 2789 * @param methodName the name of the method |
2733 * @param enclosingType the name of the enclosing type where the method is bei
ng looked for | 2790 * @param enclosingType the name of the enclosing type where the method is bei
ng looked for |
2734 */ | 2791 */ |
2735 static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticW
arningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', 75, "There is no such static met
hod '%s' in '%s'"); | 2792 static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticW
arningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 75, "There is no such stati
c method '%s' in '%s'"); |
2736 static final List<StaticWarningCode> values = [ | 2793 static final List<StaticWarningCode> values = [ |
2737 AMBIGUOUS_IMPORT, | 2794 AMBIGUOUS_IMPORT, |
2738 ARGUMENT_TYPE_NOT_ASSIGNABLE, | 2795 ARGUMENT_TYPE_NOT_ASSIGNABLE, |
2739 ASSIGNMENT_TO_CONST, | 2796 ASSIGNMENT_TO_CONST, |
2740 ASSIGNMENT_TO_FINAL, | 2797 ASSIGNMENT_TO_FINAL, |
2741 ASSIGNMENT_TO_METHOD, | 2798 ASSIGNMENT_TO_METHOD, |
2742 CASE_BLOCK_NOT_TERMINATED, | 2799 CASE_BLOCK_NOT_TERMINATED, |
2743 CAST_TO_NON_TYPE, | 2800 CAST_TO_NON_TYPE, |
2744 COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE, | 2801 COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE, |
2745 COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE, | 2802 COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2804 TYPE_TEST_NON_TYPE, | 2861 TYPE_TEST_NON_TYPE, |
2805 TYPE_PARAMETER_REFERENCED_BY_STATIC, | 2862 TYPE_PARAMETER_REFERENCED_BY_STATIC, |
2806 UNDEFINED_CLASS, | 2863 UNDEFINED_CLASS, |
2807 UNDEFINED_CLASS_BOOLEAN, | 2864 UNDEFINED_CLASS_BOOLEAN, |
2808 UNDEFINED_GETTER, | 2865 UNDEFINED_GETTER, |
2809 UNDEFINED_IDENTIFIER, | 2866 UNDEFINED_IDENTIFIER, |
2810 UNDEFINED_NAMED_PARAMETER, | 2867 UNDEFINED_NAMED_PARAMETER, |
2811 UNDEFINED_SETTER, | 2868 UNDEFINED_SETTER, |
2812 UNDEFINED_STATIC_METHOD_OR_GETTER]; | 2869 UNDEFINED_STATIC_METHOD_OR_GETTER]; |
2813 | 2870 |
2814 /// The name of this enum constant, as declared in the enum declaration. | |
2815 final String name; | |
2816 | |
2817 /// The position in the enum declaration. | |
2818 final int ordinal; | |
2819 | |
2820 /** | 2871 /** |
2821 * The message template used to create the message to be displayed for this er
ror. | 2872 * The template used to create the message to be displayed for this error. |
2822 */ | 2873 */ |
2823 String _message; | 2874 String _message; |
2824 | 2875 |
2825 /** | 2876 /** |
2826 * Initialize a newly created error code to have the given type and message. | 2877 * The template used to create the correction to be displayed for this error,
or `null` if |
| 2878 * there is no correction information for this error. |
| 2879 */ |
| 2880 String correction7; |
| 2881 |
| 2882 /** |
| 2883 * Initialize a newly created error code to have the given message. |
2827 * | 2884 * |
2828 * @param message the message template used to create the message to be displa
yed for the error | 2885 * @param message the message template used to create the message to be displa
yed for the error |
2829 */ | 2886 */ |
2830 StaticWarningCode(this.name, this.ordinal, String message) { | 2887 StaticWarningCode.con1(String name, int ordinal, String message) : super(name,
ordinal) { |
2831 this._message = message; | 2888 this._message = message; |
2832 } | 2889 } |
| 2890 |
| 2891 /** |
| 2892 * Initialize a newly created error code to have the given message and correct
ion. |
| 2893 * |
| 2894 * @param message the template used to create the message to be displayed for
the error |
| 2895 * @param correction the template used to create the correction to be displaye
d for the error |
| 2896 */ |
| 2897 StaticWarningCode.con2(String name, int ordinal, String message, String correc
tion) : super(name, ordinal) { |
| 2898 this._message = message; |
| 2899 this.correction7 = correction; |
| 2900 } |
| 2901 String get correction => correction7; |
2833 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; | 2902 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; |
2834 String get message => _message; | 2903 String get message => _message; |
2835 ErrorType get type => ErrorType.STATIC_WARNING; | 2904 ErrorType get type => ErrorType.STATIC_WARNING; |
2836 int compareTo(StaticWarningCode other) => ordinal - other.ordinal; | |
2837 int get hashCode => ordinal; | |
2838 String toString() => name; | |
2839 } | 2905 } |
2840 /** | 2906 /** |
2841 * The interface `AnalysisErrorListener` defines the behavior of objects that li
sten for | 2907 * The interface `AnalysisErrorListener` defines the behavior of objects that li
sten for |
2842 * [AnalysisError] being produced by the analysis engine. | 2908 * [AnalysisError] being produced by the analysis engine. |
2843 * | 2909 * |
2844 * @coverage dart.engine.error | 2910 * @coverage dart.engine.error |
2845 */ | 2911 */ |
2846 abstract class AnalysisErrorListener { | 2912 abstract class AnalysisErrorListener { |
2847 | 2913 |
2848 /** | 2914 /** |
(...skipping 13 matching lines...) Expand all Loading... |
2862 } | 2928 } |
2863 } | 2929 } |
2864 /** | 2930 /** |
2865 * The enumeration `HtmlWarningCode` defines the error codes used for warnings i
n HTML files. | 2931 * The enumeration `HtmlWarningCode` defines the error codes used for warnings i
n HTML files. |
2866 * The convention for this class is for the name of the error code to indicate t
he problem that | 2932 * The convention for this class is for the name of the error code to indicate t
he problem that |
2867 * caused the error to be generated and for the error message to explain what is
wrong and, when | 2933 * caused the error to be generated and for the error message to explain what is
wrong and, when |
2868 * appropriate, how the problem can be corrected. | 2934 * appropriate, how the problem can be corrected. |
2869 * | 2935 * |
2870 * @coverage dart.engine.error | 2936 * @coverage dart.engine.error |
2871 */ | 2937 */ |
2872 class HtmlWarningCode implements Enum<HtmlWarningCode>, ErrorCode { | 2938 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode { |
2873 | 2939 |
2874 /** | 2940 /** |
2875 * An error code indicating that the value of the 'src' attribute of a Dart sc
ript tag is not a | 2941 * An error code indicating that the value of the 'src' attribute of a Dart sc
ript tag is not a |
2876 * valid URI. | 2942 * valid URI. |
2877 * | 2943 * |
2878 * @param uri the URI that is invalid | 2944 * @param uri the URI that is invalid |
2879 */ | 2945 */ |
2880 static final HtmlWarningCode INVALID_URI = new HtmlWarningCode('INVALID_URI',
0, "Invalid URI syntax: '%s'"); | 2946 static final HtmlWarningCode INVALID_URI = new HtmlWarningCode.con1('INVALID_U
RI', 0, "Invalid URI syntax: '%s'"); |
2881 | 2947 |
2882 /** | 2948 /** |
2883 * An error code indicating that the value of the 'src' attribute of a Dart sc
ript tag references | 2949 * An error code indicating that the value of the 'src' attribute of a Dart sc
ript tag references |
2884 * a file that does not exist. | 2950 * a file that does not exist. |
2885 * | 2951 * |
2886 * @param uri the URI pointing to a non-existent file | 2952 * @param uri the URI pointing to a non-existent file |
2887 */ | 2953 */ |
2888 static final HtmlWarningCode URI_DOES_NOT_EXIST = new HtmlWarningCode('URI_DOE
S_NOT_EXIST', 1, "Target of URI does not exist: '%s'"); | 2954 static final HtmlWarningCode URI_DOES_NOT_EXIST = new HtmlWarningCode.con1('UR
I_DOES_NOT_EXIST', 1, "Target of URI does not exist: '%s'"); |
2889 static final List<HtmlWarningCode> values = [INVALID_URI, URI_DOES_NOT_EXIST]; | 2955 static final List<HtmlWarningCode> values = [INVALID_URI, URI_DOES_NOT_EXIST]; |
2890 | 2956 |
2891 /// The name of this enum constant, as declared in the enum declaration. | |
2892 final String name; | |
2893 | |
2894 /// The position in the enum declaration. | |
2895 final int ordinal; | |
2896 | |
2897 /** | 2957 /** |
2898 * The message template used to create the message to be displayed for this er
ror. | 2958 * The template used to create the message to be displayed for this error. |
2899 */ | 2959 */ |
2900 String _message; | 2960 String _message; |
2901 | 2961 |
2902 /** | 2962 /** |
2903 * Initialize a newly created error code to have the given type and message. | 2963 * The template used to create the correction to be displayed for this error,
or `null` if |
| 2964 * there is no correction information for this error. |
| 2965 */ |
| 2966 String correction4; |
| 2967 |
| 2968 /** |
| 2969 * Initialize a newly created error code to have the given message. |
2904 * | 2970 * |
2905 * @param message the message template used to create the message to be displa
yed for the error | 2971 * @param message the message template used to create the message to be displa
yed for the error |
2906 */ | 2972 */ |
2907 HtmlWarningCode(this.name, this.ordinal, String message) { | 2973 HtmlWarningCode.con1(String name, int ordinal, String message) : super(name, o
rdinal) { |
2908 this._message = message; | 2974 this._message = message; |
2909 } | 2975 } |
| 2976 |
| 2977 /** |
| 2978 * Initialize a newly created error code to have the given message and correct
ion. |
| 2979 * |
| 2980 * @param message the template used to create the message to be displayed for
the error |
| 2981 * @param correction the template used to create the correction to be displaye
d for the error |
| 2982 */ |
| 2983 HtmlWarningCode.con2(String name, int ordinal, String message, String correcti
on) : super(name, ordinal) { |
| 2984 this._message = message; |
| 2985 this.correction4 = correction; |
| 2986 } |
| 2987 String get correction => correction4; |
2910 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; | 2988 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; |
2911 String get message => _message; | 2989 String get message => _message; |
2912 ErrorType get type => ErrorType.STATIC_WARNING; | 2990 ErrorType get type => ErrorType.STATIC_WARNING; |
2913 int compareTo(HtmlWarningCode other) => ordinal - other.ordinal; | |
2914 int get hashCode => ordinal; | |
2915 String toString() => name; | |
2916 } | 2991 } |
2917 /** | 2992 /** |
2918 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat
ic type | 2993 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat
ic type |
2919 * warnings. The convention for this class is for the name of the error code to
indicate the problem | 2994 * warnings. The convention for this class is for the name of the error code to
indicate the problem |
2920 * that caused the error to be generated and for the error message to explain wh
at is wrong and, | 2995 * that caused the error to be generated and for the error message to explain wh
at is wrong and, |
2921 * when appropriate, how the problem can be corrected. | 2996 * when appropriate, how the problem can be corrected. |
2922 * | 2997 * |
2923 * @coverage dart.engine.error | 2998 * @coverage dart.engine.error |
2924 */ | 2999 */ |
2925 class StaticTypeWarningCode implements Enum<StaticTypeWarningCode>, ErrorCode { | 3000 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error
Code { |
2926 | 3001 |
2927 /** | 3002 /** |
2928 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type | 3003 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type |
2929 * warning if <i>T</i> does not have an accessible instance setter named <i>v=
</i>. | 3004 * warning if <i>T</i> does not have an accessible instance setter named <i>v=
</i>. |
2930 * | 3005 * |
2931 * @see #UNDEFINED_SETTER | 3006 * @see #UNDEFINED_SETTER |
2932 */ | 3007 */ |
2933 static final StaticTypeWarningCode INACCESSIBLE_SETTER = new StaticTypeWarning
Code('INACCESSIBLE_SETTER', 0, ""); | 3008 static final StaticTypeWarningCode INACCESSIBLE_SETTER = new StaticTypeWarning
Code.con1('INACCESSIBLE_SETTER', 0, ""); |
2934 | 3009 |
2935 /** | 3010 /** |
2936 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i
>m<sub>1</sub>, | 3011 * 8.1.1 Inheritance and Overriding: However, if there are multiple members <i
>m<sub>1</sub>, |
2937 * … m<sub>k</sub></i> with the same name <i>n</i> that would be inheri
ted (because | 3012 * … m<sub>k</sub></i> with the same name <i>n</i> that would be inheri
ted (because |
2938 * identically named members existed in several superinterfaces) then at most
one member is | 3013 * identically named members existed in several superinterfaces) then at most
one member is |
2939 * inherited. | 3014 * inherited. |
2940 * | 3015 * |
2941 * If the static types <i>T<sub>1</sub>, …, T<sub>k</sub></i> of the me
mbers | 3016 * If the static types <i>T<sub>1</sub>, …, T<sub>k</sub></i> of the me
mbers |
2942 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> are not identical, then there
must be a member | 3017 * <i>m<sub>1</sub>, …, m<sub>k</sub></i> are not identical, then there
must be a member |
2943 * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> < T<sub>i</sub>, 1 <=
x <= k</i> for | 3018 * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> < T<sub>i</sub>, 1 <=
x <= k</i> for |
2944 * all <i>i, 1 <= i < k</i>, or a static type warning occurs. The member
that is inherited | 3019 * all <i>i, 1 <= i < k</i>, or a static type warning occurs. The member
that is inherited |
2945 * is <i>m<sub>x</sub></i>, if it exists; otherwise: | 3020 * is <i>m<sub>x</sub></i>, if it exists; otherwise: |
2946 * <ol> | 3021 * <ol> |
2947 * * If all of <i>m<sub>1</sub>, … m<sub>k</sub></i> have the same numb
er <i>r</i> of | 3022 * * If all of <i>m<sub>1</sub>, … m<sub>k</sub></i> have the same numb
er <i>r</i> of |
2948 * required parameters and the same set of named parameters <i>s</i>, then let
<i>h = max( | 3023 * required parameters and the same set of named parameters <i>s</i>, then let
<i>h = max( |
2949 * numberOfOptionalPositionals( m<sub>i</sub> ) ), 1 <= i <= k</i>. <i>I
</i> has a method | 3024 * numberOfOptionalPositionals( m<sub>i</sub> ) ), 1 <= i <= k</i>. <i>I
</i> has a method |
2950 * named <i>n</i>, with <i>r</i> required parameters of type dynamic, <i>h</i>
optional positional | 3025 * named <i>n</i>, with <i>r</i> required parameters of type dynamic, <i>h</i>
optional positional |
2951 * parameters of type dynamic, named parameters <i>s</i> of type dynamic and r
eturn type dynamic. | 3026 * parameters of type dynamic, named parameters <i>s</i> of type dynamic and r
eturn type dynamic. |
2952 * * Otherwise none of the members <i>m<sub>1</sub>, …, m<sub>k</sub></
i> is inherited. | 3027 * * Otherwise none of the members <i>m<sub>1</sub>, …, m<sub>k</sub></
i> is inherited. |
2953 * </ol> | 3028 * </ol> |
2954 */ | 3029 */ |
2955 static final StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = new Stati
cTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', 1, "'%s' is inherited by at
least two interfaces inconsistently"); | 3030 static final StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = new Stati
cTypeWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE', 1, "'%s' is inherited b
y at least two interfaces inconsistently"); |
2956 | 3031 |
2957 /** | 3032 /** |
2958 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n
ot have an | 3033 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n
ot have an |
2959 * accessible (3.2) instance member named <i>m</i>. | 3034 * accessible (3.2) instance member named <i>m</i>. |
2960 * | 3035 * |
2961 * @param memberName the name of the static member | 3036 * @param memberName the name of the static member |
2962 * @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER | 3037 * @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER |
2963 */ | 3038 */ |
2964 static final StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = new Stat
icTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', 2, "Static member '%s' can
not be accessed using instance access"); | 3039 static final StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = new Stat
icTypeWarningCode.con1('INSTANCE_ACCESS_TO_STATIC_MEMBER', 2, "Static member '%s
' cannot be accessed using instance access"); |
2965 | 3040 |
2966 /** | 3041 /** |
2967 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i
> may not be | 3042 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i
> may not be |
2968 * assigned to the static type of <i>v</i>. The static type of the expression
<i>v = e</i> is the | 3043 * assigned to the static type of <i>v</i>. The static type of the expression
<i>v = e</i> is the |
2969 * static type of <i>e</i>. | 3044 * static type of <i>e</i>. |
2970 * | 3045 * |
2971 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i
> may not be | 3046 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i
> may not be |
2972 * assigned to the static type of <i>C.v</i>. The static type of the expressio
n <i>C.v = e</i> is | 3047 * assigned to the static type of <i>C.v</i>. The static type of the expressio
n <i>C.v = e</i> is |
2973 * the static type of <i>e</i>. | 3048 * the static type of <i>e</i>. |
2974 * | 3049 * |
2975 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type | 3050 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type |
2976 * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to <
i>T</i>. | 3051 * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to <
i>T</i>. |
2977 * | 3052 * |
2978 * @param rhsTypeName the name of the right hand side type | 3053 * @param rhsTypeName the name of the right hand side type |
2979 * @param lhsTypeName the name of the left hand side type | 3054 * @param lhsTypeName the name of the left hand side type |
2980 */ | 3055 */ |
2981 static final StaticTypeWarningCode INVALID_ASSIGNMENT = new StaticTypeWarningC
ode('INVALID_ASSIGNMENT', 3, "A value of type '%s' cannot be assigned to a varia
ble of type '%s'"); | 3056 static final StaticTypeWarningCode INVALID_ASSIGNMENT = new StaticTypeWarningC
ode.con1('INVALID_ASSIGNMENT', 3, "A value of type '%s' cannot be assigned to a
variable of type '%s'"); |
2982 | 3057 |
2983 /** | 3058 /** |
2984 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the
form | 3059 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the
form |
2985 * <i>o.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … | 3060 * <i>o.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</
sub>, … |
2986 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. | 3061 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. |
2987 * | 3062 * |
2988 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if
<i>T</i> does not | 3063 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if
<i>T</i> does not |
2989 * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it
is a static warning | 3064 * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it
is a static warning |
2990 * if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type.
If <i>T.m</i> does | 3065 * if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type.
If <i>T.m</i> does |
2991 * not exist, or if <i>F</i> is not a function type, the static type of <i>i</
i> is dynamic. | 3066 * not exist, or if <i>F</i> is not a function type, the static type of <i>i</
i> is dynamic. |
2992 * | 3067 * |
2993 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i>
of <i>C.m</i> may | 3068 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i>
of <i>C.m</i> may |
2994 * not be assigned to a function type. | 3069 * not be assigned to a function type. |
2995 * | 3070 * |
2996 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | 3071 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form |
2997 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … | 3072 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … |
2998 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If <i>S.m</i> exists, it is a static
warning if the type | 3073 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If <i>S.m</i> exists, it is a static
warning if the type |
2999 * <i>F</i> of <i>S.m</i> may not be assigned to a function type. | 3074 * <i>F</i> of <i>S.m</i> may not be assigned to a function type. |
3000 * | 3075 * |
3001 * @param nonFunctionIdentifier the name of the identifier that is not a funct
ion type | 3076 * @param nonFunctionIdentifier the name of the identifier that is not a funct
ion type |
3002 */ | 3077 */ |
3003 static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = new StaticType
WarningCode('INVOCATION_OF_NON_FUNCTION', 4, "'%s' is not a method"); | 3078 static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = new StaticType
WarningCode.con1('INVOCATION_OF_NON_FUNCTION', 4, "'%s' is not a method"); |
3004 | 3079 |
3005 /** | 3080 /** |
3006 * 12.14.4 Function Expression Invocation: A function expression invocation <i
>i</i> has the form | 3081 * 12.14.4 Function Expression Invocation: A function expression invocation <i
>i</i> has the form |
3007 * <i>e<sub>f</sub>(a<sub>1</sub>, … a<sub>n</sub>, x<sub>n+1</sub>: a<
sub>n+1</sub>, | 3082 * <i>e<sub>f</sub>(a<sub>1</sub>, … a<sub>n</sub>, x<sub>n+1</sub>: a<
sub>n+1</sub>, |
3008 * …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i>
is an expression. | 3083 * …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i>
is an expression. |
3009 * | 3084 * |
3010 * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub>
</i> may not be | 3085 * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub>
</i> may not be |
3011 * assigned to a function type. | 3086 * assigned to a function type. |
3012 */ | 3087 */ |
3013 static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = new
StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 5, "Cannot invok
e a non-function"); | 3088 static final StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = new
StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 5, "Cannot
invoke a non-function"); |
3014 | 3089 |
3015 /** | 3090 /** |
3016 * 12.19 Conditional: It is a static type warning if the type of <i>e<sub>1</s
ub></i> may not be | 3091 * 12.19 Conditional: It is a static type warning if the type of <i>e<sub>1</s
ub></i> may not be |
3017 * assigned to bool. | 3092 * assigned to bool. |
3018 * | 3093 * |
3019 * 13.5 If: It is a static type warning if the type of the expression <i>b</i>
may not be assigned | 3094 * 13.5 If: It is a static type warning if the type of the expression <i>b</i>
may not be assigned |
3020 * to bool. | 3095 * to bool. |
3021 * | 3096 * |
3022 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be
assigned to bool. | 3097 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be
assigned to bool. |
3023 * | 3098 * |
3024 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assi
gned to bool. | 3099 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assi
gned to bool. |
3025 */ | 3100 */ |
3026 static final StaticTypeWarningCode NON_BOOL_CONDITION = new StaticTypeWarningC
ode('NON_BOOL_CONDITION', 6, "Conditions must have a static type of 'bool'"); | 3101 static final StaticTypeWarningCode NON_BOOL_CONDITION = new StaticTypeWarningC
ode.con1('NON_BOOL_CONDITION', 6, "Conditions must have a static type of 'bool'"
); |
3027 | 3102 |
3028 /** | 3103 /** |
3029 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not b
e assigned to either | 3104 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not b
e assigned to either |
3030 * bool or () → bool | 3105 * bool or () → bool |
3031 */ | 3106 */ |
3032 static final StaticTypeWarningCode NON_BOOL_EXPRESSION = new StaticTypeWarning
Code('NON_BOOL_EXPRESSION', 7, "Assertions must be on either a 'bool' or '() ->
bool'"); | 3107 static final StaticTypeWarningCode NON_BOOL_EXPRESSION = new StaticTypeWarning
Code.con1('NON_BOOL_EXPRESSION', 7, "Assertions must be on either a 'bool' or '(
) -> bool'"); |
3033 | 3108 |
3034 /** | 3109 /** |
3035 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>,
1 <= i <= | 3110 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>,
1 <= i <= |
3036 * n</i> does not denote a type in the enclosing lexical scope. | 3111 * n</i> does not denote a type in the enclosing lexical scope. |
3037 */ | 3112 */ |
3038 static final StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = new StaticTypeW
arningCode('NON_TYPE_AS_TYPE_ARGUMENT', 8, "The name '%s' is not a type and cann
ot be used as a parameterized type"); | 3113 static final StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = new StaticTypeW
arningCode.con1('NON_TYPE_AS_TYPE_ARGUMENT', 8, "The name '%s' is not a type and
cannot be used as a parameterized type"); |
3039 | 3114 |
3040 /** | 3115 /** |
3041 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not b
e assigned to the | 3116 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not b
e assigned to the |
3042 * declared return type of the immediately enclosing function. | 3117 * declared return type of the immediately enclosing function. |
3043 * | 3118 * |
3044 * @param actualReturnType the return type as declared in the return statement | 3119 * @param actualReturnType the return type as declared in the return statement |
3045 * @param expectedReturnType the expected return type as defined by the method | 3120 * @param expectedReturnType the expected return type as defined by the method |
3046 * @param methodName the name of the method | 3121 * @param methodName the name of the method |
3047 */ | 3122 */ |
3048 static final StaticTypeWarningCode RETURN_OF_INVALID_TYPE = new StaticTypeWarn
ingCode('RETURN_OF_INVALID_TYPE', 9, "The return type '%s' is not a '%s', as def
ined by the method '%s'"); | 3123 static final StaticTypeWarningCode RETURN_OF_INVALID_TYPE = new StaticTypeWarn
ingCode.con1('RETURN_OF_INVALID_TYPE', 9, "The return type '%s' is not a '%s', a
s defined by the method '%s'"); |
3049 | 3124 |
3050 /** | 3125 /** |
3051 * 12.11 Instance Creation: It is a static type warning if any of the type arg
uments to a | 3126 * 12.11 Instance Creation: It is a static type warning if any of the type arg
uments to a |
3052 * constructor of a generic type <i>G</i> invoked by a new expression or a con
stant object | 3127 * constructor of a generic type <i>G</i> invoked by a new expression or a con
stant object |
3053 * expression are not subtypes of the bounds of the corresponding formal type
parameters of | 3128 * expression are not subtypes of the bounds of the corresponding formal type
parameters of |
3054 * <i>G</i>. | 3129 * <i>G</i>. |
3055 * | 3130 * |
3056 * 10 Generics: It is a static type warning if a type parameter is a supertype
of its upper bound. | 3131 * 10 Generics: It is a static type warning if a type parameter is a supertype
of its upper bound. |
3057 * | 3132 * |
3058 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</
i> of <i>G</i>, then | 3133 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</
i> of <i>G</i>, then |
3059 * the static type of the member <i>m</i> of <i>G<A<sub>1</sub>, … A
<sub>n</sub>></i> | 3134 * the static type of the member <i>m</i> of <i>G<A<sub>1</sub>, … A
<sub>n</sub>></i> |
3060 * is <i>[A<sub>1</sub>, …, A<sub>n</sub>/T<sub>1</sub>, …, T<su
b>n</sub>]S</i> | 3135 * is <i>[A<sub>1</sub>, …, A<sub>n</sub>/T<sub>1</sub>, …, T<su
b>n</sub>]S</i> |
3061 * where <i>T<sub>1</sub>, … T<sub>n</sub></i> are the formal type para
meters of <i>G</i>. | 3136 * where <i>T<sub>1</sub>, … T<sub>n</sub></i> are the formal type para
meters of <i>G</i>. |
3062 * Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub>i</sub>, 1 <= i <=
n</i>. It is a | 3137 * Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub>i</sub>, 1 <= i <=
n</i>. It is a |
3063 * static type warning if <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1
</sub>, …, | 3138 * static type warning if <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1
</sub>, …, |
3064 * A<sub>n</sub>/T<sub>1</sub>, …, T<sub>n</sub>]B<sub>i</sub>, 1 <=
i <= n</i>. | 3139 * A<sub>n</sub>/T<sub>1</sub>, …, T<sub>n</sub>]B<sub>i</sub>, 1 <=
i <= n</i>. |
3065 * | 3140 * |
3066 * 7.6.2 Factories: It is a static type warning if any of the type arguments t
o <i>k'</i> are not | 3141 * 7.6.2 Factories: It is a static type warning if any of the type arguments t
o <i>k'</i> are not |
3067 * subtypes of the bounds of the corresponding formal type parameters of type. | 3142 * subtypes of the bounds of the corresponding formal type parameters of type. |
3068 * | 3143 * |
3069 * @param boundedTypeName the name of the type used in the instance creation t
hat should be | 3144 * @param boundedTypeName the name of the type used in the instance creation t
hat should be |
3070 * limited by the bound as specified in the class declaration | 3145 * limited by the bound as specified in the class declaration |
3071 * @param boundingTypeName the name of the bounding type | 3146 * @param boundingTypeName the name of the bounding type |
3072 */ | 3147 */ |
3073 static final StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new Sta
ticTypeWarningCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 10, "'%s' does not exten
d '%s'"); | 3148 static final StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = new Sta
ticTypeWarningCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 10, "'%s' does not
extend '%s'"); |
3074 | 3149 |
3075 /** | 3150 /** |
3076 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
a static type | 3151 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
a static type |
3077 * warning if <i>T</i> does not have a getter named <i>m</i>. | 3152 * warning if <i>T</i> does not have a getter named <i>m</i>. |
3078 * | 3153 * |
3079 * @param getterName the name of the getter | 3154 * @param getterName the name of the getter |
3080 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for | 3155 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for |
3081 */ | 3156 */ |
3082 static final StaticTypeWarningCode UNDEFINED_GETTER = new StaticTypeWarningCod
e('UNDEFINED_GETTER', 11, "There is no such getter '%s' in '%s'"); | 3157 static final StaticTypeWarningCode UNDEFINED_GETTER = new StaticTypeWarningCod
e.con1('UNDEFINED_GETTER', 11, "There is no such getter '%s' in '%s'"); |
3083 | 3158 |
3084 /** | 3159 /** |
3085 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I
t is a static type | 3160 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I
t is a static type |
3086 * warning if <i>T</i> does not have an accessible instance member named <i>m<
/i>. | 3161 * warning if <i>T</i> does not have an accessible instance member named <i>m<
/i>. |
3087 * | 3162 * |
3088 * @param methodName the name of the method that is undefined | 3163 * @param methodName the name of the method that is undefined |
3089 * @param typeName the resolved type name that the method lookup is happening
on | 3164 * @param typeName the resolved type name that the method lookup is happening
on |
3090 */ | 3165 */ |
3091 static final StaticTypeWarningCode UNDEFINED_METHOD = new StaticTypeWarningCod
e('UNDEFINED_METHOD', 12, "The method '%s' is not defined for the class '%s'"); | 3166 static final StaticTypeWarningCode UNDEFINED_METHOD = new StaticTypeWarningCod
e.con1('UNDEFINED_METHOD', 12, "The method '%s' is not defined for the class '%s
'"); |
3092 | 3167 |
3093 /** | 3168 /** |
3094 * 12.18 Assignment: Evaluation of an assignment of the form | 3169 * 12.18 Assignment: Evaluation of an assignment of the form |
3095 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is equiva
lent to the | 3170 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is equiva
lent to the |
3096 * evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (<i>e<sub>1<
/sub></i>, | 3171 * evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (<i>e<sub>1<
/sub></i>, |
3097 * <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>). | 3172 * <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>). |
3098 * | 3173 * |
3099 * 12.29 Assignable Expressions: An assignable expression of the form | 3174 * 12.29 Assignable Expressions: An assignable expression of the form |
3100 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method invocat
ion of the operator | 3175 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method invocat
ion of the operator |
3101 * method [] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>. | 3176 * method [] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>. |
3102 * | 3177 * |
3103 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I
t is a static type | 3178 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I
t is a static type |
3104 * warning if <i>T</i> does not have an accessible instance member named <i>m<
/i>. | 3179 * warning if <i>T</i> does not have an accessible instance member named <i>m<
/i>. |
3105 * | 3180 * |
3106 * @param operator the name of the operator | 3181 * @param operator the name of the operator |
3107 * @param enclosingType the name of the enclosing type where the operator is b
eing looked for | 3182 * @param enclosingType the name of the enclosing type where the operator is b
eing looked for |
3108 */ | 3183 */ |
3109 static final StaticTypeWarningCode UNDEFINED_OPERATOR = new StaticTypeWarningC
ode('UNDEFINED_OPERATOR', 13, "There is no such operator '%s' in '%s'"); | 3184 static final StaticTypeWarningCode UNDEFINED_OPERATOR = new StaticTypeWarningC
ode.con1('UNDEFINED_OPERATOR', 13, "There is no such operator '%s' in '%s'"); |
3110 | 3185 |
3111 /** | 3186 /** |
3112 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type | 3187 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
It is a static type |
3113 * warning if <i>T</i> does not have an accessible instance setter named <i>v=
</i>. | 3188 * warning if <i>T</i> does not have an accessible instance setter named <i>v=
</i>. |
3114 * | 3189 * |
3115 * @param setterName the name of the setter | 3190 * @param setterName the name of the setter |
3116 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for | 3191 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for |
3117 * @see #INACCESSIBLE_SETTER | 3192 * @see #INACCESSIBLE_SETTER |
3118 */ | 3193 */ |
3119 static final StaticTypeWarningCode UNDEFINED_SETTER = new StaticTypeWarningCod
e('UNDEFINED_SETTER', 14, "There is no such setter '%s' in '%s'"); | 3194 static final StaticTypeWarningCode UNDEFINED_SETTER = new StaticTypeWarningCod
e.con1('UNDEFINED_SETTER', 14, "There is no such setter '%s' in '%s'"); |
3120 | 3195 |
3121 /** | 3196 /** |
3122 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | 3197 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form |
3123 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … | 3198 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n
+1</sub>, … |
3124 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static type warning if <i>S<
/i> does not have an | 3199 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static type warning if <i>S<
/i> does not have an |
3125 * accessible instance member named <i>m</i>. | 3200 * accessible instance member named <i>m</i>. |
3126 * | 3201 * |
3127 * @param methodName the name of the method that is undefined | 3202 * @param methodName the name of the method that is undefined |
3128 * @param typeName the resolved type name that the method lookup is happening
on | 3203 * @param typeName the resolved type name that the method lookup is happening
on |
3129 */ | 3204 */ |
3130 static final StaticTypeWarningCode UNDEFINED_SUPER_METHOD = new StaticTypeWarn
ingCode('UNDEFINED_SUPER_METHOD', 15, "There is no such method '%s' in '%s'"); | 3205 static final StaticTypeWarningCode UNDEFINED_SUPER_METHOD = new StaticTypeWarn
ingCode.con1('UNDEFINED_SUPER_METHOD', 15, "There is no such method '%s' in '%s'
"); |
3131 | 3206 |
3132 /** | 3207 /** |
3133 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n
ot have an | 3208 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n
ot have an |
3134 * accessible (3.2) instance member named <i>m</i>. | 3209 * accessible (3.2) instance member named <i>m</i>. |
3135 * | 3210 * |
3136 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used
when we are | 3211 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used
when we are |
3137 * able to find the name defined in a supertype. It exists to provide a more i
nformative error | 3212 * able to find the name defined in a supertype. It exists to provide a more i
nformative error |
3138 * message. | 3213 * message. |
3139 */ | 3214 */ |
3140 static final StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M
EMBER = new StaticTypeWarningCode('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEM
BER', 16, "Static members from supertypes must be qualified by the name of the d
efining type"); | 3215 static final StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M
EMBER = new StaticTypeWarningCode.con1('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATI
C_MEMBER', 16, "Static members from supertypes must be qualified by the name of
the defining type"); |
3141 | 3216 |
3142 /** | 3217 /** |
3143 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
generic type with | 3218 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
generic type with |
3144 * exactly <i>n</i> type parameters. | 3219 * exactly <i>n</i> type parameters. |
3145 * | 3220 * |
3146 * @param typeName the name of the type being referenced (<i>G</i>) | 3221 * @param typeName the name of the type being referenced (<i>G</i>) |
3147 * @param parameterCount the number of type parameters that were declared | 3222 * @param parameterCount the number of type parameters that were declared |
3148 * @param argumentCount the number of type arguments provided | 3223 * @param argumentCount the number of type arguments provided |
3149 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS | 3224 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS |
3150 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS | 3225 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS |
3151 */ | 3226 */ |
3152 static final StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new Static
TypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 17, "The type '%s' is declared
with %d type parameters, but %d type arguments were given"); | 3227 static final StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new Static
TypeWarningCode.con1('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 17, "The type '%s' is dec
lared with %d type parameters, but %d type arguments were given"); |
3153 static final List<StaticTypeWarningCode> values = [ | 3228 static final List<StaticTypeWarningCode> values = [ |
3154 INACCESSIBLE_SETTER, | 3229 INACCESSIBLE_SETTER, |
3155 INCONSISTENT_METHOD_INHERITANCE, | 3230 INCONSISTENT_METHOD_INHERITANCE, |
3156 INSTANCE_ACCESS_TO_STATIC_MEMBER, | 3231 INSTANCE_ACCESS_TO_STATIC_MEMBER, |
3157 INVALID_ASSIGNMENT, | 3232 INVALID_ASSIGNMENT, |
3158 INVOCATION_OF_NON_FUNCTION, | 3233 INVOCATION_OF_NON_FUNCTION, |
3159 INVOCATION_OF_NON_FUNCTION_EXPRESSION, | 3234 INVOCATION_OF_NON_FUNCTION_EXPRESSION, |
3160 NON_BOOL_CONDITION, | 3235 NON_BOOL_CONDITION, |
3161 NON_BOOL_EXPRESSION, | 3236 NON_BOOL_EXPRESSION, |
3162 NON_TYPE_AS_TYPE_ARGUMENT, | 3237 NON_TYPE_AS_TYPE_ARGUMENT, |
3163 RETURN_OF_INVALID_TYPE, | 3238 RETURN_OF_INVALID_TYPE, |
3164 TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, | 3239 TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, |
3165 UNDEFINED_GETTER, | 3240 UNDEFINED_GETTER, |
3166 UNDEFINED_METHOD, | 3241 UNDEFINED_METHOD, |
3167 UNDEFINED_OPERATOR, | 3242 UNDEFINED_OPERATOR, |
3168 UNDEFINED_SETTER, | 3243 UNDEFINED_SETTER, |
3169 UNDEFINED_SUPER_METHOD, | 3244 UNDEFINED_SUPER_METHOD, |
3170 UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, | 3245 UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, |
3171 WRONG_NUMBER_OF_TYPE_ARGUMENTS]; | 3246 WRONG_NUMBER_OF_TYPE_ARGUMENTS]; |
3172 | 3247 |
3173 /// The name of this enum constant, as declared in the enum declaration. | |
3174 final String name; | |
3175 | |
3176 /// The position in the enum declaration. | |
3177 final int ordinal; | |
3178 | |
3179 /** | 3248 /** |
3180 * The message template used to create the message to be displayed for this er
ror. | 3249 * The template used to create the message to be displayed for this error. |
3181 */ | 3250 */ |
3182 String _message; | 3251 String _message; |
3183 | 3252 |
3184 /** | 3253 /** |
3185 * Initialize a newly created error code to have the given type and message. | 3254 * The template used to create the correction to be displayed for this error,
or `null` if |
| 3255 * there is no correction information for this error. |
| 3256 */ |
| 3257 String correction6; |
| 3258 |
| 3259 /** |
| 3260 * Initialize a newly created error code to have the given message. |
3186 * | 3261 * |
3187 * @param message the message template used to create the message to be displa
yed for the error | 3262 * @param message the message template used to create the message to be displa
yed for the error |
3188 */ | 3263 */ |
3189 StaticTypeWarningCode(this.name, this.ordinal, String message) { | 3264 StaticTypeWarningCode.con1(String name, int ordinal, String message) : super(n
ame, ordinal) { |
3190 this._message = message; | 3265 this._message = message; |
3191 } | 3266 } |
| 3267 |
| 3268 /** |
| 3269 * Initialize a newly created error code to have the given message and correct
ion. |
| 3270 * |
| 3271 * @param message the template used to create the message to be displayed for
the error |
| 3272 * @param correction the template used to create the correction to be displaye
d for the error |
| 3273 */ |
| 3274 StaticTypeWarningCode.con2(String name, int ordinal, String message, String co
rrection) : super(name, ordinal) { |
| 3275 this._message = message; |
| 3276 this.correction6 = correction; |
| 3277 } |
| 3278 String get correction => correction6; |
3192 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; | 3279 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; |
3193 String get message => _message; | 3280 String get message => _message; |
3194 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; | 3281 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; |
3195 int compareTo(StaticTypeWarningCode other) => ordinal - other.ordinal; | |
3196 int get hashCode => ordinal; | |
3197 String toString() => name; | |
3198 } | 3282 } |
OLD | NEW |