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

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

Issue 706823003: Clean up error codes implementation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/enum_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information.
7
8 library engine.error; 5 library engine.error;
9 6
10 import 'dart:collection'; 7 import 'dart:collection';
11 import 'java_core.dart'; 8 import 'java_core.dart';
12 import 'source.dart'; 9 import 'source.dart';
13 import 'scanner.dart' show Token; 10 import 'scanner.dart' show Token;
14 import 'ast.dart' show AstNode; 11 import 'ast.dart' show AstNode;
15 import 'element.dart'; 12 import 'element.dart';
16 13
17 /** 14 /**
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 * @param value the new value of the given property 277 * @param value the new value of the given property
281 */ 278 */
282 void setProperty(ErrorProperty property, Object value) { 279 void setProperty(ErrorProperty property, Object value) {
283 _propertyMap[property] = value; 280 _propertyMap[property] = value;
284 } 281 }
285 } 282 }
286 283
287 /** 284 /**
288 * The enumeration `AngularCode` defines Angular specific problems. 285 * The enumeration `AngularCode` defines Angular specific problems.
289 */ 286 */
290 class AngularCode extends Enum<AngularCode> implements ErrorCode { 287 class AngularCode extends ErrorCode {
291 static const AngularCode CANNOT_PARSE_SELECTOR = const AngularCode('CANNOT_PAR SE_SELECTOR', 0, "The selector '{0}' cannot be parsed"); 288 static const AngularCode CANNOT_PARSE_SELECTOR
289 = const AngularCode(
290 'CANNOT_PARSE_SELECTOR',
291 "The selector '{0}' cannot be parsed");
292 292
293 static const AngularCode INVALID_FORMATTER_NAME = const AngularCode('INVALID_F ORMATTER_NAME', 1, "Formatter name must be a simple identifier"); 293 static const AngularCode INVALID_FORMATTER_NAME
294 = const AngularCode(
295 'INVALID_FORMATTER_NAME',
296 "Formatter name must be a simple identifier");
294 297
295 static const AngularCode INVALID_PROPERTY_KIND = const AngularCode('INVALID_PR OPERTY_KIND', 2, "Unknown property binding kind '{0}', use one of the '@', '=>', '=>!' or '<=>'"); 298 static const AngularCode INVALID_PROPERTY_KIND
299 = const AngularCode(
300 'INVALID_PROPERTY_KIND',
301 "Unknown property binding kind '{0}', use one of the '@', '=>', '=>!' or '<=>'");
296 302
297 static const AngularCode INVALID_PROPERTY_FIELD = const AngularCode('INVALID_P ROPERTY_FIELD', 3, "Unknown property field '{0}'"); 303 static const AngularCode INVALID_PROPERTY_FIELD
304 = const AngularCode(
305 'INVALID_PROPERTY_FIELD',
306 "Unknown property field '{0}'");
298 307
299 static const AngularCode INVALID_PROPERTY_MAP = const AngularCode('INVALID_PRO PERTY_MAP', 4, "Argument 'map' must be a constant map literal"); 308 static const AngularCode INVALID_PROPERTY_MAP
309 = const AngularCode(
310 'INVALID_PROPERTY_MAP',
311 "Argument 'map' must be a constant map literal");
300 312
301 static const AngularCode INVALID_PROPERTY_NAME = const AngularCode('INVALID_PR OPERTY_NAME', 5, "Property name must be a string literal"); 313 static const AngularCode INVALID_PROPERTY_NAME
314 = const AngularCode(
315 'INVALID_PROPERTY_NAME',
316 "Property name must be a string literal");
302 317
303 static const AngularCode INVALID_PROPERTY_SPEC = const AngularCode('INVALID_PR OPERTY_SPEC', 6, "Property binding specification must be a string literal"); 318 static const AngularCode INVALID_PROPERTY_SPEC
319 = const AngularCode(
320 'INVALID_PROPERTY_SPEC',
321 "Property binding specification must be a string literal");
304 322
305 static const AngularCode INVALID_REPEAT_SYNTAX = const AngularCode('INVALID_RE PEAT_SYNTAX', 7, "Expected statement in form '_item_ in _collection_ [tracked by _id_]'"); 323 static const AngularCode INVALID_REPEAT_SYNTAX
324 = const AngularCode(
325 'INVALID_REPEAT_SYNTAX',
326 "Expected statement in form '_item_ in _collection_ [tracked by _id_]' ");
306 327
307 static const AngularCode INVALID_REPEAT_ITEM_SYNTAX = const AngularCode('INVAL ID_REPEAT_ITEM_SYNTAX', 8, "Item must by identifier or in '(_key_, _value_)' pai r."); 328 static const AngularCode INVALID_REPEAT_ITEM_SYNTAX
329 = const AngularCode(
330 'INVALID_REPEAT_ITEM_SYNTAX',
331 "Item must by identifier or in '(_key_, _value_)' pair.");
308 332
309 static const AngularCode INVALID_URI = const AngularCode('INVALID_URI', 9, "In valid URI syntax: '{0}'"); 333 static const AngularCode INVALID_URI
334 = const AngularCode(
335 'INVALID_URI',
336 "Invalid URI syntax: '{0}'");
310 337
311 static const AngularCode MISSING_FORMATTER_COLON = const AngularCode('MISSING_ FORMATTER_COLON', 10, "Missing ':' before formatter argument"); 338 static const AngularCode MISSING_FORMATTER_COLON
339 = const AngularCode(
340 'MISSING_FORMATTER_COLON',
341 "Missing ':' before formatter argument");
312 342
313 static const AngularCode MISSING_NAME = const AngularCode('MISSING_NAME', 11, "Argument 'name' must be provided"); 343 static const AngularCode MISSING_NAME
344 = const AngularCode(
345 'MISSING_NAME',
346 "Argument 'name' must be provided");
314 347
315 static const AngularCode MISSING_PUBLISH_AS = const AngularCode('MISSING_PUBLI SH_AS', 12, "Argument 'publishAs' must be provided"); 348 static const AngularCode MISSING_PUBLISH_AS
349 = const AngularCode(
350 'MISSING_PUBLISH_AS',
351 "Argument 'publishAs' must be provided");
316 352
317 static const AngularCode MISSING_SELECTOR = const AngularCode('MISSING_SELECTO R', 13, "Argument 'selector' must be provided"); 353 static const AngularCode MISSING_SELECTOR
354 = const AngularCode(
355 'MISSING_SELECTOR',
356 "Argument 'selector' must be provided");
318 357
319 static const AngularCode URI_DOES_NOT_EXIST = const AngularCode('URI_DOES_NOT_ EXIST', 14, "Target of URI does not exist: '{0}'"); 358 static const AngularCode URI_DOES_NOT_EXIST
320 359 = const AngularCode(
321 static const List<AngularCode> values = const [ 360 'URI_DOES_NOT_EXIST',
322 CANNOT_PARSE_SELECTOR, 361 "Target of URI does not exist: '{0}'");
323 INVALID_FORMATTER_NAME,
324 INVALID_PROPERTY_KIND,
325 INVALID_PROPERTY_FIELD,
326 INVALID_PROPERTY_MAP,
327 INVALID_PROPERTY_NAME,
328 INVALID_PROPERTY_SPEC,
329 INVALID_REPEAT_SYNTAX,
330 INVALID_REPEAT_ITEM_SYNTAX,
331 INVALID_URI,
332 MISSING_FORMATTER_COLON,
333 MISSING_NAME,
334 MISSING_PUBLISH_AS,
335 MISSING_SELECTOR,
336 URI_DOES_NOT_EXIST];
337 362
338 /** 363 /**
339 * The template used to create the message to be displayed for this error. 364 * Initialize a newly created error code to have the given [name]. The message
365 * associated with the error will be created from the given [message]
366 * template. The correction associated with the error will be created from the
367 * given [correction] template.
340 */ 368 */
341 final String message; 369 const AngularCode(String name, String message, [String correction])
342 370 : super(name, message, correction);
343 /**
344 * Initialize a newly created error code to have the given message.
345 *
346 * @param message the message template used to create the message to be displa yed for the error
347 */
348 const AngularCode(String name, int ordinal, this.message) : super(name, ordina l);
349
350 @override
351 String get correction => null;
352 371
353 @override 372 @override
354 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 373 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
355 374
356 @override 375 @override
357 ErrorType get type => ErrorType.ANGULAR; 376 ErrorType get type => ErrorType.ANGULAR;
358
359 @override
360 String get uniqueName => "$runtimeType.$name";
361 } 377 }
362 378
363 /** 379 /**
364 * Instances of the class `BooleanErrorListener` implement a listener that keeps track of 380 * Instances of the class `BooleanErrorListener` implement a listener that keeps track of
365 * whether an error has been reported to it. 381 * whether an error has been reported to it.
366 */ 382 */
367 class BooleanErrorListener implements AnalysisErrorListener { 383 class BooleanErrorListener implements AnalysisErrorListener {
368 /** 384 /**
369 * A flag indicating whether an error has been reported to this listener. 385 * A flag indicating whether an error has been reported to this listener.
370 */ 386 */
371 bool _errorReported = false; 387 bool _errorReported = false;
372 388
373 /** 389 /**
374 * Return `true` if an error has been reported to this listener. 390 * Return `true` if an error has been reported to this listener.
375 * 391 *
376 * @return `true` if an error has been reported to this listener 392 * @return `true` if an error has been reported to this listener
377 */ 393 */
378 bool get errorReported => _errorReported; 394 bool get errorReported => _errorReported;
379 395
380 @override 396 @override
381 void onError(AnalysisError error) { 397 void onError(AnalysisError error) {
382 _errorReported = true; 398 _errorReported = true;
383 } 399 }
384 } 400 }
385 401
386 /** 402 /**
387 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time errors 403 * The enumeration `CompileTimeErrorCode` defines the error codes used for
388 * caused by constant evaluation that would throw an exception when run in check ed mode. The client 404 * compile time errors caused by constant evaluation that would throw an
389 * of the analysis engine is responsible for determining how these errors should be presented to the 405 * exception when run in checked mode. The client of the analysis engine is
390 * user (for example, a command-line compiler might elect to treat these errors differently 406 * responsible for determining how these errors should be presented to the user
391 * depending whether it is compiling it "checked" mode). 407 * (for example, a command-line compiler might elect to treat these errors
408 * differently depending whether it is compiling it "checked" mode).
392 */ 409 */
393 class CheckedModeCompileTimeErrorCode extends Enum<CheckedModeCompileTimeErrorCo de> implements ErrorCode { 410 class CheckedModeCompileTimeErrorCode extends ErrorCode {
394 // TODO(paulberry): improve the text of these error messages so that it's 411 // TODO(paulberry): improve the text of these error messages so that it's
395 // clear to the user that the error is coming from constant evaluation (and 412 // clear to the user that the error is coming from constant evaluation (and
396 // hence the constant needs to be a subtype of the annotated type) as opposed 413 // hence the constant needs to be a subtype of the annotated type) as opposed
397 // to static type analysis (which only requires that the two types be 414 // to static type analysis (which only requires that the two types be
398 // assignable). Also consider populating the "correction" field for these 415 // assignable). Also consider populating the "correction" field for these
399 // errors. 416 // errors.
400 417
401 /** 418 /**
402 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 419 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
403 * uncaught exception being thrown. 420 * object results in an uncaught exception being thrown.
404 */ 421 */
405 static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_FIELD_TYPE_MISM ATCH = 422 static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_FIELD_TYPE_MISM ATCH
406 const CheckedModeCompileTimeErrorCode.con1( 423 = const CheckedModeCompileTimeErrorCode(
407 'CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH', 424 'CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH',
408 0,
409 "The object type '{0}' cannot be assigned to the field '{1}', which ha s type '{2}'"); 425 "The object type '{0}' cannot be assigned to the field '{1}', which ha s type '{2}'");
410 426
411 /** 427 /**
412 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 428 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
413 * uncaught exception being thrown. 429 * object results in an uncaught exception being thrown.
414 */ 430 */
415 static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_PARAM_TYPE_MISM ATCH = 431 static const CheckedModeCompileTimeErrorCode CONST_CONSTRUCTOR_PARAM_TYPE_MISM ATCH
416 const CheckedModeCompileTimeErrorCode.con1( 432 = const CheckedModeCompileTimeErrorCode(
417 'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH', 433 'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH',
418 1,
419 "The object type '{0}' cannot be assigned to a parameter of type '{1}' "); 434 "The object type '{0}' cannot be assigned to a parameter of type '{1}' ");
420 435
421 /** 436 /**
422 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not 437 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error
423 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of 438 * if o is not <b>null</b> and the interface of the class of <i>o</i> is not a
424 * the field <i>v</i>. 439 * subtype of the static type of the field <i>v</i>.
425 * 440 *
426 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 441 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
427 * uncaught exception being thrown. 442 * object results in an uncaught exception being thrown.
428 * 443 *
429 * @param initializerType the name of the type of the initializer expression 444 * @param initializerType the name of the type of the initializer expression
430 * @param fieldType the name of the type of the field 445 * @param fieldType the name of the type of the field
431 */ 446 */
432 static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIG NABLE = const CheckedModeCompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ ASSIGNABLE', 2, "The initializer type '{0}' cannot be assigned to the field type '{1}'"); 447 static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIG NABLE
433 448 = const CheckedModeCompileTimeErrorCode(
434 /** 449 'CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE',
435 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ... 450 "The initializer type '{0}' cannot be assigned to the field type '{1}' ");
451
452 /**
453 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
454 * ... <i>e<sub>n</sub></i>] is evaluated as follows:
455 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
456 * second argument <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
457 *
458 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
459 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
460 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
461 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
462 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>,
463 * 1 &lt;= j &lt;= m</i>.
464 */
465 static const CheckedModeCompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE
466 = const CheckedModeCompileTimeErrorCode(
467 'LIST_ELEMENT_TYPE_NOT_ASSIGNABLE',
468 "The element type '{0}' cannot be assigned to the list type '{1}'");
469
470 /**
471 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
472 * [<i>k<sub>1</sub></i> : <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> :
436 * <i>e<sub>n</sub></i>] is evaluated as follows: 473 * <i>e<sub>n</sub></i>] is evaluated as follows:
437 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument 474 * * The operator []= is invoked on <i>m</i> with first argument
438 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i> 475 * <i>k<sub>i</sub></i> and second argument <i>e<sub>i</sub></i><i>, 1 &lt;=
439 * 476 * i &lt;= n</i>
440 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 477 *
441 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 478 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
442 * 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>. 479 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
443 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 480 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
444 * j &lt;= m</i>. 481 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
445 */ 482 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
446 static const CheckedModeCompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 3, "The element type '{0}' cannot be assigned to the list type '{1}'"); 483 * &lt;= j &lt;= m</i>.
447 484 */
448 /** 485 static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE
449 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 486 = const CheckedModeCompileTimeErrorCode(
450 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 487 'MAP_KEY_TYPE_NOT_ASSIGNABLE',
451 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 488 "The element type '{0}' cannot be assigned to the map key type '{1}'") ;
452 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 489
453 * 490 /**
454 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 491 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
455 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 492 * [<i>k<sub>1</sub></i> : <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> :
456 * 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>. 493 * <i>e<sub>n</sub></i>] is evaluated as follows:
457 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 494 * * The operator []= is invoked on <i>m</i> with first argument
458 * j &lt;= m</i>. 495 * <i>k<sub>i</sub></i> and second argument <i>e<sub>i</sub></i><i>, 1 &lt;=
459 */ 496 * i &lt;= n</i>
460 static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = con st CheckedModeCompileTimeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 4, "The e lement type '{0}' cannot be assigned to the map key type '{1}'"); 497 *
461 498 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
462 /** 499 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
463 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 500 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
464 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows: 501 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
465 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 502 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
466 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 503 * &lt;= j &lt;= m</i>.
467 * 504 */
468 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 505 static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE
469 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 506 = const CheckedModeCompileTimeErrorCode(
470 * 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>. 507 'MAP_VALUE_TYPE_NOT_ASSIGNABLE',
471 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 508 "The element type '{0}' cannot be assigned to the map value type '{1}' ");
472 * j &lt;= m</i>. 509
473 */ 510 /**
474 static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = c onst CheckedModeCompileTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 5, "T he element type '{0}' cannot be assigned to the map value type '{1}'"); 511 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
475 512 * object results in an uncaught exception being thrown.
476 /** 513 */
477 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 514 static const CheckedModeCompileTimeErrorCode VARIABLE_TYPE_MISMATCH
478 * uncaught exception being thrown. 515 = const CheckedModeCompileTimeErrorCode(
479 */
480 static const CheckedModeCompileTimeErrorCode VARIABLE_TYPE_MISMATCH =
481 const CheckedModeCompileTimeErrorCode.con1(
482 'VARIABLE_TYPE_MISMATCH', 516 'VARIABLE_TYPE_MISMATCH',
483 6,
484 "The object type '{0}' cannot be assigned to a variable of type '{1}'" ); 517 "The object type '{0}' cannot be assigned to a variable of type '{1}'" );
485 518
486 static const List<CheckedModeCompileTimeErrorCode> values = const [ 519 /**
487 CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, 520 * Initialize a newly created error code to have the given [name]. The message
488 CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, 521 * associated with the error will be created from the given [message]
489 CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, 522 * template. The correction associated with the error will be created from the
490 LIST_ELEMENT_TYPE_NOT_ASSIGNABLE, 523 * given [correction] template.
491 MAP_KEY_TYPE_NOT_ASSIGNABLE, 524 */
492 MAP_VALUE_TYPE_NOT_ASSIGNABLE, 525 const CheckedModeCompileTimeErrorCode(String name, String message, [String cor rection])
493 VARIABLE_TYPE_MISMATCH]; 526 : super(name, message, correction);
494
495 /**
496 * The template used to create the message to be displayed for this error.
497 */
498 final String message;
499
500 /**
501 * The template used to create the correction to be displayed for this error, or `null` if
502 * there is no correction information for this error.
503 */
504 final String correction;
505
506 /**
507 * Initialize a newly created error code to have the given message.
508 *
509 * @param message the message template used to create the message to be displa yed for the error
510 */
511 const CheckedModeCompileTimeErrorCode.con1(String name, int ordinal, String me ssage) : this.con2(name, ordinal, message, null);
512
513 /**
514 * Initialize a newly created error code to have the given message and correct ion.
515 *
516 * @param message the template used to create the message to be displayed for the error
517 * @param correction the template used to create the correction to be displaye d for the error
518 */
519 const CheckedModeCompileTimeErrorCode.con2(String name, int ordinal, this.mess age, this.correction) : super(name, ordinal);
520 527
521 @override 528 @override
522 ErrorSeverity get errorSeverity => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR.s everity; 529 ErrorSeverity get errorSeverity => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR.s everity;
523 530
524 @override 531 @override
525 ErrorType get type => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR; 532 ErrorType get type => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR;
526
527 @override
528 String get uniqueName => "$runtimeType.$name";
529 } 533 }
530 534
531 /** 535 /**
532 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time 536 * The enumeration `CompileTimeErrorCode` defines the error codes used for
533 * errors. The convention for this class is for the name of the error code to in dicate the problem 537 * compile time errors. The convention for this class is for the name of the
534 * that caused the error to be generated and for the error message to explain wh at is wrong and, 538 * error code to indicate the problem that caused the error to be generated and
535 * when appropriate, how the problem can be corrected. 539 * for the error message to explain what is wrong and, when appropriate, how the
540 * problem can be corrected.
536 */ 541 */
537 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo de { 542 class CompileTimeErrorCode extends ErrorCode {
538 /** 543 /**
539 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or 544 * Enum proposal: It is also a compile-time error to explicitly instantiate an
540 * 'const' or to access its private fields. 545 * enum via 'new' or 'const' or to access its private fields.
541 */ 546 */
542 static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD = const CompileTim eErrorCode.con1('ACCESS_PRIVATE_ENUM_FIELD', 0, "The private fields of an enum c annot be accessed, even within the same library"); 547 static const CompileTimeErrorCode ACCESS_PRIVATE_ENUM_FIELD = const CompileTim eErrorCode('ACCESS_PRIVATE_ENUM_FIELD', "The private fields of an enum cannot be accessed, even within the same library");
543 548
544 /** 549 /**
545 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported by a library 550 * 14.2 Exports: It is a compile-time error if a name <i>N</i> is re-exported
546 * <i>L</i> and <i>N</i> is introduced into the export namespace of <i>L</i> b y more than one 551 * by a library <i>L</i> and <i>N</i> is introduced into the export namespace
547 * export, unless each all exports refer to same declaration for the name N. 552 * of <i>L</i> by more than one export, unless each all exports refer to same
553 * declaration for the name N.
548 * 554 *
549 * @param ambiguousElementName the name of the ambiguous element 555 * @param ambiguousElementName the name of the ambiguous element
550 * @param firstLibraryName the name of the first library that the type is foun d 556 * @param firstLibraryName the name of the first library that the type is
551 * @param secondLibraryName the name of the second library that the type is fo und 557 * found
552 */ 558 * @param secondLibraryName the name of the second library that the type is
553 static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCod e.con1('AMBIGUOUS_EXPORT', 1, "The name '{0}' is defined in the libraries '{1}' and '{2}'"); 559 * found
554 560 */
555 /** 561 static const CompileTimeErrorCode AMBIGUOUS_EXPORT = const CompileTimeErrorCod e('AMBIGUOUS_EXPORT', "The name '{0}' is defined in the libraries '{1}' and '{2} '");
556 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does not denote a formal 562
557 * parameter. 563 /**
558 * 564 * 12.33 Argument Definition Test: It is a compile time error if <i>v</i> does
559 * @param the name of the identifier in the argument definition test that is n ot a parameter 565 * not denote a formal parameter.
560 */ 566 *
561 static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = con st CompileTimeErrorCode.con1('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', 2, "'{0}' is not a parameter"); 567 * @param the name of the identifier in the argument definition test that is
562 568 * not a parameter
563 /** 569 */
564 * ?? Asynchronous For-in: It is a compile-time error if an asynchronous for-i n statement appears 570 static const CompileTimeErrorCode ARGUMENT_DEFINITION_TEST_NON_PARAMETER = con st CompileTimeErrorCode('ARGUMENT_DEFINITION_TEST_NON_PARAMETER', "'{0}' is not a parameter");
565 * inside a synchronous function. 571
566 */ 572 /**
567 static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT = const CompileTi meErrorCode.con1('ASYNC_FOR_IN_WRONG_CONTEXT', 3, "The asynchronous for-in can o nly be used in a function marked with async or async*"); 573 * ?? Asynchronous For-in: It is a compile-time error if an asynchronous
568 574 * for-in statement appears inside a synchronous function.
569 /** 575 */
570 * ??: It is a compile-time error if the function immediately enclosing a is n ot declared 576 static const CompileTimeErrorCode ASYNC_FOR_IN_WRONG_CONTEXT = const CompileTi meErrorCode('ASYNC_FOR_IN_WRONG_CONTEXT', "The asynchronous for-in can only be u sed in a function marked with async or async*");
571 * asynchronous. 577
572 */ 578 /**
573 static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT = const CompileTimeEr rorCode.con1('AWAIT_IN_WRONG_CONTEXT', 4, "The await expression can only be used in a function marked as async or async*"); 579 * ??: It is a compile-time error if the function immediately enclosing a is
574 580 * not declared asynchronous.
575 /** 581 */
576 * 12.30 Identifier Reference: It is a compile-time error to use a built-in id entifier other than 582 static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT = const CompileTimeEr rorCode('AWAIT_IN_WRONG_CONTEXT', "The await expression can only be used in a fu nction marked as async or async*");
577 * dynamic as a type annotation. 583
578 */ 584 /**
579 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileT imeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE', 5, "The built-in identifier '{0 }' cannot be as a type"); 585 * 12.30 Identifier Reference: It is a compile-time error to use a built-in
580 586 * identifier other than dynamic as a type annotation.
581 /** 587 */
582 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the 588 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = const CompileT imeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE', "The built-in identifier '{0}' canno t be as a type");
583 * declared name of a class, type parameter or type alias. 589
584 */ 590 /**
585 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const Com pileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', 6, "The built-in iden tifier '{0}' cannot be used as a type name"); 591 * 12.30 Identifier Reference: It is a compile-time error if a built-in
586 592 * identifier is used as the declared name of a class, type parameter or type
587 /** 593 * alias.
588 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the 594 */
589 * declared name of a class, type parameter or type alias. 595 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = const Com pileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_NAME', "The built-in identifier ' {0}' cannot be used as a type name");
590 */ 596
591 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', 7, "The built-i n identifier '{0}' cannot be used as a type alias name"); 597 /**
592 598 * 12.30 Identifier Reference: It is a compile-time error if a built-in
593 /** 599 * identifier is used as the declared name of a class, type parameter or type
594 * 12.30 Identifier Reference: It is a compile-time error if a built-in identi fier is used as the 600 * alias.
595 * declared name of a class, type parameter or type alias. 601 */
596 */ 602 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', "The built-in identi fier '{0}' cannot be used as a type alias name");
597 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode.con1('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', 8 , "The built-in identifier '{0}' cannot be used as a type parameter name"); 603
598 604 /**
599 /** 605 * 12.30 Identifier Reference: It is a compile-time error if a built-in
600 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements th e operator 606 * identifier is used as the declared name of a class, type parameter or type
601 * <i>==</i>. 607 * alias.
602 */ 608 */
603 static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = con st CompileTimeErrorCode.con1('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', 9, "The s witch case expression type '{0}' cannot override the == operator"); 609 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = const CompileTimeErrorCode('BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', "The b uilt-in identifier '{0}' cannot be used as a type parameter name");
604 610
605 /** 611 /**
606 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise 612 * 13.9 Switch: It is a compile-time error if the class <i>C</i> implements
613 * the operator <i>==</i>.
614 */
615 static const CompileTimeErrorCode CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS = con st CompileTimeErrorCode('CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS', "The switch ca se expression type '{0}' cannot override the == operator");
616
617 /**
618 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
619 * constant would raise
607 * an exception. 620 * an exception.
608 */ 621 */
609 static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = con st CompileTimeErrorCode.con1('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', 10, ""); 622 static const CompileTimeErrorCode COMPILE_TIME_CONSTANT_RAISES_EXCEPTION = con st CompileTimeErrorCode('COMPILE_TIME_CONSTANT_RAISES_EXCEPTION', "");
610 623
611 /** 624 /**
612 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 625 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
613 * name. This restriction holds regardless of whether the getter is defined ex plicitly or 626 * method with the same name. This restriction holds regardless of whether the
614 * implicitly, or whether the getter or the method are inherited or not. 627 * getter is defined explicitly or implicitly, or whether the getter or the
615 */ 628 * method are inherited or not.
616 static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const Compil eTimeErrorCode.con1('CONFLICTING_GETTER_AND_METHOD', 11, "Class '{0}' cannot hav e both getter '{1}.{2}' and method with the same name"); 629 */
617 630 static const CompileTimeErrorCode CONFLICTING_GETTER_AND_METHOD = const Compil eTimeErrorCode('CONFLICTING_GETTER_AND_METHOD', "Class '{0}' cannot have both ge tter '{1}.{2}' and method with the same name");
618 /** 631
619 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 632 /**
620 * name. This restriction holds regardless of whether the getter is defined ex plicitly or 633 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
621 * implicitly, or whether the getter or the method are inherited or not. 634 * method with the same name. This restriction holds regardless of whether the
622 */ 635 * getter is defined explicitly or implicitly, or whether the getter or the
623 static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const Compil eTimeErrorCode.con1('CONFLICTING_METHOD_AND_GETTER', 12, "Class '{0}' cannot hav e both method '{1}.{2}' and getter with the same name"); 636 * method are inherited or not.
624 637 */
625 /** 638 static const CompileTimeErrorCode CONFLICTING_METHOD_AND_GETTER = const Compil eTimeErrorCode('CONFLICTING_METHOD_AND_GETTER', "Class '{0}' cannot have both me thod '{1}.{2}' and getter with the same name");
626 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing 639
627 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a 640 /**
628 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing 641 * 7.6 Constructors: A constructor name always begins with the name of its
629 * class. 642 * immediately enclosing class, and may optionally be followed by a dot and an
630 */ 643 * identifier <i>id</i>. It is a compile-time error if <i>id</i> is the name
631 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = con st CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', 13, "'{0} ' cannot be used to name a constructor and a field in this class"); 644 * of a member declared in the immediately enclosing class.
632 645 */
633 /** 646 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD = con st CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD', "'{0}' cannot be used to name a constructor and a field in this class");
634 * 7.6 Constructors: A constructor name always begins with the name of its imm ediately enclosing 647
635 * class, and may optionally be followed by a dot and an identifier <i>id</i>. It is a 648 /**
636 * compile-time error if <i>id</i> is the name of a member declared in the imm ediately enclosing 649 * 7.6 Constructors: A constructor name always begins with the name of its
637 * class. 650 * immediately enclosing class, and may optionally be followed by a dot and an
638 */ 651 * identifier <i>id</i>. It is a compile-time error if <i>id</i> is the name
639 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = co nst CompileTimeErrorCode.con1('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', 14, "'{ 0}' cannot be used to name a constructor and a method in this class"); 652 * of a member declared in the immediately enclosing class.
640 653 */
641 /** 654 static const CompileTimeErrorCode CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD = co nst CompileTimeErrorCode('CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD', "'{0}' canno t be used to name a constructor and a method in this class");
642 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the 655
643 * same name as the class or any of its members or constructors. 656 /**
644 */ 657 * 7. Classes: It is a compile time error if a generic class declares a type
645 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_CLASS', 15, "'{0}' cann ot be used to name a type varaible in a class with the same name"); 658 * variable with the same name as the class or any of its members or
646 659 * constructors.
647 /** 660 */
648 * 7. Classes: It is a compile time error if a generic class declares a type v ariable with the 661 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS = const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_CLASS', "'{0}' cannot be use d to name a type varaible in a class with the same name");
649 * same name as the class or any of its members or constructors. 662
650 */ 663 /**
651 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode.con1('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', 16, "'{0}' ca nnot be used to name a type varaible and member in this class"); 664 * 7. Classes: It is a compile time error if a generic class declares a type
652 665 * variable with the same name as the class or any of its members or
653 /** 666 * constructors.
654 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 667 */
655 * uncaught exception being thrown. 668 static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER = const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_MEMBER', "'{0}' cannot be u sed to name a type varaible and member in this class");
656 */ 669
657 static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const C ompileTimeErrorCode.con1('CONST_CONSTRUCTOR_THROWS_EXCEPTION', 17, "'const' cons tructors cannot throw exceptions"); 670 /**
658 671 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
659 /** 672 * object results in an uncaught exception being thrown.
660 * 10.6.3 Constant Constructors: It is a compile-time error if a constant cons tructor is declared 673 */
661 * by a class C if any instance variable declared in C is initialized with an expression that is 674 static const CompileTimeErrorCode CONST_CONSTRUCTOR_THROWS_EXCEPTION = const C ompileTimeErrorCode('CONST_CONSTRUCTOR_THROWS_EXCEPTION', "'const' constructors cannot throw exceptions");
662 * not a constant expression. 675
663 */ 676 /**
664 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_ NON_CONST = const CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_FIELD_INITIA LIZED_BY_NON_CONST', 18, "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value"); 677 * 10.6.3 Constant Constructors: It is a compile-time error if a constant
665 678 * constructor is declared by a class C if any instance variable declared in C
666 /** 679 * is initialized with an expression that is not a constant expression.
667 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in 680 */
668 * the initializer list of a constant constructor must specify a constant cons tructor of the 681 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_ NON_CONST = const CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED _BY_NON_CONST', "Can't define the 'const' constructor because the field '{0}' is initialized with a non-constant value");
669 * superclass of the immediately enclosing class or a compile-time error occur s. 682
670 * 683 /**
671 * 9 Mixins: For each generative constructor named ... an implicitly declared constructor named 684 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
672 * ... is declared. 685 * or implicitly, in the initializer list of a constant constructor must
673 */ 686 * specify a constant constructor of the superclass of the immediately
674 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN = const Compile TimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_MIXIN', 19, "Constant constructor can not be declared for a class with a mixin"); 687 * enclosing class or a compile-time error occurs.
675 688 *
676 /** 689 * 9 Mixins: For each generative constructor named ... an implicitly declared
677 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly or implicitly, in 690 * constructor named ... is declared.
678 * the initializer list of a constant constructor must specify a constant cons tructor of the 691 */
679 * superclass of the immediately enclosing class or a compile-time error occur s. 692 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_MIXIN = const Compile TimeErrorCode('CONST_CONSTRUCTOR_WITH_MIXIN', "Constant constructor cannot be de clared for a class with a mixin");
680 */ 693
681 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = con st CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', 20, "Cons tant constructor cannot call non-constant super constructor of '{0}'"); 694 /**
682 695 * 7.6.3 Constant Constructors: The superinitializer that appears, explicitly
683 /** 696 * or implicitly, in the initializer list of a constant constructor must
684 * 7.6.3 Constant Constructors: It is a compile-time error if a constant const ructor is declared 697 * specify a constant constructor of the superclass of the immediately
685 * by a class that has a non-final instance variable. 698 * enclosing class or a compile-time error occurs.
699 */
700 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER = con st CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER', "Constant cons tructor cannot call non-constant super constructor of '{0}'");
701
702 /**
703 * 7.6.3 Constant Constructors: It is a compile-time error if a constant
704 * constructor is declared by a class that has a non-final instance variable.
686 * 705 *
687 * The above refers to both locally declared and inherited instance variables. 706 * The above refers to both locally declared and inherited instance variables.
688 */ 707 */
689 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = con st CompileTimeErrorCode.con1('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 21, "Cann ot define the 'const' constructor for a class with non-final fields"); 708 static const CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = con st CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', "Cannot define the 'const' constructor for a class with non-final fields");
690 709
691 /** 710 /**
692 * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type. 711 * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type.
693 */ 712 */
694 static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErro rCode.con1('CONST_DEFERRED_CLASS', 22, "Deferred classes cannot be created with 'const'"); 713 static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErro rCode('CONST_DEFERRED_CLASS', "Deferred classes cannot be created with 'const'") ;
695 714
696 /** 715 /**
697 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a 716 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is
698 * constant variable. 717 * declared as a constant variable.
699 */ 718 */
700 static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeEr rorCode.con1('CONST_FORMAL_PARAMETER', 23, "Parameters cannot be 'const'"); 719 static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeEr rorCode('CONST_FORMAL_PARAMETER', "Parameters cannot be 'const'");
701 720
702 /** 721 /**
703 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a 722 * 5 Variables: A constant variable must be initialized to a compile-time
704 * compile-time error occurs. 723 * constant or a compile-time error occurs.
705 */ 724 */
706 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 24, "'const' variables must be constant value"); 725 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', "'const' variables must be constant value");
707 726
708 /** 727 /**
709 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a 728 * 5 Variables: A constant variable must be initialized to a compile-time
710 * compile-time error occurs. 729 * constant or a compile-time error occurs.
711 * 730 *
712 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 731 * 12.1 Constants: A qualified reference to a static constant variable that is
713 * deferred prefix. 732 * not qualified by a deferred prefix.
714 */ 733 */
715 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FR OM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NO N_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY', 25, "Constant values from a deferred li brary cannot be used to initialized a 'const' variable"); 734 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FR OM_DEFERRED_LIBRARY = const CompileTimeErrorCode('CONST_INITIALIZED_WITH_NON_CON STANT_VALUE_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library can not be used to initialized a 'const' variable");
716 735
717 /** 736 /**
718 * 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be 737 * 7.5 Instance Variables: It is a compile-time error if an instance variable
719 * constant. 738 * is declared to be constant.
720 */ 739 */
721 static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErro rCode.con1('CONST_INSTANCE_FIELD', 26, "Only static fields can be declared as 'c onst'"); 740 static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErro rCode('CONST_INSTANCE_FIELD', "Only static fields can be declared as 'const'");
722 741
723 /** 742 /**
724 * 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an 743 * 12.8 Maps: It is a compile-time error if the key of an entry in a constant
725 * instance of a class that implements the operator <i>==</i> unless the key i s a string or 744 * map literal is an instance of a class that implements the operator
726 * integer. 745 * <i>==</i> unless the key is a string or integer.
727 */ 746 */
728 static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS = const CompileTimeErrorCode.con1('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_ EQUALS', 27, "The constant map entry key expression type '{0}' cannot override t he == operator"); 747 static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS = const CompileTimeErrorCode('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUAL S', "The constant map entry key expression type '{0}' cannot override the == ope rator");
729 748
730 /** 749 /**
731 * 5 Variables: A constant variable must be initialized to a compile-time cons tant (12.1) or a 750 * 5 Variables: A constant variable must be initialized to a compile-time
732 * compile-time error occurs. 751 * constant (12.1) or a compile-time error occurs.
733 * 752 *
734 * @param name the name of the uninitialized final variable 753 * @param name the name of the uninitialized final variable
735 */ 754 */
736 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErr orCode.con1('CONST_NOT_INITIALIZED', 28, "The const variable '{0}' must be initi alized"); 755 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErr orCode('CONST_NOT_INITIALIZED', "The const variable '{0}' must be initialized");
737 756
738 /** 757 /**
739 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2 758 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2,
740 * are constant expressions that evaluate to a boolean value. 759 * where e, e1 and e2 are constant expressions that evaluate to a boolean
741 */ 760 * value.
742 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErro rCode.con1('CONST_EVAL_TYPE_BOOL', 29, "An expression of type 'bool' was expecte d"); 761 */
743 762 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErro rCode('CONST_EVAL_TYPE_BOOL', "An expression of type 'bool' was expected");
744 /** 763
745 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are 764 /**
746 * constant expressions that evaluate to a numeric, string or boolean value or to null. 765 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where
747 */ 766 * e1 and e2 are constant expressions that evaluate to a numeric, string or
748 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const Comp ileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 30, "An expression of t ype 'bool', 'num', 'String' or 'null' was expected"); 767 * boolean value or to null.
749 768 */
750 /** 769 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const Comp ileTimeErrorCode('CONST_EVAL_TYPE_BOOL_NUM_STRING', "An expression of type 'bool ', 'num', 'String' or 'null' was expected");
751 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1 770
752 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte ger value or to 771 /**
753 * null. 772 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2,
754 */ 773 * e1 | e2, e1 >> e2 or e1 << e2, where e, e1 and e2 are constant expressions
755 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeError Code.con1('CONST_EVAL_TYPE_INT', 31, "An expression of type 'int' was expected") ; 774 * that evaluate to an integer value or to null.
756 775 */
757 /** 776 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeError Code('CONST_EVAL_TYPE_INT', "An expression of type 'int' was expected");
758 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/ 777
759 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant 778 /**
760 * expressions that evaluate to a numeric value or to null.. 779 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 *
761 */ 780 * e2, e1 / e2, e1 ~/ e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2,
762 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeError Code.con1('CONST_EVAL_TYPE_NUM', 32, "An expression of type 'num' was expected") ; 781 * where e, e1 and e2 are constant expressions that evaluate to a numeric
763 782 * value or to null.
764 /** 783 */
765 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 784 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeError Code('CONST_EVAL_TYPE_NUM', "An expression of type 'num' was expected");
766 * uncaught exception being thrown. 785
767 */ 786 /**
768 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileT imeErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 33, "Evaluation of this constan t expression causes exception"); 787 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
769 788 * object results in an uncaught exception being thrown.
770 /** 789 */
771 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 790 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileT imeErrorCode('CONST_EVAL_THROWS_EXCEPTION', "Evaluation of this constant express ion causes exception");
772 * uncaught exception being thrown. 791
773 */ 792 /**
774 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE rrorCode.con1('CONST_EVAL_THROWS_IDBZE', 34, "Evaluation of this constant expres sion throws IntegerDivisionByZeroException"); 793 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
775 794 * object results in an uncaught exception being thrown.
776 /** 795 */
777 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, & hellip;, 796 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE rrorCode('CONST_EVAL_THROWS_IDBZE', "Evaluation of this constant expression thro ws IntegerDivisionByZeroException");
778 * U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time error if <i>S </i> is not a 797
779 * generic type with <i>m</i> type parameters. 798 /**
799 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>,
800 * &hellip;, U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time
801 * error if <i>S</i> is not a generic type with <i>m</i> type parameters.
780 * 802 *
781 * @param typeName the name of the type being referenced (<i>S</i>) 803 * @param typeName the name of the type being referenced (<i>S</i>)
782 * @param parameterCount the number of type parameters that were declared 804 * @param parameterCount the number of type parameters that were declared
783 * @param argumentCount the number of type arguments provided 805 * @param argumentCount the number of type arguments provided
784 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS 806 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
785 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS 807 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS
786 */ 808 */
787 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const C ompileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 35, "The type '{0 }' is declared with {1} type parameters, but {2} type arguments were given"); 809 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const C ompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is dec lared with {1} type parameters, but {2} type arguments were given");
788 810
789 /** 811 /**
790 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip ;, a<sub>n</sub>, 812 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>,
791 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a 813 * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;,
792 * compile-time error if the type <i>T</i> does not declare a constant constru ctor with the same 814 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if the
793 * name as the declaration of <i>T</i>. 815 * type <i>T</i> does not declare a constant constructor with the same name as
794 */ 816 * the declaration of <i>T</i>.
795 static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErro rCode.con1('CONST_WITH_NON_CONST', 36, "The constructor being called is not a 'c onst' constructor"); 817 */
796 818 static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErro rCode('CONST_WITH_NON_CONST', "The constructor being called is not a 'const' con structor");
797 /** 819
798 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i> a<sub>i</sub>, 1 820 /**
799 * &lt;= i &lt;= n + k</i>, is not a compile-time constant expression. 821 * 12.11.2 Const: In all of the above cases, it is a compile-time error if
800 */ 822 * <i>a<sub>i</sub>, 1 &lt;= i &lt;= n + k</i>, is not a compile-time constant
801 static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const Com pileTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 37, "Arguments of a c onstant creation must be constant expressions"); 823 * expression.
802 824 */
803 /** 825 static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const Com pileTimeErrorCode('CONST_WITH_NON_CONSTANT_ARGUMENT', "Arguments of a constant c reation must be constant expressions");
804 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current 826
805 * scope, optionally followed by type arguments. 827 /**
806 * 828 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
807 * 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>, 829 * accessible in the current scope, optionally followed by type arguments.
808 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub> )</i> it is a 830 *
809 * compile-time error if <i>T</i> is not a class accessible in the current sco pe, optionally 831 * 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>,
832 * &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;
833 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if
834 * <i>T</i> is not a class accessible in the current scope, optionally
810 * followed by type arguments. 835 * followed by type arguments.
811 * 836 *
812 * @param name the name of the non-type element 837 * @param name the name of the non-type element
813 */ 838 */
814 static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeError Code.con1('CONST_WITH_NON_TYPE', 38, "The name '{0}' is not a class"); 839 static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeError Code('CONST_WITH_NON_TYPE', "The name '{0}' is not a class");
815 840
816 /** 841 /**
817 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par ameters. 842 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type
818 */ 843 * parameters.
819 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTi meErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 39, "The constant creation cannot use a type parameter"); 844 */
820 845 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTi meErrorCode('CONST_WITH_TYPE_PARAMETERS', "The constant creation cannot use a ty pe parameter");
821 /** 846
822 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant 847 /**
823 * constructor declared by the type <i>T</i>. 848 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
849 * a constant constructor declared by the type <i>T</i>.
824 * 850 *
825 * @param typeName the name of the type 851 * @param typeName the name of the type
826 * @param constructorName the name of the requested constant constructor 852 * @param constructorName the name of the requested constant constructor
827 */ 853 */
828 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const Com pileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 40, "The class '{0}' does not have a constant constructor '{1}'"); 854 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const Com pileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR', "The class '{0}' does not have a constant constructor '{1}'");
829 855
830 /** 856 /**
831 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant 857 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of
832 * constructor declared by the type <i>T</i>. 858 * a constant constructor declared by the type <i>T</i>.
833 * 859 *
834 * @param typeName the name of the type 860 * @param typeName the name of the type
835 */ 861 */
836 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = c onst CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 41, " The class '{0}' does not have a default constant constructor"); 862 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = c onst CompileTimeErrorCode('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', "The class '{0}' does not have a default constant constructor");
837 863
838 /** 864 /**
839 * 15.3.1 Typedef: It is a compile-time error if any default values are specif ied in the signature 865 * 15.3.1 Typedef: It is a compile-time error if any default values are
840 * of a function type alias. 866 * specified in the signature of a function type alias.
841 */ 867 */
842 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 42, "Default values aren't allowed in typedefs"); 868 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', "Default values ar en't allowed in typedefs");
843 869
844 /** 870 /**
845 * 6.2.1 Required Formals: By means of a function signature that names the par ameter and describes 871 * 6.2.1 Required Formals: By means of a function signature that names the
846 * its type as a function type. It is a compile-time error if any default valu es are specified in 872 * parameter and describes its type as a function type. It is a compile-time
847 * the signature of such a function type. 873 * error if any default values are specified in the signature of such a
848 */ 874 * function type.
849 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 43, "Default values aren't allowed in function type parameters"); 875 */
850 876 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', "Default values aren't allowed in function type parameters");
851 /** 877
852 * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifie s a default value 878 /**
853 * for an optional parameter. 879 * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly
854 */ 880 * specifies a default value for an optional parameter.
855 static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRU CTOR = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CON STRUCTOR', 44, "Default values aren't allowed in factory constructors that redir ect to another constructor"); 881 */
856 882 static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRU CTOR = const CompileTimeErrorCode('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUC TOR', "Default values aren't allowed in factory constructors that redirect to an other constructor");
857 /** 883
858 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 884 /**
859 * declared in the same scope. 885 * 3.1 Scoping: It is a compile-time error if there is more than one entity
860 */ 886 * with the same name declared in the same scope.
861 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const Compil eTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 45, "The default constructo r is already defined"); 887 */
862 888 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const Compil eTimeErrorCode('DUPLICATE_CONSTRUCTOR_DEFAULT', "The default constructor is alre ady defined");
863 /** 889
864 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 890 /**
865 * declared in the same scope. 891 * 3.1 Scoping: It is a compile-time error if there is more than one entity
892 * with the same name declared in the same scope.
866 * 893 *
867 * @param duplicateName the name of the duplicate entity 894 * @param duplicateName the name of the duplicate entity
868 */ 895 */
869 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTi meErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 46, "The constructor with name '{ 0}' is already defined"); 896 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTi meErrorCode('DUPLICATE_CONSTRUCTOR_NAME', "The constructor with name '{0}' is al ready defined");
870 897
871 /** 898 /**
872 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 899 * 3.1 Scoping: It is a compile-time error if there is more than one entity
873 * declared in the same scope. 900 * with the same name declared in the same scope.
874 * 901 *
875 * 7 Classes: It is a compile-time error if a class declares two members of th e same name. 902 * 7 Classes: It is a compile-time error if a class declares two members of
876 * 903 * the same name.
877 * 7 Classes: It is a compile-time error if a class has an instance member and a static member 904 *
878 * with the same name. 905 * 7 Classes: It is a compile-time error if a class has an instance member and
906 * a static member with the same name.
879 * 907 *
880 * @param duplicateName the name of the duplicate entity 908 * @param duplicateName the name of the duplicate entity
881 */ 909 */
882 static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErro rCode.con1('DUPLICATE_DEFINITION', 47, "The name '{0}' is already defined"); 910 static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErro rCode('DUPLICATE_DEFINITION', "The name '{0}' is already defined");
883 911
884 /** 912 /**
885 * 7. Classes: It is a compile-time error if a class has an instance member an d a static member 913 * 7. Classes: It is a compile-time error if a class has an instance member
886 * with the same name. 914 * and a static member with the same name.
887 * 915 *
888 * This covers the additional duplicate definition cases where inheritance has to be considered. 916 * This covers the additional duplicate definition cases where inheritance has
889 * 917 * to be considered.
890 * @param className the name of the class that has conflicting instance/static members 918 *
919 * @param className the name of the class that has conflicting instance/static
920 * members
891 * @param name the name of the conflicting members 921 * @param name the name of the conflicting members
892 * @see #DUPLICATE_DEFINITION 922 * @see [DUPLICATE_DEFINITION]
893 */ 923 */
894 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com pileTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 48, "The name '{0}' i s already defined in '{1}'"); 924 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com pileTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE', "The name '{0}' is already defined in '{1}'");
895 925
896 /** 926 /**
897 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub> i</sub> = 927 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if
898 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named 928 * <i>q<sub>i</sub> = q<sub>j</sub></i> for any <i>i != j</i> [where
899 * argument]. 929 * <i>q<sub>i</sub></i> is the label for a named argument].
900 */ 930 */
901 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTime ErrorCode.con1('DUPLICATE_NAMED_ARGUMENT', 49, "The argument for the named param eter '{0}' was already specified"); 931 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTime ErrorCode('DUPLICATE_NAMED_ARGUMENT', "The argument for the named parameter '{0} ' was already specified");
902 932
903 /** 933 /**
904 * SDK implementation libraries can be exported only by other SDK libraries. 934 * SDK implementation libraries can be exported only by other SDK libraries.
905 * 935 *
906 * @param uri the uri pointing to a library 936 * @param uri the uri pointing to a library
907 */ 937 */
908 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('EXPORT_INTERNAL_LIBRARY', 50, "The library '{0}' is internal and cannot be exported"); 938 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode('EXPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and cannot be exported");
909 939
910 /** 940 /**
911 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 941 * 14.2 Exports: It is a compile-time error if the compilation unit found at
912 * not a library declaration. 942 * the specified URI is not a library declaration.
913 * 943 *
914 * @param uri the uri pointing to a non-library declaration 944 * @param uri the uri pointing to a non-library declaration
915 */ 945 */
916 static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1('EXPORT_OF_NON_LIBRARY', 51, "The exported library '{0}' must not ha ve a part-of directive"); 946 static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErr orCode('EXPORT_OF_NON_LIBRARY', "The exported library '{0}' must not have a part -of directive");
917 947
918 /** 948 /**
919 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. 949 * Enum proposal: It is a compile-time error to subclass, mix-in or implement
920 */ 950 * an enum.
921 static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode.co n1('EXTENDS_ENUM', 52, "Classes cannot extend an enum"); 951 */
922 952 static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode('E XTENDS_ENUM', "Classes cannot extend an enum");
923 /** 953
924 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes 954 /**
925 * a type expression that does not denote a class available in the lexical sco pe of <i>C</i>. 955 * 7.9 Superclasses: It is a compile-time error if the extends clause of a
956 * class <i>C</i> includes a type expression that does not denote a class
957 * available in the lexical scope of <i>C</i>.
926 * 958 *
927 * @param typeName the name of the superclass that was not found 959 * @param typeName the name of the superclass that was not found
928 */ 960 */
929 static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCo de.con1('EXTENDS_NON_CLASS', 53, "Classes can only extend other classes"); 961 static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCo de('EXTENDS_NON_CLASS', "Classes can only extend other classes");
930 962
931 /** 963 /**
932 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 964 * 12.2 Null: It is a compile-time error for a class to attempt to extend or
933 * 965 * implement Null.
934 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 966 *
935 * 967 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
936 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 968 * or implement int.
937 * 969 *
938 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 970 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
971 * or implement double.
972 *
973 * 12.3 Numbers: It is a compile-time error for any type other than the types
974 * int and double to
939 * attempt to extend or implement num. 975 * attempt to extend or implement num.
940 * 976 *
941 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 977 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
942 * 978 * or implement bool.
943 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 979 *
980 * 12.5 Strings: It is a compile-time error for a class to attempt to extend
981 * or implement String.
944 * 982 *
945 * @param typeName the name of the type that cannot be extended 983 * @param typeName the name of the type that cannot be extended
946 * @see #IMPLEMENTS_DISALLOWED_CLASS 984 * @see [IMPLEMENTS_DISALLOWED_CLASS]
947 */ 985 */
948 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime ErrorCode.con1('EXTENDS_DISALLOWED_CLASS', 54, "Classes cannot extend '{0}'"); 986 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime ErrorCode('EXTENDS_DISALLOWED_CLASS', "Classes cannot extend '{0}'");
949 987
950 /** 988 /**
951 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes 989 * 7.9 Superclasses: It is a compile-time error if the extends clause of a
952 * a deferred type expression. 990 * class <i>C</i> includes a deferred type expression.
953 * 991 *
954 * @param typeName the name of the type that cannot be extended 992 * @param typeName the name of the type that cannot be extended
955 * @see #IMPLEMENTS_DEFERRED_CLASS 993 * @see [IMPLEMENTS_DEFERRED_CLASS]
956 * @see #MIXIN_DEFERRED_CLASS 994 * @see [MIXIN_DEFERRED_CLASS]
957 */ 995 */
958 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeEr rorCode.con1('EXTENDS_DEFERRED_CLASS', 55, "This class cannot extend the deferre d class '{0}'"); 996 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeEr rorCode('EXTENDS_DEFERRED_CLASS', "This class cannot extend the deferred class ' {0}'");
959 997
960 /** 998 /**
961 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt; 999 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
962 * n</i>. 1000 * h</i> or if <i>m &gt; n</i>.
963 * 1001 *
964 * 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
965 * uncaught exception being thrown. 1003 * object results in an uncaught exception being thrown.
966 * 1004 *
967 * @param requiredCount the maximum number of positional arguments 1005 * @param requiredCount the maximum number of positional arguments
968 * @param argumentCount the actual number of positional arguments given 1006 * @param argumentCount the actual number of positional arguments given
969 */ 1007 */
970 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTi meErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 56, "{0} positional arguments exp ected, but {1} found"); 1008 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTi meErrorCode('EXTRA_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, bu t {1} found");
971 1009
972 /** 1010 /**
973 * 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
974 * error if more than one initializer corresponding to a given instance variab le appears in 1012 * is a compile time error if more than one initializer corresponding to a
975 * <i>k</i>'s list. 1013 * given instance variable appears in <i>k</i>'s list.
976 */ 1014 */
977 static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 5 7, "The field '{0}' cannot be initialized twice in the same constructor"); 1015 static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', "The f ield '{0}' cannot be initialized twice in the same constructor");
978 1016
979 /** 1017 /**
980 * 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
981 * error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized 1019 * is a compile time error if <i>k</i>'s initializer list contains an
982 * by means of an initializing formal of <i>k</i>. 1020 * initializer for a variable that is initialized by means of an initializing
983 */ 1021 * formal of <i>k</i>.
984 static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIAL IZER', 58, "Fields cannot be initialized in both the parameter list and the init ializers"); 1022 */
985 1023 static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER = const CompileTimeErrorCode('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER' , "Fields cannot be initialized in both the parameter list and the initializers" );
986 /** 1024
987 * 5 Variables: It is a compile-time error if a final instance variable that h as is initialized by 1025 /**
988 * means of an initializing formal of a constructor is also initialized elsewh ere in the same 1026 * 5 Variables: It is a compile-time error if a final instance variable that
989 * constructor. 1027 * has is initialized by means of an initializing formal of a constructor is
1028 * also initialized elsewhere in the same constructor.
990 * 1029 *
991 * @param name the name of the field in question 1030 * @param name the name of the field in question
992 */ 1031 */
993 static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const Com pileTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 59, "'{0}' is a final field and so can only be set once"); 1032 static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const Com pileTimeErrorCode('FINAL_INITIALIZED_MULTIPLE_TIMES', "'{0}' is a final field an d so can only be set once");
994 1033
995 /** 1034 /**
996 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 1035 * 7.6.1 Generative Constructors: It is a compile-time error if an
997 * a function other than a non-redirecting generative constructor. 1036 * initializing formal is used by a function other than a non-redirecting
998 */ 1037 * generative constructor.
999 static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = cons t CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 60, "Initia lizing formal fields cannot be used in factory constructors"); 1038 */
1000 1039 static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = cons t CompileTimeErrorCode('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', "Initializing fo rmal fields cannot be used in factory constructors");
1001 /** 1040
1002 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 1041 /**
1003 * a function other than a non-redirecting generative constructor. 1042 * 7.6.1 Generative Constructors: It is a compile-time error if an
1004 */ 1043 * initializing formal is used by a function other than a non-redirecting
1005 static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = cons t CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 61, "Initia lizing formal fields can only be used in constructors"); 1044 * generative constructor.
1006 1045 */
1007 /** 1046 static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = cons t CompileTimeErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', "Initializing fo rmal fields can only be used in constructors");
1008 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1047
1009 * only action is to invoke another generative constructor. 1048 /**
1010 * 1049 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
1011 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 1050 * in which case its only action is to invoke another generative constructor.
1012 * a function other than a non-redirecting generative constructor. 1051 *
1013 */ 1052 * 7.6.1 Generative Constructors: It is a compile-time error if an
1014 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 62, "The redirecting constructor cannot have a field initializer"); 1053 * initializing formal is used by a function other than a non-redirecting
1015 1054 * generative constructor.
1016 /** 1055 */
1017 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 1056 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', "The red irecting constructor cannot have a field initializer");
1018 * name. 1057
1058 /**
1059 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
1060 * method with the same name.
1019 * 1061 *
1020 * @param name the conflicting name of the getter and method 1062 * @param name the conflicting name of the getter and method
1021 */ 1063 */
1022 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 63, "'{0}' cannot be used to name a getter, there is already a method with the same name"); 1064 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const Com pileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', "'{0}' cannot be used to n ame a getter, there is already a method with the same name");
1023 1065
1024 /** 1066 /**
1025 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> 1067 * 7.10 Superinterfaces: It is a compile-time error if the implements clause
1026 * specifies a malformed type or deferred type as a superinterface. 1068 * of a class <i>C</i> specifies a malformed type or deferred type as a
1069 * superinterface.
1027 * 1070 *
1028 * @param typeName the name of the type that cannot be extended 1071 * @param typeName the name of the type that cannot be extended
1029 * @see #EXTENDS_DEFERRED_CLASS 1072 * @see [EXTENDS_DEFERRED_CLASS]
1030 * @see #MIXIN_DEFERRED_CLASS 1073 * @see [MIXIN_DEFERRED_CLASS]
1031 */ 1074 */
1032 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTim eErrorCode.con1('IMPLEMENTS_DEFERRED_CLASS', 64, "This class cannot implement th e deferred class '{0}'"); 1075 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTim eErrorCode('IMPLEMENTS_DEFERRED_CLASS', "This class cannot implement the deferre d class '{0}'");
1033 1076
1034 /** 1077 /**
1035 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 1078 * 12.2 Null: It is a compile-time error for a class to attempt to extend or
1036 * 1079 * implement Null.
1037 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 1080 *
1038 * 1081 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
1039 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 1082 * or implement int.
1040 * 1083 *
1041 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 1084 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
1085 * or implement double.
1086 *
1087 * 12.3 Numbers: It is a compile-time error for any type other than the types
1088 * int and double to
1042 * attempt to extend or implement num. 1089 * attempt to extend or implement num.
1043 * 1090 *
1044 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 1091 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
1045 * 1092 * or implement bool.
1046 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 1093 *
1094 * 12.5 Strings: It is a compile-time error for a class to attempt to extend
1095 * or implement String.
1047 * 1096 *
1048 * @param typeName the name of the type that cannot be implemented 1097 * @param typeName the name of the type that cannot be implemented
1049 * @see #EXTENDS_DISALLOWED_CLASS 1098 * @see [EXTENDS_DISALLOWED_CLASS]
1050 */ 1099 */
1051 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT imeErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 65, "Classes cannot implement ' {0}'"); 1100 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT imeErrorCode('IMPLEMENTS_DISALLOWED_CLASS', "Classes cannot implement '{0}'");
1052 1101
1053 /** 1102 /**
1054 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class includes 1103 * 7.10 Superinterfaces: It is a compile-time error if the implements clause
1055 * type dynamic. 1104 * of a class includes type dynamic.
1056 */ 1105 */
1057 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC ode.con1('IMPLEMENTS_DYNAMIC', 66, "Classes cannot implement 'dynamic'"); 1106 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC ode('IMPLEMENTS_DYNAMIC', "Classes cannot implement 'dynamic'");
1058 1107
1059 /** 1108 /**
1060 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. 1109 * Enum proposal: It is a compile-time error to subclass, mix-in or implement
1061 */ 1110 * an enum.
1062 static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode .con1('IMPLEMENTS_ENUM', 67, "Classes cannot implement an enum"); 1111 */
1063 1112 static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode ('IMPLEMENTS_ENUM', "Classes cannot implement an enum");
1064 /** 1113
1065 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> 1114 /**
1066 * includes a type expression that does not denote a class available in the le xical scope of 1115 * 7.10 Superinterfaces: It is a compile-time error if the implements clause
1067 * <i>C</i>. 1116 * of a class <i>C</i> includes a type expression that does not denote a class
1117 * available in the lexical scope of <i>C</i>.
1068 * 1118 *
1069 * @param typeName the name of the interface that was not found 1119 * @param typeName the name of the interface that was not found
1070 */ 1120 */
1071 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErro rCode.con1('IMPLEMENTS_NON_CLASS', 68, "Classes can only implement other classes "); 1121 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErro rCode('IMPLEMENTS_NON_CLASS', "Classes can only implement other classes");
1072 1122
1073 /** 1123 /**
1074 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in 1124 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears
1075 * the implements clause of a class. 1125 * more than once in the implements clause of a class.
1076 * 1126 *
1077 * @param className the name of the class that is implemented more than once 1127 * @param className the name of the class that is implemented more than once
1078 */ 1128 */
1079 static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeError Code.con1('IMPLEMENTS_REPEATED', 69, "'{0}' can only be implemented once"); 1129 static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeError Code('IMPLEMENTS_REPEATED', "'{0}' can only be implemented once");
1080 1130
1081 /** 1131 /**
1082 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla ss <i>C</i> appears 1132 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a
1083 * in the implements clause of <i>C</i>. 1133 * class <i>C</i> appears in the implements clause of <i>C</i>.
1084 * 1134 *
1085 * @param className the name of the class that appears in both "extends" and " implements" clauses 1135 * @param className the name of the class that appears in both "extends" and
1086 */ 1136 * "implements" clauses
1087 static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeEr rorCode.con1('IMPLEMENTS_SUPER_CLASS', 70, "'{0}' cannot be used in both 'extend s' and 'implements' clauses"); 1137 */
1088 1138 static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeEr rorCode('IMPLEMENTS_SUPER_CLASS', "'{0}' cannot be used in both 'extends' and 'i mplements' clauses");
1089 /** 1139
1090 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of 1140 /**
1091 * an initializer. 1141 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the
1092 * 1142 * right hand side of an initializer.
1093 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable 1143 *
1094 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the 1144 * 12.10 This: It is a compile-time error if this appears in a top-level
1095 * initializer of an instance variable. 1145 * function or variable initializer, in a factory constructor, or in a static
1146 * method or variable initializer, or in the initializer of an instance
1147 * variable.
1096 * 1148 *
1097 * @param name the name of the type in question 1149 * @param name the name of the type in question
1098 */ 1150 */
1099 static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = con st CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 71, "Only static members can be accessed in initializers"); 1151 static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = con st CompileTimeErrorCode('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', "Only static m embers can be accessed in initializers");
1100 1152
1101 /** 1153 /**
1102 * SDK implementation libraries can be imported only by other SDK libraries. 1154 * SDK implementation libraries can be imported only by other SDK libraries.
1103 * 1155 *
1104 * @param uri the uri pointing to a library 1156 * @param uri the uri pointing to a library
1105 */ 1157 */
1106 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('IMPORT_INTERNAL_LIBRARY', 72, "The library '{0}' is internal and cannot be imported"); 1158 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode('IMPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and cannot be imported");
1107 1159
1108 /** 1160 /**
1109 * 14.1 Imports: It is a compile-time error if the specified URI of an immedia te import does not 1161 * 14.1 Imports: It is a compile-time error if the specified URI of an
1110 * refer to a library declaration. 1162 * immediate import does not refer to a library declaration.
1111 * 1163 *
1112 * @param uri the uri pointing to a non-library declaration 1164 * @param uri the uri pointing to a non-library declaration
1113 * @see StaticWarningCode#IMPORT_OF_NON_LIBRARY 1165 * @see [StaticWarningCode.IMPORT_OF_NON_LIBRARY]
1114 */ 1166 */
1115 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1('IMPORT_OF_NON_LIBRARY', 73, "The imported library '{0}' must not ha ve a part-of directive"); 1167 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErr orCode('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part -of directive");
1116 1168
1117 /** 1169 /**
1118 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s ub>k</sub></i> are 1170 * 13.9 Switch: It is a compile-time error if values of the expressions
1119 * not instances of the same class <i>C</i>, for all <i>1 &lt;= k &lt;= n</i>. 1171 * <i>e<sub>k</sub></i> are not instances of the same class <i>C</i>, for all
1120 * 1172 * <i>1 &lt;= k &lt;= n</i>.
1121 * @param expressionSource the expression source code that is the unexpected t ype 1173 *
1174 * @param expressionSource the expression source code that is the unexpected
1175 * type
1122 * @param expectedType the name of the expected type 1176 * @param expectedType the name of the expected type
1123 */ 1177 */
1124 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const C ompileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 74, "Case express ions must have the same types, '{0}' is not a '{1}'"); 1178 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const C ompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES', "Case expressions must have the same types, '{0}' is not a '{1}'");
1125 1179
1126 /** 1180 /**
1127 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1181 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
1128 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an 1182 * is a compile-time error if <i>k</i>'s initializer list contains an
1129 * instance variable declared in the immediately surrounding class. 1183 * initializer for a variable that is not an instance variable declared in the
1130 * 1184 * immediately surrounding class.
1131 * @param id the name of the initializing formal that is not an instance varia ble in the 1185 *
1132 * immediately enclosing class 1186 * @param id the name of the initializing formal that is not an instance
1133 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD 1187 * variable in the immediately enclosing class
1134 */ 1188 * @see [INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]
1135 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = const C ompileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTENT_FIELD', 75, "'{0}' is not a variable in the enclosing class"); 1189 */
1136 1190 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = const C ompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTENT_FIELD', "'{0}' is not a variab le in the enclosing class");
1137 /** 1191
1138 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1192 /**
1139 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an 1193 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
1140 * instance variable declared in the immediately surrounding class. 1194 * is a compile-time error if <i>k</i>'s initializer list contains an
1141 * 1195 * initializer for a variable that is not an instance variable declared in the
1142 * @param id the name of the initializing formal that is a static variable in the immediately 1196 * immediately surrounding class.
1143 * enclosing class 1197 *
1198 * @param id the name of the initializing formal that is a static variable in
1199 * the immediately enclosing class
1144 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD 1200 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
1145 */ 1201 */
1146 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const Compile TimeErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 76, "'{0}' is a static variab le in the enclosing class, variables initialized in a constructor cannot be stat ic"); 1202 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const Compile TimeErrorCode('INITIALIZER_FOR_STATIC_FIELD', "'{0}' is a static variable in the enclosing class, variables initialized in a constructor cannot be static");
1147 1203
1148 /** 1204 /**
1149 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a 1205 * 7.6.1 Generative Constructors: An initializing formal has the form
1150 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately 1206 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of
1151 * enclosing class. 1207 * an instance variable of the immediately enclosing class.
1152 * 1208 *
1153 * @param id the name of the initializing formal that is not an instance varia ble in the 1209 * @param id the name of the initializing formal that is not an instance
1154 * immediately enclosing class 1210 * variable in the immediately enclosing class
1155 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD 1211 * @see [INITIALIZING_FORMAL_FOR_STATIC_FIELD]
1156 * @see #INITIALIZER_FOR_NON_EXISTENT_FIELD 1212 * @see [INITIALIZER_FOR_NON_EXISTENT_FIELD]
1157 */ 1213 */
1158 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', 7 7, "'{0}' is not a variable in the enclosing class"); 1214 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD = const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', "'{0}' is not a variable in the enclosing class");
1159 1215
1160 /** 1216 /**
1161 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a 1217 * 7.6.1 Generative Constructors: An initializing formal has the form
1162 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately 1218 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of
1163 * enclosing class. 1219 * an instance variable of the immediately enclosing class.
1164 * 1220 *
1165 * @param id the name of the initializing formal that is a static variable in the immediately 1221 * @param id the name of the initializing formal that is a static variable in
1166 * enclosing class 1222 * the immediately enclosing class
1167 * @see #INITIALIZER_FOR_STATIC_FIELD 1223 * @see [INITIALIZER_FOR_STATIC_FIELD]
1168 */ 1224 */
1169 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 78, "'{0}' is a static field in the enclosing class, fields initialized in a constructor cann ot be static"); 1225 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD', "'{0}' is a static field in the enclosing class, fields initialized in a constructor cannot be sta tic");
1170 1226
1171 /** 1227 /**
1172 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action 1228 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
1173 * <b>this</b>.<i>id</i>. 1229 * extraction <b>this</b>.<i>id</i>.
1174 */ 1230 */
1175 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', 79, "Instance m embers cannot be accessed from a factory constructor"); 1231 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', "Instance members ca nnot be accessed from a factory constructor");
1176 1232
1177 /** 1233 /**
1178 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action 1234 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property
1179 * <b>this</b>.<i>id</i>. 1235 * extraction <b>this</b>.<i>id</i>.
1180 */ 1236 */
1181 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const C ompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 80, "Instance mem bers cannot be accessed from a static method"); 1237 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const C ompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_STATIC', "Instance members cann ot be accessed from a static method");
1182 1238
1183 /** 1239 /**
1184 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or 1240 * Enum proposal: It is also a compile-time error to explicitly instantiate an
1185 * 'const' or to access its private fields. 1241 * enum via 'new' or 'const' or to access its private fields.
1186 */ 1242 */
1187 static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCod e.con1('INSTANTIATE_ENUM', 81, "Enums cannot be instantiated"); 1243 static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCod e('INSTANTIATE_ENUM', "Enums cannot be instantiated");
1188 1244
1189 /** 1245 /**
1190 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1246 * 11 Metadata: Metadata consists of a series of annotations, each of which
1191 * character @, followed by a constant expression that must be either a refere nce to a 1247 * begin with the character @, followed by a constant expression that must be
1192 * compile-time constant variable, or a call to a constant constructor. 1248 * either a reference to a compile-time constant variable, or a call to a
1193 */ 1249 * constant constructor.
1194 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode.con1('INVALID_ANNOTATION', 82, "Annotation can be only constant variable or constant constructor invocation"); 1250 */
1195 1251 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode('INVALID_ANNOTATION', "Annotation can be only constant variable or constant constructor invocation");
1196 /** 1252
1197 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1253 /**
1198 * character @, followed by a constant expression that must be either a refere nce to a 1254 * 11 Metadata: Metadata consists of a series of annotations, each of which
1199 * compile-time constant variable, or a call to a constant constructor. 1255 * begin with the character @, followed by a constant expression that must be
1200 * 1256 * either a reference to a compile-time constant variable, or a call to a
1201 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1257 * constant constructor.
1202 * deferred prefix. 1258 *
1203 */ 1259 * 12.1 Constants: A qualified reference to a static constant variable that is
1204 static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = c onst CompileTimeErrorCode.con1('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', 83, " Constant values from a deferred library cannot be used as annotations"); 1260 * not qualified by a deferred prefix.
1205 1261 */
1206 /** 1262 static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = c onst CompileTimeErrorCode('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as annotations");
1207 * 15.31 Identifier Reference: It is a compile-time error if any of the identi fiers async, await 1263
1208 * or yield is used as an identifier in a function body marked with either asy nc, async* or sync*. 1264 /**
1209 */ 1265 * 15.31 Identifier Reference: It is a compile-time error if any of the
1210 static const CompileTimeErrorCode INVALID_IDENTIFIER_IN_ASYNC = const CompileT imeErrorCode.con1('INVALID_IDENTIFIER_IN_ASYNC', 84, "The identifier '{0}' canno t be used in a function marked with async, async* or sync*"); 1266 * identifiers async, await or yield is used as an identifier in a function
1211 1267 * body marked with either async, async* or sync*.
1212 /** 1268 */
1213 * 9. Functions: It is a compile-time error if an async, async* or sync* modif ier is attached to 1269 static const CompileTimeErrorCode INVALID_IDENTIFIER_IN_ASYNC = const CompileT imeErrorCode('INVALID_IDENTIFIER_IN_ASYNC', "The identifier '{0}' cannot be used in a function marked with async, async* or sync*");
1214 * the body of a setter or constructor. 1270
1215 */ 1271 /**
1216 static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR = const Comp ileTimeErrorCode.con1('INVALID_MODIFIER_ON_CONSTRUCTOR', 85, "The modifier '{0}' cannot be applied to the body of a constructor"); 1272 * 9. Functions: It is a compile-time error if an async, async* or sync*
1217 1273 * modifier is attached to the body of a setter or constructor.
1218 /** 1274 */
1219 * 9. Functions: It is a compile-time error if an async, async* or sync* modif ier is attached to 1275 static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR = const Comp ileTimeErrorCode('INVALID_MODIFIER_ON_CONSTRUCTOR', "The modifier '{0}' cannot b e applied to the body of a constructor");
1220 * the body of a setter or constructor. 1276
1221 */ 1277 /**
1222 static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER = const CompileTi meErrorCode.con1('INVALID_MODIFIER_ON_SETTER', 86, "The modifier '{0}' cannot be applied to the body of a setter"); 1278 * 9. Functions: It is a compile-time error if an async, async* or sync*
1223 1279 * modifier is attached to the body of a setter or constructor.
1224 /** 1280 */
1225 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time 1281 static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER = const CompileTi meErrorCode('INVALID_MODIFIER_ON_SETTER', "The modifier '{0}' cannot be applied to the body of a setter");
1226 * constants. Until then, this acts as a placeholder for more informative erro rs. 1282
1283 /**
1284 * TODO(brianwilkerson) Remove this when we have decided on how to report
1285 * errors in compile-time constants. Until then, this acts as a placeholder
1286 * for more informative errors.
1227 * 1287 *
1228 * See TODOs in ConstantVisitor 1288 * See TODOs in ConstantVisitor
1229 */ 1289 */
1230 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e.con1('INVALID_CONSTANT', 87, "Invalid constant value"); 1290 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e('INVALID_CONSTANT', "Invalid constant value");
1231 1291
1232 /** 1292 /**
1233 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor 1293 * 7.6 Constructors: It is a compile-time error if the name of a constructor
1234 * name. 1294 * is not a constructor name.
1235 */ 1295 */
1236 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 88, "Invalid constructor name"); 1296 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode('INVALID_CONSTRUCTOR_NAME', "Invalid constructor name");
1237 1297
1238 /** 1298 /**
1239 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately 1299 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of
1240 * enclosing class. 1300 * the immediately enclosing class.
1241 */ 1301 */
1242 static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const Com pileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 89, "The name of the immediately enclosing class expected"); 1302 static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const Com pileTimeErrorCode('INVALID_FACTORY_NAME_NOT_A_CLASS', "The name of the immediate ly enclosing class expected");
1243 1303
1244 /** 1304 /**
1245 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable 1305 * 12.10 This: It is a compile-time error if this appears in a top-level
1246 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the 1306 * function or variable initializer, in a factory constructor, or in a static
1247 * initializer of an instance variable. 1307 * method or variable initializer, or in the initializer of an instance
1248 */ 1308 * variable.
1249 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode.con1('INVALID_REFERENCE_TO_THIS', 90, "Invalid reference to 'this' ex pression"); 1309 */
1250 1310 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode('INVALID_REFERENCE_TO_THIS', "Invalid reference to 'this' expression" );
1251 /** 1311
1252 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes 1312 /**
1253 * a type parameter. 1313 * 12.6 Lists: It is a compile time error if the type argument of a constant
1314 * list literal includes a type parameter.
1254 * 1315 *
1255 * @name the name of the type parameter 1316 * @name the name of the type parameter
1256 */ 1317 */
1257 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 91, "Constant l ist literals cannot include a type parameter as a type argument, such as '{0}'") ; 1318 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', "Constant list liter als cannot include a type parameter as a type argument, such as '{0}'");
1258 1319
1259 /** 1320 /**
1260 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a 1321 * 12.7 Maps: It is a compile time error if the type arguments of a constant
1261 * type parameter. 1322 * map literal include a type parameter.
1262 * 1323 *
1263 * @name the name of the type parameter 1324 * @name the name of the type parameter
1264 */ 1325 */
1265 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const C ompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 92, "Constant map literals cannot include a type parameter as a type argument, such as '{0}'"); 1326 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const C ompileTimeErrorCode('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', "Constant map literals cannot include a type parameter as a type argument, such as '{0}'");
1266 1327
1267 /** 1328 /**
1268 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 1329 * 14.2 Exports: It is a compile-time error if the compilation unit found at
1269 * not a library declaration. 1330 * the specified URI is not a library declaration.
1270 * 1331 *
1271 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 1332 * 14.1 Imports: It is a compile-time error if the compilation unit found at
1272 * not a library declaration. 1333 * the specified URI is not a library declaration.
1273 * 1334 *
1274 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1335 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
1275 * declaration. 1336 * valid part declaration.
1276 * 1337 *
1277 * @param uri the URI that is invalid 1338 * @param uri the URI that is invalid
1278 * @see #URI_DOES_NOT_EXIST 1339 * @see [URI_DOES_NOT_EXIST]
1279 */ 1340 */
1280 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con 1('INVALID_URI', 93, "Invalid URI syntax: '{0}'"); 1341 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode('IN VALID_URI', "Invalid URI syntax: '{0}'");
1281 1342
1282 /** 1343 /**
1283 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within 1344 * 13.13 Break: It is a compile-time error if no such statement
1284 * the innermost function in which <i>s<sub>b</sub></i> occurs. 1345 * <i>s<sub>E</sub></i> exists within the innermost function in which
1285 * 1346 * <i>s<sub>b</sub></i> occurs.
1286 * 13.14 Continue: It is a compile-time error if no such statement or case cla use 1347 *
1287 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. 1348 * 13.14 Continue: It is a compile-time error if no such statement or case
1349 * clause <i>s<sub>E</sub></i> exists within the innermost function in which
1350 * <i>s<sub>c</sub></i> occurs.
1288 * 1351 *
1289 * @param labelName the name of the unresolvable label 1352 * @param labelName the name of the unresolvable label
1290 */ 1353 */
1291 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErro rCode.con1('LABEL_IN_OUTER_SCOPE', 94, "Cannot reference label '{0}' declared in an outer method"); 1354 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErro rCode('LABEL_IN_OUTER_SCOPE', "Cannot reference label '{0}' declared in an outer method");
1292 1355
1293 /** 1356 /**
1294 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within 1357 * 13.13 Break: It is a compile-time error if no such statement
1295 * the innermost function in which <i>s<sub>b</sub></i> occurs. 1358 * <i>s<sub>E</sub></i> exists within the innermost function in which
1296 * 1359 * <i>s<sub>b</sub></i> occurs.
1297 * 13.14 Continue: It is a compile-time error if no such statement or case cla use 1360 *
1298 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. 1361 * 13.14 Continue: It is a compile-time error if no such statement or case
1362 * clause <i>s<sub>E</sub></i> exists within the innermost function in which
1363 * <i>s<sub>c</sub></i> occurs.
1299 * 1364 *
1300 * @param labelName the name of the unresolvable label 1365 * @param labelName the name of the unresolvable label
1301 */ 1366 */
1302 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode .con1('LABEL_UNDEFINED', 95, "Cannot reference undefined label '{0}'"); 1367 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode ('LABEL_UNDEFINED', "Cannot reference undefined label '{0}'");
1303 1368
1304 /** 1369 /**
1305 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name 1370 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member
1306 * as <i>C</i>. 1371 * with the same name as <i>C</i>.
1307 */ 1372 */
1308 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeEr rorCode.con1('MEMBER_WITH_CLASS_NAME', 96, "Class members cannot have the same n ame as the enclosing class"); 1373 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeEr rorCode('MEMBER_WITH_CLASS_NAME', "Class members cannot have the same name as th e enclosing class");
1309 1374
1310 /** 1375 /**
1311 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 1376 * 7.2 Getters: It is a compile-time error if a class has both a getter and a
1312 * name. 1377 * method with the same name.
1313 * 1378 *
1314 * @param name the conflicting name of the getter and method 1379 * @param name the conflicting name of the getter and method
1315 */ 1380 */
1316 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 97, "'{0}' cannot be used to name a method, there is already a getter with the same name"); 1381 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const Com pileTimeErrorCode('METHOD_AND_GETTER_WITH_SAME_NAME', "'{0}' cannot be used to n ame a method, there is already a getter with the same name");
1317 1382
1318 /** 1383 /**
1319 * 12.1 Constants: A constant expression is ... a constant list literal. 1384 * 12.1 Constants: A constant expression is ... a constant list literal.
1320 */ 1385 */
1321 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const Compil eTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 98, "List literals must be prefixed with 'const' when used as a constant expression"); 1386 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const Compil eTimeErrorCode('MISSING_CONST_IN_LIST_LITERAL', "List literals must be prefixed with 'const' when used as a constant expression");
1322 1387
1323 /** 1388 /**
1324 * 12.1 Constants: A constant expression is ... a constant map literal. 1389 * 12.1 Constants: A constant expression is ... a constant map literal.
1325 */ 1390 */
1326 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const Compile TimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 99, "Map literals must be pre fixed with 'const' when used as a constant expression"); 1391 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const Compile TimeErrorCode('MISSING_CONST_IN_MAP_LITERAL', "Map literals must be prefixed wit h 'const' when used as a constant expression");
1327 1392
1328 /** 1393 /**
1329 * Enum proposal: It is a static warning if all of the following conditions ho ld: 1394 * Enum proposal: It is a static warning if all of the following conditions
1395 * hold:
1330 * * The switch statement does not have a 'default' clause. 1396 * * The switch statement does not have a 'default' clause.
1331 * * The static type of <i>e</i> is an enumerated typed with elements <i>id<su b>1</sub></i>, 1397 * * The static type of <i>e</i> is an enumerated typed with elements
1332 * &hellip;, <i>id<sub>n</sub></i>. 1398 * <i>id<sub>1</sub></i>, &hellip;, <i>id<sub>n</sub></i>.
1333 * * The sets {<i>e<sub>1</sub></i>, &hellip;, <i>e<sub>k</sub></i>} and {<i>i d<sub>1</sub></i>, 1399 * * The sets {<i>e<sub>1</sub></i>, &hellip;, <i>e<sub>k</sub></i>} and
1334 * &hellip;, <i>id<sub>n</sub></i>} are not the same. 1400 * {<i>id<sub>1</sub></i>, &hellip;, <i>id<sub>n</sub></i>} are not the same .
1335 * 1401 *
1336 * @param constantName the name of the constant that is missing 1402 * @param constantName the name of the constant that is missing
1337 */ 1403 */
1338 static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = const Comp ileTimeErrorCode.con2('MISSING_ENUM_CONSTANT_IN_SWITCH', 100, "Missing case clau se for '{0}'", "Add a case clause for the missing constant or add a default clau se."); 1404 static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = const Comp ileTimeErrorCode('MISSING_ENUM_CONSTANT_IN_SWITCH', "Missing case clause for '{0 }'", "Add a case clause for the missing constant or add a default clause.");
1339 1405
1340 /** 1406 /**
1341 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a 1407 * 9 Mixins: It is a compile-time error if a declared or derived mixin
1342 * constructor. 1408 * explicitly declares a constructor.
1343 * 1409 *
1344 * @param typeName the name of the mixin that is invalid 1410 * @param typeName the name of the mixin that is invalid
1345 */ 1411 */
1346 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi meErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 101, "The class '{0}' cannot be u sed as a mixin because it declares a constructor"); 1412 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi meErrorCode('MIXIN_DECLARES_CONSTRUCTOR', "The class '{0}' cannot be used as a m ixin because it declares a constructor");
1347 1413
1348 /** 1414 /**
1349 * 9.1 Mixin Application: It is a compile-time error if the with clause of a m ixin application 1415 * 9.1 Mixin Application: It is a compile-time error if the with clause of a
1350 * <i>C</i> includes a deferred type expression. 1416 * mixin application <i>C</i> includes a deferred type expression.
1351 * 1417 *
1352 * @param typeName the name of the type that cannot be extended 1418 * @param typeName the name of the type that cannot be extended
1353 * @see #EXTENDS_DEFERRED_CLASS 1419 * @see #EXTENDS_DEFERRED_CLASS
1354 * @see #IMPLEMENTS_DEFERRED_CLASS 1420 * @see #IMPLEMENTS_DEFERRED_CLASS
1355 */ 1421 */
1356 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode.con1('MIXIN_DEFERRED_CLASS', 102, "This class cannot mixin the deferred cl ass '{0}'"); 1422 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode('MIXIN_DEFERRED_CLASS', "This class cannot mixin the deferred class '{0}'" );
1357 1423
1358 /** 1424 /**
1359 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not 1425 * 9 Mixins: It is a compile-time error if a mixin is derived from a class
1360 * Object. 1426 * whose superclass is not Object.
1361 * 1427 *
1362 * @param typeName the name of the mixin that is invalid 1428 * @param typeName the name of the mixin that is invalid
1363 */ 1429 */
1364 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 103, "The class '{0}' can not be used as a mixin because it extends a class other than Object"); 1430 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', "The class '{0}' cannot be use d as a mixin because it extends a class other than Object");
1365 1431
1366 /** 1432 /**
1367 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 1433 * 12.2 Null: It is a compile-time error for a class to attempt to extend or
1368 * 1434 * implement Null.
1369 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 1435 *
1370 * 1436 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
1371 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 1437 * or implement int.
1372 * 1438 *
1373 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 1439 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend
1374 * attempt to extend or implement num. 1440 * or implement double.
1375 * 1441 *
1376 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 1442 * 12.3 Numbers: It is a compile-time error for any type other than the types
1377 * 1443 * int and double to attempt to extend or implement num.
1378 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 1444 *
1445 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend
1446 * or implement bool.
1447 *
1448 * 12.5 Strings: It is a compile-time error for a class to attempt to extend
1449 * or implement String.
1379 * 1450 *
1380 * @param typeName the name of the type that cannot be extended 1451 * @param typeName the name of the type that cannot be extended
1381 * @see #IMPLEMENTS_DISALLOWED_CLASS 1452 * @see [IMPLEMENTS_DISALLOWED_CLASS]
1382 */ 1453 */
1383 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 104, "Classes cannot mixin '{0}'"); 1454 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode('MIXIN_OF_DISALLOWED_CLASS', "Classes cannot mixin '{0}'");
1384 1455
1385 /** 1456 /**
1386 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. 1457 * Enum proposal: It is a compile-time error to subclass, mix-in or implement
1387 */ 1458 * an enum.
1388 static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode.c on1('MIXIN_OF_ENUM', 105, "Classes cannot mixin an enum"); 1459 */
1389 1460 static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode(' MIXIN_OF_ENUM', "Classes cannot mixin an enum");
1390 /** 1461
1391 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin 1462 /**
1392 * available in the immediately enclosing scope. 1463 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not
1393 */ 1464 * denote a class or mixin available in the immediately enclosing scope.
1394 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode.con1('MIXIN_OF_NON_CLASS', 106, "Classes can only mixin other classes"); 1465 */
1395 1466 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode('MIXIN_OF_NON_CLASS', "Classes can only mixin other classes");
1396 /** 1467
1397 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super. 1468 /**
1398 */ 1469 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers
1399 static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeEr rorCode.con1('MIXIN_REFERENCES_SUPER', 107, "The class '{0}' cannot be used as a mixin because it references 'super'"); 1470 * to super.
1400 1471 */
1401 /** 1472 static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeEr rorCode('MIXIN_REFERENCES_SUPER', "The class '{0}' cannot be used as a mixin bec ause it references 'super'");
1402 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available 1473
1403 * in the immediately enclosing scope. 1474 /**
1404 */ 1475 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not
1405 static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const Comp ileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 108, "Mixin can only be applied to class"); 1476 * denote a class available in the immediately enclosing scope.
1406 1477 */
1407 /** 1478 static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const Comp ileTimeErrorCode('MIXIN_WITH_NON_CLASS_SUPERCLASS', "Mixin can only be applied t o class");
1408 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1479
1409 * only action is to invoke another generative constructor. 1480 /**
1410 */ 1481 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
1411 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS ', 109, "Constructor may have at most one 'this' redirection"); 1482 * in which case its only action is to invoke another generative constructor.
1412 1483 */
1413 /** 1484 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS', "C onstructor may have at most one 'this' redirection");
1414 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may 1485
1415 * include at most one superinitializer in its initializer list or a compile t ime error occurs. 1486 /**
1416 */ 1487 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor.
1417 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 110, "Constructor may have at m ost one 'super' initializer"); 1488 * Then <i>k</i> may include at most one superinitializer in its initializer
1418 1489 * list or a compile time error occurs.
1419 /** 1490 */
1420 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1491 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode('MULTIPLE_SUPER_INITIALIZERS', "Constructor may have at most one 's uper' initializer");
1421 * character @, followed by a constant expression that must be either a refere nce to a 1492
1422 * compile-time constant variable, or a call to a constant constructor. 1493 /**
1423 */ 1494 * 11 Metadata: Metadata consists of a series of annotations, each of which
1424 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 111, "Annotatio n creation must have arguments"); 1495 * begin with the character @, followed by a constant expression that must be
1425 1496 * either a reference to a compile-time constant variable, or a call to a
1426 /** 1497 * constant constructor.
1427 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer 1498 */
1428 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the 1499 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', "Annotation creation must have arguments");
1429 * enclosing class is class <i>Object</i>. 1500
1430 * 1501 /**
1431 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a 1502 * 7.6.1 Generative Constructors: If no superinitializer is provided, an
1432 * generative constructor named <i>S</i> (respectively <i>S.id</i>) 1503 * implicit superinitializer of the form <b>super</b>() is added at the end of
1433 */ 1504 * <i>k</i>'s initializer list, unless the enclosing class is class
1434 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 112, "The c lass '{0}' does not have a default constructor"); 1505 * <i>Object</i>.
1435 1506 *
1436 /** 1507 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
1437 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a 1508 * does not declare a generative constructor named <i>S</i> (respectively
1438 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>. 1509 * <i>S.id</i>)
1439 * 1510 */
1440 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a 1511 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = cons t CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', "The class '{0}' does not have a default constructor");
1441 * generative constructor named <i>S</i> (respectively <i>S.id</i>) 1512
1442 */ 1513 /**
1443 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 113, "The c lass '{0}' does not have a default constructor"); 1514 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it
1444 1515 * implicitly has a default constructor C() : <b>super<b>() {}, unless
1445 /** 1516 * <i>C</i> is class <i>Object</i>.
1446 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has 1517 *
1447 * no explicit type arguments appears in a place where a statement is expected . 1518 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i>
1448 */ 1519 * does not declare a generative constructor named <i>S</i> (respectively
1449 static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = cons t CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 114, "A non -constant map literal without type arguments cannot be used as an expression sta tement"); 1520 * <i>S.id</i>)
1450 1521 */
1451 /** 1522 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = cons t CompileTimeErrorCode('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', "The class '{0}' does not have a default constructor");
1452 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip; 1523
1453 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip; 1524 /**
1454 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form 1525 * 13.2 Expression Statements: It is a compile-time error if a non-constant
1455 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>: 1526 * map literal that has no explicit type arguments appears in a place where a
1456 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>: 1527 * statement is expected.
1457 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not 1528 */
1529 static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = cons t CompileTimeErrorCode('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', "A non-constant map literal without type arguments cannot be used as an expression statement");
1530
1531 /**
1532 * 13.9 Switch: Given a switch statement of the form <i>switch (e) {
1533 * label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub>1</sub>:
1534 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case
1535 * e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</sub>}</i> or the form
1536 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case
1537 * e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip;
1538 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub>}</i>, it is a
1539 * compile-time error if the expressions <i>e<sub>k</sub></i> are not
1458 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>. 1540 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
1459 */ 1541 */
1460 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 115, "Case expressions must b e constant"); 1542 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode('NON_CONSTANT_CASE_EXPRESSION', "Case expressions must be constant ");
1461 1543
1462 /** 1544 /**
1463 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip; 1545 * 13.9 Switch: Given a switch statement of the form <i>switch (e) {
1464 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip; 1546 * label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub>1</sub>:
1465 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form 1547 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case
1466 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>: 1548 * e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</sub>}</i> or the form
1467 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>: 1549 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case
1468 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not 1550 * e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip;
1551 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub>}</i>, it is a
1552 * compile-time error if the expressions <i>e<sub>k</sub></i> are not
1469 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>. 1553 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
1470 * 1554 *
1471 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1555 * 12.1 Constants: A qualified reference to a static constant variable that is
1472 * deferred prefix. 1556 * not qualified by a deferred prefix.
1473 */ 1557 */
1474 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_L IBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFE RRED_LIBRARY', 116, "Constant values from a deferred library cannot be used as a case expression"); 1558 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_L IBRARY = const CompileTimeErrorCode('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_ LIBRARY', "Constant values from a deferred library cannot be used as a case expr ession");
1475 1559
1476 /** 1560 /**
1477 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional 1561 * 6.2.2 Optional Formals: It is a compile-time error if the default value of
1478 * parameter is not a compile-time constant. 1562 * an optional parameter is not a compile-time constant.
1479 */ 1563 */
1480 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTi meErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 117, "Default values of an option al parameter must be constant"); 1564 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTi meErrorCode('NON_CONSTANT_DEFAULT_VALUE', "Default values of an optional paramet er must be constant");
1481 1565
1482 /** 1566 /**
1483 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional 1567 * 6.2.2 Optional Formals: It is a compile-time error if the default value of
1484 * parameter is not a compile-time constant. 1568 * an optional parameter is not a compile-time constant.
1485 * 1569 *
1486 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1570 * 12.1 Constants: A qualified reference to a static constant variable that is
1487 * deferred prefix. 1571 * not qualified by a deferred prefix.
1488 */ 1572 */
1489 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIB RARY = const CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED _LIBRARY', 118, "Constant values from a deferred library cannot be used as a def ault parameter value"); 1573 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIB RARY = const CompileTimeErrorCode('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBR ARY', "Constant values from a deferred library cannot be used as a default param eter value");
1490 1574
1491 /** 1575 /**
1492 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a 1576 * 12.6 Lists: It is a compile time error if an element of a constant list
1493 * compile-time constant.
1494 */
1495 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 119, "'const' lists must have all c onstant values");
1496
1497 /**
1498 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a
1499 * compile-time constant.
1500 *
1501 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1502 * deferred prefix.
1503 */
1504 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBR ARY = const CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_L IBRARY', 120, "Constant values from a deferred library cannot be used as values in a 'const' list");
1505
1506 /**
1507 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1508 * literal is not a compile-time constant. 1577 * literal is not a compile-time constant.
1509 */ 1578 */
1510 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode.con1('NON_CONSTANT_MAP_KEY', 121, "The keys in a map must be constant"); 1579 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode('NON_CONSTANT_LIST_ELEMENT', "'const' lists must have all constant va lues");
1511 1580
1512 /** 1581 /**
1513 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1582 * 12.6 Lists: It is a compile time error if an element of a constant list
1514 * literal is not a compile-time constant. 1583 * literal is not a compile-time constant.
1515 * 1584 *
1516 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1585 * 12.1 Constants: A qualified reference to a static constant variable that is
1517 * deferred prefix. 1586 * not qualified by a deferred prefix.
1518 */ 1587 */
1519 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', 1 22, "Constant values from a deferred library cannot be used as keys in a map"); 1588 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBR ARY = const CompileTimeErrorCode('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRAR Y', "Constant values from a deferred library cannot be used as values in a 'cons t' list");
1520 1589
1521 /** 1590 /**
1522 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1591 * 12.7 Maps: It is a compile time error if either a key or a value of an
1523 * literal is not a compile-time constant. 1592 * entry in a constant map literal is not a compile-time constant.
1524 */ 1593 */
1525 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeEr rorCode.con1('NON_CONSTANT_MAP_VALUE', 123, "The values in a 'const' map must be constant"); 1594 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode('NON_CONSTANT_MAP_KEY', "The keys in a map must be constant");
1526 1595
1527 /** 1596 /**
1528 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1597 * 12.7 Maps: It is a compile time error if either a key or a value of an
1529 * literal is not a compile-time constant. 1598 * entry in a constant map literal is not a compile-time constant.
1530 * 1599 *
1531 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1600 * 12.1 Constants: A qualified reference to a static constant variable that is
1532 * deferred prefix. 1601 * not qualified by a deferred prefix.
1533 */ 1602 */
1534 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY ', 124, "Constant values from a deferred library cannot be used as values in a ' const' map"); 1603 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', "Const ant values from a deferred library cannot be used as keys in a map");
1535 1604
1536 /** 1605 /**
1537 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1606 * 12.7 Maps: It is a compile time error if either a key or a value of an
1538 * character @, followed by a constant expression that must be either a refere nce to a 1607 * entry in a constant map literal is not a compile-time constant.
1539 * compile-time constant variable, or a call to a constant constructor. 1608 */
1609 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeEr rorCode('NON_CONSTANT_MAP_VALUE', "The values in a 'const' map must be constant" );
1610
1611 /**
1612 * 12.7 Maps: It is a compile time error if either a key or a value of an
1613 * entry in a constant map literal is not a compile-time constant.
1614 *
1615 * 12.1 Constants: A qualified reference to a static constant variable that is
1616 * not qualified by a deferred prefix.
1617 */
1618 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY', "C onstant values from a deferred library cannot be used as values in a 'const' map ");
1619
1620 /**
1621 * 11 Metadata: Metadata consists of a series of annotations, each of which
1622 * begin with the character @, followed by a constant expression that must be
1623 * either a reference to a compile-time constant variable, or a call to a
1624 * constant constructor.
1540 * 1625 *
1541 * "From deferred library" case is covered by 1626 * "From deferred library" case is covered by
1542 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]. 1627 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY].
1543 */ 1628 */
1544 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 125, "Annotatio n creation can use only 'const' constructor"); 1629 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', "Annotation creation can use only 'const' constructor");
1545 1630
1546 /** 1631 /**
1547 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a 1632 * 7.6.3 Constant Constructors: Any expression that appears within the
1548 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. 1633 * initializer list of a constant constructor must be a potentially constant
1549 */ 1634 * expression, or a compile-time error occurs.
1550 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co mpileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 126, "Initializer e xpressions in constant constructors must be constants"); 1635 */
1551 1636 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co mpileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', "Initializer expressions in constant constructors must be constants");
1552 /** 1637
1553 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a 1638 /**
1554 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. 1639 * 7.6.3 Constant Constructors: Any expression that appears within the
1555 * 1640 * initializer list of a constant constructor must be a potentially constant
1556 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1641 * expression, or a compile-time error occurs.
1557 * deferred prefix. 1642 *
1558 */ 1643 * 12.1 Constants: A qualified reference to a static constant variable that is
1559 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFER RED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER _FROM_DEFERRED_LIBRARY', 127, "Constant values from a deferred library cannot be used as constant initializers"); 1644 * not qualified by a deferred prefix.
1560 1645 */
1561 /** 1646 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFER RED_LIBRARY = const CompileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER_FROM _DEFERRED_LIBRARY', "Constant values from a deferred library cannot be used as c onstant initializers");
1562 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>. 1647
1563 * 1648 /**
1564 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1649 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i>
1565 * uncaught exception being thrown. 1650 * or if <i>m > n</i>.
1651 *
1652 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
1653 * object results in an uncaught exception being thrown.
1566 * 1654 *
1567 * @param requiredCount the expected number of required arguments 1655 * @param requiredCount the expected number of required arguments
1568 * @param argumentCount the actual number of positional arguments given 1656 * @param argumentCount the actual number of positional arguments given
1569 */ 1657 */
1570 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 128, "{0} required argument (s) expected, but {1} found"); 1658 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', "{0} required argument(s) expect ed, but {1} found");
1571 1659
1572 /** 1660 /**
1573 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1661 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
1574 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1662 * superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
1575 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1663 * Let <i>k</i> be a generative constructor. It is a compile-time error if
1664 * class <i>S</i> does not declare a generative constructor named <i>S</i>
1576 * (respectively <i>S.id</i>) 1665 * (respectively <i>S.id</i>)
1577 */ 1666 */
1578 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 129, "The generative constructor '{0}' expected, but factory found"); 1667 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode('NON_GENERATIVE_CONSTRUCTOR', "The generative constructor '{0}' expe cted, but factory found");
1579 1668
1580 /** 1669 /**
1581 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object. 1670 * 7.9 Superclasses: It is a compile-time error to specify an extends clause
1582 */ 1671 * for class Object.
1583 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 130, ""); 1672 */
1584 1673 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', "");
1585 /** 1674
1586 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator. 1675 /**
1587 */ 1676 * 7.1.1 Operators: It is a compile-time error to declare an optional
1588 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const Compi leTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 131, "Optional parameters are not allowed when defining an operator"); 1677 * parameter in an operator.
1589 1678 */
1590 /** 1679 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const Compi leTimeErrorCode('OPTIONAL_PARAMETER_IN_OPERATOR', "Optional parameters are not a llowed when defining an operator");
1591 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1680
1592 * declaration. 1681 /**
1682 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
1683 * valid part declaration.
1593 * 1684 *
1594 * @param uri the uri pointing to a non-library declaration 1685 * @param uri the uri pointing to a non-library declaration
1595 */ 1686 */
1596 static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCod e.con1('PART_OF_NON_PART', 132, "The included part '{0}' must have a part-of dir ective"); 1687 static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCod e('PART_OF_NON_PART', "The included part '{0}' must have a part-of directive");
1597 1688
1598 /** 1689 /**
1599 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member 1690 * 14.1 Imports: It is a compile-time error if the current library declares a
1600 * named <i>p</i>. 1691 * top-level member named <i>p</i>.
1601 */ 1692 */
1602 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = cons t CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 133, "The n ame '{0}' is already used as an import prefix and cannot be used to name a top-l evel element"); 1693 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = cons t CompileTimeErrorCode('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', "The name '{0}' is already used as an import prefix and cannot be used to name a top-level eleme nt");
1603 1694
1604 /** 1695 /**
1605 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter 1696 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named
1606 * begins with an '_' character. 1697 * optional parameter begins with an '_' character.
1607 */ 1698 */
1608 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 134, "Named optional parameters c annot start with an underscore"); 1699 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode('PRIVATE_OPTIONAL_PARAMETER', "Named optional parameters cannot star t with an underscore");
1609 1700
1610 /** 1701 /**
1611 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression 1702 * 12.1 Constants: It is a compile-time error if the value of a compile-time
1612 * depends on itself. 1703 * constant expression depends on itself.
1613 */ 1704 */
1614 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 135, ""); 1705 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode('RECURSIVE_COMPILE_TIME_CONSTANT', "");
1615 1706
1616 /** 1707 /**
1617 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1708 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
1618 * only action is to invoke another generative constructor. 1709 * in which case its only action is to invoke another generative constructor.
1619 * 1710 *
1620 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in 1711 * TODO(scheglov) review this later, there are no explicit "it is a
1621 * specification. But it was added to the co19 and there is same error for fac tories. 1712 * compile-time error" in specification. But it was added to the co19 and
1713 * there is same error for factories.
1622 * 1714 *
1623 * https://code.google.com/p/dart/issues/detail?id=954 1715 * https://code.google.com/p/dart/issues/detail?id=954
1624 */ 1716 */
1625 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 136, "Cycle in redirectin g generative constructors"); 1717 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode('RECURSIVE_CONSTRUCTOR_REDIRECT', "Cycle in redirecting generati ve constructors");
1626 1718
1627 /** 1719 /**
1628 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to 1720 * 7.6.2 Factories: It is a compile-time error if a redirecting factory
1629 * itself, either directly or indirectly via a sequence of redirections. 1721 * constructor redirects to itself, either directly or indirectly via a
1630 */ 1722 * sequence of redirections.
1631 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 137, "Cycle in redirecting factor y constructors"); 1723 */
1632 1724 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode('RECURSIVE_FACTORY_REDIRECT', "Cycle in redirecting factory construc tors");
1633 /** 1725
1634 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1726 /**
1727 * 7.10 Superinterfaces: It is a compile-time error if the interface of a
1728 * class <i>C</i> is a superinterface of itself.
1729 *
1730 * 8.1 Superinterfaces: It is a compile-time error if an interface is a
1635 * superinterface of itself. 1731 * superinterface of itself.
1636 * 1732 *
1637 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1733 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
1638 * 1734 * superclass of itself.
1639 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1640 * 1735 *
1641 * @param className the name of the class that implements itself recursively 1736 * @param className the name of the class that implements itself recursively
1642 * @param strImplementsPath a string representation of the implements loop 1737 * @param strImplementsPath a string representation of the implements loop
1643 */ 1738 */
1644 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 138, "'{0}' cannot be a superinterface of itself: {1}"); 1739 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE', "'{0}' cannot be a superinte rface of itself: {1}");
1645 1740
1646 /** 1741 /**
1647 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1742 * 7.10 Superinterfaces: It is a compile-time error if the interface of a
1743 * class <i>C</i> is a superinterface of itself.
1744 *
1745 * 8.1 Superinterfaces: It is a compile-time error if an interface is a
1648 * superinterface of itself. 1746 * superinterface of itself.
1649 * 1747 *
1650 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1748 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
1651 * 1749 * superclass of itself.
1652 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1653 * 1750 *
1654 * @param className the name of the class that implements itself recursively 1751 * @param className the name of the class that implements itself recursively
1655 */ 1752 */
1656 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CA SE_EXTENDS', 139, "'{0}' cannot extend itself"); 1753 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS', "'{0}' cannot extend itself");
1657 1754
1658 /** 1755 /**
1659 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1756 * 7.10 Superinterfaces: It is a compile-time error if the interface of a
1757 * class <i>C</i> is a superinterface of itself.
1758 *
1759 * 8.1 Superinterfaces: It is a compile-time error if an interface is a
1660 * superinterface of itself. 1760 * superinterface of itself.
1661 * 1761 *
1662 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1762 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
1663 * 1763 * superclass of itself.
1664 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1665 * 1764 *
1666 * @param className the name of the class that implements itself recursively 1765 * @param className the name of the class that implements itself recursively
1667 */ 1766 */
1668 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE _CASE_IMPLEMENTS', 140, "'{0}' cannot implement itself"); 1767 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE _IMPLEMENTS', "'{0}' cannot implement itself");
1669 1768
1670 /** 1769 /**
1671 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1770 * 7.10 Superinterfaces: It is a compile-time error if the interface of a
1771 * class <i>C</i> is a superinterface of itself.
1772 *
1773 * 8.1 Superinterfaces: It is a compile-time error if an interface is a
1672 * superinterface of itself. 1774 * superinterface of itself.
1673 * 1775 *
1674 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1776 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a
1675 * 1777 * superclass of itself.
1676 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1677 * 1778 *
1678 * @param className the name of the class that implements itself recursively 1779 * @param className the name of the class that implements itself recursively
1679 */ 1780 */
1680 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_ WITH', 141, "'{0}' cannot use itself as a mixin"); 1781 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH = const CompileTimeErrorCode('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH' , "'{0}' cannot use itself as a mixin");
1681 1782
1682 /** 1783 /**
1683 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1784 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
1684 * <i>k'</i> is not a constant constructor. 1785 * the const modifier but <i>k'</i> is not a constant constructor.
1685 */ 1786 */
1686 static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const Comp ileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 142, "The constructor ' {0}' could not be found in '{1}'"); 1787 static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const Comp ileTimeErrorCode('REDIRECT_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' could not be found in '{1}'");
1687 1788
1688 /** 1789 /**
1689 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1790 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
1690 * <i>k'</i> is not a constant constructor. 1791 * the const modifier but <i>k'</i> is not a constant constructor.
1691 */ 1792 */
1692 static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErr orCode.con1('REDIRECT_TO_NON_CLASS', 143, "The name '{0}' is not a type and cann ot be used in a redirected constructor"); 1793 static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErr orCode('REDIRECT_TO_NON_CLASS', "The name '{0}' is not a type and cannot be used in a redirected constructor");
1693 1794
1694 /** 1795 /**
1695 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1796 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with
1696 * <i>k'</i> is not a constant constructor. 1797 * the const modifier but <i>k'</i> is not a constant constructor.
1697 */ 1798 */
1698 static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const Co mpileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 144, "Constant fact ory constructor cannot delegate to a non-constant constructor"); 1799 static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const Co mpileTimeErrorCode('REDIRECT_TO_NON_CONST_CONSTRUCTOR', "Constant factory constr uctor cannot delegate to a non-constant constructor");
1699 1800
1700 /** 1801 /**
1701 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which 1802 * 7.6.1 Generative constructors: A generative constructor may be
1702 * case its only action is to invoke another generative constructor. 1803 * <i>redirecting</i>, in which case its only action is to invoke another
1703 */ 1804 * generative constructor.
1704 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', 1 45, "The constructor '{0}' could not be found in '{1}'"); 1805 */
1705 1806 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', "The c onstructor '{0}' could not be found in '{1}'");
1706 /** 1807
1707 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which 1808 /**
1708 * case its only action is to invoke another generative constructor. 1809 * 7.6.1 Generative constructors: A generative constructor may be
1709 */ 1810 * <i>redirecting</i>, in which case its only action is to invoke another
1710 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTR UCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_C ONSTRUCTOR', 146, "Generative constructor cannot redirect to a factory construct or"); 1811 * generative constructor.
1711 1812 */
1712 /** 1813 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTR UCTOR = const CompileTimeErrorCode('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTR UCTOR', "Generative constructor cannot redirect to a factory constructor");
1713 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after 1814
1714 * its initializer, if any, is complete, or a compile-time error occurs. 1815 /**
1715 */ 1816 * 5 Variables: A local variable may only be referenced at a source code
1716 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 147, "Local variables canno t be referenced before they are declared"); 1817 * location that is after its initializer, if any, is complete, or a
1717 1818 * compile-time error occurs.
1718 /** 1819 */
1719 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not 1820 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode('REFERENCED_BEFORE_DECLARATION', "Local variables cannot be refer enced before they are declared");
1720 * enclosed within a on-catch clause. 1821
1721 */ 1822 /**
1722 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode.con1('RETHROW_OUTSIDE_CATCH', 148, "rethrow must be inside of a catch cla use"); 1823 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form
1723 1824 * <i>rethrow;</i> is not enclosed within a on-catch clause.
1724 /** 1825 */
1725 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i> 1826 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode('RETHROW_OUTSIDE_CATCH', "rethrow must be inside of a catch clause");
1726 * appears in a generative constructor. 1827
1727 */ 1828 /**
1728 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 149, "Constructors ca nnot return a value"); 1829 * 13.12 Return: It is a compile-time error if a return statement of the form
1729 1830 * <i>return e;</i> appears in a generative constructor.
1730 /** 1831 */
1731 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i> 1832 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode('RETURN_IN_GENERATIVE_CONSTRUCTOR', "Constructors cannot retur n a value");
1732 * appears in a generator function. 1833
1733 */ 1834 /**
1734 static const CompileTimeErrorCode RETURN_IN_GENERATOR = const CompileTimeError Code.con1('RETURN_IN_GENERATOR', 150, "Cannot return a value from a generator fu nction (one marked with either 'async*' or 'sync*')"); 1835 * 13.12 Return: It is a compile-time error if a return statement of the form
1735 1836 * <i>return e;</i> appears in a generator function.
1736 /** 1837 */
1737 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred imp ort is used in 1838 static const CompileTimeErrorCode RETURN_IN_GENERATOR = const CompileTimeError Code('RETURN_IN_GENERATOR', "Cannot return a value from a generator function (on e marked with either 'async*' or 'sync*')");
1738 * another import clause. 1839
1739 */ 1840 /**
1740 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeEr rorCode.con1('SHARED_DEFERRED_PREFIX', 151, "The prefix of a deferred import can not be used in other import directives"); 1841 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred
1842 * import is used in another import clause.
1843 */
1844 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeEr rorCode('SHARED_DEFERRED_PREFIX', "The prefix of a deferred import cannot be use d in other import directives");
1741 1845
1742 /** 1846 /**
1743 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 1847 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
1744 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip; 1848 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
1745 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation 1849 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a
1746 * occurs in a top-level function or variable initializer, in an instance vari able initializer or 1850 * compile-time error if a super method invocation occurs in a top-level
1747 * initializer list, in class Object, in a factory constructor, or in a static method or variable 1851 * function or variable initializer, in an instance variable initializer or
1748 * initializer. 1852 * initializer list, in class Object, in a factory constructor, or in a static
1749 */ 1853 * method or variable initializer.
1750 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 152, "Invalid context for 'super' inv ocation"); 1854 */
1751 1855 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode('SUPER_IN_INVALID_CONTEXT', "Invalid context for 'super' invocation");
1752 /** 1856
1753 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1857 /**
1754 * only action is to invoke another generative constructor. 1858 * 7.6.1 Generative Constructors: A generative constructor may be redirecting,
1755 */ 1859 * in which case its only action is to invoke another generative constructor.
1756 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 153, "The redirecting constructor cannot have a 'super' initializer"); 1860 */
1757 1861 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode('SUPER_IN_REDIRECTING_CONSTRUCTOR', "The redirecting construct or cannot have a 'super' initializer");
1758 /** 1862
1759 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1863 /**
1760 * error if a generative constructor of class Object includes a superinitializ er. 1864 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It
1761 */ 1865 * is a compile-time error if a generative constructor of class Object
1762 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 154, ""); 1866 * includes a superinitializer.
1763 1867 */
1764 /** 1868 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode('SUPER_INITIALIZER_IN_OBJECT', "");
1765 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a 1869
1766 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object 1870 /**
1767 * expression are not subtypes of the bounds of the corresponding formal type parameters of 1871 * 12.11 Instance Creation: It is a static type warning if any of the type
1768 * <i>G</i>. 1872 * arguments to a constructor of a generic type <i>G</i> invoked by a new
1769 * 1873 * expression or a constant object expression are not subtypes of the bounds
1770 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a 1874 * of the corresponding formal type parameters of <i>G</i>.
1771 * dynamic error occurs. 1875 *
1772 * 1876 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if
1773 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise 1877 * T is mal-bounded a dynamic error occurs.
1774 * an exception. 1878 *
1775 * 1879 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time
1776 * @param boundedTypeName the name of the type used in the instance creation t hat should be 1880 * constant would raise an exception.
1777 * limited by the bound as specified in the class declaration 1881 *
1882 * @param boundedTypeName the name of the type used in the instance creation
1883 * that should be limited by the bound as specified in the class
1884 * declaration
1778 * @param boundingTypeName the name of the bounding type 1885 * @param boundingTypeName the name of the bounding type
1779 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS 1886 * @see [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]
1780 */ 1887 */
1781 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 155, "'{0}' does no t extend '{1}'"); 1888 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend ' {1}'");
1782 1889
1783 /** 1890 /**
1784 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a 1891 * 15.3.1 Typedef: Any self reference, either directly, or recursively via
1785 * compile time error. 1892 * another typedef, is a compile time error.
1786 */ 1893 */
1787 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C ompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 156, "Type alias cannot reference itself directly or recursively via another typedef"); 1894 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C ompileTimeErrorCode('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', "Type alias cannot ref erence itself directly or recursively via another typedef");
1788 1895
1789 /** 1896 /**
1790 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current 1897 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class
1791 * scope, optionally followed by type arguments. 1898 * accessible in the current scope, optionally followed by type arguments.
1792 */ 1899 */
1793 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode .con1('UNDEFINED_CLASS', 157, "Undefined class '{0}'"); 1900 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode ('UNDEFINED_CLASS', "Undefined class '{0}'");
1794 1901
1795 /** 1902 /**
1796 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1903 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
1797 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1904 * superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
1798 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1905 * Let <i>k</i> be a generative constructor. It is a compile-time error if
1906 * class <i>S</i> does not declare a generative constructor named <i>S</i>
1799 * (respectively <i>S.id</i>) 1907 * (respectively <i>S.id</i>)
1800 */ 1908 */
1801 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 158, "The cla ss '{0}' does not have a generative constructor '{1}'"); 1909 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', "The class '{0}' d oes not have a generative constructor '{1}'");
1802 1910
1803 /** 1911 /**
1804 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1912 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the
1805 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1913 * superinitializer appears and let <i>S</i> be the superclass of <i>C</i>.
1806 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1914 * Let <i>k</i> be a generative constructor. It is a compile-time error if
1915 * class <i>S</i> does not declare a generative constructor named <i>S</i>
1807 * (respectively <i>S.id</i>) 1916 * (respectively <i>S.id</i>)
1808 */ 1917 */
1809 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT ', 159, "The class '{0}' does not have a default generative constructor"); 1918 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', "T he class '{0}' does not have a default generative constructor");
1810 1919
1811 /** 1920 /**
1812 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, 1921 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
1813 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ... 1922 * <i>1<=i<=l</i>, must have a corresponding named parameter in the set
1814 * <i>p<sub>n+k</sub></i>} or a static warning occurs. 1923 * {<i>p<sub>n+1</sub></i> ... <i>p<sub>n+k</sub></i>} or a static warning
1815 * 1924 * occurs.
1816 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1925 *
1817 * uncaught exception being thrown. 1926 * 12.11.2 Const: It is a compile-time error if evaluation of a constant
1927 * object results in an uncaught exception being thrown.
1818 * 1928 *
1819 * @param name the name of the requested named parameter 1929 * @param name the name of the requested named parameter
1820 */ 1930 */
1821 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 160, "The named parameter '{0}' is not defined"); 1931 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode('UNDEFINED_NAMED_PARAMETER', "The named parameter '{0}' is not define d");
1822 1932
1823 /** 1933 /**
1824 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 1934 * 14.2 Exports: It is a compile-time error if the compilation unit found at
1825 * not a library declaration. 1935 * the specified URI is not a library declaration.
1826 * 1936 *
1827 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 1937 * 14.1 Imports: It is a compile-time error if the compilation unit found at
1828 * not a library declaration. 1938 * the specified URI is not a library declaration.
1829 * 1939 *
1830 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1940 * 14.3 Parts: It is a compile time error if the contents of the URI are not a
1831 * declaration. 1941 * valid part declaration.
1832 * 1942 *
1833 * @param uri the URI pointing to a non-existent file 1943 * @param uri the URI pointing to a non-existent file
1834 * @see #INVALID_URI 1944 * @see [INVALID_URI]
1835 */ 1945 */
1836 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode.con1('URI_DOES_NOT_EXIST', 161, "Target of URI does not exist: '{0}'"); 1946 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'");
1837 1947
1838 /** 1948 /**
1839 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if 1949 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time
1840 * <i>x</i> involves string interpolation. 1950 * constant, or if <i>x</i> involves string interpolation.
1841 * 1951 *
1842 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if 1952 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time
1843 * <i>s</i> involves string interpolation. 1953 * constant, or if <i>s</i> involves string interpolation.
1844 * 1954 *
1845 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is 1955 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that
1846 * not a compile-time constant, or if <i>x</i> involves string interpolation. 1956 * describes a URI is not a compile-time constant, or if <i>x</i> involves
1847 */ 1957 * string interpolation.
1848 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode.con1('URI_WITH_INTERPOLATION', 162, "URIs cannot use string interpolatio n"); 1958 */
1849 1959 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode('URI_WITH_INTERPOLATION', "URIs cannot use string interpolation");
1850 /** 1960
1851 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is 1961 /**
1852 * not 2. It is a compile time error if the arity of a user-declared operator with one of the 1962 * 7.1.1 Operators: It is a compile-time error if the arity of the
1853 * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt ;&gt;, [] is not 1. 1963 * user-declared operator []= is not 2. It is a compile time error if the
1854 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a 1964 * arity of a user-declared operator with one of the names: &lt;, &gt;, &lt;=,
1855 * compile time error if the arity of the user-declared operator ~ is not 0. 1965 * &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt;&gt;, [] is not 1. It is
1966 * a compile time error if the arity of the user-declared operator - is not 0
1967 * or 1. It is a compile time error if the arity of the user-declared operator
1968 * ~ is not 0.
1856 * 1969 *
1857 * @param operatorName the name of the declared operator 1970 * @param operatorName the name of the declared operator
1858 * @param expectedNumberOfParameters the number of parameters expected 1971 * @param expectedNumberOfParameters the number of parameters expected
1859 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration 1972 * @param actualNumberOfParameters the number of parameters found in the
1860 */ 1973 * operator declaration
1861 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = co nst CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 163, "O perator '{0}' should declare exactly {1} parameter(s), but {2} found"); 1974 */
1862 1975 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = co nst CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', "Operator '{ 0}' should declare exactly {1} parameter(s), but {2} found");
1863 /** 1976
1864 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not 1977 /**
1865 * 0 or 1. 1978 * 7.1.1 Operators: It is a compile time error if the arity of the
1866 * 1979 * user-declared operator - is not 0 or 1.
1867 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration 1980 *
1868 */ 1981 * @param actualNumberOfParameters the number of parameters found in the
1869 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MIN US', 164, "Operator '-' should declare 0 or 1 parameter, but {0} found"); 1982 * operator declaration
1870 1983 */
1871 /** 1984 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = const CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', "Operator '-' should declare 0 or 1 parameter, but {0} found");
1872 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include 1985
1873 * exactly one required formal parameter <i>p</i>. 1986 /**
1874 */ 1987 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list
1875 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = cons t CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 165, "Sette rs should declare exactly one required parameter"); 1988 * does not include exactly one required formal parameter <i>p</i>.
1876 1989 */
1877 /** 1990 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = cons t CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', "Setters should declare exactly one required parameter");
1878 * ?? Yield: It is a compile-time error if a yield statement appears in a func tion that is not a 1991
1879 * generator function. 1992 /**
1880 */ 1993 * ?? Yield: It is a compile-time error if a yield statement appears in a
1881 static const CompileTimeErrorCode YIELD_EACH_IN_NON_GENERATOR = const CompileT imeErrorCode.con1('YIELD_EACH_IN_NON_GENERATOR', 166, "Yield-each statements mus t be in a generator function (one marked with either 'async*' or 'sync*')"); 1994 * function that is not a generator function.
1882 1995 */
1883 /** 1996 static const CompileTimeErrorCode YIELD_EACH_IN_NON_GENERATOR = const CompileT imeErrorCode('YIELD_EACH_IN_NON_GENERATOR', "Yield-each statements must be in a generator function (one marked with either 'async*' or 'sync*')");
1884 * ?? Yield: It is a compile-time error if a yield statement appears in a func tion that is not a 1997
1885 * generator function. 1998 /**
1886 */ 1999 * ?? Yield: It is a compile-time error if a yield statement appears in a
1887 static const CompileTimeErrorCode YIELD_IN_NON_GENERATOR = const CompileTimeEr rorCode.con1('YIELD_IN_NON_GENERATOR', 167, "Yield statements must be in a gener ator function (one marked with either 'async*' or 'sync*')"); 2000 * function that is not a generator function.
1888 2001 */
1889 static const List<CompileTimeErrorCode> values = const [ 2002 static const CompileTimeErrorCode YIELD_IN_NON_GENERATOR = const CompileTimeEr rorCode('YIELD_IN_NON_GENERATOR', "Yield statements must be in a generator funct ion (one marked with either 'async*' or 'sync*')");
1890 ACCESS_PRIVATE_ENUM_FIELD, 2003
1891 AMBIGUOUS_EXPORT, 2004 /**
1892 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, 2005 * Initialize a newly created error code to have the given [name]. The message
1893 ASYNC_FOR_IN_WRONG_CONTEXT, 2006 * associated with the error will be created from the given [message]
1894 AWAIT_IN_WRONG_CONTEXT, 2007 * template. The correction associated with the error will be created from the
1895 BUILT_IN_IDENTIFIER_AS_TYPE, 2008 * given [correction] template.
1896 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 2009 */
1897 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 2010 const CompileTimeErrorCode(String name, String message, [String correction]) : super(name, message, correction);
1898 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME,
1899 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
1900 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION,
1901 CONFLICTING_GETTER_AND_METHOD,
1902 CONFLICTING_METHOD_AND_GETTER,
1903 CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD,
1904 CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD,
1905 CONFLICTING_TYPE_VARIABLE_AND_CLASS,
1906 CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
1907 CONST_CONSTRUCTOR_THROWS_EXCEPTION,
1908 CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
1909 CONST_CONSTRUCTOR_WITH_MIXIN,
1910 CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
1911 CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
1912 CONST_DEFERRED_CLASS,
1913 CONST_FORMAL_PARAMETER,
1914 CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
1915 CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY,
1916 CONST_INSTANCE_FIELD,
1917 CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
1918 CONST_NOT_INITIALIZED,
1919 CONST_EVAL_TYPE_BOOL,
1920 CONST_EVAL_TYPE_BOOL_NUM_STRING,
1921 CONST_EVAL_TYPE_INT,
1922 CONST_EVAL_TYPE_NUM,
1923 CONST_EVAL_THROWS_EXCEPTION,
1924 CONST_EVAL_THROWS_IDBZE,
1925 CONST_WITH_INVALID_TYPE_PARAMETERS,
1926 CONST_WITH_NON_CONST,
1927 CONST_WITH_NON_CONSTANT_ARGUMENT,
1928 CONST_WITH_NON_TYPE,
1929 CONST_WITH_TYPE_PARAMETERS,
1930 CONST_WITH_UNDEFINED_CONSTRUCTOR,
1931 CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
1932 DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS,
1933 DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER,
1934 DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRUCTOR,
1935 DUPLICATE_CONSTRUCTOR_DEFAULT,
1936 DUPLICATE_CONSTRUCTOR_NAME,
1937 DUPLICATE_DEFINITION,
1938 DUPLICATE_DEFINITION_INHERITANCE,
1939 DUPLICATE_NAMED_ARGUMENT,
1940 EXPORT_INTERNAL_LIBRARY,
1941 EXPORT_OF_NON_LIBRARY,
1942 EXTENDS_ENUM,
1943 EXTENDS_NON_CLASS,
1944 EXTENDS_DISALLOWED_CLASS,
1945 EXTENDS_DEFERRED_CLASS,
1946 EXTRA_POSITIONAL_ARGUMENTS,
1947 FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
1948 FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER,
1949 FINAL_INITIALIZED_MULTIPLE_TIMES,
1950 FIELD_INITIALIZER_FACTORY_CONSTRUCTOR,
1951 FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR,
1952 FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR,
1953 GETTER_AND_METHOD_WITH_SAME_NAME,
1954 IMPLEMENTS_DEFERRED_CLASS,
1955 IMPLEMENTS_DISALLOWED_CLASS,
1956 IMPLEMENTS_DYNAMIC,
1957 IMPLEMENTS_ENUM,
1958 IMPLEMENTS_NON_CLASS,
1959 IMPLEMENTS_REPEATED,
1960 IMPLEMENTS_SUPER_CLASS,
1961 IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
1962 IMPORT_INTERNAL_LIBRARY,
1963 IMPORT_OF_NON_LIBRARY,
1964 INCONSISTENT_CASE_EXPRESSION_TYPES,
1965 INITIALIZER_FOR_NON_EXISTENT_FIELD,
1966 INITIALIZER_FOR_STATIC_FIELD,
1967 INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
1968 INITIALIZING_FORMAL_FOR_STATIC_FIELD,
1969 INSTANCE_MEMBER_ACCESS_FROM_FACTORY,
1970 INSTANCE_MEMBER_ACCESS_FROM_STATIC,
1971 INSTANTIATE_ENUM,
1972 INVALID_ANNOTATION,
1973 INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY,
1974 INVALID_IDENTIFIER_IN_ASYNC,
1975 INVALID_MODIFIER_ON_CONSTRUCTOR,
1976 INVALID_MODIFIER_ON_SETTER,
1977 INVALID_CONSTANT,
1978 INVALID_CONSTRUCTOR_NAME,
1979 INVALID_FACTORY_NAME_NOT_A_CLASS,
1980 INVALID_REFERENCE_TO_THIS,
1981 INVALID_TYPE_ARGUMENT_IN_CONST_LIST,
1982 INVALID_TYPE_ARGUMENT_IN_CONST_MAP,
1983 INVALID_URI,
1984 LABEL_IN_OUTER_SCOPE,
1985 LABEL_UNDEFINED,
1986 MEMBER_WITH_CLASS_NAME,
1987 METHOD_AND_GETTER_WITH_SAME_NAME,
1988 MISSING_CONST_IN_LIST_LITERAL,
1989 MISSING_CONST_IN_MAP_LITERAL,
1990 MISSING_ENUM_CONSTANT_IN_SWITCH,
1991 MIXIN_DECLARES_CONSTRUCTOR,
1992 MIXIN_DEFERRED_CLASS,
1993 MIXIN_INHERITS_FROM_NOT_OBJECT,
1994 MIXIN_OF_DISALLOWED_CLASS,
1995 MIXIN_OF_ENUM,
1996 MIXIN_OF_NON_CLASS,
1997 MIXIN_REFERENCES_SUPER,
1998 MIXIN_WITH_NON_CLASS_SUPERCLASS,
1999 MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS,
2000 MULTIPLE_SUPER_INITIALIZERS,
2001 NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS,
2002 NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
2003 NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT,
2004 NON_CONST_MAP_AS_EXPRESSION_STATEMENT,
2005 NON_CONSTANT_CASE_EXPRESSION,
2006 NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_LIBRARY,
2007 NON_CONSTANT_DEFAULT_VALUE,
2008 NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIBRARY,
2009 NON_CONSTANT_LIST_ELEMENT,
2010 NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBRARY,
2011 NON_CONSTANT_MAP_KEY,
2012 NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY,
2013 NON_CONSTANT_MAP_VALUE,
2014 NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY,
2015 NON_CONSTANT_ANNOTATION_CONSTRUCTOR,
2016 NON_CONSTANT_VALUE_IN_INITIALIZER,
2017 NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY,
2018 NOT_ENOUGH_REQUIRED_ARGUMENTS,
2019 NON_GENERATIVE_CONSTRUCTOR,
2020 OBJECT_CANNOT_EXTEND_ANOTHER_CLASS,
2021 OPTIONAL_PARAMETER_IN_OPERATOR,
2022 PART_OF_NON_PART,
2023 PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER,
2024 PRIVATE_OPTIONAL_PARAMETER,
2025 RECURSIVE_COMPILE_TIME_CONSTANT,
2026 RECURSIVE_CONSTRUCTOR_REDIRECT,
2027 RECURSIVE_FACTORY_REDIRECT,
2028 RECURSIVE_INTERFACE_INHERITANCE,
2029 RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS,
2030 RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS,
2031 RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH,
2032 REDIRECT_TO_MISSING_CONSTRUCTOR,
2033 REDIRECT_TO_NON_CLASS,
2034 REDIRECT_TO_NON_CONST_CONSTRUCTOR,
2035 REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR,
2036 REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTRUCTOR,
2037 REFERENCED_BEFORE_DECLARATION,
2038 RETHROW_OUTSIDE_CATCH,
2039 RETURN_IN_GENERATIVE_CONSTRUCTOR,
2040 RETURN_IN_GENERATOR,
2041 SHARED_DEFERRED_PREFIX,
2042 SUPER_IN_INVALID_CONTEXT,
2043 SUPER_IN_REDIRECTING_CONSTRUCTOR,
2044 SUPER_INITIALIZER_IN_OBJECT,
2045 TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
2046 TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
2047 UNDEFINED_CLASS,
2048 UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
2049 UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
2050 UNDEFINED_NAMED_PARAMETER,
2051 URI_DOES_NOT_EXIST,
2052 URI_WITH_INTERPOLATION,
2053 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR,
2054 WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS,
2055 WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER,
2056 YIELD_EACH_IN_NON_GENERATOR,
2057 YIELD_IN_NON_GENERATOR];
2058
2059 /**
2060 * The template used to create the message to be displayed for this error.
2061 */
2062 final String message;
2063
2064 /**
2065 * The template used to create the correction to be displayed for this error, or `null` if
2066 * there is no correction information for this error.
2067 */
2068 final String correction;
2069
2070 /**
2071 * Initialize a newly created error code to have the given message.
2072 *
2073 * @param message the message template used to create the message to be displa yed for the error
2074 */
2075 const CompileTimeErrorCode.con1(String name, int ordinal, String message) : th is.con2(name, ordinal, message, null);
2076
2077 /**
2078 * Initialize a newly created error code to have the given message and correct ion.
2079 *
2080 * @param message the template used to create the message to be displayed for the error
2081 * @param correction the template used to create the correction to be displaye d for the error
2082 */
2083 const CompileTimeErrorCode.con2(String name, int ordinal, this.message, this.c orrection) : super(name, ordinal);
2084 2011
2085 @override 2012 @override
2086 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity; 2013 ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;
2087 2014
2088 @override 2015 @override
2089 ErrorType get type => ErrorType.COMPILE_TIME_ERROR; 2016 ErrorType get type => ErrorType.COMPILE_TIME_ERROR;
2090 2017 }
2091 @override 2018
2019 /**
2020 * An `ErrorCode` represents an error code associated with an [AnalysisError].
2021 *
2022 * Generally, we want to provide messages that consist of three sentences. From
2023 * the user's perspective these sentences should explain:
2024 * 1. what is wrong,
2025 * 2. why is it wrong, and
2026 * 3. how do I fix it.
2027 * However, we combine the first two in the [message] and the last in the
2028 * [correction].
2029 */
2030 abstract class ErrorCode {
2031 /**
2032 * The name of the error code.
2033 */
2034 final String name;
2035
2036 /**
2037 * The template used to create the message to be displayed for this error. The
2038 * message should indicate what is wrong and why it is wrong.
2039 */
2040 final String message;
2041
2042 /**
2043 * The template used to create the correction to be displayed for this error,
2044 * or `null` if there is no correction information for this error. The
2045 * correction should indicate how the user can fix the error.
2046 */
2047 final String correction;
2048
2049 /**
2050 * Initialize a newly created error code to have the given [name]. The message
2051 * associated with the error will be created from the given [message]
2052 * template. The correction associated with the error will be created from the
2053 * given [correction] template.
2054 */
2055 const ErrorCode(this.name, this.message, [this.correction]);
2056
2057 /**
2058 * The severity of the error.
2059 */
2060 ErrorSeverity get errorSeverity;
2061
2062 /**
2063 * The type of the error.
2064 */
2065 ErrorType get type;
2066
2067 /**
2068 * The unique name of this error code.
2069 */
2092 String get uniqueName => "$runtimeType.$name"; 2070 String get uniqueName => "$runtimeType.$name";
2093 } 2071 }
2094 2072
2095 /** 2073 /**
2096 * The interface `ErrorCode` defines the behavior common to objects representing error codes
2097 * associated with [AnalysisError].
2098 *
2099 * Generally, we want to provide messages that consist of three sentences: 1. wh at is wrong, 2. why
2100 * is it wrong, and 3. how do I fix it. However, we combine the first two in the result of
2101 * [getMessage] and the last in the result of [getCorrection].
2102 */
2103 abstract class ErrorCode {
2104 /**
2105 * Return the template used to create the correction to be displayed for this error, or
2106 * `null` if there is no correction information for this error. The correction should
2107 * indicate how the user can fix the error.
2108 *
2109 * @return the template used to create the correction to be displayed for this error
2110 */
2111 String get correction;
2112
2113 /**
2114 * Return the severity of this error.
2115 *
2116 * @return the severity of this error
2117 */
2118 ErrorSeverity get errorSeverity;
2119
2120 /**
2121 * Return the template used to create the message to be displayed for this err or. The message
2122 * should indicate what is wrong and why it is wrong.
2123 *
2124 * @return the template used to create the message to be displayed for this er ror
2125 */
2126 String get message;
2127
2128 /**
2129 * Return the type of the error.
2130 *
2131 * @return the type of the error
2132 */
2133 ErrorType get type;
2134
2135 /**
2136 * Return a unique name for this error code.
2137 *
2138 * @return a unique name for this error code
2139 */
2140 String get uniqueName;
2141 }
2142
2143 /**
2144 * The enumeration `ErrorProperty` defines the properties that can be associated with an 2074 * The enumeration `ErrorProperty` defines the properties that can be associated with an
2145 * [AnalysisError]. 2075 * [AnalysisError].
2146 */ 2076 */
2147 class ErrorProperty extends Enum<ErrorProperty> { 2077 class ErrorProperty extends Enum<ErrorProperty> {
2148 /** 2078 /**
2149 * A property whose value is an array of [ExecutableElement] that should 2079 * A property whose value is an array of [ExecutableElement] that should
2150 * be but are not implemented by a concrete class. 2080 * be but are not implemented by a concrete class.
2151 */ 2081 */
2152 static const ErrorProperty UNIMPLEMENTED_METHODS = const ErrorProperty('UNIMPL EMENTED_METHODS', 0); 2082 static const ErrorProperty UNIMPLEMENTED_METHODS = const ErrorProperty('UNIMPL EMENTED_METHODS', 0);
2153 2083
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
2471 * Initialize a newly created error type to have the given severity. 2401 * Initialize a newly created error type to have the given severity.
2472 * 2402 *
2473 * @param severity the severity of this type of error 2403 * @param severity the severity of this type of error
2474 */ 2404 */
2475 const ErrorType(String name, int ordinal, this.severity) : super(name, ordinal ); 2405 const ErrorType(String name, int ordinal, this.severity) : super(name, ordinal );
2476 2406
2477 String get displayName => name.toLowerCase().replaceAll('_', ' '); 2407 String get displayName => name.toLowerCase().replaceAll('_', ' ');
2478 } 2408 }
2479 2409
2480 /** 2410 /**
2481 * The enumeration `HintCode` defines the hints and coding recommendations for b est practices 2411 * The class `HintCode` defines the hints and coding recommendations for best
2482 * which are not mentioned in the Dart Language Specification. 2412 * practices which are not mentioned in the Dart Language Specification.
2483 */ 2413 */
2484 class HintCode extends Enum<HintCode> implements ErrorCode { 2414 class HintCode extends ErrorCode {
2485 /** 2415 /**
2486 * This hint is generated anywhere where the 2416 * This hint is generated anywhere where the
2487 * [StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated, if we used 2417 * [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE] would have been generated,
2488 * propagated information for the warnings. 2418 * if we used propagated information for the warnings.
2489 * 2419 *
2490 * @param actualType the name of the actual argument type 2420 * @param actualType the name of the actual argument type
2491 * @param expectedType the name of the expected type 2421 * @param expectedType the name of the expected type
2492 * @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE 2422 */
2493 */ 2423 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode('ARGUMENT_ TYPE_NOT_ASSIGNABLE', "The argument type '{0}' cannot be assigned to the paramet er type '{1}'");
2494 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode.con1('ARGU MENT_TYPE_NOT_ASSIGNABLE', 0, "The argument type '{0}' cannot be assigned to the parameter type '{1}'"); 2424
2495 2425 /**
2496 /** 2426 * Dead code is code that is never reached, this can happen for instance if a
2497 * Dead code is code that is never reached, this can happen for instance if a statement follows a 2427 * statement follows a return statement.
2498 * return statement. 2428 */
2499 */ 2429 static const HintCode DEAD_CODE = const HintCode('DEAD_CODE', "Dead code");
2500 static const HintCode DEAD_CODE = const HintCode.con1('DEAD_CODE', 1, "Dead co de"); 2430
2501 2431 /**
2502 /** 2432 * Dead code is code that is never reached. This case covers cases where the
2503 * Dead code is code that is never reached. This case covers cases where the u ser has catch 2433 * user has catch clauses after `catch (e)` or `on Object catch (e)`.
2504 * clauses after `catch (e)` or `on Object catch (e)`. 2434 */
2505 */ 2435 static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode('DEAD_C ODE_CATCH_FOLLOWING_CATCH', "Dead code, catch clauses after a 'catch (e)' or an 'on Object catch (e)' are never reached");
2506 static const HintCode DEAD_CODE_CATCH_FOLLOWING_CATCH = const HintCode.con1('D EAD_CODE_CATCH_FOLLOWING_CATCH', 2, "Dead code, catch clauses after a 'catch (e) ' or an 'on Object catch (e)' are never reached"); 2436
2507 2437 /**
2508 /** 2438 * Dead code is code that is never reached. This case covers cases where the
2509 * Dead code is code that is never reached. This case covers cases where the u ser has an on-catch 2439 * user has an on-catch clause such as `on A catch (e)`, where a supertype of
2510 * clause such as `on A catch (e)`, where a supertype of `A` was already caugh t. 2440 * `A` was already caught.
2511 * 2441 *
2512 * @param subtypeName name of the subtype 2442 * @param subtypeName name of the subtype
2513 * @param supertypeName name of the supertype 2443 * @param supertypeName name of the supertype
2514 */ 2444 */
2515 static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode.con1('DEAD_C ODE_ON_CATCH_SUBTYPE', 3, "Dead code, this on-catch block will never be executed since '{0}' is a subtype of '{1}'"); 2445 static const HintCode DEAD_CODE_ON_CATCH_SUBTYPE = const HintCode('DEAD_CODE_O N_CATCH_SUBTYPE', "Dead code, this on-catch block will never be executed since ' {0}' is a subtype of '{1}'");
2516 2446
2517 /** 2447 /**
2518 * Deprecated members should not be invoked or used. 2448 * Deprecated members should not be invoked or used.
2519 * 2449 *
2520 * @param memberName the name of the member 2450 * @param memberName the name of the member
2521 */ 2451 */
2522 static const HintCode DEPRECATED_MEMBER_USE = const HintCode.con1('DEPRECATED_ MEMBER_USE', 4, "'{0}' is deprecated"); 2452 static const HintCode DEPRECATED_MEMBER_USE = const HintCode('DEPRECATED_MEMBE R_USE', "'{0}' is deprecated");
2523 2453
2524 /** 2454 /**
2525 * Duplicate imports. 2455 * Duplicate imports.
2526 */ 2456 */
2527 static const HintCode DUPLICATE_IMPORT = const HintCode.con1('DUPLICATE_IMPORT ', 5, "Duplicate import"); 2457 static const HintCode DUPLICATE_IMPORT = const HintCode('DUPLICATE_IMPORT', "D uplicate import");
2528 2458
2529 /** 2459 /**
2530 * Hint to use the ~/ operator. 2460 * Hint to use the ~/ operator.
2531 */ 2461 */
2532 static const HintCode DIVISION_OPTIMIZATION = const HintCode.con1('DIVISION_OP TIMIZATION', 6, "The operator x ~/ y is more efficient than (x / y).toInt()"); 2462 static const HintCode DIVISION_OPTIMIZATION = const HintCode('DIVISION_OPTIMIZ ATION', "The operator x ~/ y is more efficient than (x / y).toInt()");
2533 2463
2534 /** 2464 /**
2535 * Hint for the `x is double` type checks. 2465 * Hint for the `x is double` type checks.
2536 */ 2466 */
2537 static const HintCode IS_DOUBLE = const HintCode.con1('IS_DOUBLE', 7, "When co mpiled to JS, this test might return true when the left hand side is an int"); 2467 static const HintCode IS_DOUBLE = const HintCode('IS_DOUBLE', "When compiled t o JS, this test might return true when the left hand side is an int");
2538 2468
2539 /** 2469 /**
2540 * Hint for the `x is int` type checks. 2470 * Hint for the `x is int` type checks.
2541 */ 2471 */
2542 static const HintCode IS_INT = const HintCode.con1('IS_INT', 8, "When compiled to JS, this test might return true when the left hand side is a double"); 2472 static const HintCode IS_INT = const HintCode('IS_INT', "When compiled to JS, this test might return true when the left hand side is a double");
2543 2473
2544 /** 2474 /**
2545 * Hint for the `x is! double` type checks. 2475 * Hint for the `x is! double` type checks.
2546 */ 2476 */
2547 static const HintCode IS_NOT_DOUBLE = const HintCode.con1('IS_NOT_DOUBLE', 9, "When compiled to JS, this test might return false when the left hand side is an int"); 2477 static const HintCode IS_NOT_DOUBLE = const HintCode('IS_NOT_DOUBLE', "When co mpiled to JS, this test might return false when the left hand side is an int");
2548 2478
2549 /** 2479 /**
2550 * Hint for the `x is! int` type checks. 2480 * Hint for the `x is! int` type checks.
2551 */ 2481 */
2552 static const HintCode IS_NOT_INT = const HintCode.con1('IS_NOT_INT', 10, "When compiled to JS, this test might return false when the left hand side is a doubl e"); 2482 static const HintCode IS_NOT_INT = const HintCode('IS_NOT_INT', "When compiled to JS, this test might return false when the left hand side is a double");
2553 2483
2554 /** 2484 /**
2555 * Deferred libraries shouldn't define a top level function 'loadLibrary'. 2485 * Deferred libraries shouldn't define a top level function 'loadLibrary'.
2556 */ 2486 */
2557 static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintC ode.con1('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', 11, "The library '{0}' de fines a top-level function named 'loadLibrary' which is hidden by deferring this library"); 2487 static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintC ode('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', "The library '{0}' defines a t op-level function named 'loadLibrary' which is hidden by deferring this library" );
2558 2488
2559 /** 2489 /**
2560 * This hint is generated anywhere where the [StaticTypeWarningCode#INVALID_AS SIGNMENT] 2490 * This hint is generated anywhere where the
2561 * would have been generated, if we used propagated information for the warnin gs. 2491 * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we
2492 * used propagated information for the warnings.
2562 * 2493 *
2563 * @param rhsTypeName the name of the right hand side type 2494 * @param rhsTypeName the name of the right hand side type
2564 * @param lhsTypeName the name of the left hand side type 2495 * @param lhsTypeName the name of the left hand side type
2565 * @see StaticTypeWarningCode#INVALID_ASSIGNMENT 2496 * @see [StaticTypeWarningCode.INVALID_ASSIGNMENT]
2566 */ 2497 */
2567 static const HintCode INVALID_ASSIGNMENT = const HintCode.con1('INVALID_ASSIGN MENT', 12, "A value of type '{0}' cannot be assigned to a variable of type '{1}' "); 2498 static const HintCode INVALID_ASSIGNMENT = const HintCode('INVALID_ASSIGNMENT' , "A value of type '{0}' cannot be assigned to a variable of type '{1}'");
2568 2499
2569 /** 2500 /**
2570 * Generate a hint for methods or functions that have a return type, but do no t have a non-void 2501 * Generate a hint for methods or functions that have a return type, but do
2571 * return statement on all branches. At the end of methods or functions with n o return, Dart 2502 * not have a non-void return statement on all branches. At the end of methods
2572 * implicitly returns `null`, avoiding these implicit returns is considered a best practice. 2503 * or functions with no return, Dart implicitly returns `null`, avoiding these
2504 * implicit returns is considered a best practice.
2573 * 2505 *
2574 * @param returnType the name of the declared return type 2506 * @param returnType the name of the declared return type
2575 */ 2507 */
2576 static const HintCode MISSING_RETURN = const HintCode.con2('MISSING_RETURN', 1 3, "This function declares a return type of '{0}', but does not end with a retur n statement", "Either add a return statement or change the return type to 'void' "); 2508 static const HintCode MISSING_RETURN = const HintCode('MISSING_RETURN', "This function declares a return type of '{0}', but does not end with a return stateme nt", "Either add a return statement or change the return type to 'void'");
2577 2509
2578 /** 2510 /**
2579 * A getter with the override annotation does not override an existing getter. 2511 * A getter with the override annotation does not override an existing getter.
2580 */ 2512 */
2581 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_GETTER', 14, "Getter does not override an inherited getter"); 2513 static const HintCode OVERRIDE_ON_NON_OVERRIDING_GETTER = const HintCode('OVER RIDE_ON_NON_OVERRIDING_GETTER', "Getter does not override an inherited getter");
2582 2514
2583 /** 2515 /**
2584 * A method with the override annotation does not override an existing method. 2516 * A method with the override annotation does not override an existing method.
2585 */ 2517 */
2586 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_METHOD', 15, "Method does not override an inherited method"); 2518 static const HintCode OVERRIDE_ON_NON_OVERRIDING_METHOD = const HintCode('OVER RIDE_ON_NON_OVERRIDING_METHOD', "Method does not override an inherited method");
2587 2519
2588 /** 2520 /**
2589 * A setter with the override annotation does not override an existing setter. 2521 * A setter with the override annotation does not override an existing setter.
2590 */ 2522 */
2591 static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode.con1( 'OVERRIDE_ON_NON_OVERRIDING_SETTER', 16, "Setter does not override an inherited setter"); 2523 static const HintCode OVERRIDE_ON_NON_OVERRIDING_SETTER = const HintCode('OVER RIDE_ON_NON_OVERRIDING_SETTER', "Setter does not override an inherited setter");
2592 2524
2593 /** 2525 /**
2594 * Hint for classes that override equals, but not hashCode. 2526 * Hint for classes that override equals, but not hashCode.
2595 * 2527 *
2596 * @param className the name of the current class 2528 * @param className the name of the current class
2597 */ 2529 */
2598 static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode.con1( 'OVERRIDE_EQUALS_BUT_NOT_HASH_CODE', 17, "The class '{0}' overrides 'operator==' , but not 'get hashCode'"); 2530 static const HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = const HintCode('OVER RIDE_EQUALS_BUT_NOT_HASH_CODE', "The class '{0}' overrides 'operator==', but not 'get hashCode'");
2599 2531
2600 /** 2532 /**
2601 * Type checks of the type `x is! Null` should be done with `x != null`. 2533 * Type checks of the type `x is! Null` should be done with `x != null`.
2602 */ 2534 */
2603 static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode.con1('TYPE_CHECK _IS_NOT_NULL', 18, "Tests for non-null should be done with '!= null'"); 2535 static const HintCode TYPE_CHECK_IS_NOT_NULL = const HintCode('TYPE_CHECK_IS_N OT_NULL', "Tests for non-null should be done with '!= null'");
2604 2536
2605 /** 2537 /**
2606 * Type checks of the type `x is Null` should be done with `x == null`. 2538 * Type checks of the type `x is Null` should be done with `x == null`.
2607 */ 2539 */
2608 static const HintCode TYPE_CHECK_IS_NULL = const HintCode.con1('TYPE_CHECK_IS_ NULL', 19, "Tests for null should be done with '== null'"); 2540 static const HintCode TYPE_CHECK_IS_NULL = const HintCode('TYPE_CHECK_IS_NULL' , "Tests for null should be done with '== null'");
2609 2541
2610 /** 2542 /**
2611 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ GETTER] or 2543 * This hint is generated anywhere where the
2612 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used propagated 2544 * [StaticTypeWarningCode.UNDEFINED_GETTER] or
2613 * information for the warnings. 2545 * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used
2546 * propagated information for the warnings.
2614 * 2547 *
2615 * @param getterName the name of the getter 2548 * @param getterName the name of the getter
2616 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for 2549 * @param enclosingType the name of the enclosing type where the getter is
2617 * @see StaticTypeWarningCode#UNDEFINED_GETTER 2550 * being looked for
2618 * @see StaticWarningCode#UNDEFINED_GETTER 2551 * @see [StaticTypeWarningCode.UNDEFINED_GETTER]
2619 */ 2552 * @see [StaticWarningCode.UNDEFINED_GETTER]
2620 static const HintCode UNDEFINED_GETTER = const HintCode.con1('UNDEFINED_GETTER ', 20, "There is no such getter '{0}' in '{1}'"); 2553 */
2621 2554 static const HintCode UNDEFINED_GETTER = const HintCode('UNDEFINED_GETTER', "T here is no such getter '{0}' in '{1}'");
2622 /** 2555
2623 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ METHOD] would 2556 /**
2624 * have been generated, if we used propagated information for the warnings. 2557 * This hint is generated anywhere where the
2558 * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we
2559 * used propagated information for the warnings.
2625 * 2560 *
2626 * @param methodName the name of the method that is undefined 2561 * @param methodName the name of the method that is undefined
2627 * @param typeName the resolved type name that the method lookup is happening on 2562 * @param typeName the resolved type name that the method lookup is happening
2628 * @see StaticTypeWarningCode#UNDEFINED_METHOD 2563 * on
2629 */ 2564 * @see [StaticTypeWarningCode.UNDEFINED_METHOD]
2630 static const HintCode UNDEFINED_METHOD = const HintCode.con1('UNDEFINED_METHOD ', 21, "The method '{0}' is not defined for the class '{1}'"); 2565 */
2631 2566 static const HintCode UNDEFINED_METHOD = const HintCode('UNDEFINED_METHOD', "T he method '{0}' is not defined for the class '{1}'");
2632 /** 2567
2633 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ OPERATOR] 2568 /**
2634 * would have been generated, if we used propagated information for the warnin gs. 2569 * This hint is generated anywhere where the
2570 * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we
2571 * used propagated information for the warnings.
2635 * 2572 *
2636 * @param operator the name of the operator 2573 * @param operator the name of the operator
2637 * @param enclosingType the name of the enclosing type where the operator is b eing looked for 2574 * @param enclosingType the name of the enclosing type where the operator is
2638 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR 2575 * being looked for
2639 */ 2576 * @see [StaticTypeWarningCode.UNDEFINED_OPERATOR]
2640 static const HintCode UNDEFINED_OPERATOR = const HintCode.con1('UNDEFINED_OPER ATOR', 22, "There is no such operator '{0}' in '{1}'"); 2577 */
2641 2578 static const HintCode UNDEFINED_OPERATOR = const HintCode('UNDEFINED_OPERATOR' , "There is no such operator '{0}' in '{1}'");
2642 /** 2579
2643 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_ SETTER] or 2580 /**
2644 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used propagated 2581 * This hint is generated anywhere where the
2645 * information for the warnings. 2582 * [StaticTypeWarningCode.UNDEFINED_SETTER] or
2583 * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used
2584 * propagated information for the warnings.
2646 * 2585 *
2647 * @param setterName the name of the setter 2586 * @param setterName the name of the setter
2648 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for 2587 * @param enclosingType the name of the enclosing type where the setter is
2649 * @see StaticTypeWarningCode#UNDEFINED_SETTER 2588 * being looked for
2650 * @see StaticWarningCode#UNDEFINED_SETTER 2589 * @see [StaticTypeWarningCode.UNDEFINED_SETTER]
2651 */ 2590 * @see [StaticWarningCode.UNDEFINED_SETTER]
2652 static const HintCode UNDEFINED_SETTER = const HintCode.con1('UNDEFINED_SETTER ', 23, "There is no such setter '{0}' in '{1}'"); 2591 */
2592 static const HintCode UNDEFINED_SETTER = const HintCode('UNDEFINED_SETTER', "T here is no such setter '{0}' in '{1}'");
2653 2593
2654 /** 2594 /**
2655 * Unnecessary cast. 2595 * Unnecessary cast.
2656 */ 2596 */
2657 static const HintCode UNNECESSARY_CAST = const HintCode.con1('UNNECESSARY_CAST ', 24, "Unnecessary cast"); 2597 static const HintCode UNNECESSARY_CAST = const HintCode('UNNECESSARY_CAST', "U nnecessary cast");
2658 2598
2659 /** 2599 /**
2660 * Unnecessary type checks, the result is always true. 2600 * Unnecessary type checks, the result is always true.
2661 */ 2601 */
2662 static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode.con1('UNNE CESSARY_TYPE_CHECK_FALSE', 25, "Unnecessary type check, the result is always fal se"); 2602 static const HintCode UNNECESSARY_TYPE_CHECK_FALSE = const HintCode('UNNECESSA RY_TYPE_CHECK_FALSE', "Unnecessary type check, the result is always false");
2663 2603
2664 /** 2604 /**
2665 * Unnecessary type checks, the result is always false. 2605 * Unnecessary type checks, the result is always false.
2666 */ 2606 */
2667 static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode.con1('UNNEC ESSARY_TYPE_CHECK_TRUE', 26, "Unnecessary type check, the result is always true" ); 2607 static const HintCode UNNECESSARY_TYPE_CHECK_TRUE = const HintCode('UNNECESSAR Y_TYPE_CHECK_TRUE', "Unnecessary type check, the result is always true");
2668 2608
2669 /** 2609 /**
2670 * Unused imports are imports which are never used. 2610 * Unused imports are imports which are never used.
2671 */ 2611 */
2672 static const HintCode UNUSED_IMPORT = const HintCode.con1('UNUSED_IMPORT', 27, "Unused import"); 2612 static const HintCode UNUSED_IMPORT = const HintCode('UNUSED_IMPORT', "Unused import");
2673 2613
2674 /** 2614 /**
2675 * Unused local variables are local varaibles which are never read. 2615 * Unused local variables are local varaibles which are never read.
2676 */ 2616 */
2677 static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode.con1('UNUSED_LOCA L_VARIABLE', 28, "The value of the local variable '{0}' is not used"); 2617 static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode('UNUSED_LOCAL_VAR IABLE', "The value of the local variable '{0}' is not used");
2678 2618
2679 /** 2619 /**
2680 * Hint for cases where the source expects a method or function to return a no n-void result, but 2620 * Hint for cases where the source expects a method or function to return a
2681 * the method or function signature returns void. 2621 * non-void result, but the method or function signature returns void.
2682 * 2622 *
2683 * @param name the name of the method or function that returns void 2623 * @param name the name of the method or function that returns void
2684 */ 2624 */
2685 static const HintCode USE_OF_VOID_RESULT = const HintCode.con1('USE_OF_VOID_RE SULT', 29, "The result of '{0}' is being used, even though it is declared to be 'void'"); 2625 static const HintCode USE_OF_VOID_RESULT = const HintCode('USE_OF_VOID_RESULT' , "The result of '{0}' is being used, even though it is declared to be 'void'");
2686 2626
2687 /** 2627 /**
2688 * It is a bad practice for a source file in a package "lib" directory hierarc hy to traverse 2628 * It is a bad practice for a source file in a package "lib" directory
2689 * outside that directory hierarchy. For example, a source file in the "lib" d irectory should not 2629 * hierarchy to traverse outside that directory hierarchy. For example, a
2690 * contain a directive such as `import '../web/some.dart'` which references a file outside 2630 * source file in the "lib" directory should not contain a directive such as
2691 * the lib directory. 2631 * `import '../web/some.dart'` which references a file outside the lib
2692 */ 2632 * directory.
2693 static const HintCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const H intCode.con1('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 30, "A file in th e 'lib' directory hierarchy should not reference a file outside that hierarchy") ; 2633 */
2694 2634 static const HintCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = const H intCode('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', "A file in the 'lib' d irectory hierarchy should not reference a file outside that hierarchy");
2695 /** 2635
2696 * It is a bad practice for a source file ouside a package "lib" directory hie rarchy to traverse 2636 /**
2697 * into that directory hierarchy. For example, a source file in the "web" dire ctory should not 2637 * It is a bad practice for a source file ouside a package "lib" directory
2698 * contain a directive such as `import '../lib/some.dart'` which references a file inside 2638 * hierarchy to traverse into that directory hierarchy. For example, a source
2699 * the lib directory. 2639 * file in the "web" directory should not contain a directive such as
2700 */ 2640 * `import '../lib/some.dart'` which references a file inside the lib
2701 static const HintCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const H intCode.con1('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 31, "A file outsi de the 'lib' directory hierarchy should not reference a file inside that hierarc hy. Use a package: reference instead."); 2641 * directory.
2702 2642 */
2703 /** 2643 static const HintCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = const H intCode('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', "A file outside the 'l ib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
2704 * It is a bad practice for a package import to reference anything outside the given package, or 2644
2705 * more generally, it is bad practice for a package import to contain a "..". For example, a 2645 /**
2706 * source file should not contain a directive such as `import 'package:foo/../ some.dart'`. 2646 * It is a bad practice for a package import to reference anything outside the
2707 */ 2647 * given package, or more generally, it is bad practice for a package import
2708 static const HintCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const HintCode.con1('P ACKAGE_IMPORT_CONTAINS_DOT_DOT', 32, "A package import should not contain '..'") ; 2648 * to contain a "..". For example, a source file should not contain a
2709 2649 * directive such as `import 'package:foo/../some.dart'`.
2710 static const List<HintCode> values = const [ 2650 */
2711 ARGUMENT_TYPE_NOT_ASSIGNABLE, 2651 static const HintCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = const HintCode('PACKAG E_IMPORT_CONTAINS_DOT_DOT', "A package import should not contain '..'");
2712 DEAD_CODE, 2652
2713 DEAD_CODE_CATCH_FOLLOWING_CATCH, 2653 /**
2714 DEAD_CODE_ON_CATCH_SUBTYPE, 2654 * Initialize a newly created error code to have the given [name]. The message
2715 DEPRECATED_MEMBER_USE, 2655 * associated with the error will be created from the given [message]
2716 DUPLICATE_IMPORT, 2656 * template. The correction associated with the error will be created from the
2717 DIVISION_OPTIMIZATION, 2657 * given [correction] template.
2718 IS_DOUBLE, 2658 */
2719 IS_INT, 2659 const HintCode(String name, String message, [String correction]) : super(name, message, correction);
2720 IS_NOT_DOUBLE,
2721 IS_NOT_INT,
2722 IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION,
2723 INVALID_ASSIGNMENT,
2724 MISSING_RETURN,
2725 OVERRIDE_ON_NON_OVERRIDING_GETTER,
2726 OVERRIDE_ON_NON_OVERRIDING_METHOD,
2727 OVERRIDE_ON_NON_OVERRIDING_SETTER,
2728 OVERRIDE_EQUALS_BUT_NOT_HASH_CODE,
2729 TYPE_CHECK_IS_NOT_NULL,
2730 TYPE_CHECK_IS_NULL,
2731 UNDEFINED_GETTER,
2732 UNDEFINED_METHOD,
2733 UNDEFINED_OPERATOR,
2734 UNDEFINED_SETTER,
2735 UNNECESSARY_CAST,
2736 UNNECESSARY_TYPE_CHECK_FALSE,
2737 UNNECESSARY_TYPE_CHECK_TRUE,
2738 UNUSED_IMPORT,
2739 UNUSED_LOCAL_VARIABLE,
2740 USE_OF_VOID_RESULT,
2741 FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE,
2742 FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE,
2743 PACKAGE_IMPORT_CONTAINS_DOT_DOT];
2744
2745 /**
2746 * The template used to create the message to be displayed for this error.
2747 */
2748 final String message;
2749
2750 /**
2751 * The template used to create the correction to be displayed for this error, or `null` if
2752 * there is no correction information for this error.
2753 */
2754 final String correction;
2755
2756 /**
2757 * Initialize a newly created error code to have the given message.
2758 *
2759 * @param message the message template used to create the message to be displa yed for the error
2760 */
2761 const HintCode.con1(String name, int ordinal, String message) : this.con2(name , ordinal, message, null);
2762
2763 /**
2764 * Initialize a newly created error code to have the given message and correct ion.
2765 *
2766 * @param message the template used to create the message to be displayed for the error
2767 * @param correction the template used to create the correction to be displaye d for the error
2768 */
2769 const HintCode.con2(String name, int ordinal, this.message, this.correction) : super(name, ordinal);
2770 2660
2771 @override 2661 @override
2772 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; 2662 ErrorSeverity get errorSeverity => ErrorType.HINT.severity;
2773 2663
2774 @override 2664 @override
2775 ErrorType get type => ErrorType.HINT; 2665 ErrorType get type => ErrorType.HINT;
2776
2777 @override
2778 String get uniqueName => "$runtimeType.$name";
2779 } 2666 }
2780 2667
2781 /** 2668 /**
2782 * The enumeration `HtmlWarningCode` defines the error codes used for warnings i n HTML files. 2669 * The enumeration `HtmlWarningCode` defines the error codes used for warnings
2783 * The convention for this class is for the name of the error code to indicate t he problem that 2670 * in HTML files. The convention for this class is for the name of the error
2784 * caused the error to be generated and for the error message to explain what is wrong and, when 2671 * code to indicate the problem that caused the error to be generated and for
2785 * appropriate, how the problem can be corrected. 2672 * the error message to explain what is wrong and, when appropriate, how the
2673 * problem can be corrected.
2786 */ 2674 */
2787 class HtmlWarningCode extends Enum<HtmlWarningCode> implements ErrorCode { 2675 class HtmlWarningCode extends ErrorCode {
2788 /** 2676 /**
2789 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag is not a 2677 * An error code indicating that the value of the 'src' attribute of a Dart
2790 * valid URI. 2678 * script tag is not a valid URI.
2791 * 2679 *
2792 * @param uri the URI that is invalid 2680 * @param uri the URI that is invalid
2793 */ 2681 */
2794 static const HtmlWarningCode INVALID_URI = const HtmlWarningCode.con1('INVALID _URI', 0, "Invalid URI syntax: '{0}'"); 2682 static const HtmlWarningCode INVALID_URI = const HtmlWarningCode('INVALID_URI' , "Invalid URI syntax: '{0}'");
2795 2683
2796 /** 2684 /**
2797 * An error code indicating that the value of the 'src' attribute of a Dart sc ript tag references 2685 * An error code indicating that the value of the 'src' attribute of a Dart
2798 * a file that does not exist. 2686 * script tag references a file that does not exist.
2799 * 2687 *
2800 * @param uri the URI pointing to a non-existent file 2688 * @param uri the URI pointing to a non-existent file
2801 */ 2689 */
2802 static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode.con1(' URI_DOES_NOT_EXIST', 1, "Target of URI does not exist: '{0}'"); 2690 static const HtmlWarningCode URI_DOES_NOT_EXIST = const HtmlWarningCode('URI_D OES_NOT_EXIST', "Target of URI does not exist: '{0}'");
2803 2691
2804 static const List<HtmlWarningCode> values = const [INVALID_URI, URI_DOES_NOT_E XIST]; 2692 /**
2805 2693 * Initialize a newly created error code to have the given [name]. The message
2806 /** 2694 * associated with the error will be created from the given [message]
2807 * The template used to create the message to be displayed for this error. 2695 * template. The correction associated with the error will be created from the
2808 */ 2696 * given [correction] template.
2809 final String message; 2697 */
2810 2698 const HtmlWarningCode(String name, String message, [String correction]) : supe r(name, message, correction);
2811 /**
2812 * The template used to create the correction to be displayed for this error, or `null` if
2813 * there is no correction information for this error.
2814 */
2815 final String correction;
2816
2817 /**
2818 * Initialize a newly created error code to have the given message.
2819 *
2820 * @param message the message template used to create the message to be displa yed for the error
2821 */
2822 const HtmlWarningCode.con1(String name, int ordinal, String message) : this.co n2(name, ordinal, message, null);
2823
2824 /**
2825 * Initialize a newly created error code to have the given message and correct ion.
2826 *
2827 * @param message the template used to create the message to be displayed for the error
2828 * @param correction the template used to create the correction to be displaye d for the error
2829 */
2830 const HtmlWarningCode.con2(String name, int ordinal, this.message, this.correc tion) : super(name, ordinal);
2831 2699
2832 @override 2700 @override
2833 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING; 2701 ErrorSeverity get errorSeverity => ErrorSeverity.WARNING;
2834 2702
2835 @override 2703 @override
2836 ErrorType get type => ErrorType.STATIC_WARNING; 2704 ErrorType get type => ErrorType.STATIC_WARNING;
2837
2838 @override
2839 String get uniqueName => "$runtimeType.$name";
2840 } 2705 }
2841 2706
2842 /** 2707 /**
2843 * The enumeration `PolymerCode` defines Polymer specific problems. 2708 * The enumeration `PolymerCode` defines Polymer specific problems.
2844 */ 2709 */
2845 class PolymerCode extends Enum<PolymerCode> implements ErrorCode { 2710 class PolymerCode extends ErrorCode {
2846 static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode('AT TRIBUTE_FIELD_NOT_PUBLISHED', 0, "Field '{0}' in '{1}' must be @published"); 2711 static const PolymerCode ATTRIBUTE_FIELD_NOT_PUBLISHED = const PolymerCode('AT TRIBUTE_FIELD_NOT_PUBLISHED', "Field '{0}' in '{1}' must be @published");
2847 2712
2848 static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode('D UPLICATE_ATTRIBUTE_DEFINITION', 1, "The attribute '{0}' is already defined"); 2713 static const PolymerCode DUPLICATE_ATTRIBUTE_DEFINITION = const PolymerCode('D UPLICATE_ATTRIBUTE_DEFINITION', "The attribute '{0}' is already defined");
2849 2714
2850 static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode('EMPTY_ATTRIBUTE S', 2, "Empty 'attributes' attribute is useless"); 2715 static const PolymerCode EMPTY_ATTRIBUTES = const PolymerCode('EMPTY_ATTRIBUTE S', "Empty 'attributes' attribute is useless");
2851 2716
2852 static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode('INVALID_A TTRIBUTE_NAME', 3, "'{0}' is not a valid name for a custom element attribute"); 2717 static const PolymerCode INVALID_ATTRIBUTE_NAME = const PolymerCode('INVALID_A TTRIBUTE_NAME', "'{0}' is not a valid name for a custom element attribute");
2853 2718
2854 static const PolymerCode INVALID_TAG_NAME = const PolymerCode('INVALID_TAG_NAM E', 4, "'{0}' is not a valid name for a custom element"); 2719 static const PolymerCode INVALID_TAG_NAME = const PolymerCode('INVALID_TAG_NAM E', "'{0}' is not a valid name for a custom element");
2855 2720
2856 static const PolymerCode MISSING_TAG_NAME = const PolymerCode('MISSING_TAG_NAM E', 5, "Missing tag name of the custom element. Please include an attribute like name='your-tag-name'"); 2721 static const PolymerCode MISSING_TAG_NAME = const PolymerCode('MISSING_TAG_NAM E', "Missing tag name of the custom element. Please include an attribute like na me='your-tag-name'");
2857 2722
2858 static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode('UNDEFI NED_ATTRIBUTE_FIELD', 6, "There is no such field '{0}' in '{1}'"); 2723 static const PolymerCode UNDEFINED_ATTRIBUTE_FIELD = const PolymerCode('UNDEFI NED_ATTRIBUTE_FIELD', "There is no such field '{0}' in '{1}'");
2859 2724
2860 static const List<PolymerCode> values = const [ 2725 /**
2861 ATTRIBUTE_FIELD_NOT_PUBLISHED, 2726 * Initialize a newly created error code to have the given [name]. The message
2862 DUPLICATE_ATTRIBUTE_DEFINITION, 2727 * associated with the error will be created from the given [message]
2863 EMPTY_ATTRIBUTES, 2728 * template. The correction associated with the error will be created from the
2864 INVALID_ATTRIBUTE_NAME, 2729 * given [correction] template.
2865 INVALID_TAG_NAME, 2730 */
2866 MISSING_TAG_NAME, 2731 const PolymerCode(String name, String message, [String correction]) : super(na me, message, correction);
2867 UNDEFINED_ATTRIBUTE_FIELD];
2868
2869 /**
2870 * The template used to create the message to be displayed for this error.
2871 */
2872 final String message;
2873
2874 /**
2875 * Initialize a newly created error code to have the given message.
2876 *
2877 * @param message the message template used to create the message to be displa yed for the error
2878 */
2879 const PolymerCode(String name, int ordinal, this.message) : super(name, ordina l);
2880
2881 @override
2882 String get correction => null;
2883 2732
2884 @override 2733 @override
2885 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 2734 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
2886 2735
2887 @override 2736 @override
2888 ErrorType get type => ErrorType.POLYMER; 2737 ErrorType get type => ErrorType.POLYMER;
2889
2890 @override
2891 String get uniqueName => "$runtimeType.$name";
2892 } 2738 }
2893 2739
2894 /** 2740 /**
2895 * The enumeration `StaticTypeWarningCode` defines the error codes used for stat ic type 2741 * The class `StaticTypeWarningCode` defines the error codes used for static
2896 * warnings. The convention for this class is for the name of the error code to indicate the problem 2742 * type warnings. The convention for this class is for the name of the error
2897 * that caused the error to be generated and for the error message to explain wh at is wrong and, 2743 * code to indicate the problem that caused the error to be generated and for
2898 * when appropriate, how the problem can be corrected. 2744 * the error message to explain what is wrong and, when appropriate, how the
2745 * problem can be corrected.
2899 */ 2746 */
2900 class StaticTypeWarningCode extends Enum<StaticTypeWarningCode> implements Error Code { 2747 class StaticTypeWarningCode extends ErrorCode {
2901 /** 2748 /**
2902 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose clas s implements the 2749 * 12.7 Lists: A fresh instance (7.6.1) <i>a</i>, of size <i>n</i>, whose
2903 * built-in class <i>List&lt;E></i> is allocated. 2750 * class implements the built-in class <i>List&lt;E></i> is allocated.
2904 * 2751 *
2905 * @param numTypeArgument the number of provided type arguments 2752 * @param numTypeArgument the number of provided type arguments
2906 */ 2753 */
2907 static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const St aticTypeWarningCode.con1('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', 0, "List literal re quires exactly one type arguments or none, but {0} found"); 2754 static const StaticTypeWarningCode EXPECTED_ONE_LIST_TYPE_ARGUMENTS = const St aticTypeWarningCode('EXPECTED_ONE_LIST_TYPE_ARGUMENTS', "List literal requires e xactly one type arguments or none, but {0} found");
2908 2755
2909 /** 2756 /**
2910 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class implements the 2757 * 12.8 Maps: A fresh instance (7.6.1) <i>m</i>, of size <i>n</i>, whose class
2911 * built-in class <i>Map&lt;K, V></i> is allocated. 2758 * implements the built-in class <i>Map&lt;K, V></i> is allocated.
2912 * 2759 *
2913 * @param numTypeArgument the number of provided type arguments 2760 * @param numTypeArgument the number of provided type arguments
2914 */ 2761 */
2915 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const Sta ticTypeWarningCode.con1('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', 1, "Map literal requi res exactly two type arguments or none, but {0} found"); 2762 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const Sta ticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', "Map literal requires exac tly two type arguments or none, but {0} found");
2916 2763
2917 /** 2764 /**
2918 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type 2765 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
2919 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. 2766 * It is a static type warning if <i>T</i> does not have an accessible
2920 * 2767 * instance setter named <i>v=</i>.
2921 * @see #UNDEFINED_SETTER 2768 *
2922 */ 2769 * @see [UNDEFINED_SETTER]
2923 static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarni ngCode.con1('INACCESSIBLE_SETTER', 2, ""); 2770 */
2924 2771 static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarni ngCode('INACCESSIBLE_SETTER', "");
2925 /** 2772
2926 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause m ultiple members 2773 /**
2927 * <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the same name <i>n</i> t hat would be 2774 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
2928 * inherited (because identically named members existed in several superinterf aces) then at most 2775 * multiple members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the
2929 * one member is inherited. 2776 * same name <i>n</i> that would be inherited (because identically named
2930 * 2777 * members existed in several superinterfaces) then at most one member is
2931 * If the static types <i>T<sub>1</sub>, &hellip;, T<sub>k</sub></i> of the me mbers 2778 * inherited.
2932 * <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> are not identical, then there must be a member 2779 *
2933 * <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> &lt;: T<sub>i</sub>, 1 &lt; = x &lt;= k</i> for 2780 * If the static types <i>T<sub>1</sub>, &hellip;, T<sub>k</sub></i> of the
2934 * all <i>i, 1 &lt;= i &lt;= k</i>, or a static type warning occurs. The membe r that is inherited 2781 * members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> are not identical,
2935 * is <i>m<sub>x</sub></i>, if it exists; otherwise: 2782 * then there must be a member <i>m<sub>x</sub></i> such that <i>T<sub>x</sub>
2936 * * Let <i>numberOfPositionals</i>(<i>f</i>) denote the number of positional parameters of a 2783 * &lt;: T<sub>i</sub>, 1 &lt;= x &lt;= k</i> for all <i>i, 1 &lt;= i &lt;=
2937 * function <i>f</i>, and let <i>numberOfRequiredParams</i>(<i>f</i>) denote t he number of 2784 * k</i>, or a static type warning occurs. The member that is inherited is
2938 * required parameters of a function <i>f</i>. Furthermore, let <i>s</i> denot e the set of all 2785 * <i>m<sub>x</sub></i>, if it exists; otherwise:
2939 * named parameters of the <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i>. Then let 2786 * * Let <i>numberOfPositionals</i>(<i>f</i>) denote the number of positional
2787 * parameters of a function <i>f</i>, and let
2788 * <i>numberOfRequiredParams</i>(<i>f</i>) denote the number of required
2789 * parameters of a function <i>f</i>. Furthermore, let <i>s</i> denote the
2790 * set of all named parameters of the <i>m<sub>1</sub>, &hellip;,
2791 * m<sub>k</sub></i>. Then let
2940 * * <i>h = max(numberOfPositionals(m<sub>i</sub>)),</i> 2792 * * <i>h = max(numberOfPositionals(m<sub>i</sub>)),</i>
2941 * * <i>r = min(numberOfRequiredParams(m<sub>i</sub>)), for all <i>i</i>, 1 <= i <= k.</i> 2793 * * <i>r = min(numberOfRequiredParams(m<sub>i</sub>)), for all <i>i</i>, 1 <=
2942 * If <i>r <= h</i> then <i>I</i> has a method named <i>n</i>, with <i>r</i> r equired parameters 2794 * i <= k.</i> If <i>r <= h</i> then <i>I</i> has a method named <i>n</i>,
2943 * of type <b>dynamic</b>, <i>h</i> positional parameters of type <b>dynamic</ b>, named parameters 2795 * with <i>r</i> required parameters of type <b>dynamic</b>, <i>h</i>
2944 * <i>s</i> of type <b>dynamic</b> and return type <b>dynamic</b>. 2796 * positional parameters of type <b>dynamic</b>, named parameters <i>s</i>
2945 * * Otherwise none of the members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></ i> is inherited. 2797 * of type <b>dynamic</b> and return type <b>dynamic</b>.
2946 */ 2798 * * Otherwise none of the members <i>m<sub>1</sub>, &hellip;,
2947 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const Sta ticTypeWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE', 3, "'{0}' is inherite d by at least two interfaces inconsistently, from {1}"); 2799 * m<sub>k</sub></i> is inherited.
2948 2800 */
2949 /** 2801 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const Sta ticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', "'{0}' is inherited by at least two interfaces inconsistently, from {1}");
2950 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an 2802
2951 * accessible (3.2) instance member named <i>m</i>. 2803 /**
2804 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
2805 * not have an accessible (3.2) instance member named <i>m</i>.
2952 * 2806 *
2953 * @param memberName the name of the static member 2807 * @param memberName the name of the static member
2954 * @see UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER 2808 * @see [UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]
2955 */ 2809 */
2956 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const St aticTypeWarningCode.con1('INSTANCE_ACCESS_TO_STATIC_MEMBER', 4, "Static member ' {0}' cannot be accessed using instance access"); 2810 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const St aticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', "Static member '{0}' can not be accessed using instance access");
2957 2811
2958 /** 2812 /**
2959 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be 2813 * 12.18 Assignment: It is a static type warning if the static type of
2960 * assigned to the static type of <i>v</i>. The static type of the expression <i>v = e</i> is the 2814 * <i>e</i> may not be assigned to the static type of <i>v</i>. The static
2961 * static type of <i>e</i>. 2815 * type of the expression <i>v = e</i> is the static type of <i>e</i>.
2962 * 2816 *
2963 * 12.18 Assignment: It is a static type warning if the static type of <i>e</i > may not be 2817 * 12.18 Assignment: It is a static type warning if the static type of
2964 * assigned to the static type of <i>C.v</i>. The static type of the expressio n <i>C.v = e</i> is 2818 * <i>e</i> may not be assigned to the static type of <i>C.v</i>. The static
2965 * the static type of <i>e</i>. 2819 * type of the expression <i>C.v = e</i> is the static type of <i>e</i>.
2966 * 2820 *
2967 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type 2821 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
2968 * warning if the static type of <i>e<sub>2</sub></i> may not be assigned to < i>T</i>. 2822 * It is a static type warning if the static type of <i>e<sub>2</sub></i> may
2823 * not be assigned to <i>T</i>.
2969 * 2824 *
2970 * @param rhsTypeName the name of the right hand side type 2825 * @param rhsTypeName the name of the right hand side type
2971 * @param lhsTypeName the name of the left hand side type 2826 * @param lhsTypeName the name of the left hand side type
2972 */ 2827 */
2973 static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarnin gCode.con1('INVALID_ASSIGNMENT', 5, "A value of type '{0}' cannot be assigned to a variable of type '{1}'"); 2828 static const StaticTypeWarningCode INVALID_ASSIGNMENT = const StaticTypeWarnin gCode('INVALID_ASSIGNMENT', "A value of type '{0}' cannot be assigned to a varia ble of type '{1}'");
2974 2829
2975 /** 2830 /**
2976 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the form 2831 * 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the
2977 * <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, &hellip; 2832 * form <i>o.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
2978 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. 2833 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
2979 * 2834 *
2980 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if <i>T</i> does not 2835 * Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if
2981 * have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it is a static warning 2836 * <i>T</i> does not have an accessible instance member named <i>m</i>. If
2982 * 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 2837 * <i>T.m</i> exists, it is a static warning if the type <i>F</i> of
2983 * not exist, or if <i>F</i> is not a function type, the static type of <i>i</ i> is dynamic. 2838 * <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does not
2984 * 2839 * exist, or if <i>F</i> is not a function type, the static type of <i>i</i>
2985 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i> of <i>C.m</i> may 2840 * is dynamic.
2986 * not be assigned to a function type. 2841 *
2842 * 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i>
2843 * of <i>C.m</i> may not be assigned to a function type.
2987 * 2844 *
2988 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 2845 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
2989 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip; 2846 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
2990 * 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 2847 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If
2991 * <i>F</i> of <i>S.m</i> may not be assigned to a function type. 2848 * <i>S.m</i> exists, it is a static warning if the type <i>F</i> of
2992 * 2849 * <i>S.m</i> may not be assigned to a function type.
2993 * @param nonFunctionIdentifier the name of the identifier that is not a funct ion type 2850 *
2994 */ 2851 * @param nonFunctionIdentifier the name of the identifier that is not a
2995 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTy peWarningCode.con1('INVOCATION_OF_NON_FUNCTION', 6, "'{0}' is not a method"); 2852 * function type
2996 2853 */
2997 /** 2854 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION = const StaticTy peWarningCode('INVOCATION_OF_NON_FUNCTION', "'{0}' is not a method");
2998 * 12.14.4 Function Expression Invocation: A function expression invocation <i >i</i> has the form 2855
2999 * <i>e<sub>f</sub>(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a <sub>n+1</sub>, 2856 /**
3000 * &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression. 2857 * 12.14.4 Function Expression Invocation: A function expression invocation
3001 * 2858 * <i>i</i> has the form <i>e<sub>f</sub>(a<sub>1</sub>, &hellip;,
3002 * It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub> </i> may not be 2859 * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>:
3003 * assigned to a function type. 2860 * a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression.
3004 */ 2861 *
3005 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = con st StaticTypeWarningCode.con1('INVOCATION_OF_NON_FUNCTION_EXPRESSION', 7, "Canno t invoke a non-function"); 2862 * It is a static type warning if the static type <i>F</i> of
3006 2863 * <i>e<sub>f</sub></i> may not be assigned to a function type.
3007 /** 2864 */
3008 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be 2865 static const StaticTypeWarningCode INVOCATION_OF_NON_FUNCTION_EXPRESSION = con st StaticTypeWarningCode('INVOCATION_OF_NON_FUNCTION_EXPRESSION', "Cannot invoke a non-function");
2866
2867 /**
2868 * 12.20 Conditional: It is a static type warning if the type of
2869 * <i>e<sub>1</sub></i> may not be assigned to bool.
2870 *
2871 * 13.5 If: It is a static type warning if the type of the expression <i>b</i>
2872 * may not be assigned to bool.
2873 *
2874 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be
3009 * assigned to bool. 2875 * assigned to bool.
3010 * 2876 *
3011 * 13.5 If: It is a static type warning if the type of the expression <i>b</i> may not be assigned 2877 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be
3012 * to bool.
3013 *
3014 * 13.7 While: It is a static type warning if the type of <i>e</i> may not be assigned to bool.
3015 *
3016 * 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assi gned to bool.
3017 */
3018 static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarnin gCode.con1('NON_BOOL_CONDITION', 8, "Conditions must have a static type of 'bool '");
3019
3020 /**
3021 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not b e assigned to either
3022 * bool or () &rarr; bool
3023 */
3024 static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarni ngCode.con1('NON_BOOL_EXPRESSION', 9, "Assertions must be on either a 'bool' or '() -> bool'");
3025
3026 /**
3027 * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the expr ession
3028 * <i>e</i>?<b>false<b> : <b>true</b>.
3029 *
3030 * 12.20 Conditional: It is a static type warning if the type of <i>e<sub>1</s ub></i> may not be
3031 * assigned to bool. 2878 * assigned to bool.
3032 */ 2879 */
3033 static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const Static TypeWarningCode.con1('NON_BOOL_NEGATION_EXPRESSION', 10, "Negation argument must have a static type of 'bool'"); 2880 static const StaticTypeWarningCode NON_BOOL_CONDITION = const StaticTypeWarnin gCode('NON_BOOL_CONDITION', "Conditions must have a static type of 'bool'");
3034 2881
3035 /** 2882 /**
3036 * 12.21 Logical Boolean Expressions: It is a static type warning if the stati c types of both of 2883 * 13.15 Assert: It is a static type warning if the type of <i>e</i> may not
3037 * <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> may not be assigned to bool. 2884 * be assigned to either bool or () &rarr; bool
2885 */
2886 static const StaticTypeWarningCode NON_BOOL_EXPRESSION = const StaticTypeWarni ngCode('NON_BOOL_EXPRESSION', "Assertions must be on either a 'bool' or '() -> b ool'");
2887
2888 /**
2889 * 12.28 Unary Expressions: The expression !<i>e</i> is equivalent to the
2890 * expression <i>e</i>?<b>false<b> : <b>true</b>.
2891 *
2892 * 12.20 Conditional: It is a static type warning if the type of
2893 * <i>e<sub>1</sub></i> may not be assigned to bool.
2894 */
2895 static const StaticTypeWarningCode NON_BOOL_NEGATION_EXPRESSION = const Static TypeWarningCode('NON_BOOL_NEGATION_EXPRESSION', "Negation argument must have a s tatic type of 'bool'");
2896
2897 /**
2898 * 12.21 Logical Boolean Expressions: It is a static type warning if the
2899 * static types of both of <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> may
2900 * not be assigned to bool.
3038 * 2901 *
3039 * @param operator the lexeme of the logical operator 2902 * @param operator the lexeme of the logical operator
3040 */ 2903 */
3041 static const StaticTypeWarningCode NON_BOOL_OPERAND = const StaticTypeWarningC ode.con1('NON_BOOL_OPERAND', 11, "The operands of the '{0}' operator must be ass ignable to 'bool'"); 2904 static const StaticTypeWarningCode NON_BOOL_OPERAND = const StaticTypeWarningC ode('NON_BOOL_OPERAND', "The operands of the '{0}' operator must be assignable t o 'bool'");
3042 2905
3043 /** 2906 /**
3044 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>, 1 &lt;= i &lt;= 2907 * 15.8 Parameterized Types: It is a static type warning if <i>A<sub>i</sub>,
3045 * n</i> does not denote a type in the enclosing lexical scope. 2908 * 1 &lt;= i &lt;= n</i> does not denote a type in the enclosing lexical scope .
3046 */ 2909 */
3047 static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTyp eWarningCode.con1('NON_TYPE_AS_TYPE_ARGUMENT', 12, "The name '{0}' is not a type and cannot be used as a parameterized type"); 2910 static const StaticTypeWarningCode NON_TYPE_AS_TYPE_ARGUMENT = const StaticTyp eWarningCode('NON_TYPE_AS_TYPE_ARGUMENT', "The name '{0}' is not a type and cann ot be used as a parameterized type");
3048 2911
3049 /** 2912 /**
3050 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not b e assigned to the 2913 * 13.11 Return: It is a static type warning if the type of <i>e</i> may not
3051 * declared return type of the immediately enclosing function. 2914 * be assigned to the declared return type of the immediately enclosing
2915 * function.
3052 * 2916 *
3053 * @param actualReturnType the return type as declared in the return statement 2917 * @param actualReturnType the return type as declared in the return statement
3054 * @param expectedReturnType the expected return type as defined by the method 2918 * @param expectedReturnType the expected return type as defined by the method
3055 * @param methodName the name of the method 2919 * @param methodName the name of the method
3056 */ 2920 */
3057 static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWa rningCode.con1('RETURN_OF_INVALID_TYPE', 13, "The return type '{0}' is not a '{1 }', as defined by the method '{2}'"); 2921 static const StaticTypeWarningCode RETURN_OF_INVALID_TYPE = const StaticTypeWa rningCode('RETURN_OF_INVALID_TYPE', "The return type '{0}' is not a '{1}', as de fined by the method '{2}'");
3058 2922
3059 /** 2923 /**
3060 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a 2924 * 12.11 Instance Creation: It is a static type warning if any of the type
3061 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object 2925 * arguments to a constructor of a generic type <i>G</i> invoked by a new
3062 * expression are not subtypes of the bounds of the corresponding formal type parameters of 2926 * expression or a constant object expression are not subtypes of the bounds
3063 * <i>G</i>. 2927 * of the corresponding formal type parameters of <i>G</i>.
3064 * 2928 *
3065 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</ i> of <i>G</i>, then 2929 * 15.8 Parameterized Types: If <i>S</i> is the static type of a member
3066 * the static type of the member <i>m</i> of <i>G&lt;A<sub>1</sub>, &hellip;, 2930 * <i>m</i> of <i>G</i>, then the static type of the member <i>m</i> of
3067 * A<sub>n</sub>&gt;</i> is <i>[A<sub>1</sub>, &hellip;, A<sub>n</sub>/T<sub>1 </sub>, &hellip;, 2931 * <i>G&lt;A<sub>1</sub>, &hellip;, A<sub>n</sub>&gt;</i> is <i>[A<sub>1</sub> ,
3068 * T<sub>n</sub>]S</i> where <i>T<sub>1</sub>, &hellip;, T<sub>n</sub></i> are the formal type 2932 * &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]S</i> where
3069 * parameters of <i>G</i>. Let <i>B<sub>i</sub></i> be the bounds of <i>T<sub> i</sub>, 1 &lt;= i 2933 * <i>T<sub>1</sub>, &hellip;, T<sub>n</sub></i> are the formal type
3070 * &lt;= n</i>. It is a static type warning if <i>A<sub>i</sub></i> is not a s ubtype of 2934 * parameters of <i>G</i>. Let <i>B<sub>i</sub></i> be the bounds of
3071 * <i>[A<sub>1</sub>, &hellip;, A<sub>n</sub>/T<sub>1</sub>, &hellip;, 2935 * <i>T<sub>i</sub>, 1 &lt;= i &lt;= n</i>. It is a static type warning if
3072 * T<sub>n</sub>]B<sub>i</sub>, 1 &lt;= i &lt;= n</i>. 2936 * <i>A<sub>i</sub></i> is not a subtype of <i>[A<sub>1</sub>, &hellip;,
3073 * 2937 * A<sub>n</sub>/T<sub>1</sub>, &hellip;, T<sub>n</sub>]B<sub>i</sub>, 1 &lt;=
3074 * 7.6.2 Factories: It is a static type warning if any of the type arguments t o <i>k'</i> are not 2938 * i &lt;= n</i>.
3075 * subtypes of the bounds of the corresponding formal type parameters of type. 2939 *
3076 * 2940 * 7.6.2 Factories: It is a static type warning if any of the type arguments
3077 * @param boundedTypeName the name of the type used in the instance creation t hat should be 2941 * to <i>k'</i> are not subtypes of the bounds of the corresponding formal
3078 * limited by the bound as specified in the class declaration 2942 * type parameters of type.
2943 *
2944 * @param boundedTypeName the name of the type used in the instance creation
2945 * that should be limited by the bound as specified in the class
2946 * declaration
3079 * @param boundingTypeName the name of the bounding type 2947 * @param boundingTypeName the name of the bounding type
3080 * @see #TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND 2948 * @see [TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]
3081 */ 2949 */
3082 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const S taticTypeWarningCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 14, "'{0}' does n ot extend '{1}'"); 2950 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const S taticTypeWarningCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '{1}'");
3083 2951
3084 /** 2952 /**
3085 * 10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound. 2953 * 10 Generics: It is a static type warning if a type parameter is a supertype
2954 * of its upper bound.
3086 * 2955 *
3087 * @param typeParameterName the name of the type parameter 2956 * @param typeParameterName the name of the type parameter
3088 * @see #TYPE_ARGUMENT_NOT_MATCHING_BOUNDS 2957 * @see [TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]
3089 */ 2958 */
3090 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = con st StaticTypeWarningCode.con1('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', 15, "'{0} ' cannot be a supertype of its upper bound"); 2959 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = con st StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', "'{0}' cannot be a supertype of its upper bound");
3091 2960
3092 /** 2961 /**
3093 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</ i> in the enclosing 2962 * 12.17 Getter Invocation: It is a static warning if there is no class
3094 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e xplicitly, a getter 2963 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does
2964 * not declare, implicitly or explicitly, a getter named <i>m</i>.
2965 *
2966 * @param constantName the name of the enumeration constant that is not
2967 * defined
2968 * @param enumName the name of the enumeration used to access the constant
2969 */
2970 static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = const StaticTypeW arningCode('UNDEFINED_ENUM_CONSTANT', "There is no constant named '{0}' in '{1}' ");
2971
2972 /**
2973 * 12.15.3 Unqualified Invocation: If there exists a lexically visible
2974 * declaration named <i>id</i>, let <i>f<sub>id</sub></i> be the innermost
2975 * such declaration. Then: [skip]. Otherwise, <i>f<sub>id</sub></i> is
2976 * considered equivalent to the ordinary method invocation
2977 * <b>this</b>.<i>id</i>(<i>a<sub>1</sub></i>, ..., <i>a<sub>n</sub></i>,
2978 * <i>x<sub>n+1</sub></i> : <i>a<sub>n+1</sub></i>, ...,
2979 * <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i>).
2980 *
2981 * @param methodName the name of the method that is undefined
2982 */
2983 static const StaticTypeWarningCode UNDEFINED_FUNCTION = const StaticTypeWarnin gCode('UNDEFINED_FUNCTION', "The function '{0}' is not defined");
2984
2985 /**
2986 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is
2987 * a static type warning if <i>T</i> does not have a getter named <i>m</i>.
2988 *
2989 * @param getterName the name of the getter
2990 * @param enclosingType the name of the enclosing type where the getter is
2991 * being looked for
2992 */
2993 static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningC ode('UNDEFINED_GETTER', "There is no such getter '{0}' in '{1}'");
2994
2995 /**
2996 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
2997 * It is a static type warning if <i>T</i> does not have an accessible
2998 * instance member named <i>m</i>.
2999 *
3000 * @param methodName the name of the method that is undefined
3001 * @param typeName the resolved type name that the method lookup is happening
3002 * on
3003 */
3004 static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningC ode('UNDEFINED_METHOD', "The method '{0}' is not defined for the class '{1}'");
3005
3006 /**
3007 * 12.18 Assignment: Evaluation of an assignment of the form
3008 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is
3009 * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e);
3010 * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>,
3011 * <i>e<sub>2</sub></i>).
3012 *
3013 * 12.29 Assignable Expressions: An assignable expression of the form
3014 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method
3015 * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument
3016 * <i>e<sub>2</sub></i>.
3017 *
3018 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>.
3019 * It is a static type warning if <i>T</i> does not have an accessible
3020 * instance member named <i>m</i>.
3021 *
3022 * @param operator the name of the operator
3023 * @param enclosingType the name of the enclosing type where the operator is
3024 * being looked for
3025 */
3026 static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarnin gCode('UNDEFINED_OPERATOR', "There is no such operator '{0}' in '{1}'");
3027
3028 /**
3029 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>.
3030 * It is a static type warning if <i>T</i> does not have an accessible
3031 * instance setter named <i>v=</i>.
3032 *
3033 * @param setterName the name of the setter
3034 * @param enclosingType the name of the enclosing type where the setter is
3035 * being looked for
3036 * @see [INACCESSIBLE_SETTER]
3037 */
3038 static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningC ode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'");
3039
3040 /**
3041 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
3042 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
3043 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a
3044 * static type warning if <i>S</i> does not have an accessible instance member
3095 * named <i>m</i>. 3045 * named <i>m</i>.
3096 * 3046 *
3097 * @param constantName the name of the enumeration constant that is not define d
3098 * @param enumName the name of the enumeration used to access the constant
3099 */
3100 static const StaticTypeWarningCode UNDEFINED_ENUM_CONSTANT = const StaticTypeW arningCode.con1('UNDEFINED_ENUM_CONSTANT', 16, "There is no constant named '{0}' in '{1}'");
3101
3102 /**
3103 * 12.15.3 Unqualified Invocation: If there exists a lexically visible declara tion named
3104 * <i>id</i>, let <i>f<sub>id</sub></i> be the innermost such declaration. The n: [skip].
3105 * Otherwise, <i>f<sub>id</sub></i> is considered equivalent to the ordinary m ethod invocation
3106 * <b>this</b>.<i>id</i>(<i>a<sub>1</sub></i>, ..., <i>a<sub>n</sub></i>, <i>x <sub>n+1</sub></i> :
3107 * <i>a<sub>n+1</sub></i>, ..., <i>x<sub>n+k</sub></i> : <i>a<sub>n+k</sub></i >).
3108 *
3109 * @param methodName the name of the method that is undefined 3047 * @param methodName the name of the method that is undefined
3110 */ 3048 * @param typeName the resolved type name that the method lookup is happening
3111 static const StaticTypeWarningCode UNDEFINED_FUNCTION = const StaticTypeWarnin gCode.con1('UNDEFINED_FUNCTION', 17, "The function '{0}' is not defined"); 3049 * on
3112 3050 */
3113 /** 3051 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWa rningCode('UNDEFINED_SUPER_METHOD', "There is no such method '{0}' in '{1}'");
3114 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is a static type 3052
3115 * warning if <i>T</i> does not have a getter named <i>m</i>. 3053 /**
3116 * 3054 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does
3117 * @param getterName the name of the getter 3055 * not have an accessible (3.2) instance member named <i>m</i>.
3118 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for 3056 *
3119 */ 3057 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used
3120 static const StaticTypeWarningCode UNDEFINED_GETTER = const StaticTypeWarningC ode.con1('UNDEFINED_GETTER', 18, "There is no such getter '{0}' in '{1}'"); 3058 * when we are able to find the name defined in a supertype. It exists to
3121 3059 * provide a more informative error message.
3122 /** 3060 */
3123 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type 3061 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER = const StaticTypeWarningCode('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER', "Static members from supertypes must be qualified by the name of the def ining type");
3124 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>. 3062
3125 * 3063 /**
3126 * @param methodName the name of the method that is undefined 3064 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a
3127 * @param typeName the resolved type name that the method lookup is happening on 3065 * generic type with exactly <i>n</i> type parameters.
3128 */
3129 static const StaticTypeWarningCode UNDEFINED_METHOD = const StaticTypeWarningC ode.con1('UNDEFINED_METHOD', 19, "The method '{0}' is not defined for the class '{1}'");
3130
3131 /**
3132 * 12.18 Assignment: Evaluation of an assignment of the form
3133 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is equiva lent to the
3134 * evaluation of the expression (a, i, e){a.[]=(i, e); return e;} (<i>e<sub>1< /sub></i>,
3135 * <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>).
3136 *
3137 * 12.29 Assignable Expressions: An assignable expression of the form
3138 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method invocat ion of the operator
3139 * method [] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>.
3140 *
3141 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. I t is a static type
3142 * warning if <i>T</i> does not have an accessible instance member named <i>m< /i>.
3143 *
3144 * @param operator the name of the operator
3145 * @param enclosingType the name of the enclosing type where the operator is b eing looked for
3146 */
3147 static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarnin gCode.con1('UNDEFINED_OPERATOR', 20, "There is no such operator '{0}' in '{1}'") ;
3148
3149 /**
3150 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
3151 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>.
3152 *
3153 * @param setterName the name of the setter
3154 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for
3155 * @see #INACCESSIBLE_SETTER
3156 */
3157 static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningC ode.con1('UNDEFINED_SETTER', 21, "There is no such setter '{0}' in '{1}'");
3158
3159 /**
3160 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
3161 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip;
3162 * 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
3163 * accessible instance member named <i>m</i>.
3164 *
3165 * @param methodName the name of the method that is undefined
3166 * @param typeName the resolved type name that the method lookup is happening on
3167 */
3168 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = const StaticTypeWa rningCode.con1('UNDEFINED_SUPER_METHOD', 22, "There is no such method '{0}' in ' {1}'");
3169
3170 /**
3171 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does n ot have an
3172 * accessible (3.2) instance member named <i>m</i>.
3173 *
3174 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used when we are
3175 * able to find the name defined in a supertype. It exists to provide a more i nformative error
3176 * message.
3177 */
3178 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M EMBER = const StaticTypeWarningCode.con1('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STA TIC_MEMBER', 23, "Static members from supertypes must be qualified by the name o f the defining type");
3179
3180 /**
3181 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a generic type with
3182 * exactly <i>n</i> type parameters.
3183 * 3066 *
3184 * @param typeName the name of the type being referenced (<i>G</i>) 3067 * @param typeName the name of the type being referenced (<i>G</i>)
3185 * @param parameterCount the number of type parameters that were declared 3068 * @param parameterCount the number of type parameters that were declared
3186 * @param argumentCount the number of type arguments provided 3069 * @param argumentCount the number of type arguments provided
3187 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS 3070 * @see [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]
3188 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS 3071 * @see [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS]
3189 */ 3072 */
3190 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const Stat icTypeWarningCode.con1('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 24, "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given"); 3073 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const Stat icTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
3191 3074
3192 static const List<StaticTypeWarningCode> values = const [ 3075 /**
3193 EXPECTED_ONE_LIST_TYPE_ARGUMENTS, 3076 * Initialize a newly created error code to have the given [name]. The message
3194 EXPECTED_TWO_MAP_TYPE_ARGUMENTS, 3077 * associated with the error will be created from the given [message]
3195 INACCESSIBLE_SETTER, 3078 * template. The correction associated with the error will be created from the
3196 INCONSISTENT_METHOD_INHERITANCE, 3079 * given [correction] template.
3197 INSTANCE_ACCESS_TO_STATIC_MEMBER, 3080 */
3198 INVALID_ASSIGNMENT, 3081 const StaticTypeWarningCode(String name, String message, [String correction]) : super(name, message, correction);
3199 INVOCATION_OF_NON_FUNCTION,
3200 INVOCATION_OF_NON_FUNCTION_EXPRESSION,
3201 NON_BOOL_CONDITION,
3202 NON_BOOL_EXPRESSION,
3203 NON_BOOL_NEGATION_EXPRESSION,
3204 NON_BOOL_OPERAND,
3205 NON_TYPE_AS_TYPE_ARGUMENT,
3206 RETURN_OF_INVALID_TYPE,
3207 TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
3208 TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
3209 UNDEFINED_ENUM_CONSTANT,
3210 UNDEFINED_FUNCTION,
3211 UNDEFINED_GETTER,
3212 UNDEFINED_METHOD,
3213 UNDEFINED_OPERATOR,
3214 UNDEFINED_SETTER,
3215 UNDEFINED_SUPER_METHOD,
3216 UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
3217 WRONG_NUMBER_OF_TYPE_ARGUMENTS];
3218
3219 /**
3220 * The template used to create the message to be displayed for this error.
3221 */
3222 final String message;
3223
3224 /**
3225 * The template used to create the correction to be displayed for this error, or `null` if
3226 * there is no correction information for this error.
3227 */
3228 final String correction;
3229
3230 /**
3231 * Initialize a newly created error code to have the given message.
3232 *
3233 * @param message the message template used to create the message to be displa yed for the error
3234 */
3235 const StaticTypeWarningCode.con1(String name, int ordinal, String message) : t his.con2(name, ordinal, message, null);
3236
3237 /**
3238 * Initialize a newly created error code to have the given message and correct ion.
3239 *
3240 * @param message the template used to create the message to be displayed for the error
3241 * @param correction the template used to create the correction to be displaye d for the error
3242 */
3243 const StaticTypeWarningCode.con2(String name, int ordinal, this.message, this. correction) : super(name, ordinal);
3244 3082
3245 @override 3083 @override
3246 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; 3084 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity;
3247 3085
3248 @override 3086 @override
3249 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; 3087 ErrorType get type => ErrorType.STATIC_TYPE_WARNING;
3250
3251 @override
3252 String get uniqueName => "$runtimeType.$name";
3253 } 3088 }
3254 3089
3255 /** 3090 /**
3256 * The enumeration `StaticWarningCode` defines the error codes used for static w arnings. The 3091 * The enumeration `StaticWarningCode` defines the error codes used for static
3257 * convention for this class is for the name of the error code to indicate the p roblem that caused 3092 * warnings. The convention for this class is for the name of the error code to
3258 * the error to be generated and for the error message to explain what is wrong and, when 3093 * indicate the problem that caused the error to be generated and for the error
3259 * appropriate, how the problem can be corrected. 3094 * message to explain what is wrong and, when appropriate, how the problem can
3095 * be corrected.
3260 */ 3096 */
3261 class StaticWarningCode extends Enum<StaticWarningCode> implements ErrorCode { 3097 class StaticWarningCode extends ErrorCode {
3262 /** 3098 /**
3263 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i >N</i> is introduced 3099 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and
3264 * into the top level scope <i>L</i> by more than one import then: 3100 * <i>N</i> is introduced into the top level scope <i>L</i> by more than one
3265 * <ol> 3101 * import then:
3266 * * A static warning occurs. 3102 * 1. A static warning occurs.
3267 * * If <i>N</i> is referenced as a function, getter or setter, a <i>NoSuchMet hodError</i> is 3103 * 2. If <i>N</i> is referenced as a function, getter or setter, a
3268 * raised. 3104 * <i>NoSuchMethodError</i> is raised.
3269 * * If <i>N</i> is referenced as a type, it is treated as a malformed type. 3105 * 3. If <i>N</i> is referenced as a type, it is treated as a malformed type.
3270 * </ol>
3271 * 3106 *
3272 * @param ambiguousTypeName the name of the ambiguous type 3107 * @param ambiguousTypeName the name of the ambiguous type
3273 * @param firstLibraryName the name of the first library that the type is foun d 3108 * @param firstLibraryName the name of the first library that the type is
3274 * @param secondLibraryName the name of the second library that the type is fo und 3109 * found
3275 */ 3110 * @param secondLibraryName the name of the second library that the type is
3276 static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode.con1 ('AMBIGUOUS_IMPORT', 0, "The name '{0}' is defined in the libraries {1}"); 3111 * found
3277 3112 */
3278 /** 3113 static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode('AMB IGUOUS_IMPORT', "The name '{0}' is defined in the libraries {1}");
3279 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+ 3114
3280 * k</i> may not be assigned to the type of the corresponding formal parameter of the constructor 3115 /**
3281 * <i>T.id</i> (respectively <i>T</i>). 3116 * 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>,
3282 * 3117 * 1 &lt;= i &lt;= n+ k</i> may not be assigned to the type of the
3283 * 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub >, 1 &lt;= i &lt;= 3118 * corresponding formal parameter of the constructor <i>T.id</i> (respectively
3284 * n+ k</i> may not be assigned to the type of the corresponding formal parame ter of the 3119 * <i>T</i>).
3285 * constructor <i>T.id</i> (respectively <i>T</i>). 3120 *
3286 * 3121 * 12.11.2 Const: It is a static warning if the static type of
3287 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 3122 * <i>a<sub>i</sub>, 1 &lt;= i &lt;= n+ k</i> may not be assigned to the type
3288 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 3123 * of the corresponding formal parameter of the constructor <i>T.id</i>
3289 * 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>. 3124 * (respectively <i>T</i>).
3290 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 3125 *
3291 * j &lt;= m</i>. 3126 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
3292 * 3127 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
3293 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 & lt;= i &lt;= l</i>, 3128 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
3294 * must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, & hellip; 3129 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
3295 * p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if 3130 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
3296 * <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>, 3131 * &lt;= j &lt;= m</i>.
3297 * 1 &lt;= j &lt;= l</i>. 3132 *
3133 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1
3134 * &lt;= i &lt;= l</i>, must have a corresponding named parameter in the set
3135 * <i>{p<sub>n+1</sub>, &hellip; p<sub>n+k</sub>}</i> or a static warning
3136 * occurs. It is a static warning if <i>T<sub>m+j</sub></i> may not be
3137 * assigned to <i>S<sub>r</sub></i>, where <i>r = q<sub>j</sub>, 1 &lt;= j
3138 * &lt;= l</i>.
3298 * 3139 *
3299 * @param actualType the name of the actual argument type 3140 * @param actualType the name of the actual argument type
3300 * @param expectedType the name of the expected type 3141 * @param expectedType the name of the expected type
3301 */ 3142 */
3302 static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarn ingCode.con1('ARGUMENT_TYPE_NOT_ASSIGNABLE', 1, "The argument type '{0}' cannot be assigned to the parameter type '{1}'"); 3143 static const StaticWarningCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const StaticWarn ingCode('ARGUMENT_TYPE_NOT_ASSIGNABLE', "The argument type '{0}' cannot be assig ned to the parameter type '{1}'");
3303 3144
3304 /** 3145 /**
3305 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError 3146 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
3306 * to be thrown, because no setter is defined for it. The assignment will also give rise to a 3147 * a NoSuchMethodError to be thrown, because no setter is defined for it. The
3307 * static warning for the same reason. 3148 * assignment will also give rise to a static warning for the same reason.
3308 * 3149 *
3309 * A constant variable is always implicitly final. 3150 * A constant variable is always implicitly final.
3310 */ 3151 */
3311 static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode.c on1('ASSIGNMENT_TO_CONST', 2, "Constant variables cannot be assigned a value"); 3152 static const StaticWarningCode ASSIGNMENT_TO_CONST = const StaticWarningCode(' ASSIGNMENT_TO_CONST', "Constant variables cannot be assigned a value");
3312 3153
3313 /** 3154 /**
3314 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError 3155 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
3315 * to be thrown, because no setter is defined for it. The assignment will also give rise to a 3156 * a NoSuchMethodError to be thrown, because no setter is defined for it. The
3316 * static warning for the same reason. 3157 * assignment will also give rise to a static warning for the same reason.
3317 */ 3158 */
3318 static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode.c on1('ASSIGNMENT_TO_FINAL', 3, "'{0}' cannot be used as a setter, it is final"); 3159 static const StaticWarningCode ASSIGNMENT_TO_FINAL = const StaticWarningCode(' ASSIGNMENT_TO_FINAL', "'{0}' cannot be used as a setter, it is final");
3319 3160
3320 /** 3161 /**
3321 * 5 Variables: Attempting to assign to a final variable elsewhere will cause a NoSuchMethodError 3162 * 5 Variables: Attempting to assign to a final variable elsewhere will cause
3322 * to be thrown, because no setter is defined for it. The assignment will also give rise to a 3163 * a NoSuchMethodError to be thrown, because no setter is defined for it. The
3323 * static warning for the same reason. 3164 * assignment will also give rise to a static warning for the same reason.
3324 */ 3165 */
3325 static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER = const StaticWar ningCode.con1('ASSIGNMENT_TO_FINAL_NO_SETTER', 4, "No setter named '{0}' in clas s '{1}'"); 3166 static const StaticWarningCode ASSIGNMENT_TO_FINAL_NO_SETTER = const StaticWar ningCode('ASSIGNMENT_TO_FINAL_NO_SETTER', "No setter named '{0}' in class '{1}'" );
3326 3167
3327 /** 3168 /**
3328 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs 3169 * 12.18 Assignment: It is as static warning if an assignment of the form
3329 * inside a top level or static function (be it function, method, getter, or s etter) or variable 3170 * <i>v = e</i> occurs inside a top level or static function (be it function,
3330 * initializer and there is neither a local variable declaration with name <i> v</i> nor setter 3171 * method, getter, or setter) or variable initializer and there is neither a
3331 * declaration with name <i>v=</i> in the lexical scope enclosing the assignme nt. 3172 * local variable declaration with name <i>v</i> nor setter declaration with
3332 */ 3173 * name <i>v=</i> in the lexical scope enclosing the assignment.
3333 static const StaticWarningCode ASSIGNMENT_TO_FUNCTION = const StaticWarningCod e.con1('ASSIGNMENT_TO_FUNCTION', 5, "Functions cannot be assigned a value"); 3174 */
3334 3175 static const StaticWarningCode ASSIGNMENT_TO_FUNCTION = const StaticWarningCod e('ASSIGNMENT_TO_FUNCTION', "Functions cannot be assigned a value");
3335 /** 3176
3336 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type 3177 /**
3337 * warning if <i>T</i> does not have an accessible instance setter named <i>v= </i>. 3178 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>
3338 */ 3179 * It is a static type warning if <i>T</i> does not have an accessible
3339 static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode. con1('ASSIGNMENT_TO_METHOD', 6, "Methods cannot be assigned a value"); 3180 * instance setter named <i>v=</i>.
3340 3181 */
3341 /** 3182 static const StaticWarningCode ASSIGNMENT_TO_METHOD = const StaticWarningCode( 'ASSIGNMENT_TO_METHOD', "Methods cannot be assigned a value");
3342 * 13.9 Switch: It is a static warning if the last statement of the statement sequence 3183
3343 * <i>s<sub>k</sub></i> is not a break, continue, return or throw statement. 3184 /**
3344 */ 3185 * 13.9 Switch: It is a static warning if the last statement of the statement
3345 static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarning Code.con1('CASE_BLOCK_NOT_TERMINATED', 7, "The last statement of the 'case' shou ld be 'break', 'continue', 'return' or 'throw'"); 3186 * sequence <i>s<sub>k</sub></i> is not a break, continue, return or throw
3346 3187 * statement.
3347 /** 3188 */
3348 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type available in the 3189 static const StaticWarningCode CASE_BLOCK_NOT_TERMINATED = const StaticWarning Code('CASE_BLOCK_NOT_TERMINATED', "The last statement of the 'case' should be 'b reak', 'continue', 'return' or 'throw'");
3349 * current lexical scope. 3190
3350 */ 3191 /**
3351 static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode.con1 ('CAST_TO_NON_TYPE', 8, "The name '{0}' is not a type and cannot be used in an ' as' expression"); 3192 * 12.32 Type Cast: It is a static warning if <i>T</i> does not denote a type
3352 3193 * available in the current lexical scope.
3353 /** 3194 */
3354 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 3195 static const StaticWarningCode CAST_TO_NON_TYPE = const StaticWarningCode('CAS T_TO_NON_TYPE', "The name '{0}' is not a type and cannot be used in an 'as' expr ession");
3355 * inherited in a concrete class. 3196
3356 */ 3197 /**
3357 static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const Sta ticWarningCode.con1('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', 9, "'{0}' must have a method body because '{1}' is not abstract"); 3198 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
3358 3199 * is declared or inherited in a concrete class.
3359 /** 3200 */
3360 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i >N</i> would be 3201 static const StaticWarningCode CONCRETE_CLASS_WITH_ABSTRACT_MEMBER = const Sta ticWarningCode('CONCRETE_CLASS_WITH_ABSTRACT_MEMBER', "'{0}' must have a method body because '{1}' is not abstract");
3361 * introduced into the top level scope of <i>L</i> by an import from a library whose URI begins 3202
3362 * with <i>dart:</i> and an import from a library whose URI does not begin wit h <i>dart:</i>: 3203 /**
3204 * 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and
3205 * <i>N</i> would be introduced into the top level scope of <i>L</i> by an
3206 * import from a library whose URI begins with <i>dart:</i> and an import from
3207 * a library whose URI does not begin with <i>dart:</i>:
3363 * * The import from <i>dart:</i> is implicitly extended by a hide N clause. 3208 * * The import from <i>dart:</i> is implicitly extended by a hide N clause.
3364 * * A static warning is issued. 3209 * * A static warning is issued.
3365 * 3210 *
3366 * @param ambiguousName the ambiguous name 3211 * @param ambiguousName the ambiguous name
3367 * @param sdkLibraryName the name of the dart: library that the element is fou nd 3212 * @param sdkLibraryName the name of the dart: library that the element is
3368 * @param otherLibraryName the name of the non-dart: library that the element is found 3213 * found
3369 */ 3214 * @param otherLibraryName the name of the non-dart: library that the element
3370 static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCo de.con1('CONFLICTING_DART_IMPORT', 10, "Element '{0}' from SDK library '{1}' is implicitly hidden by '{2}'"); 3215 * is found
3371 3216 */
3372 /** 3217 static const StaticWarningCode CONFLICTING_DART_IMPORT = const StaticWarningCo de('CONFLICTING_DART_IMPORT', "Element '{0}' from SDK library '{1}' is implicitl y hidden by '{2}'");
3373 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an instanc e getter named 3218
3374 * <i>v</i> and an accessible static member named <i>v</i> or <i>v=</i> is dec lared in a 3219 /**
3375 * superclass of <i>C</i>. 3220 * 7.2 Getters: It is a static warning if a class <i>C</i> declares an
3221 * instance getter named <i>v</i> and an accessible static member named
3222 * <i>v</i> or <i>v=</i> is declared in a superclass of <i>C</i>.
3376 * 3223 *
3377 * @param superName the name of the super class declaring a static member 3224 * @param superName the name of the super class declaring a static member
3378 */ 3225 */
3379 static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_ME MBER', 11, "Superclass '{0}' declares static member with the same name"); 3226 static const StaticWarningCode CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode('CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER' , "Superclass '{0}' declares static member with the same name");
3380 3227
3381 /** 3228 /**
3382 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method 3229 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
3383 * named <i>n</i> and has a setter named <i>n=</i>. 3230 * an instance method named <i>n</i> and has a setter named <i>n=</i>.
3384 */ 3231 */
3385 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const Stat icWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER', 12, "Class '{0}' declar es instance method '{1}', but also has a setter with the same name from '{2}'"); 3232 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER = const Stat icWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER', "Class '{0}' declares instan ce method '{1}', but also has a setter with the same name from '{2}'");
3386 3233
3387 /** 3234 /**
3388 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method 3235 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
3389 * named <i>n</i> and has a setter named <i>n=</i>. 3236 * an instance method named <i>n</i> and has a setter named <i>n=</i>.
3390 */ 3237 */
3391 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const Sta ticWarningCode.con1('CONFLICTING_INSTANCE_METHOD_SETTER2', 13, "Class '{0}' decl ares the setter '{1}', but also has an instance method in the same class"); 3238 static const StaticWarningCode CONFLICTING_INSTANCE_METHOD_SETTER2 = const Sta ticWarningCode('CONFLICTING_INSTANCE_METHOD_SETTER2', "Class '{0}' declares the setter '{1}', but also has an instance method in the same class");
3392 3239
3393 /** 3240 /**
3394 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an instanc e setter named 3241 * 7.3 Setters: It is a static warning if a class <i>C</i> declares an
3395 * <i>v=</i> and an accessible static member named <i>v=</i> or <i>v</i> is de clared in a 3242 * instance setter named <i>v=</i> and an accessible static member named
3396 * superclass of <i>C</i>. 3243 * <i>v=</i> or <i>v</i> is declared in a superclass of <i>C</i>.
3397 * 3244 *
3398 * @param superName the name of the super class declaring a static member 3245 * @param superName the name of the super class declaring a static member
3399 */ 3246 */
3400 static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode.con1('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_ME MBER', 14, "Superclass '{0}' declares static member with the same name"); 3247 static const StaticWarningCode CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMB ER = const StaticWarningCode('CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER' , "Superclass '{0}' declares static member with the same name");
3401 3248
3402 /** 3249 /**
3403 * 7.2 Getters: It is a static warning if a class declares a static getter nam ed <i>v</i> and also 3250 * 7.2 Getters: It is a static warning if a class declares a static getter
3404 * has a non-static setter named <i>v=</i>. 3251 * named <i>v</i> and also has a non-static setter named <i>v=</i>.
3405 */ 3252 */
3406 static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode.con1('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', 1 5, "Class '{0}' declares non-static setter with the same name"); 3253 static const StaticWarningCode CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER = const StaticWarningCode('CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER', "Class '{0}' declares non-static setter with the same name");
3407 3254
3408 /** 3255 /**
3409 * 7.3 Setters: It is a static warning if a class declares a static setter nam ed <i>v=</i> and 3256 * 7.3 Setters: It is a static warning if a class declares a static setter
3410 * also has a non-static member named <i>v</i>. 3257 * named <i>v=</i> and also has a non-static member named <i>v</i>.
3411 */ 3258 */
3412 static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode.con1('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', 1 6, "Class '{0}' declares non-static member with the same name"); 3259 static const StaticWarningCode CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER = const StaticWarningCode('CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER', "Class '{0}' declares non-static member with the same name");
3413 3260
3414 /** 3261 /**
3415 * 12.11.2 Const: Given an instance creation expression of the form <i>const q (a<sub>1</sub>, 3262 * 12.11.2 Const: Given an instance creation expression of the form <i>const
3416 * &hellip; a<sub>n</sub>)</i> it is a static warning if <i>q</i> is the const ructor of an 3263 * q(a<sub>1</sub>, &hellip; a<sub>n</sub>)</i> it is a static warning if
3417 * abstract class but <i>q</i> is not a factory constructor. 3264 * <i>q</i> is the constructor of an abstract class but <i>q</i> is not a
3418 */ 3265 * factory constructor.
3419 static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarning Code.con1('CONST_WITH_ABSTRACT_CLASS', 17, "Abstract classes cannot be created w ith a 'const' expression"); 3266 */
3420 3267 static const StaticWarningCode CONST_WITH_ABSTRACT_CLASS = const StaticWarning Code('CONST_WITH_ABSTRACT_CLASS', "Abstract classes cannot be created with a 'co nst' expression");
3421 /** 3268
3422 * 12.7 Maps: It is a static warning if the values of any two keys in a map li teral are equal. 3269 /**
3423 */ 3270 * 12.7 Maps: It is a static warning if the values of any two keys in a map
3424 static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode.con 1('EQUAL_KEYS_IN_MAP', 18, "Keys in a map cannot be equal"); 3271 * literal are equal.
3425 3272 */
3426 /** 3273 static const StaticWarningCode EQUAL_KEYS_IN_MAP = const StaticWarningCode('EQ UAL_KEYS_IN_MAP', "Keys in a map cannot be equal");
3427 * 14.2 Exports: It is a static warning to export two different libraries with the same name. 3274
3275 /**
3276 * 14.2 Exports: It is a static warning to export two different libraries with
3277 * the same name.
3428 * 3278 *
3429 * @param uri1 the uri pointing to a first library 3279 * @param uri1 the uri pointing to a first library
3430 * @param uri2 the uri pointing to a second library 3280 * @param uri2 the uri pointing to a second library
3431 * @param name the shared name of the exported libraries 3281 * @param name the shared name of the exported libraries
3432 */ 3282 */
3433 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode.con1('EXPORT_DUPLICATED_LIBRARY_NAME', 19, "The exported libraries '{0 }' and '{1}' should not have the same name '{2}'"); 3283 static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode('EXPORT_DUPLICATED_LIBRARY_NAME', "The exported libraries '{0}' and '{ 1}' should not have the same name '{2}'");
3434 3284
3435 /** 3285 /**
3436 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt; 3286 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
3437 * n</i>. 3287 * h</i> or if <i>m &gt; n</i>.
3438 * 3288 *
3439 * @param requiredCount the maximum number of positional arguments 3289 * @param requiredCount the maximum number of positional arguments
3440 * @param argumentCount the actual number of positional arguments given 3290 * @param argumentCount the actual number of positional arguments given
3441 * @see #NOT_ENOUGH_REQUIRED_ARGUMENTS 3291 * @see [NOT_ENOUGH_REQUIRED_ARGUMENTS]
3442 */ 3292 */
3443 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarnin gCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 20, "{0} positional arguments expected, but {1} found"); 3293 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarnin gCode('EXTRA_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, but {1} found");
3444 3294
3445 /** 3295 /**
3446 * 5. Variables: It is a static warning if a final instance variable that has been initialized at 3296 * 5. Variables: It is a static warning if a final instance variable that has
3447 * its point of declaration is also initialized in a constructor. 3297 * been initialized at its point of declaration is also initialized in a
3448 */ 3298 * constructor.
3449 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO N = const StaticWarningCode.con1('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATI ON', 21, "Values cannot be set in the constructor if they are final, and have al ready been set"); 3299 */
3450 3300 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO N = const StaticWarningCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', "Values cannot be set in the constructor if they are final, and have already bee n set");
3451 /** 3301
3452 * 5. Variables: It is a static warning if a final instance variable that has been initialized at 3302 /**
3453 * its point of declaration is also initialized in a constructor. 3303 * 5. Variables: It is a static warning if a final instance variable that has
3304 * been initialized at its point of declaration is also initialized in a
3305 * constructor.
3454 * 3306 *
3455 * @param name the name of the field in question 3307 * @param name the name of the field in question
3456 */ 3308 */
3457 static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO R = const StaticWarningCode.con1('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCT OR', 22, "'{0}' is final and was given a value when it was declared, so it canno t be set to a new value"); 3309 static const StaticWarningCode FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTO R = const StaticWarningCode('FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR', "'{0}' is final and was given a value when it was declared, so it cannot be set to a new value");
3458 3310
3459 /** 3311 /**
3460 * 7.6.1 Generative Constructors: Execution of an initializer of the form <b>t his</b>.<i>v</i> = 3312 * 7.6.1 Generative Constructors: Execution of an initializer of the form
3461 * <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated t o an object 3313 * <b>this</b>.<i>v</i> = <i>e</i> proceeds as follows: First, the expression
3462 * <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by thi s is bound to 3314 * <i>e</i> is evaluated to an object <i>o</i>. Then, the instance variable
3463 * <i>o</i>. 3315 * <i>v</i> of the object denoted by this is bound to <i>o</i>.
3464 * 3316 *
3465 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 3317 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
3466 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 3318 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
3467 * 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>. 3319 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
3468 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 3320 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
3469 * j &lt;= m</i>. 3321 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
3322 * &lt;= j &lt;= m</i>.
3470 * 3323 *
3471 * @param initializerType the name of the type of the initializer expression 3324 * @param initializerType the name of the type of the initializer expression
3472 * @param fieldType the name of the type of the field 3325 * @param fieldType the name of the type of the field
3473 */ 3326 */
3474 static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const Static WarningCode.con1('FIELD_INITIALIZER_NOT_ASSIGNABLE', 23, "The initializer type ' {0}' cannot be assigned to the field type '{1}'"); 3327 static const StaticWarningCode FIELD_INITIALIZER_NOT_ASSIGNABLE = const Static WarningCode('FIELD_INITIALIZER_NOT_ASSIGNABLE', "The initializer type '{0}' cann ot be assigned to the field type '{1}'");
3475 3328
3476 /** 3329 /**
3477 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a 3330 * 7.6.1 Generative Constructors: An initializing formal has the form
3478 * static warning if the static type of <i>id</i> is not assignable to <i>T<su b>id</sub></i>. 3331 * <i>this.id</i>. It is a static warning if the static type of <i>id</i> is
3332 * not assignable to <i>T<sub>id</sub></i>.
3479 * 3333 *
3480 * @param parameterType the name of the type of the field formal parameter 3334 * @param parameterType the name of the type of the field formal parameter
3481 * @param fieldType the name of the type of the field 3335 * @param fieldType the name of the type of the field
3482 */ 3336 */
3483 static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = cons t StaticWarningCode.con1('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', 24, "The pa rameter type '{0}' is incompatable with the field type '{1}'"); 3337 static const StaticWarningCode FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE = cons t StaticWarningCode('FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE', "The parameter t ype '{0}' is incompatable with the field type '{1}'");
3484 3338
3485 /** 3339 /**
3486 * 5 Variables: It is a static warning if a library, static or local variable <i>v</i> is final 3340 * 5 Variables: It is a static warning if a library, static or local variable
3487 * and <i>v</i> is not initialized at its point of declaration. 3341 * <i>v</i> is final and <i>v</i> is not initialized at its point of
3488 * 3342 * declaration.
3489 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i> declar ed in the 3343 *
3490 * immediately enclosing class must have an initializer in <i>k</i>'s initiali zer list unless it 3344 * 7.6.1 Generative Constructors: Each final instance variable <i>f</i>
3491 * has already been initialized by one of the following means: 3345 * declared in the immediately enclosing class must have an initializer in
3346 * <i>k</i>'s initializer list unless it has already been initialized by one
3347 * of the following means:
3492 * * Initialization at the declaration of <i>f</i>. 3348 * * Initialization at the declaration of <i>f</i>.
3493 * * Initialization by means of an initializing formal of <i>k</i>. 3349 * * Initialization by means of an initializing formal of <i>k</i>.
3494 * or a static warning occurs. 3350 * or a static warning occurs.
3495 * 3351 *
3496 * @param name the name of the uninitialized final variable 3352 * @param name the name of the uninitialized final variable
3497 */ 3353 */
3498 static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode .con1('FINAL_NOT_INITIALIZED', 25, "The final variable '{0}' must be initialized "); 3354 static const StaticWarningCode FINAL_NOT_INITIALIZED = const StaticWarningCode ('FINAL_NOT_INITIALIZED', "The final variable '{0}' must be initialized");
3499 3355
3500 /** 3356 /**
3501 * 15.5 Function Types: It is a static warning if a concrete class implements Function and does 3357 * 15.5 Function Types: It is a static warning if a concrete class implements
3502 * not have a concrete method named call(). 3358 * Function and does not have a concrete method named call().
3503 */ 3359 */
3504 static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode .con1('FUNCTION_WITHOUT_CALL', 26, "Concrete classes that implement Function mus t implement the method call()"); 3360 static const StaticWarningCode FUNCTION_WITHOUT_CALL = const StaticWarningCode ('FUNCTION_WITHOUT_CALL', "Concrete classes that implement Function must impleme nt the method call()");
3505 3361
3506 /** 3362 /**
3507 * 14.1 Imports: It is a static warning to import two different libraries with the same name. 3363 * 14.1 Imports: It is a static warning to import two different libraries with
3364 * the same name.
3508 * 3365 *
3509 * @param uri1 the uri pointing to a first library 3366 * @param uri1 the uri pointing to a first library
3510 * @param uri2 the uri pointing to a second library 3367 * @param uri2 the uri pointing to a second library
3511 * @param name the shared name of the imported libraries 3368 * @param name the shared name of the imported libraries
3512 */ 3369 */
3513 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode.con1('IMPORT_DUPLICATED_LIBRARY_NAME', 27, "The imported libraries '{0 }' and '{1}' should not have the same name '{2}'"); 3370 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_NAME = const StaticWa rningCode('IMPORT_DUPLICATED_LIBRARY_NAME', "The imported libraries '{0}' and '{ 1}' should not have the same name '{2}'");
3514 3371
3515 /** 3372 /**
3516 * 14.1 Imports: It is a static warning if the specified URI of a deferred imp ort does not refer 3373 * 14.1 Imports: It is a static warning if the specified URI of a deferred
3517 * to a library declaration. 3374 * import does not refer to a library declaration.
3518 * 3375 *
3519 * @param uri the uri pointing to a non-library declaration 3376 * @param uri the uri pointing to a non-library declaration
3520 * @see CompileTimeErrorCode#IMPORT_OF_NON_LIBRARY 3377 * @see [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]
3521 */ 3378 */
3522 static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode .con1('IMPORT_OF_NON_LIBRARY', 28, "The imported library '{0}' must not have a p art-of directive"); 3379 static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode ('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part-of di rective");
3523 3380
3524 /** 3381 /**
3525 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause m ultiple members 3382 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause
3526 * <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the same name <i>n</i> t hat would be 3383 * multiple members <i>m<sub>1</sub>, &hellip;, m<sub>k</sub></i> with the
3527 * inherited (because identically named members existed in several superinterf aces) then at most 3384 * same name <i>n</i> that would be inherited (because identically named
3528 * one member is inherited. 3385 * members existed in several superinterfaces) then at most one member is
3529 * 3386 * inherited.
3530 * If some but not all of the <i>m<sub>i</sub>, 1 &lt;= i &lt;= k</i> are gett ers none of the 3387 *
3531 * <i>m<sub>i</sub></i> are inherited, and a static warning is issued. 3388 * If some but not all of the <i>m<sub>i</sub>, 1 &lt;= i &lt;= k</i> are
3532 */ 3389 * getters none of the <i>m<sub>i</sub></i> are inherited, and a static
3533 static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD = const StaticWarningCode.con1('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_ME THOD', 29, "'{0}' is inherited as a getter and also a method"); 3390 * warning is issued.
3534 3391 */
3535 /** 3392 static const StaticWarningCode INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METH OD = const StaticWarningCode('INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD' , "'{0}' is inherited as a getter and also a method");
3536 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares a n instance method 3393
3537 * named <i>n</i> and an accessible static member named <i>n</i> is declared i n a superclass of 3394 /**
3538 * <i>C</i>. 3395 * 7.1 Instance Methods: It is a static warning if a class <i>C</i> declares
3396 * an instance method named <i>n</i> and an accessible static member named
3397 * <i>n</i> is declared in a superclass of <i>C</i>.
3539 * 3398 *
3540 * @param memberName the name of the member with the name conflict 3399 * @param memberName the name of the member with the name conflict
3541 * @param superclassName the name of the enclosing class that has the static m ember 3400 * @param superclassName the name of the enclosing class that has the static
3542 */ 3401 * member
3543 static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC = const StaticWarningCode.con1('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCL ASS_STATIC', 30, "'{0}' collides with a static member in the superclass '{1}'"); 3402 */
3544 3403 static const StaticWarningCode INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC = const StaticWarningCode('INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_S TATIC', "'{0}' collides with a static member in the superclass '{1}'");
3545 /** 3404
3546 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a gette r <i>m2</i> and the 3405 /**
3547 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 3406 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a
3407 * getter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of
3408 * <i>m2</i>.
3548 * 3409 *
3549 * @param actualReturnTypeName the name of the expected return type 3410 * @param actualReturnTypeName the name of the expected return type
3550 * @param expectedReturnType the name of the actual return type, not assignabl e to the 3411 * @param expectedReturnType the name of the actual return type, not
3551 * actualReturnTypeName 3412 * assignable to the actualReturnTypeName
3552 * @param className the name of the class where the overridden getter is decla red 3413 * @param className the name of the class where the overridden getter is
3553 * @see #INVALID_METHOD_OVERRIDE_RETURN_TYPE 3414 * declared
3554 */ 3415 * @see [INVALID_METHOD_OVERRIDE_RETURN_TYPE]
3555 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode.con1('INVALID_GETTER_OVERRIDE_RETURN_TYPE', 31, "The return type '{0}' is not assignable to '{1}' as required by the getter it is overriding from '{2}'"); 3416 */
3556 3417 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE', "The return type '{0}' is not assignable to '{1}' as required by the getter it is overriding from '{2}'");
3557 /** 3418
3558 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3419 /**
3559 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 3420 * 7.1 Instance Methods: It is a static warning if an instance method
3421 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
3422 * is not a subtype of the type of <i>m2</i>.
3560 * 3423 *
3561 * @param actualParamTypeName the name of the expected parameter type 3424 * @param actualParamTypeName the name of the expected parameter type
3562 * @param expectedParamType the name of the actual parameter type, not assigna ble to the 3425 * @param expectedParamType the name of the actual parameter type, not
3563 * actualParamTypeName 3426 * assignable to the actualParamTypeName
3564 * @param className the name of the class where the overridden method is decla red 3427 * @param className the name of the class where the overridden method is
3565 */ 3428 * declared
3566 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = cons t StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', 32, "The pa rameter type '{0}' is not assignable to '{1}' as required by the method it is ov erriding from '{2}'"); 3429 */
3567 3430 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = cons t StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', "The parameter t ype '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
3568 /** 3431
3569 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3432 /**
3570 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 3433 * 7.1 Instance Methods: It is a static warning if an instance method
3434 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
3435 * is not a subtype of the type of <i>m2</i>.
3571 * 3436 *
3572 * @param actualParamTypeName the name of the expected parameter type 3437 * @param actualParamTypeName the name of the expected parameter type
3573 * @param expectedParamType the name of the actual parameter type, not assigna ble to the 3438 * @param expectedParamType the name of the actual parameter type, not
3574 * actualParamTypeName 3439 * assignable to the actualParamTypeName
3575 * @param className the name of the class where the overridden method is decla red 3440 * @param className the name of the class where the overridden method is
3576 * @see #INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE 3441 * declared
3577 */ 3442 * @see [INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]
3578 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', 33, "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'"); 3443 */
3579 3444 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the method it is overridin g from '{2}'");
3580 /** 3445
3581 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3446 /**
3582 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 3447 * 7.1 Instance Methods: It is a static warning if an instance method
3448 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
3449 * is not a subtype of the type of <i>m2</i>.
3583 * 3450 *
3584 * @param actualParamTypeName the name of the expected parameter type 3451 * @param actualParamTypeName the name of the expected parameter type
3585 * @param expectedParamType the name of the actual parameter type, not assigna ble to the 3452 * @param expectedParamType the name of the actual parameter type, not
3586 * actualParamTypeName 3453 * assignable to the actualParamTypeName
3587 * @param className the name of the class where the overridden method is decla red 3454 * @param className the name of the class where the overridden method is
3588 */ 3455 * declared
3589 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = c onst StaticWarningCode.con1('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', 34, " The parameter type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'"); 3456 */
3590 3457 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = c onst StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', "The param eter type '{0}' is not assignable to '{1}' as required by the method it is overr iding from '{2}'");
3591 /** 3458
3592 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3459 /**
3593 * instance method <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of <i>m2</i>. 3460 * 7.1 Instance Methods: It is a static warning if an instance method
3461 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i>
3462 * is not a subtype of the type of <i>m2</i>.
3594 * 3463 *
3595 * @param actualReturnTypeName the name of the expected return type 3464 * @param actualReturnTypeName the name of the expected return type
3596 * @param expectedReturnType the name of the actual return type, not assignabl e to the 3465 * @param expectedReturnType the name of the actual return type, not
3597 * actualReturnTypeName 3466 * assignable to the actualReturnTypeName
3598 * @param className the name of the class where the overridden method is decla red 3467 * @param className the name of the class where the overridden method is
3599 * @see #INVALID_GETTER_OVERRIDE_RETURN_TYPE 3468 * declared
3600 */ 3469 * @see [INVALID_GETTER_OVERRIDE_RETURN_TYPE]
3601 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode.con1('INVALID_METHOD_OVERRIDE_RETURN_TYPE', 35, "The return type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'"); 3470 */
3602 3471 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const Sta ticWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE', "The return type '{0}' is not assignable to '{1}' as required by the method it is overriding from '{2}'");
3603 /** 3472
3604 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3473 /**
3605 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for 3474 * 7.1 Instance Methods: It is a static warning if an instance method
3606 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value 3475 * <i>m1</i> overrides an instance member <i>m2</i>, the signature of
3476 * <i>m2</i> explicitly specifies a default value for a formal parameter
3477 * <i>p</i> and the signature of <i>m1</i> specifies a different default value
3607 * for <i>p</i>. 3478 * for <i>p</i>.
3608 */ 3479 */
3609 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED ', 36, "Parameters cannot override default values, this method overrides '{0}.{1 }' where '{2}' has a different value"); 3480 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = const StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', "P arameters cannot override default values, this method overrides '{0}.{1}' where '{2}' has a different value");
3610 3481
3611 /** 3482 /**
3612 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3483 * 7.1 Instance Methods: It is a static warning if an instance method
3613 * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for 3484 * <i>m1</i> overrides an instance member <i>m2</i>, the signature of
3614 * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a diff erent default value 3485 * <i>m2</i> explicitly specifies a default value for a formal parameter
3486 * <i>p</i> and the signature of <i>m1</i> specifies a different default value
3615 * for <i>p</i>. 3487 * for <i>p</i>.
3616 */ 3488 */
3617 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL = const StaticWarningCode.con1('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_ POSITIONAL', 37, "Parameters cannot override default values, this method overrid es '{0}.{1}' where this positional parameter has a different value"); 3489 static const StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL = const StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSIT IONAL', "Parameters cannot override default values, this method overrides '{0}.{ 1}' where this positional parameter has a different value");
3618 3490
3619 /** 3491 /**
3620 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3492 * 7.1 Instance Methods: It is a static warning if an instance method
3621 * instance member <i>m2</i> and <i>m1</i> does not declare all the named para meters declared by 3493 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> does not
3622 * <i>m2</i>. 3494 * declare all the named parameters declared by <i>m2</i>.
3623 * 3495 *
3624 * @param paramCount the number of named parameters in the overridden member 3496 * @param paramCount the number of named parameters in the overridden member
3625 * @param className the name of the class from the overridden method 3497 * @param className the name of the class from the overridden method
3626 */ 3498 */
3627 static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCod e.con1('INVALID_OVERRIDE_NAMED', 38, "Missing the named parameter '{0}' to match the overridden method from '{1}'"); 3499 static const StaticWarningCode INVALID_OVERRIDE_NAMED = const StaticWarningCod e('INVALID_OVERRIDE_NAMED', "Missing the named parameter '{0}' to match the over ridden method from '{1}'");
3628 3500
3629 /** 3501 /**
3630 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3502 * 7.1 Instance Methods: It is a static warning if an instance method
3631 * instance member <i>m2</i> and <i>m1</i> has fewer positional parameters tha n <i>m2</i>. 3503 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> has fewer
3632 * 3504 * positional parameters than <i>m2</i>.
3633 * @param paramCount the number of positional parameters in the overridden mem ber 3505 *
3506 * @param paramCount the number of positional parameters in the overridden
3507 * member
3634 * @param className the name of the class from the overridden method 3508 * @param className the name of the class from the overridden method
3635 */ 3509 */
3636 static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarni ngCode.con1('INVALID_OVERRIDE_POSITIONAL', 39, "Must have at least {0} parameter s to match the overridden method from '{1}'"); 3510 static const StaticWarningCode INVALID_OVERRIDE_POSITIONAL = const StaticWarni ngCode('INVALID_OVERRIDE_POSITIONAL', "Must have at least {0} parameters to matc h the overridden method from '{1}'");
3637 3511
3638 /** 3512 /**
3639 * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i > overrides an 3513 * 7.1 Instance Methods: It is a static warning if an instance method
3640 * instance member <i>m2</i> and <i>m1</i> has a greater number of required pa rameters than 3514 * <i>m1</i> overrides an instance member <i>m2</i> and <i>m1</i> has a
3515 * greater number of required parameters than <i>m2</i>.
3516 *
3517 * @param paramCount the number of required parameters in the overridden
3518 * member
3519 * @param className the name of the class from the overridden method
3520 */
3521 static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarning Code('INVALID_OVERRIDE_REQUIRED', "Must have {0} required parameters or less to match the overridden method from '{1}'");
3522
3523 /**
3524 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a
3525 * setter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of
3641 * <i>m2</i>. 3526 * <i>m2</i>.
3642 * 3527 *
3643 * @param paramCount the number of required parameters in the overridden membe r
3644 * @param className the name of the class from the overridden method
3645 */
3646 static const StaticWarningCode INVALID_OVERRIDE_REQUIRED = const StaticWarning Code.con1('INVALID_OVERRIDE_REQUIRED', 40, "Must have {0} required parameters or less to match the overridden method from '{1}'");
3647
3648 /**
3649 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a sette r <i>m2</i> and the
3650 * type of <i>m1</i> is not a subtype of the type of <i>m2</i>.
3651 *
3652 * @param actualParamTypeName the name of the expected parameter type 3528 * @param actualParamTypeName the name of the expected parameter type
3653 * @param expectedParamType the name of the actual parameter type, not assigna ble to the 3529 * @param expectedParamType the name of the actual parameter type, not
3654 * actualParamTypeName 3530 * assignable to the actualParamTypeName
3655 * @param className the name of the class where the overridden setter is decla red 3531 * @param className the name of the class where the overridden setter is
3656 * @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE 3532 * declared
3657 */ 3533 * @see [INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]
3658 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode.con1('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 41, "The parameter type '{0}' is not assignable to '{1}' as required by the setter it is overriding from '{2}'"); 3534 */
3659 3535 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = con st StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter type '{0}' is not assignable to '{1}' as required by the setter it is overridin g from '{2}'");
3660 /** 3536
3661 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> &hellip; 3537 /**
3662 * <i>e<sub>n</sub></i>] is evaluated as follows: 3538 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i>
3663 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument 3539 * &hellip; <i>e<sub>n</sub></i>] is evaluated as follows:
3664 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i> 3540 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and
3665 * 3541 * second argument <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
3666 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 3542 *
3667 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 3543 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
3668 * 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>. 3544 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
3669 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 3545 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
3670 * j &lt;= m</i>. 3546 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
3671 */ 3547 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
3672 static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Static WarningCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 42, "The element type '{0}' cannot be assigned to the list type '{1}'"); 3548 * &lt;= j &lt;= m</i>.
3673 3549 */
3674 /** 3550 static const StaticWarningCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Static WarningCode('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot b e assigned to the list type '{1}'");
3675 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 3551
3676 * <i>e<sub>1</sub></i> &hellip; <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as 3552 /**
3677 * follows: 3553 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
3678 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 3554 * [<i>k<sub>1</sub></i> : <i>e<sub>1</sub></i> &hellip; <i>k<sub>n</sub></i>
3679 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 3555 * : <i>e<sub>n</sub></i>] is evaluated as follows:
3680 * 3556 * * The operator []= is invoked on <i>m</i> with first argument
3681 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 3557 * <i>k<sub>i</sub></i> and second argument <i>e<sub>i</sub></i><i>, 1 &lt;=
3682 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 3558 * i &lt;= n</i>
3683 * 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>. 3559 *
3684 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 3560 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
3685 * j &lt;= m</i>. 3561 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
3686 */ 3562 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
3687 static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarni ngCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 43, "The element type '{0}' cannot be assigned to the map key type '{1}'"); 3563 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
3688 3564 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
3689 /** 3565 * &lt;= j &lt;= m</i>.
3690 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> : 3566 */
3691 * <i>e<sub>1</sub></i> &hellip; <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is evaluated as 3567 static const StaticWarningCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const StaticWarni ngCode('MAP_KEY_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot be assigned to the map key type '{1}'");
3692 * follows: 3568
3693 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second 3569 /**
3694 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i> 3570 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt;
3695 * 3571 * [<i>k<sub>1</sub></i> : <i>e<sub>1</sub></i> &hellip; <i>k<sub>n</sub></i>
3696 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of 3572 * : <i>e<sub>n</sub></i>] is evaluated as follows:
3697 * <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</s ub>, 1 &lt;= i &lt;= 3573 * * The operator []= is invoked on <i>m</i> with first argument
3698 * 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>. 3574 * <i>k<sub>i</sub></i> and second argument <i>e<sub>i</sub></i><i>, 1 &lt;=
3699 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;= 3575 * i &lt;= n</i>
3700 * j &lt;= m</i>. 3576 *
3701 */ 3577 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static
3702 static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWar ningCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 44, "The element type '{0}' canno t be assigned to the map value type '{1}'"); 3578 * type of <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of
3703 3579 * <i>p<sub>i</sub>, 1 &lt;= i &lt;= n+k</i> and let <i>S<sub>q</sub></i> be
3704 /** 3580 * the type of the named parameter <i>q</i> of <i>f</i>. It is a static
3705 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type 3581 * warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1
3706 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be 3582 * &lt;= j &lt;= m</i>.
3707 * assigned to <i>S</i>. 3583 */
3708 */ 3584 static const StaticWarningCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const StaticWar ningCode('MAP_VALUE_TYPE_NOT_ASSIGNABLE', "The element type '{0}' cannot be assi gned to the map value type '{1}'");
3709 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const Stat icWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES', 45, "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}') "); 3585
3710 3586 /**
3711 /** 3587 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
3712 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type 3588 * with argument type <i>T</i> and a getter named <i>v</i> with return type
3713 * <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i > may not be 3589 * <i>S</i>, and <i>T</i> may not be assigned to <i>S</i>.
3714 * assigned to <i>S</i>. 3590 */
3715 */ 3591 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = const Stat icWarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES', "The parameter type for sett er '{0}' is '{1}' which is not assignable to its getter (of type '{2}')");
3716 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY PE = const StaticWarningCode.con1('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPER TYPE', 46, "The parameter type for setter '{0}' is '{1}' which is not assignable to its getter (of type '{2}'), from superclass '{3}'"); 3592
3717 3593 /**
3718 /** 3594 * 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i>
3719 * 13.12 Return: It is a static warning if a function contains both one or mor e return statements 3595 * with argument type <i>T</i> and a getter named <i>v</i> with return type
3720 * of the form <i>return;</i> and one or more return statements of the form <i >return e;</i>. 3596 * <i>S</i>, and <i>T</i> may not be assigned to <i>S</i>.
3721 */ 3597 */
3722 static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode.co n1('MIXED_RETURN_TYPES', 47, "Methods and functions cannot use return both with and without values"); 3598 static const StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTY PE = const StaticWarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE' , "The parameter type for setter '{0}' is '{1}' which is not assignable to its g etter (of type '{2}'), from superclass '{3}'");
3723 3599
3724 /** 3600 /**
3725 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abst ract class and 3601 * 13.12 Return: It is a static warning if a function contains both one or
3726 * <i>q</i> is not a factory constructor. 3602 * more return statements of the form <i>return;</i> and one or more return
3727 */ 3603 * statements of the form <i>return e;</i>.
3728 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCo de.con1('NEW_WITH_ABSTRACT_CLASS', 48, "Abstract classes cannot be created with a 'new' expression"); 3604 */
3729 3605 static const StaticWarningCode MIXED_RETURN_TYPES = const StaticWarningCode('M IXED_RETURN_TYPES', "Methods and functions cannot use return both with and witho ut values");
3730 /** 3606
3731 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a stat ic warning. 3607 /**
3608 * 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an
3609 * abstract class and <i>q</i> is not a factory constructor.
3610 */
3611 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCo de('NEW_WITH_ABSTRACT_CLASS', "Abstract classes cannot be created with a 'new' e xpression");
3612
3613 /**
3614 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a
3615 * static warning.
3732 * 3616 *
3733 * @param typeName the name of the type being referenced (<i>S</i>) 3617 * @param typeName the name of the type being referenced (<i>S</i>)
3734 * @param parameterCount the number of type parameters that were declared 3618 * @param parameterCount the number of type parameters that were declared
3735 * @param argumentCount the number of type arguments provided 3619 * @param argumentCount the number of type arguments provided
3736 * @see CompileTimeErrorCode#CONST_WITH_INVALID_TYPE_PARAMETERS 3620 * @see [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS]
3737 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS 3621 * @see [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]
3738 */ 3622 */
3739 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const Static WarningCode.con1('NEW_WITH_INVALID_TYPE_PARAMETERS', 49, "The type '{0}' is decl ared with {1} type parameters, but {2} type arguments were given"); 3623 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const Static WarningCode('NEW_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is declared with {1} type parameters, but {2} type arguments were given");
3740 3624
3741 /** 3625 /**
3742 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible i n the current scope, 3626 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible
3743 * optionally followed by type arguments. 3627 * in the current scope, optionally followed by type arguments.
3744 * 3628 *
3745 * @param name the name of the non-type element 3629 * @param name the name of the non-type element
3746 */ 3630 */
3747 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode.con 1('NEW_WITH_NON_TYPE', 50, "The name '{0}' is not a class"); 3631 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode('NE W_WITH_NON_TYPE', "The name '{0}' is not a class");
3748 3632
3749 /** 3633 /**
3750 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then: 3634 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
3751 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, a<sub>n< /sub>, 3635 * current scope then:
3752 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a 3636 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;,
3753 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>. 3637 * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;,
3754 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x< sub>n+1</sub>: 3638 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a static warning if
3755 * a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a st atic warning if the 3639 * <i>T.id</i> is not the name of a constructor declared by the type
3756 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>. 3640 * <i>T</i>.
3757 */ 3641 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>,
3758 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWa rningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR', 51, "The class '{0}' does not h ave a constructor '{1}'"); 3642 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>:
3759 3643 * a<sub>n+kM/sub>)</i> it is a static warning if the type <i>T</i> does not
3760 /** 3644 * declare a constructor with the same name as the declaration of <i>T</i>.
3761 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then: 3645 */
3762 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;, a<sub>n< /sub>, 3646 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = const StaticWa rningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR', "The class '{0}' does not have a con structor '{1}'");
3763 * x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+k</sub >)</i> it is a 3647
3764 * static warning if <i>T.id</i> is not the name of a constructor declared by the type <i>T</i>. 3648 /**
3765 * If <i>e</i> of the form <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x< sub>n+1</sub>: 3649 * 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the
3766 * a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a st atic warning if the 3650 * current scope then:
3767 * type <i>T</i> does not declare a constructor with the same name as the decl aration of <i>T</i>. 3651 * 1. If <i>e</i> is of the form <i>new T.id(a<sub>1</sub>, &hellip;,
3768 */ 3652 * a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>:
3769 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode.con1('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 52, "The class '{0}' does not have a default constructor"); 3653 * a<sub>n+k</sub>)</i> it is a static warning if <i>T.id</i> is not the name
3770 3654 * of a constructor declared by the type <i>T</i>. If <i>e</i> of the form
3771 /** 3655 * <i>new T(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
3772 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 3656 * a<sub>n+1</sub>, &hellip;, x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a
3773 * abstract method. 3657 * static warning if the type <i>T</i> does not declare a constructor with the
3774 * 3658 * same name as the declaration of <i>T</i>.
3775 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 3659 */
3776 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 3660 static const StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = const StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', "The class '{0}' doe s not have a default constructor");
3777 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 3661
3778 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 3662 /**
3779 * 3663 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
3780 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 3664 * class inherits an abstract method.
3781 * inherited in a concrete class unless that member overrides a concrete one. 3665 *
3666 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
3667 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
3668 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
3669 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
3670 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
3671 *
3672 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
3673 * is declared or inherited in a concrete class unless that member overrides a
3674 * concrete one.
3782 * 3675 *
3783 * @param memberName the name of the first member 3676 * @param memberName the name of the first member
3784 * @param memberName the name of the second member 3677 * @param memberName the name of the second member
3785 * @param memberName the name of the third member 3678 * @param memberName the name of the third member
3786 * @param memberName the name of the fourth member 3679 * @param memberName the name of the fourth member
3787 * @param additionalCount the number of additional missing members that aren't listed 3680 * @param additionalCount the number of additional missing members that aren't
3788 */ 3681 * listed
3789 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV E_PLUS = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMB ER_FIVE_PLUS', 53, "Missing concrete implementation of {0}, {1}, {2}, {3} and {4 } more"); 3682 */
3790 3683 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIV E_PLUS = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FI VE_PLUS', "Missing concrete implementation of {0}, {1}, {2}, {3} and {4} more");
3791 /** 3684
3792 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 3685 /**
3793 * abstract method. 3686 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
3794 * 3687 * class inherits an abstract method.
3795 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 3688 *
3796 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 3689 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
3797 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 3690 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
3798 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 3691 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
3799 * 3692 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
3800 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 3693 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
3801 * inherited in a concrete class unless that member overrides a concrete one. 3694 *
3695 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
3696 * is declared or inherited in a concrete class unless that member overrides a
3697 * concrete one.
3802 * 3698 *
3803 * @param memberName the name of the first member 3699 * @param memberName the name of the first member
3804 * @param memberName the name of the second member 3700 * @param memberName the name of the second member
3805 * @param memberName the name of the third member 3701 * @param memberName the name of the third member
3806 * @param memberName the name of the fourth member 3702 * @param memberName the name of the fourth member
3807 */ 3703 */
3808 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU R = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FO UR', 54, "Missing concrete implementation of {0}, {1}, {2} and {3}"); 3704 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOU R = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', "Missing concrete implementation of {0}, {1}, {2} and {3}");
3809 3705
3810 /** 3706 /**
3811 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 3707 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
3812 * abstract method. 3708 * class inherits an abstract method.
3813 * 3709 *
3814 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 3710 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
3815 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 3711 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
3816 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 3712 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
3817 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 3713 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
3818 * 3714 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
3819 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 3715 *
3820 * inherited in a concrete class unless that member overrides a concrete one. 3716 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
3717 * is declared or inherited in a concrete class unless that member overrides a
3718 * concrete one.
3821 * 3719 *
3822 * @param memberName the name of the member 3720 * @param memberName the name of the member
3823 */ 3721 */
3824 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE ', 55, "Missing concrete implementation of {0}"); 3722 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', "M issing concrete implementation of {0}");
3825 3723
3826 /** 3724 /**
3827 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 3725 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
3828 * abstract method. 3726 * class inherits an abstract method.
3829 * 3727 *
3830 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 3728 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
3831 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 3729 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
3832 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 3730 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
3833 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 3731 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
3834 * 3732 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
3835 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 3733 *
3836 * inherited in a concrete class unless that member overrides a concrete one. 3734 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
3735 * is declared or inherited in a concrete class unless that member overrides a
3736 * concrete one.
3837 * 3737 *
3838 * @param memberName the name of the first member 3738 * @param memberName the name of the first member
3839 * @param memberName the name of the second member 3739 * @param memberName the name of the second member
3840 * @param memberName the name of the third member 3740 * @param memberName the name of the third member
3841 */ 3741 */
3842 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_T HREE', 56, "Missing concrete implementation of {0}, {1} and {2}"); 3742 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THR EE = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE' , "Missing concrete implementation of {0}, {1} and {2}");
3843 3743
3844 /** 3744 /**
3845 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an 3745 * 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract
3846 * abstract method. 3746 * class inherits an abstract method.
3847 * 3747 *
3848 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not declar e its own 3748 * 7.10 Superinterfaces: Let <i>C</i> be a concrete class that does not
3849 * <i>noSuchMethod()</i> method. It is a static warning if the implicit interf ace of <i>C</i> 3749 * declare its own <i>noSuchMethod()</i> method. It is a static warning if the
3850 * includes an instance member <i>m</i> of type <i>F</i> and <i>C</i> does not declare or inherit 3750 * implicit interface of <i>C</i> includes an instance member <i>m</i> of type
3851 * a corresponding instance member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>. 3751 * <i>F</i> and <i>C</i> does not declare or inherit a corresponding instance
3852 * 3752 * member <i>m</i> of type <i>F'</i> such that <i>F' <: F</i>.
3853 * 7.4 Abstract Instance Members: It is a static warning if an abstract member is declared or 3753 *
3854 * inherited in a concrete class unless that member overrides a concrete one. 3754 * 7.4 Abstract Instance Members: It is a static warning if an abstract member
3755 * is declared or inherited in a concrete class unless that member overrides a
3756 * concrete one.
3855 * 3757 *
3856 * @param memberName the name of the first member 3758 * @param memberName the name of the first member
3857 * @param memberName the name of the second member 3759 * @param memberName the name of the second member
3858 */ 3760 */
3859 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode.con1('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO ', 57, "Missing concrete implementation of {0} and {1}"); 3761 static const StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = const StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', "M issing concrete implementation of {0} and {1}");
3860 3762
3861 /** 3763 /**
3862 * 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 3764 * 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>,
3863 * <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 3765 * p<sub>2</sub>) s</i> or <i>on T s</i> matches an object <i>o</i> if the
3864 * is a static warning if <i>T</i> does not denote a type available in the lex ical scope of the 3766 * type of <i>o</i> is a subtype of <i>T</i>. It is a static warning if
3767 * <i>T</i> does not denote a type available in the lexical scope of the
3865 * catch clause. 3768 * catch clause.
3866 * 3769 *
3867 * @param name the name of the non-type element 3770 * @param name the name of the non-type element
3868 */ 3771 */
3869 static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningC ode.con1('NON_TYPE_IN_CATCH_CLAUSE', 58, "The name '{0}' is not a type and canno t be used in an on-catch clause"); 3772 static const StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = const StaticWarningC ode('NON_TYPE_IN_CATCH_CLAUSE', "The name '{0}' is not a type and cannot be used in an on-catch clause");
3870 3773
3871 /** 3774 /**
3872 * 7.1.1 Operators: It is a static warning if the return type of the user-decl ared operator []= is 3775 * 7.1.1 Operators: It is a static warning if the return type of the
3873 * explicitly declared and not void. 3776 * user-declared operator []= is explicitly declared and not void.
3874 */ 3777 */
3875 static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarn ingCode.con1('NON_VOID_RETURN_FOR_OPERATOR', 59, "The return type of the operato r []= must be 'void'"); 3778 static const StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = const StaticWarn ingCode('NON_VOID_RETURN_FOR_OPERATOR', "The return type of the operator []= mus t be 'void'");
3876 3779
3877 /** 3780 /**
3878 * 7.3 Setters: It is a static warning if a setter declares a return type othe r than void. 3781 * 7.3 Setters: It is a static warning if a setter declares a return type
3879 */ 3782 * other than void.
3880 static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarnin gCode.con1('NON_VOID_RETURN_FOR_SETTER', 60, "The return type of the setter must be 'void'"); 3783 */
3881 3784 static const StaticWarningCode NON_VOID_RETURN_FOR_SETTER = const StaticWarnin gCode('NON_VOID_RETURN_FOR_SETTER', "The return type of the setter must be 'void '");
3882 /** 3785
3883 * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the for m <i>id</i> or the 3786 /**
3884 * form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</ i> (respectively 3787 * 15.1 Static Types: A type <i>T</i> is malformed iff:
3885 * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type paramet er in the 3788 * * <i>T</i> has the form <i>id</i> or the form <i>prefix.id</i>, and in the
3886 * enclosing lexical scope, but occurs in the signature or body of a static me mber. * 3789 * enclosing lexical scope, the name <i>id</i> (respectively
3887 * <i>T</i> is a parameterized type of the form <i>G&lt;S<sub>1</sub>, .., S<s ub>n</sub>&gt;</i>, 3790 * <i>prefix.id</i>) does not denote a type.
3791 * * <i>T</i> denotes a type parameter in the enclosing lexical scope, but
3792 * occurs in the signature or body of a static member.
3793 * * <i>T</i> is a parameterized type of the form <i>G&lt;S<sub>1</sub>, ..,
3794 * S<sub>n</sub>&gt;</i>,
3888 * 3795 *
3889 * Any use of a malformed type gives rise to a static warning. 3796 * Any use of a malformed type gives rise to a static warning.
3890 * 3797 *
3891 * @param nonTypeName the name that is not a type 3798 * @param nonTypeName the name that is not a type
3892 */ 3799 */
3893 static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode.con1('NOT_ A_TYPE', 61, "{0} is not a type"); 3800 static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode('NOT_A_TYP E', "{0} is not a type");
3894 3801
3895 /** 3802 /**
3896 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt; 3803 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt;
3897 * n</i>. 3804 * h</i> or if <i>m &gt; n</i>.
3898 * 3805 *
3899 * @param requiredCount the expected number of required arguments 3806 * @param requiredCount the expected number of required arguments
3900 * @param argumentCount the actual number of positional arguments given 3807 * @param argumentCount the actual number of positional arguments given
3901 * @see #EXTRA_POSITIONAL_ARGUMENTS 3808 * @see [EXTRA_POSITIONAL_ARGUMENTS]
3902 */ 3809 */
3903 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWar ningCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 62, "{0} required argument(s) exp ected, but {1} found"); 3810 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWar ningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', "{0} required argument(s) expected, bu t {1} found");
3904 3811
3905 /** 3812 /**
3906 * 14.3 Parts: It is a static warning if the referenced part declaration <i>p< /i> names a library 3813 * 14.3 Parts: It is a static warning if the referenced part declaration
3907 * other than the current library as the library to which <i>p</i> belongs. 3814 * <i>p</i> names a library other than the current library as the library to
3815 * which <i>p</i> belongs.
3908 * 3816 *
3909 * @param expectedLibraryName the name of expected library name 3817 * @param expectedLibraryName the name of expected library name
3910 * @param actualLibraryName the non-matching actual library name from the "par t of" declaration 3818 * @param actualLibraryName the non-matching actual library name from the
3911 */ 3819 * "part of" declaration
3912 static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarning Code.con1('PART_OF_DIFFERENT_LIBRARY', 63, "Expected this library to be part of '{0}', not '{1}'"); 3820 */
3913 3821 static const StaticWarningCode PART_OF_DIFFERENT_LIBRARY = const StaticWarning Code('PART_OF_DIFFERENT_LIBRARY', "Expected this library to be part of '{0}', no t '{1}'");
3914 /** 3822
3915 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of 3823 /**
3916 * the type of <i>k</i>. 3824 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
3825 * is not a subtype of the type of <i>k</i>.
3917 * 3826 *
3918 * @param redirectedName the name of the redirected constructor 3827 * @param redirectedName the name of the redirected constructor
3919 * @param redirectingName the name of the redirecting constructor 3828 * @param redirectingName the name of the redirecting constructor
3920 */ 3829 */
3921 static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const Stati cWarningCode.con1('REDIRECT_TO_INVALID_FUNCTION_TYPE', 64, "The redirected const ructor '{0}' has incompatible parameters with '{1}'"); 3830 static const StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = const Stati cWarningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE', "The redirected constructor '{ 0}' has incompatible parameters with '{1}'");
3922 3831
3923 /** 3832 /**
3924 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> i s not a subtype of 3833 * 7.6.2 Factories: It is a static warning if the function type of <i>k'</i>
3925 * the type of <i>k</i>. 3834 * is not a subtype of the type of <i>k</i>.
3926 * 3835 *
3927 * @param redirectedName the name of the redirected constructor return type 3836 * @param redirectedName the name of the redirected constructor return type
3928 * @param redirectingName the name of the redirecting constructor return type 3837 * @param redirectingName the name of the redirecting constructor return type
3929 */ 3838 */
3930 static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticW arningCode.con1('REDIRECT_TO_INVALID_RETURN_TYPE', 65, "The return type '{0}' of the redirected constructor is not assignable to '{1}'"); 3839 static const StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = const StaticW arningCode('REDIRECT_TO_INVALID_RETURN_TYPE', "The return type '{0}' of the redi rected constructor is not assignable to '{1}'");
3931 3840
3932 /** 3841 /**
3933 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the 3842 * 7.6.2 Factories: It is a static warning if type does not denote a class
3934 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the 3843 * accessible in the current scope; if type does denote such a class <i>C</i>
3935 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>. 3844 * it is a static warning if the referenced constructor (be it <i>type</i> or
3936 */ 3845 * <i>type.id</i>) is not a constructor of <i>C</i>.
3937 static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticW arningCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 66, "The constructor '{0}' co uld not be found in '{1}'"); 3846 */
3938 3847 static const StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = const StaticW arningCode('REDIRECT_TO_MISSING_CONSTRUCTOR', "The constructor '{0}' could not b e found in '{1}'");
3939 /** 3848
3940 * 7.6.2 Factories: It is a static warning if type does not denote a class acc essible in the 3849 /**
3941 * current scope; if type does denote such a class <i>C</i> it is a static war ning if the 3850 * 7.6.2 Factories: It is a static warning if type does not denote a class
3942 * referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a const ructor of <i>C</i>. 3851 * accessible in the current scope; if type does denote such a class <i>C</i>
3943 */ 3852 * it is a static warning if the referenced constructor (be it <i>type</i> or
3944 static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode .con1('REDIRECT_TO_NON_CLASS', 67, "The name '{0}' is not a type and cannot be u sed in a redirected constructor"); 3853 * <i>type.id</i>) is not a constructor of <i>C</i>.
3945 3854 */
3946 /** 3855 static const StaticWarningCode REDIRECT_TO_NON_CLASS = const StaticWarningCode ('REDIRECT_TO_NON_CLASS', "The name '{0}' is not a type and cannot be used in a redirected constructor");
3947 * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return s tatement of the form 3856
3948 * <i>return;</i> It is a static warning if both of the following conditions h old: 3857 /**
3949 * <ol> 3858 * 13.12 Return: Let <i>f</i> be the function immediately enclosing a return
3859 * statement of the form <i>return;</i> It is a static warning if both of the
3860 * following conditions hold:
3950 * * <i>f</i> is not a generative constructor. 3861 * * <i>f</i> is not a generative constructor.
3951 * * The return type of <i>f</i> may not be assigned to void. 3862 * * The return type of <i>f</i> may not be assigned to void.
3952 * </ol> 3863 */
3953 */ 3864 static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode( 'RETURN_WITHOUT_VALUE', "Missing return value after 'return'");
3954 static const StaticWarningCode RETURN_WITHOUT_VALUE = const StaticWarningCode. con1('RETURN_WITHOUT_VALUE', 68, "Missing return value after 'return'"); 3865
3955 3866 /**
3956 /** 3867 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
3957 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method 3868 * declare a static method or getter <i>m</i>.
3958 * or getter <i>m</i>.
3959 * 3869 *
3960 * @param memberName the name of the instance member 3870 * @param memberName the name of the instance member
3961 */ 3871 */
3962 static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const Static WarningCode.con1('STATIC_ACCESS_TO_INSTANCE_MEMBER', 69, "Instance member '{0}' cannot be accessed using static access"); 3872 static const StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = const Static WarningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER', "Instance member '{0}' cannot be accessed using static access");
3963 3873
3964 /** 3874 /**
3965 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assi gned to the type of 3875 * 13.9 Switch: It is a static warning if the type of <i>e</i> may not be
3966 * <i>e<sub>k</sub></i>. 3876 * assigned to the type of <i>e<sub>k</sub></i>.
3967 */ 3877 */
3968 static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const Static WarningCode.con1('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 70, "Type '{0}' of the swit ch expression is not assignable to the type '{1}' of case expressions"); 3878 static const StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = const Static WarningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE', "Type '{0}' of the switch expres sion is not assignable to the type '{1}' of case expressions");
3969 3879
3970 /** 3880 /**
3971 * 15.1 Static Types: It is a static warning to use a deferred type in a type annotation. 3881 * 15.1 Static Types: It is a static warning to use a deferred type in a type
3972 * 3882 * annotation.
3973 * @param name the name of the type that is deferred and being used in a type annotation 3883 *
3974 */ 3884 * @param name the name of the type that is deferred and being used in a type
3975 static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS = const StaticWa rningCode.con1('TYPE_ANNOTATION_DEFERRED_CLASS', 71, "The deferred type '{0}' ca nnot be used in a declaration, cast or type test"); 3885 * annotation
3976 3886 */
3977 /** 3887 static const StaticWarningCode TYPE_ANNOTATION_DEFERRED_CLASS = const StaticWa rningCode('TYPE_ANNOTATION_DEFERRED_CLASS', "The deferred type '{0}' cannot be u sed in a declaration, cast or type test");
3978 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type available in the 3888
3979 * current lexical scope. 3889 /**
3980 */ 3890 * 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type
3981 static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode.co n1('TYPE_TEST_NON_TYPE', 72, "The name '{0}' is not a type and cannot be used in an 'is' expression"); 3891 * available in the current lexical scope.
3982 3892 */
3983 /** 3893 static const StaticWarningCode TYPE_TEST_NON_TYPE = const StaticWarningCode('T YPE_TEST_NON_TYPE', "The name '{0}' is not a type and cannot be used in an 'is' expression");
3984 * 10 Generics: However, a type parameter is considered to be a malformed type when referenced by 3894
3985 * a static member. 3895 /**
3986 * 3896 * 10 Generics: However, a type parameter is considered to be a malformed type
3987 * 15.1 Static Types: Any use of a malformed type gives rise to a static warni ng. A malformed type 3897 * when referenced by a static member.
3988 * is then interpreted as dynamic by the static type checker and the runtime. 3898 *
3989 */ 3899 * 15.1 Static Types: Any use of a malformed type gives rise to a static
3990 static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const Sta ticWarningCode.con1('TYPE_PARAMETER_REFERENCED_BY_STATIC', 73, "Static members c annot reference type parameters"); 3900 * warning. A malformed type is then interpreted as dynamic by the static type
3901 * checker and the runtime.
3902 */
3903 static const StaticWarningCode TYPE_PARAMETER_REFERENCED_BY_STATIC = const Sta ticWarningCode('TYPE_PARAMETER_REFERENCED_BY_STATIC', "Static members cannot ref erence type parameters");
3991 3904
3992 /** 3905 /**
3993 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form 3906 * 12.16.3 Static Invocation: A static method invocation <i>i</i> has the form
3994 * <i>C.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</ sub>, &hellip; 3907 * <i>C.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>:
3995 * 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 3908 * a<sub>n+1</sub>, &hellip; x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a
3996 * class in the current scope. 3909 * static warning if <i>C</i> does not denote a class in the current scope.
3997 * 3910 *
3998 * @param undefinedClassName the name of the undefined class 3911 * @param undefinedClassName the name of the undefined class
3999 */ 3912 */
4000 static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode.con1( 'UNDEFINED_CLASS', 74, "Undefined class '{0}'"); 3913 static const StaticWarningCode UNDEFINED_CLASS = const StaticWarningCode('UNDE FINED_CLASS', "Undefined class '{0}'");
4001 3914
4002 /** 3915 /**
4003 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool". 3916 * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool".
4004 */ 3917 */
4005 static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCo de.con1('UNDEFINED_CLASS_BOOLEAN', 75, "Undefined class 'boolean'; did you mean 'bool'?"); 3918 static const StaticWarningCode UNDEFINED_CLASS_BOOLEAN = const StaticWarningCo de('UNDEFINED_CLASS_BOOLEAN', "Undefined class 'boolean'; did you mean 'bool'?") ;
4006 3919
4007 /** 3920 /**
4008 * 12.17 Getter Invocation: It is a static warning if there is no class <i>C</ i> in the enclosing 3921 * 12.17 Getter Invocation: It is a static warning if there is no class
4009 * lexical scope of <i>i</i>, or if <i>C</i> does not declare, implicitly or e xplicitly, a getter 3922 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does
4010 * named <i>m</i>. 3923 * not declare, implicitly or explicitly, a getter named <i>m</i>.
4011 * 3924 *
4012 * @param getterName the name of the getter 3925 * @param getterName the name of the getter
4013 * @param enclosingType the name of the enclosing type where the getter is bei ng looked for 3926 * @param enclosingType the name of the enclosing type where the getter is
4014 */ 3927 * being looked for
4015 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode.con1 ('UNDEFINED_GETTER', 76, "There is no such getter '{0}' in '{1}'"); 3928 */
4016 3929 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode('UND EFINED_GETTER', "There is no such getter '{0}' in '{1}'");
4017 /** 3930
4018 * 12.30 Identifier Reference: It is as static warning if an identifier expres sion of the form 3931 /**
4019 * <i>id</i> occurs inside a top level or static function (be it function, met hod, getter, or 3932 * 12.30 Identifier Reference: It is as static warning if an identifier
4020 * setter) or variable initializer and there is no declaration <i>d</i> with n ame <i>id</i> in the 3933 * expression of the form <i>id</i> occurs inside a top level or static
3934 * function (be it function, method, getter, or setter) or variable
3935 * initializer and there is no declaration <i>d</i> with name <i>id</i> in the
4021 * lexical scope enclosing the expression. 3936 * lexical scope enclosing the expression.
4022 * 3937 *
4023 * @param name the name of the identifier 3938 * @param name the name of the identifier
4024 */ 3939 */
4025 static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode. con1('UNDEFINED_IDENTIFIER', 77, "Undefined name '{0}'"); 3940 static const StaticWarningCode UNDEFINED_IDENTIFIER = const StaticWarningCode( 'UNDEFINED_IDENTIFIER', "Undefined name '{0}'");
4026 3941
4027 /** 3942 /**
4028 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, 3943 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>,
4029 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > &hellip; 3944 * <i>1<=i<=l</i>, must have a corresponding named parameter in the set
4030 * <i>p<sub>n+k</sub></i>} or a static warning occurs. 3945 * {<i>p<sub>n+1</sub></i> &hellip; <i>p<sub>n+k</sub></i>} or a static
3946 * warning occurs.
4031 * 3947 *
4032 * @param name the name of the requested named parameter 3948 * @param name the name of the requested named parameter
4033 */ 3949 */
4034 static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarning Code.con1('UNDEFINED_NAMED_PARAMETER', 78, "The named parameter '{0}' is not def ined"); 3950 static const StaticWarningCode UNDEFINED_NAMED_PARAMETER = const StaticWarning Code('UNDEFINED_NAMED_PARAMETER', "The named parameter '{0}' is not defined");
4035 3951
4036 /** 3952 /**
4037 * 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs 3953 * 12.18 Assignment: It is as static warning if an assignment of the form
4038 * inside a top level or static function (be it function, method, getter, or s etter) or variable 3954 * <i>v = e</i> occurs inside a top level or static function (be it function,
4039 * initializer and there is no declaration <i>d</i> with name <i>v=</i> in the lexical scope 3955 * method, getter, or setter) or variable initializer and there is no
4040 * enclosing the assignment. 3956 * declaration <i>d</i> with name <i>v=</i> in the lexical scope enclosing the
4041 * 3957 * assignment.
4042 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in t he enclosing lexical 3958 *
4043 * scope of the assignment, or if <i>C</i> does not declare, implicitly or exp licitly, a setter 3959 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in
4044 * <i>v=</i>. 3960 * the enclosing lexical scope of the assignment, or if <i>C</i> does not
3961 * declare, implicitly or explicitly, a setter <i>v=</i>.
4045 * 3962 *
4046 * @param setterName the name of the getter 3963 * @param setterName the name of the getter
4047 * @param enclosingType the name of the enclosing type where the setter is bei ng looked for 3964 * @param enclosingType the name of the enclosing type where the setter is
4048 */ 3965 * being looked for
4049 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode.con1 ('UNDEFINED_SETTER', 79, "There is no such setter '{0}' in '{1}'"); 3966 */
4050 3967 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode('UND EFINED_SETTER', "There is no such setter '{0}' in '{1}'");
4051 /** 3968
4052 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not decl are a static method 3969 /**
4053 * or getter <i>m</i>. 3970 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not
3971 * declare a static method or getter <i>m</i>.
4054 * 3972 *
4055 * @param methodName the name of the method 3973 * @param methodName the name of the method
4056 * @param enclosingType the name of the enclosing type where the method is bei ng looked for 3974 * @param enclosingType the name of the enclosing type where the method is
4057 */ 3975 * being looked for
4058 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const Stati cWarningCode.con1('UNDEFINED_STATIC_METHOD_OR_GETTER', 80, "There is no such sta tic method, getter or setter '{0}' in '{1}'"); 3976 */
3977 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = const Stati cWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', "There is no such static metho d, getter or setter '{0}' in '{1}'");
4059 3978
4060 /** 3979 /**
4061 * 7.2 Getters: It is a static warning if the return type of a getter is void. 3980 * 7.2 Getters: It is a static warning if the return type of a getter is void.
4062 */ 3981 */
4063 static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCod e.con1('VOID_RETURN_FOR_GETTER', 81, "The return type of the getter must not be 'void'"); 3982 static const StaticWarningCode VOID_RETURN_FOR_GETTER = const StaticWarningCod e('VOID_RETURN_FOR_GETTER', "The return type of the getter must not be 'void'");
4064 3983
4065 static const List<StaticWarningCode> values = const [ 3984 /**
4066 AMBIGUOUS_IMPORT, 3985 * Initialize a newly created error code to have the given [name]. The message
4067 ARGUMENT_TYPE_NOT_ASSIGNABLE, 3986 * associated with the error will be created from the given [message]
4068 ASSIGNMENT_TO_CONST, 3987 * template. The correction associated with the error will be created from the
4069 ASSIGNMENT_TO_FINAL, 3988 * given [correction] template.
4070 ASSIGNMENT_TO_FINAL_NO_SETTER, 3989 */
4071 ASSIGNMENT_TO_FUNCTION, 3990 const StaticWarningCode(String name, String message, [String correction]) : su per(name, message, correction);
4072 ASSIGNMENT_TO_METHOD,
4073 CASE_BLOCK_NOT_TERMINATED,
4074 CAST_TO_NON_TYPE,
4075 CONCRETE_CLASS_WITH_ABSTRACT_MEMBER,
4076 CONFLICTING_DART_IMPORT,
4077 CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
4078 CONFLICTING_INSTANCE_METHOD_SETTER,
4079 CONFLICTING_INSTANCE_METHOD_SETTER2,
4080 CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER,
4081 CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER,
4082 CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER,
4083 CONST_WITH_ABSTRACT_CLASS,
4084 EQUAL_KEYS_IN_MAP,
4085 EXPORT_DUPLICATED_LIBRARY_NAME,
4086 EXTRA_POSITIONAL_ARGUMENTS,
4087 FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION,
4088 FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR,
4089 FIELD_INITIALIZER_NOT_ASSIGNABLE,
4090 FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE,
4091 FINAL_NOT_INITIALIZED,
4092 FUNCTION_WITHOUT_CALL,
4093 IMPORT_DUPLICATED_LIBRARY_NAME,
4094 IMPORT_OF_NON_LIBRARY,
4095 INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD,
4096 INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC,
4097 INVALID_GETTER_OVERRIDE_RETURN_TYPE,
4098 INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE,
4099 INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE,
4100 INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE,
4101 INVALID_METHOD_OVERRIDE_RETURN_TYPE,
4102 INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED,
4103 INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL,
4104 INVALID_OVERRIDE_NAMED,
4105 INVALID_OVERRIDE_POSITIONAL,
4106 INVALID_OVERRIDE_REQUIRED,
4107 INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE,
4108 LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
4109 MAP_KEY_TYPE_NOT_ASSIGNABLE,
4110 MAP_VALUE_TYPE_NOT_ASSIGNABLE,
4111 MISMATCHED_GETTER_AND_SETTER_TYPES,
4112 MISMATCHED_GETTER_AND_SETTER_TYPES_FROM_SUPERTYPE,
4113 MIXED_RETURN_TYPES,
4114 NEW_WITH_ABSTRACT_CLASS,
4115 NEW_WITH_INVALID_TYPE_PARAMETERS,
4116 NEW_WITH_NON_TYPE,
4117 NEW_WITH_UNDEFINED_CONSTRUCTOR,
4118 NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
4119 NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS,
4120 NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR,
4121 NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE,
4122 NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE,
4123 NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO,
4124 NON_TYPE_IN_CATCH_CLAUSE,
4125 NON_VOID_RETURN_FOR_OPERATOR,
4126 NON_VOID_RETURN_FOR_SETTER,
4127 NOT_A_TYPE,
4128 NOT_ENOUGH_REQUIRED_ARGUMENTS,
4129 PART_OF_DIFFERENT_LIBRARY,
4130 REDIRECT_TO_INVALID_FUNCTION_TYPE,
4131 REDIRECT_TO_INVALID_RETURN_TYPE,
4132 REDIRECT_TO_MISSING_CONSTRUCTOR,
4133 REDIRECT_TO_NON_CLASS,
4134 RETURN_WITHOUT_VALUE,
4135 STATIC_ACCESS_TO_INSTANCE_MEMBER,
4136 SWITCH_EXPRESSION_NOT_ASSIGNABLE,
4137 TYPE_ANNOTATION_DEFERRED_CLASS,
4138 TYPE_TEST_NON_TYPE,
4139 TYPE_PARAMETER_REFERENCED_BY_STATIC,
4140 UNDEFINED_CLASS,
4141 UNDEFINED_CLASS_BOOLEAN,
4142 UNDEFINED_GETTER,
4143 UNDEFINED_IDENTIFIER,
4144 UNDEFINED_NAMED_PARAMETER,
4145 UNDEFINED_SETTER,
4146 UNDEFINED_STATIC_METHOD_OR_GETTER,
4147 VOID_RETURN_FOR_GETTER];
4148
4149 /**
4150 * The template used to create the message to be displayed for this error.
4151 */
4152 final String message;
4153
4154 /**
4155 * The template used to create the correction to be displayed for this error, or `null` if
4156 * there is no correction information for this error.
4157 */
4158 final String correction;
4159
4160 /**
4161 * Initialize a newly created error code to have the given message.
4162 *
4163 * @param message the message template used to create the message to be displa yed for the error
4164 */
4165 const StaticWarningCode.con1(String name, int ordinal, String message) : this. con2(name, ordinal, message, null);
4166
4167 /**
4168 * Initialize a newly created error code to have the given message and correct ion.
4169 *
4170 * @param message the template used to create the message to be displayed for the error
4171 * @param correction the template used to create the correction to be displaye d for the error
4172 */
4173 const StaticWarningCode.con2(String name, int ordinal, this.message, this.corr ection) : super(name, ordinal);
4174 3991
4175 @override 3992 @override
4176 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity; 3993 ErrorSeverity get errorSeverity => ErrorType.STATIC_WARNING.severity;
4177 3994
4178 @override 3995 @override
4179 ErrorType get type => ErrorType.STATIC_WARNING; 3996 ErrorType get type => ErrorType.STATIC_WARNING;
4180
4181 @override
4182 String get uniqueName => "$runtimeType.$name";
4183 } 3997 }
4184 3998
4185 /** 3999 /**
4186 * The enumeration `TodoCode` defines the single TODO `ErrorCode`. 4000 * The class `TodoCode` defines the single TODO error code.
4187 */ 4001 */
4188 class TodoCode extends Enum<TodoCode> implements ErrorCode { 4002 class TodoCode extends ErrorCode {
4189 /** 4003 /**
4190 * The single enum of TodoCode. 4004 * The single enum of TodoCode.
4191 */ 4005 */
4192 static const TodoCode TODO = const TodoCode('TODO', 0); 4006 static const TodoCode TODO = const TodoCode('TODO');
4193
4194 static const List<TodoCode> values = const [TODO];
4195 4007
4196 /** 4008 /**
4197 * This matches the two common Dart task styles 4009 * This matches the two common Dart task styles
4198 * 4010 *
4199 * * TODO: 4011 * * TODO:
4200 * * TODO(username): 4012 * * TODO(username):
4201 * 4013 *
4202 * As well as 4014 * As well as
4203 * * TODO 4015 * * TODO
4204 * 4016 *
4205 * But not 4017 * But not
4206 * * todo 4018 * * todo
4207 * * TODOS 4019 * * TODOS
4208 */ 4020 */
4209 static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|( TODO:?\$))"); 4021 static RegExp TODO_REGEX = new RegExp("([\\s/\\*])((TODO[^\\w\\d][^\\r\\n]*)|( TODO:?\$))");
4210 4022
4211 const TodoCode(String name, int ordinal) : super(name, ordinal); 4023 /**
4212 4024 * Initialize a newly created error code to have the given [name].
4213 @override 4025 */
4214 String get correction => null; 4026 const TodoCode(String name) : super(name, "{0}");
4215 4027
4216 @override 4028 @override
4217 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; 4029 ErrorSeverity get errorSeverity => ErrorSeverity.INFO;
4218 4030
4219 @override 4031 @override
4220 String get message => "{0}";
4221
4222 @override
4223 ErrorType get type => ErrorType.TODO; 4032 ErrorType get type => ErrorType.TODO;
4224
4225 @override
4226 String get uniqueName => "$runtimeType.$name";
4227 } 4033 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/enum_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698