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

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

Issue 622743002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.error; 8 library engine.error;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 */ 376 */
377 bool get errorReported => _errorReported; 377 bool get errorReported => _errorReported;
378 378
379 @override 379 @override
380 void onError(AnalysisError error) { 380 void onError(AnalysisError error) {
381 _errorReported = true; 381 _errorReported = true;
382 } 382 }
383 } 383 }
384 384
385 /** 385 /**
386 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time errors
387 * caused by constant evaluation that would throw an exception when run in check ed mode. The client
388 * of the analysis engine is responsible for determining how these errors should be presented to the
389 * user (for example, a command-line compiler might elect to treat these errors differently
390 * depending whether it is compiling it "checked" mode).
391 */
392 class CheckedModeCompileTimeErrorCode extends Enum<CheckedModeCompileTimeErrorCo de> implements ErrorCode {
393 /**
394 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not
395 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of
396 * the field <i>v</i>.
397 *
398 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
399 * uncaught exception being thrown.
400 *
401 * @param initializerType the name of the type of the initializer expression
402 * @param fieldType the name of the type of the field
403 */
404 static const CheckedModeCompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIG NABLE = const CheckedModeCompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ ASSIGNABLE', 0, "The initializer type '{0}' cannot be assigned to the field type '{1}'");
405
406 /**
407 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
408 * <i>e<sub>n</sub></i>] is evaluated as follows:
409 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument
410 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
411 *
412 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
413 * <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;=
414 * 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>.
415 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
416 * j &lt;= m</i>.
417 */
418 static const CheckedModeCompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const CheckedModeCompileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 1, "The element type '{0}' cannot be assigned to the list type '{1}'");
419
420 /**
421 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
422 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
423 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
424 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
425 *
426 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
427 * <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;=
428 * 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>.
429 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
430 * j &lt;= m</i>.
431 */
432 static const CheckedModeCompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = con st CheckedModeCompileTimeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 2, "The e lement type '{0}' cannot be assigned to the map key type '{1}'");
433
434 /**
435 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
436 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
437 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
438 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
439 *
440 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
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;=
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>.
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;=
444 * j &lt;= m</i>.
445 */
446 static const CheckedModeCompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = c onst CheckedModeCompileTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 3, "T he element type '{0}' cannot be assigned to the map value type '{1}'");
447
448 static const List<CheckedModeCompileTimeErrorCode> values = const [
449 CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
450 LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
451 MAP_KEY_TYPE_NOT_ASSIGNABLE,
452 MAP_VALUE_TYPE_NOT_ASSIGNABLE];
453
454 /**
455 * The template used to create the message to be displayed for this error.
456 */
457 final String message;
458
459 /**
460 * The template used to create the correction to be displayed for this error, or `null` if
461 * there is no correction information for this error.
462 */
463 final String correction;
464
465 /**
466 * Initialize a newly created error code to have the given message.
467 *
468 * @param message the message template used to create the message to be displa yed for the error
469 */
470 const CheckedModeCompileTimeErrorCode.con1(String name, int ordinal, String me ssage) : this.con2(name, ordinal, message, null);
471
472 /**
473 * Initialize a newly created error code to have the given message and correct ion.
474 *
475 * @param message the template used to create the message to be displayed for the error
476 * @param correction the template used to create the correction to be displaye d for the error
477 */
478 const CheckedModeCompileTimeErrorCode.con2(String name, int ordinal, this.mess age, this.correction) : super(name, ordinal);
479
480 @override
481 ErrorSeverity get errorSeverity => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR.s everity;
482
483 @override
484 ErrorType get type => ErrorType.CHECKED_MODE_COMPILE_TIME_ERROR;
485
486 @override
487 String get uniqueName => "${runtimeType.toString()}.${name}";
488 }
489
490 /**
386 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time 491 * The enumeration `CompileTimeErrorCode` defines the error codes used for compi le time
387 * errors. The convention for this class is for the name of the error code to in dicate the problem 492 * errors. The convention for this class is for the name of the error code to in dicate the problem
388 * that caused the error to be generated and for the error message to explain wh at is wrong and, 493 * that caused the error to be generated and for the error message to explain wh at is wrong and,
389 * when appropriate, how the problem can be corrected. 494 * when appropriate, how the problem can be corrected.
390 */ 495 */
391 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo de { 496 class CompileTimeErrorCode extends Enum<CompileTimeErrorCode> implements ErrorCo de {
392 /** 497 /**
393 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or 498 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or
394 * 'const' or to access its private fields. 499 * 'const' or to access its private fields.
395 */ 500 */
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 * The above refers to both locally declared and inherited instance variables. 646 * The above refers to both locally declared and inherited instance variables.
542 */ 647 */
543 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"); 648 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");
544 649
545 /** 650 /**
546 * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type. 651 * 12.12.2 Const: It is a compile-time error if <i>T</i> is a deferred type.
547 */ 652 */
548 static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErro rCode.con1('CONST_DEFERRED_CLASS', 22, "Deferred classes cannot be created with 'const'"); 653 static const CompileTimeErrorCode CONST_DEFERRED_CLASS = const CompileTimeErro rCode.con1('CONST_DEFERRED_CLASS', 22, "Deferred classes cannot be created with 'const'");
549 654
550 /** 655 /**
551 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not
552 * <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of
553 * the field <i>v</i>.
554 *
555 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
556 * uncaught exception being thrown.
557 *
558 * @param initializerType the name of the type of the initializer expression
559 * @param fieldType the name of the type of the field
560 */
561 static const CompileTimeErrorCode CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE = con st CompileTimeErrorCode.con1('CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE', 23, "The initializer type '{0}' cannot be assigned to the field type '{1}'");
562
563 /**
564 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a 656 * 6.2 Formal Parameters: It is a compile-time error if a formal parameter is declared as a
565 * constant variable. 657 * constant variable.
566 */ 658 */
567 static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeEr rorCode.con1('CONST_FORMAL_PARAMETER', 24, "Parameters cannot be 'const'"); 659 static const CompileTimeErrorCode CONST_FORMAL_PARAMETER = const CompileTimeEr rorCode.con1('CONST_FORMAL_PARAMETER', 23, "Parameters cannot be 'const'");
568 660
569 /** 661 /**
570 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a 662 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a
571 * compile-time error occurs. 663 * compile-time error occurs.
572 */ 664 */
573 static const CompileTimeErrorCode CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE = const CompileTimeErrorCode.con1('CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE', 25, "'const' variables must be constant value"); 665 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");
574 666
575 /** 667 /**
576 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a 668 * 5 Variables: A constant variable must be initialized to a compile-time cons tant or a
577 * compile-time error occurs. 669 * compile-time error occurs.
578 * 670 *
579 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 671 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
580 * deferred prefix. 672 * deferred prefix.
581 */ 673 */
582 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', 26, "Constant values from a deferred li brary cannot be used to initialized a 'const' variable"); 674 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");
583 675
584 /** 676 /**
585 * 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be 677 * 7.5 Instance Variables: It is a compile-time error if an instance variable is declared to be
586 * constant. 678 * constant.
587 */ 679 */
588 static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErro rCode.con1('CONST_INSTANCE_FIELD', 27, "Only static fields can be declared as 'c onst'"); 680 static const CompileTimeErrorCode CONST_INSTANCE_FIELD = const CompileTimeErro rCode.con1('CONST_INSTANCE_FIELD', 26, "Only static fields can be declared as 'c onst'");
589 681
590 /** 682 /**
591 * 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an 683 * 12.8 Maps: It is a compile-time error if the key of an entry in a constant map literal is an
592 * instance of a class that implements the operator <i>==</i> unless the key i s a string or 684 * instance of a class that implements the operator <i>==</i> unless the key i s a string or
593 * integer. 685 * integer.
594 */ 686 */
595 static const CompileTimeErrorCode CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQU ALS = const CompileTimeErrorCode.con1('CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_ EQUALS', 28, "The constant map entry key expression type '{0}' cannot override t he == operator"); 687 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");
596 688
597 /** 689 /**
598 * 5 Variables: A constant variable must be initialized to a compile-time cons tant (12.1) or a 690 * 5 Variables: A constant variable must be initialized to a compile-time cons tant (12.1) or a
599 * compile-time error occurs. 691 * compile-time error occurs.
600 * 692 *
601 * @param name the name of the uninitialized final variable 693 * @param name the name of the uninitialized final variable
602 */ 694 */
603 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErr orCode.con1('CONST_NOT_INITIALIZED', 29, "The const variable '{0}' must be initi alized"); 695 static const CompileTimeErrorCode CONST_NOT_INITIALIZED = const CompileTimeErr orCode.con1('CONST_NOT_INITIALIZED', 28, "The const variable '{0}' must be initi alized");
604 696
605 /** 697 /**
606 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2 698 * 12.11.2 Const: An expression of one of the forms !e, e1 && e2 or e1 || e2, where e, e1 and e2
607 * are constant expressions that evaluate to a boolean value. 699 * are constant expressions that evaluate to a boolean value.
608 */ 700 */
609 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErro rCode.con1('CONST_EVAL_TYPE_BOOL', 30, "An expression of type 'bool' was expecte d"); 701 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL = const CompileTimeErro rCode.con1('CONST_EVAL_TYPE_BOOL', 29, "An expression of type 'bool' was expecte d");
610 702
611 /** 703 /**
612 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are 704 * 12.11.2 Const: An expression of one of the forms e1 == e2 or e1 != e2 where e1 and e2 are
613 * constant expressions that evaluate to a numeric, string or boolean value or to null. 705 * constant expressions that evaluate to a numeric, string or boolean value or to null.
614 */ 706 */
615 static const CompileTimeErrorCode CONST_EVAL_TYPE_BOOL_NUM_STRING = const Comp ileTimeErrorCode.con1('CONST_EVAL_TYPE_BOOL_NUM_STRING', 31, "An expression of t ype 'bool', 'num', 'String' or 'null' was expected"); 707 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");
616 708
617 /** 709 /**
618 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1 710 * 12.11.2 Const: An expression of one of the forms ~e, e1 ^ e2, e1 & e2, e1 | e2, e1 >> e2 or e1
619 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte ger value or to 711 * << e2, where e, e1 and e2 are constant expressions that evaluate to an inte ger value or to
620 * null. 712 * null.
621 */ 713 */
622 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeError Code.con1('CONST_EVAL_TYPE_INT', 32, "An expression of type 'int' was expected") ; 714 static const CompileTimeErrorCode CONST_EVAL_TYPE_INT = const CompileTimeError Code.con1('CONST_EVAL_TYPE_INT', 31, "An expression of type 'int' was expected") ;
623 715
624 /** 716 /**
625 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/ 717 * 12.11.2 Const: An expression of one of the forms e, e1 + e2, e1 - e2, e1 * e2, e1 / e2, e1 ~/
626 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant 718 * e2, e1 > e2, e1 < e2, e1 >= e2, e1 <= e2 or e1 % e2, where e, e1 and e2 are constant
627 * expressions that evaluate to a numeric value or to null.. 719 * expressions that evaluate to a numeric value or to null..
628 */ 720 */
629 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeError Code.con1('CONST_EVAL_TYPE_NUM', 33, "An expression of type 'num' was expected") ; 721 static const CompileTimeErrorCode CONST_EVAL_TYPE_NUM = const CompileTimeError Code.con1('CONST_EVAL_TYPE_NUM', 32, "An expression of type 'num' was expected") ;
630 722
631 /** 723 /**
632 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 724 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
633 * uncaught exception being thrown. 725 * uncaught exception being thrown.
634 */ 726 */
635 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileT imeErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 34, "Evaluation of this constan t expression causes exception"); 727 static const CompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = const CompileT imeErrorCode.con1('CONST_EVAL_THROWS_EXCEPTION', 33, "Evaluation of this constan t expression causes exception");
636 728
637 /** 729 /**
638 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 730 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
639 * uncaught exception being thrown. 731 * uncaught exception being thrown.
640 */ 732 */
641 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE rrorCode.con1('CONST_EVAL_THROWS_IDBZE', 35, "Evaluation of this constant expres sion throws IntegerDivisionByZeroException"); 733 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE rrorCode.con1('CONST_EVAL_THROWS_IDBZE', 34, "Evaluation of this constant expres sion throws IntegerDivisionByZeroException");
642 734
643 /** 735 /**
644 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, & hellip;, 736 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S&lt;U<sub>1</sub>, & hellip;,
645 * U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time error if <i>S </i> is not a 737 * U<sub>m</sub>&gt;</i>, let <i>R = S</i>; It is a compile time error if <i>S </i> is not a
646 * generic type with <i>m</i> type parameters. 738 * generic type with <i>m</i> type parameters.
647 * 739 *
648 * @param typeName the name of the type being referenced (<i>S</i>) 740 * @param typeName the name of the type being referenced (<i>S</i>)
649 * @param parameterCount the number of type parameters that were declared 741 * @param parameterCount the number of type parameters that were declared
650 * @param argumentCount the number of type arguments provided 742 * @param argumentCount the number of type arguments provided
651 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS 743 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS
652 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS 744 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS
653 */ 745 */
654 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const C ompileTimeErrorCode.con1('CONST_WITH_INVALID_TYPE_PARAMETERS', 36, "The type '{0 }' is declared with {1} type parameters, but {2} type arguments were given"); 746 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");
655 747
656 /** 748 /**
657 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip ;, a<sub>n</sub>, 749 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, &hellip ;, a<sub>n</sub>,
658 * 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 750 * 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
659 * compile-time error if the type <i>T</i> does not declare a constant constru ctor with the same 751 * compile-time error if the type <i>T</i> does not declare a constant constru ctor with the same
660 * name as the declaration of <i>T</i>. 752 * name as the declaration of <i>T</i>.
661 */ 753 */
662 static const CompileTimeErrorCode CONST_WITH_NON_CONST = const CompileTimeErro rCode.con1('CONST_WITH_NON_CONST', 37, "The constructor being called is not a 'c onst' constructor"); 754 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");
663 755
664 /** 756 /**
665 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i> a<sub>i</sub>, 1 757 * 12.11.2 Const: In all of the above cases, it is a compile-time error if <i> a<sub>i</sub>, 1
666 * &lt;= i &lt;= n + k</i>, is not a compile-time constant expression. 758 * &lt;= i &lt;= n + k</i>, is not a compile-time constant expression.
667 */ 759 */
668 static const CompileTimeErrorCode CONST_WITH_NON_CONSTANT_ARGUMENT = const Com pileTimeErrorCode.con1('CONST_WITH_NON_CONSTANT_ARGUMENT', 38, "Arguments of a c onstant creation must be constant expressions"); 760 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");
669 761
670 /** 762 /**
671 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current 763 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current
672 * scope, optionally followed by type arguments. 764 * scope, optionally followed by type arguments.
673 * 765 *
674 * 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>, 766 * 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>,
675 * 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 767 * 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
676 * compile-time error if <i>T</i> is not a class accessible in the current sco pe, optionally 768 * compile-time error if <i>T</i> is not a class accessible in the current sco pe, optionally
677 * followed by type arguments. 769 * followed by type arguments.
678 * 770 *
679 * @param name the name of the non-type element 771 * @param name the name of the non-type element
680 */ 772 */
681 static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeError Code.con1('CONST_WITH_NON_TYPE', 39, "The name '{0}' is not a class"); 773 static const CompileTimeErrorCode CONST_WITH_NON_TYPE = const CompileTimeError Code.con1('CONST_WITH_NON_TYPE', 38, "The name '{0}' is not a class");
682 774
683 /** 775 /**
684 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par ameters. 776 * 12.11.2 Const: It is a compile-time error if <i>T</i> includes any type par ameters.
685 */ 777 */
686 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTi meErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 40, "The constant creation cannot use a type parameter"); 778 static const CompileTimeErrorCode CONST_WITH_TYPE_PARAMETERS = const CompileTi meErrorCode.con1('CONST_WITH_TYPE_PARAMETERS', 39, "The constant creation cannot use a type parameter");
687 779
688 /** 780 /**
689 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant 781 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
690 * constructor declared by the type <i>T</i>. 782 * constructor declared by the type <i>T</i>.
691 * 783 *
692 * @param typeName the name of the type 784 * @param typeName the name of the type
693 * @param constructorName the name of the requested constant constructor 785 * @param constructorName the name of the requested constant constructor
694 */ 786 */
695 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR = const Com pileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR', 41, "The class '{0}' does not have a constant constructor '{1}'"); 787 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}'");
696 788
697 /** 789 /**
698 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant 790 * 12.11.2 Const: It is a compile-time error if <i>T.id</i> is not the name of a constant
699 * constructor declared by the type <i>T</i>. 791 * constructor declared by the type <i>T</i>.
700 * 792 *
701 * @param typeName the name of the type 793 * @param typeName the name of the type
702 */ 794 */
703 static const CompileTimeErrorCode CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = c onst CompileTimeErrorCode.con1('CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 42, " The class '{0}' does not have a default constant constructor"); 795 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");
704 796
705 /** 797 /**
706 * 15.3.1 Typedef: It is a compile-time error if any default values are specif ied in the signature 798 * 15.3.1 Typedef: It is a compile-time error if any default values are specif ied in the signature
707 * of a function type alias. 799 * of a function type alias.
708 */ 800 */
709 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS', 43, "Default values aren't allowed in typedefs"); 801 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");
710 802
711 /** 803 /**
712 * 6.2.1 Required Formals: By means of a function signature that names the par ameter and describes 804 * 6.2.1 Required Formals: By means of a function signature that names the par ameter and describes
713 * its type as a function type. It is a compile-time error if any default valu es are specified in 805 * its type as a function type. It is a compile-time error if any default valu es are specified in
714 * the signature of such a function type. 806 * the signature of such a function type.
715 */ 807 */
716 static const CompileTimeErrorCode DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_FUNCTION_TYPED_PARAMETER', 44, "Default values aren't allowed in function type parameters"); 808 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");
717 809
718 /** 810 /**
719 * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifie s a default value 811 * 7.6.2 Factories: It is a compile-time error if <i>k</i> explicitly specifie s a default value
720 * for an optional parameter. 812 * for an optional parameter.
721 */ 813 */
722 static const CompileTimeErrorCode DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CONSTRU CTOR = const CompileTimeErrorCode.con1('DEFAULT_VALUE_IN_REDIRECTING_FACTORY_CON STRUCTOR', 45, "Default values aren't allowed in factory constructors that redir ect to another constructor"); 814 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");
723 815
724 /** 816 /**
725 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 817 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name
726 * declared in the same scope. 818 * declared in the same scope.
727 */ 819 */
728 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const Compil eTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 46, "The default constructo r is already defined"); 820 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_DEFAULT = const Compil eTimeErrorCode.con1('DUPLICATE_CONSTRUCTOR_DEFAULT', 45, "The default constructo r is already defined");
729 821
730 /** 822 /**
731 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 823 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name
732 * declared in the same scope. 824 * declared in the same scope.
733 * 825 *
734 * @param duplicateName the name of the duplicate entity 826 * @param duplicateName the name of the duplicate entity
735 */ 827 */
736 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTi meErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 47, "The constructor with name '{ 0}' is already defined"); 828 static const CompileTimeErrorCode DUPLICATE_CONSTRUCTOR_NAME = const CompileTi meErrorCode.con1('DUPLICATE_CONSTRUCTOR_NAME', 46, "The constructor with name '{ 0}' is already defined");
737 829
738 /** 830 /**
739 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name 831 * 3.1 Scoping: It is a compile-time error if there is more than one entity wi th the same name
740 * declared in the same scope. 832 * declared in the same scope.
741 * 833 *
742 * 7 Classes: It is a compile-time error if a class declares two members of th e same name. 834 * 7 Classes: It is a compile-time error if a class declares two members of th e same name.
743 * 835 *
744 * 7 Classes: It is a compile-time error if a class has an instance member and a static member 836 * 7 Classes: It is a compile-time error if a class has an instance member and a static member
745 * with the same name. 837 * with the same name.
746 * 838 *
747 * @param duplicateName the name of the duplicate entity 839 * @param duplicateName the name of the duplicate entity
748 */ 840 */
749 static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErro rCode.con1('DUPLICATE_DEFINITION', 48, "The name '{0}' is already defined"); 841 static const CompileTimeErrorCode DUPLICATE_DEFINITION = const CompileTimeErro rCode.con1('DUPLICATE_DEFINITION', 47, "The name '{0}' is already defined");
750 842
751 /** 843 /**
752 * 7. Classes: It is a compile-time error if a class has an instance member an d a static member 844 * 7. Classes: It is a compile-time error if a class has an instance member an d a static member
753 * with the same name. 845 * with the same name.
754 * 846 *
755 * This covers the additional duplicate definition cases where inheritance has to be considered. 847 * This covers the additional duplicate definition cases where inheritance has to be considered.
756 * 848 *
757 * @param className the name of the class that has conflicting instance/static members 849 * @param className the name of the class that has conflicting instance/static members
758 * @param name the name of the conflicting members 850 * @param name the name of the conflicting members
759 * @see #DUPLICATE_DEFINITION 851 * @see #DUPLICATE_DEFINITION
760 */ 852 */
761 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com pileTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 49, "The name '{0}' i s already defined in '{1}'"); 853 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com pileTimeErrorCode.con1('DUPLICATE_DEFINITION_INHERITANCE', 48, "The name '{0}' i s already defined in '{1}'");
762 854
763 /** 855 /**
764 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub> i</sub> = 856 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if <i>q<sub> i</sub> =
765 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named 857 * q<sub>j</sub></i> for any <i>i != j</i> [where <i>q<sub>i</sub></i> is the label for a named
766 * argument]. 858 * argument].
767 */ 859 */
768 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTime ErrorCode.con1('DUPLICATE_NAMED_ARGUMENT', 50, "The argument for the named param eter '{0}' was already specified"); 860 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");
769 861
770 /** 862 /**
771 * SDK implementation libraries can be exported only by other SDK libraries. 863 * SDK implementation libraries can be exported only by other SDK libraries.
772 * 864 *
773 * @param uri the uri pointing to a library 865 * @param uri the uri pointing to a library
774 */ 866 */
775 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('EXPORT_INTERNAL_LIBRARY', 51, "The library '{0}' is internal and cannot be exported"); 867 static const CompileTimeErrorCode EXPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('EXPORT_INTERNAL_LIBRARY', 50, "The library '{0}' is internal and cannot be exported");
776 868
777 /** 869 /**
778 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 870 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is
779 * not a library declaration. 871 * not a library declaration.
780 * 872 *
781 * @param uri the uri pointing to a non-library declaration 873 * @param uri the uri pointing to a non-library declaration
782 */ 874 */
783 static const CompileTimeErrorCode EXPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1('EXPORT_OF_NON_LIBRARY', 52, "The exported library '{0}' must not ha ve a part-of directive"); 875 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");
784 876
785 /** 877 /**
786 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. 878 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum.
787 */ 879 */
788 static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode.co n1('EXTENDS_ENUM', 53, "Classes cannot extend an enum"); 880 static const CompileTimeErrorCode EXTENDS_ENUM = const CompileTimeErrorCode.co n1('EXTENDS_ENUM', 52, "Classes cannot extend an enum");
789 881
790 /** 882 /**
791 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes 883 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes
792 * a type expression that does not denote a class available in the lexical sco pe of <i>C</i>. 884 * a type expression that does not denote a class available in the lexical sco pe of <i>C</i>.
793 * 885 *
794 * @param typeName the name of the superclass that was not found 886 * @param typeName the name of the superclass that was not found
795 */ 887 */
796 static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCo de.con1('EXTENDS_NON_CLASS', 54, "Classes can only extend other classes"); 888 static const CompileTimeErrorCode EXTENDS_NON_CLASS = const CompileTimeErrorCo de.con1('EXTENDS_NON_CLASS', 53, "Classes can only extend other classes");
797 889
798 /** 890 /**
799 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 891 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null.
800 * 892 *
801 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 893 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int.
802 * 894 *
803 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 895 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double.
804 * 896 *
805 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 897 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
806 * attempt to extend or implement num. 898 * attempt to extend or implement num.
807 * 899 *
808 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 900 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
809 * 901 *
810 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 902 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String.
811 * 903 *
812 * @param typeName the name of the type that cannot be extended 904 * @param typeName the name of the type that cannot be extended
813 * @see #IMPLEMENTS_DISALLOWED_CLASS 905 * @see #IMPLEMENTS_DISALLOWED_CLASS
814 */ 906 */
815 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime ErrorCode.con1('EXTENDS_DISALLOWED_CLASS', 55, "Classes cannot extend '{0}'"); 907 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime ErrorCode.con1('EXTENDS_DISALLOWED_CLASS', 54, "Classes cannot extend '{0}'");
816 908
817 /** 909 /**
818 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes 910 * 7.9 Superclasses: It is a compile-time error if the extends clause of a cla ss <i>C</i> includes
819 * a deferred type expression. 911 * a deferred type expression.
820 * 912 *
821 * @param typeName the name of the type that cannot be extended 913 * @param typeName the name of the type that cannot be extended
822 * @see #IMPLEMENTS_DEFERRED_CLASS 914 * @see #IMPLEMENTS_DEFERRED_CLASS
823 * @see #MIXIN_DEFERRED_CLASS 915 * @see #MIXIN_DEFERRED_CLASS
824 */ 916 */
825 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeEr rorCode.con1('EXTENDS_DEFERRED_CLASS', 56, "This class cannot extend the deferre d class '{0}'"); 917 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeEr rorCode.con1('EXTENDS_DEFERRED_CLASS', 55, "This class cannot extend the deferre d class '{0}'");
826 918
827 /** 919 /**
828 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt; 920 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m &lt; h</ i> or if <i>m &gt;
829 * n</i>. 921 * n</i>.
830 * 922 *
831 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 923 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
832 * uncaught exception being thrown. 924 * uncaught exception being thrown.
833 * 925 *
834 * @param requiredCount the maximum number of positional arguments 926 * @param requiredCount the maximum number of positional arguments
835 * @param argumentCount the actual number of positional arguments given 927 * @param argumentCount the actual number of positional arguments given
836 */ 928 */
837 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTi meErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 57, "{0} positional arguments exp ected, but {1} found"); 929 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = const CompileTi meErrorCode.con1('EXTRA_POSITIONAL_ARGUMENTS', 56, "{0} positional arguments exp ected, but {1} found");
838 930
839 /** 931 /**
840 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time 932 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
841 * error if more than one initializer corresponding to a given instance variab le appears in 933 * error if more than one initializer corresponding to a given instance variab le appears in
842 * <i>k</i>'s list. 934 * <i>k</i>'s list.
843 */ 935 */
844 static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', 5 8, "The field '{0}' cannot be initialized twice in the same constructor"); 936 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");
845 937
846 /** 938 /**
847 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time 939 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile time
848 * error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized 940 * error if <i>k</i>'s initializer list contains an initializer for a variable that is initialized
849 * by means of an initializing formal of <i>k</i>. 941 * by means of an initializing formal of <i>k</i>.
850 */ 942 */
851 static const CompileTimeErrorCode FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZ ER = const CompileTimeErrorCode.con1('FIELD_INITIALIZED_IN_PARAMETER_AND_INITIAL IZER', 59, "Fields cannot be initialized in both the parameter list and the init ializers"); 943 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");
852 944
853 /** 945 /**
854 * 5 Variables: It is a compile-time error if a final instance variable that h as is initialized by 946 * 5 Variables: It is a compile-time error if a final instance variable that h as is initialized by
855 * means of an initializing formal of a constructor is also initialized elsewh ere in the same 947 * means of an initializing formal of a constructor is also initialized elsewh ere in the same
856 * constructor. 948 * constructor.
857 * 949 *
858 * @param name the name of the field in question 950 * @param name the name of the field in question
859 */ 951 */
860 static const CompileTimeErrorCode FINAL_INITIALIZED_MULTIPLE_TIMES = const Com pileTimeErrorCode.con1('FINAL_INITIALIZED_MULTIPLE_TIMES', 60, "'{0}' is a final field and so can only be set once"); 952 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");
861 953
862 /** 954 /**
863 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 955 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by
864 * a function other than a non-redirecting generative constructor. 956 * a function other than a non-redirecting generative constructor.
865 */ 957 */
866 static const CompileTimeErrorCode FIELD_INITIALIZER_FACTORY_CONSTRUCTOR = cons t CompileTimeErrorCode.con1('FIELD_INITIALIZER_FACTORY_CONSTRUCTOR', 61, "Initia lizing formal fields cannot be used in factory constructors"); 958 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");
867 959
868 /** 960 /**
869 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 961 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by
870 * a function other than a non-redirecting generative constructor. 962 * a function other than a non-redirecting generative constructor.
871 */ 963 */
872 static const CompileTimeErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = cons t CompileTimeErrorCode.con1('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', 62, "Initia lizing formal fields can only be used in constructors"); 964 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");
873 965
874 /** 966 /**
875 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 967 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
876 * only action is to invoke another generative constructor. 968 * only action is to invoke another generative constructor.
877 * 969 *
878 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by 970 * 7.6.1 Generative Constructors: It is a compile-time error if an initializin g formal is used by
879 * a function other than a non-redirecting generative constructor. 971 * a function other than a non-redirecting generative constructor.
880 */ 972 */
881 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 63, "The redirecting constructor cannot have a field initializer"); 973 static const CompileTimeErrorCode FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR = const CompileTimeErrorCode.con1('FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR', 62, "The redirecting constructor cannot have a field initializer");
882 974
883 /** 975 /**
884 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 976 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
885 * name. 977 * name.
886 * 978 *
887 * @param name the conflicting name of the getter and method 979 * @param name the conflicting name of the getter and method
888 */ 980 */
889 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('GETTER_AND_METHOD_WITH_SAME_NAME', 64, "'{0}' cannot be used to name a getter, there is already a method with the same name"); 981 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");
890 982
891 /** 983 /**
892 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> 984 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i>
893 * specifies a malformed type or deferred type as a superinterface. 985 * specifies a malformed type or deferred type as a superinterface.
894 * 986 *
895 * @param typeName the name of the type that cannot be extended 987 * @param typeName the name of the type that cannot be extended
896 * @see #EXTENDS_DEFERRED_CLASS 988 * @see #EXTENDS_DEFERRED_CLASS
897 * @see #MIXIN_DEFERRED_CLASS 989 * @see #MIXIN_DEFERRED_CLASS
898 */ 990 */
899 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTim eErrorCode.con1('IMPLEMENTS_DEFERRED_CLASS', 65, "This class cannot implement th e deferred class '{0}'"); 991 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTim eErrorCode.con1('IMPLEMENTS_DEFERRED_CLASS', 64, "This class cannot implement th e deferred class '{0}'");
900 992
901 /** 993 /**
902 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 994 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null.
903 * 995 *
904 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 996 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int.
905 * 997 *
906 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 998 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double.
907 * 999 *
908 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 1000 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
909 * attempt to extend or implement num. 1001 * attempt to extend or implement num.
910 * 1002 *
911 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 1003 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
912 * 1004 *
913 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 1005 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String.
914 * 1006 *
915 * @param typeName the name of the type that cannot be implemented 1007 * @param typeName the name of the type that cannot be implemented
916 * @see #EXTENDS_DISALLOWED_CLASS 1008 * @see #EXTENDS_DISALLOWED_CLASS
917 */ 1009 */
918 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT imeErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 66, "Classes cannot implement ' {0}'"); 1010 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT imeErrorCode.con1('IMPLEMENTS_DISALLOWED_CLASS', 65, "Classes cannot implement ' {0}'");
919 1011
920 /** 1012 /**
921 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class includes 1013 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class includes
922 * type dynamic. 1014 * type dynamic.
923 */ 1015 */
924 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC ode.con1('IMPLEMENTS_DYNAMIC', 67, "Classes cannot implement 'dynamic'"); 1016 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC ode.con1('IMPLEMENTS_DYNAMIC', 66, "Classes cannot implement 'dynamic'");
925 1017
926 /** 1018 /**
927 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. 1019 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum.
928 */ 1020 */
929 static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode .con1('IMPLEMENTS_ENUM', 68, "Classes cannot implement an enum"); 1021 static const CompileTimeErrorCode IMPLEMENTS_ENUM = const CompileTimeErrorCode .con1('IMPLEMENTS_ENUM', 67, "Classes cannot implement an enum");
930 1022
931 /** 1023 /**
932 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i> 1024 * 7.10 Superinterfaces: It is a compile-time error if the implements clause o f a class <i>C</i>
933 * includes a type expression that does not denote a class available in the le xical scope of 1025 * includes a type expression that does not denote a class available in the le xical scope of
934 * <i>C</i>. 1026 * <i>C</i>.
935 * 1027 *
936 * @param typeName the name of the interface that was not found 1028 * @param typeName the name of the interface that was not found
937 */ 1029 */
938 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErro rCode.con1('IMPLEMENTS_NON_CLASS', 69, "Classes can only implement other classes "); 1030 static const CompileTimeErrorCode IMPLEMENTS_NON_CLASS = const CompileTimeErro rCode.con1('IMPLEMENTS_NON_CLASS', 68, "Classes can only implement other classes ");
939 1031
940 /** 1032 /**
941 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in 1033 * 7.10 Superinterfaces: It is a compile-time error if a type <i>T</i> appears more than once in
942 * the implements clause of a class. 1034 * the implements clause of a class.
943 * 1035 *
944 * @param className the name of the class that is implemented more than once 1036 * @param className the name of the class that is implemented more than once
945 */ 1037 */
946 static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeError Code.con1('IMPLEMENTS_REPEATED', 70, "'{0}' can only be implemented once"); 1038 static const CompileTimeErrorCode IMPLEMENTS_REPEATED = const CompileTimeError Code.con1('IMPLEMENTS_REPEATED', 69, "'{0}' can only be implemented once");
947 1039
948 /** 1040 /**
949 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla ss <i>C</i> appears 1041 * 7.10 Superinterfaces: It is a compile-time error if the superclass of a cla ss <i>C</i> appears
950 * in the implements clause of <i>C</i>. 1042 * in the implements clause of <i>C</i>.
951 * 1043 *
952 * @param className the name of the class that appears in both "extends" and " implements" clauses 1044 * @param className the name of the class that appears in both "extends" and " implements" clauses
953 */ 1045 */
954 static const CompileTimeErrorCode IMPLEMENTS_SUPER_CLASS = const CompileTimeEr rorCode.con1('IMPLEMENTS_SUPER_CLASS', 71, "'{0}' cannot be used in both 'extend s' and 'implements' clauses"); 1046 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");
955 1047
956 /** 1048 /**
957 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of 1049 * 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the right hand side of
958 * an initializer. 1050 * an initializer.
959 * 1051 *
960 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable 1052 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable
961 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the 1053 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the
962 * initializer of an instance variable. 1054 * initializer of an instance variable.
963 * 1055 *
964 * @param name the name of the type in question 1056 * @param name the name of the type in question
965 */ 1057 */
966 static const CompileTimeErrorCode IMPLICIT_THIS_REFERENCE_IN_INITIALIZER = con st CompileTimeErrorCode.con1('IMPLICIT_THIS_REFERENCE_IN_INITIALIZER', 72, "Only static members can be accessed in initializers"); 1058 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");
967 1059
968 /** 1060 /**
969 * SDK implementation libraries can be imported only by other SDK libraries. 1061 * SDK implementation libraries can be imported only by other SDK libraries.
970 * 1062 *
971 * @param uri the uri pointing to a library 1063 * @param uri the uri pointing to a library
972 */ 1064 */
973 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('IMPORT_INTERNAL_LIBRARY', 73, "The library '{0}' is internal and cannot be imported"); 1065 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE rrorCode.con1('IMPORT_INTERNAL_LIBRARY', 72, "The library '{0}' is internal and cannot be imported");
974 1066
975 /** 1067 /**
976 * 14.1 Imports: It is a compile-time error if the specified URI of an immedia te import does not 1068 * 14.1 Imports: It is a compile-time error if the specified URI of an immedia te import does not
977 * refer to a library declaration. 1069 * refer to a library declaration.
978 * 1070 *
979 * @param uri the uri pointing to a non-library declaration 1071 * @param uri the uri pointing to a non-library declaration
980 * @see StaticWarningCode#IMPORT_OF_NON_LIBRARY 1072 * @see StaticWarningCode#IMPORT_OF_NON_LIBRARY
981 */ 1073 */
982 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErr orCode.con1('IMPORT_OF_NON_LIBRARY', 74, "The imported library '{0}' must not ha ve a part-of directive"); 1074 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");
983 1075
984 /** 1076 /**
985 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s ub>k</sub></i> are 1077 * 13.9 Switch: It is a compile-time error if values of the expressions <i>e<s ub>k</sub></i> are
986 * not instances of the same class <i>C</i>, for all <i>1 &lt;= k &lt;= n</i>. 1078 * not instances of the same class <i>C</i>, for all <i>1 &lt;= k &lt;= n</i>.
987 * 1079 *
988 * @param expressionSource the expression source code that is the unexpected t ype 1080 * @param expressionSource the expression source code that is the unexpected t ype
989 * @param expectedType the name of the expected type 1081 * @param expectedType the name of the expected type
990 */ 1082 */
991 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const C ompileTimeErrorCode.con1('INCONSISTENT_CASE_EXPRESSION_TYPES', 75, "Case express ions must have the same types, '{0}' is not a '{1}'"); 1083 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}'");
992 1084
993 /** 1085 /**
994 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1086 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
995 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an 1087 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
996 * instance variable declared in the immediately surrounding class. 1088 * instance variable declared in the immediately surrounding class.
997 * 1089 *
998 * @param id the name of the initializing formal that is not an instance varia ble in the 1090 * @param id the name of the initializing formal that is not an instance varia ble in the
999 * immediately enclosing class 1091 * immediately enclosing class
1000 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD 1092 * @see #INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD
1001 */ 1093 */
1002 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = const C ompileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTANT_FIELD', 76, "'{0}' is not a variable in the enclosing class"); 1094 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTANT_FIELD = const C ompileTimeErrorCode.con1('INITIALIZER_FOR_NON_EXISTANT_FIELD', 75, "'{0}' is not a variable in the enclosing class");
1003 1095
1004 /** 1096 /**
1005 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1097 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
1006 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an 1098 * error if <i>k</i>'s initializer list contains an initializer for a variable that is not an
1007 * instance variable declared in the immediately surrounding class. 1099 * instance variable declared in the immediately surrounding class.
1008 * 1100 *
1009 * @param id the name of the initializing formal that is a static variable in the immediately 1101 * @param id the name of the initializing formal that is a static variable in the immediately
1010 * enclosing class 1102 * enclosing class
1011 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD 1103 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
1012 */ 1104 */
1013 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const Compile TimeErrorCode.con1('INITIALIZER_FOR_STATIC_FIELD', 77, "'{0}' is a static variab le in the enclosing class, variables initialized in a constructor cannot be stat ic"); 1105 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");
1014 1106
1015 /** 1107 /**
1016 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a 1108 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a
1017 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately 1109 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately
1018 * enclosing class. 1110 * enclosing class.
1019 * 1111 *
1020 * @param id the name of the initializing formal that is not an instance varia ble in the 1112 * @param id the name of the initializing formal that is not an instance varia ble in the
1021 * immediately enclosing class 1113 * immediately enclosing class
1022 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD 1114 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD
1023 * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD 1115 * @see #INITIALIZER_FOR_NON_EXISTANT_FIELD
1024 */ 1116 */
1025 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 7 8, "'{0}' is not a variable in the enclosing class"); 1117 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD', 7 7, "'{0}' is not a variable in the enclosing class");
1026 1118
1027 /** 1119 /**
1028 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a 1120 * 7.6.1 Generative Constructors: An initializing formal has the form <i>this. id</i>. It is a
1029 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately 1121 * compile-time error if <i>id</i> is not the name of an instance variable of the immediately
1030 * enclosing class. 1122 * enclosing class.
1031 * 1123 *
1032 * @param id the name of the initializing formal that is a static variable in the immediately 1124 * @param id the name of the initializing formal that is a static variable in the immediately
1033 * enclosing class 1125 * enclosing class
1034 * @see #INITIALIZER_FOR_STATIC_FIELD 1126 * @see #INITIALIZER_FOR_STATIC_FIELD
1035 */ 1127 */
1036 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const CompileTimeErrorCode.con1('INITIALIZING_FORMAL_FOR_STATIC_FIELD', 79, "'{0}' is a static field in the enclosing class, fields initialized in a constructor cann ot be static"); 1128 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");
1037 1129
1038 /** 1130 /**
1039 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action 1131 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action
1040 * <b>this</b>.<i>id</i>. 1132 * <b>this</b>.<i>id</i>.
1041 */ 1133 */
1042 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const CompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', 80, "Instance m embers cannot be accessed from a factory constructor"); 1134 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");
1043 1135
1044 /** 1136 /**
1045 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action 1137 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property extr action
1046 * <b>this</b>.<i>id</i>. 1138 * <b>this</b>.<i>id</i>.
1047 */ 1139 */
1048 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_STATIC = const C ompileTimeErrorCode.con1('INSTANCE_MEMBER_ACCESS_FROM_STATIC', 81, "Instance mem bers cannot be accessed from a static method"); 1140 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");
1049 1141
1050 /** 1142 /**
1051 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or 1143 * Enum proposal: It is also a compile-time error to explicitly instantiate an enum via 'new' or
1052 * 'const' or to access its private fields. 1144 * 'const' or to access its private fields.
1053 */ 1145 */
1054 static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCod e.con1('INSTANTIATE_ENUM', 82, "Enums cannot be instantiated"); 1146 static const CompileTimeErrorCode INSTANTIATE_ENUM = const CompileTimeErrorCod e.con1('INSTANTIATE_ENUM', 81, "Enums cannot be instantiated");
1055 1147
1056 /** 1148 /**
1057 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1149 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1058 * character @, followed by a constant expression that must be either a refere nce to a 1150 * character @, followed by a constant expression that must be either a refere nce to a
1059 * compile-time constant variable, or a call to a constant constructor. 1151 * compile-time constant variable, or a call to a constant constructor.
1060 */ 1152 */
1061 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode.con1('INVALID_ANNOTATION', 83, "Annotation can be only constant variable or constant constructor invocation"); 1153 static const CompileTimeErrorCode INVALID_ANNOTATION = const CompileTimeErrorC ode.con1('INVALID_ANNOTATION', 82, "Annotation can be only constant variable or constant constructor invocation");
1062 1154
1063 /** 1155 /**
1064 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1156 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1065 * character @, followed by a constant expression that must be either a refere nce to a 1157 * character @, followed by a constant expression that must be either a refere nce to a
1066 * compile-time constant variable, or a call to a constant constructor. 1158 * compile-time constant variable, or a call to a constant constructor.
1067 * 1159 *
1068 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1160 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1069 * deferred prefix. 1161 * deferred prefix.
1070 */ 1162 */
1071 static const CompileTimeErrorCode INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY = c onst CompileTimeErrorCode.con1('INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY', 84, " Constant values from a deferred library cannot be used as annotations"); 1163 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");
1072 1164
1073 /** 1165 /**
1074 * 15.31 Identifier Reference: It is a compile-time error if any of the identi fiers async, await 1166 * 15.31 Identifier Reference: It is a compile-time error if any of the identi fiers async, await
1075 * or yield is used as an identifier in a function body marked with either asy nc, async* or sync*. 1167 * or yield is used as an identifier in a function body marked with either asy nc, async* or sync*.
1076 */ 1168 */
1077 static const CompileTimeErrorCode INVALID_IDENTIFIER_IN_ASYNC = const CompileT imeErrorCode.con1('INVALID_IDENTIFIER_IN_ASYNC', 85, "The identifier '{0}' canno t be used in a function marked with async, async* or sync*"); 1169 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*");
1078 1170
1079 /** 1171 /**
1080 * 9. Functions: It is a compile-time error if an async, async* or sync* modif ier is attached to 1172 * 9. Functions: It is a compile-time error if an async, async* or sync* modif ier is attached to
1081 * the body of a setter or constructor. 1173 * the body of a setter or constructor.
1082 */ 1174 */
1083 static const CompileTimeErrorCode INVALID_MODIFIER_ON_CONSTRUCTOR = const Comp ileTimeErrorCode.con1('INVALID_MODIFIER_ON_CONSTRUCTOR', 86, "The modifier '{0}' cannot be applied to the body of a constructor"); 1175 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");
1084 1176
1085 /** 1177 /**
1086 * 9. Functions: It is a compile-time error if an async, async* or sync* modif ier is attached to 1178 * 9. Functions: It is a compile-time error if an async, async* or sync* modif ier is attached to
1087 * the body of a setter or constructor. 1179 * the body of a setter or constructor.
1088 */ 1180 */
1089 static const CompileTimeErrorCode INVALID_MODIFIER_ON_SETTER = const CompileTi meErrorCode.con1('INVALID_MODIFIER_ON_SETTER', 87, "The modifier '{0}' cannot be applied to the body of a setter"); 1181 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");
1090 1182
1091 /** 1183 /**
1092 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time 1184 * TODO(brianwilkerson) Remove this when we have decided on how to report erro rs in compile-time
1093 * constants. Until then, this acts as a placeholder for more informative erro rs. 1185 * constants. Until then, this acts as a placeholder for more informative erro rs.
1094 * 1186 *
1095 * See TODOs in ConstantVisitor 1187 * See TODOs in ConstantVisitor
1096 */ 1188 */
1097 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e.con1('INVALID_CONSTANT', 88, "Invalid constant value"); 1189 static const CompileTimeErrorCode INVALID_CONSTANT = const CompileTimeErrorCod e.con1('INVALID_CONSTANT', 87, "Invalid constant value");
1098 1190
1099 /** 1191 /**
1100 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor 1192 * 7.6 Constructors: It is a compile-time error if the name of a constructor i s not a constructor
1101 * name. 1193 * name.
1102 */ 1194 */
1103 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 89, "Invalid constructor name"); 1195 static const CompileTimeErrorCode INVALID_CONSTRUCTOR_NAME = const CompileTime ErrorCode.con1('INVALID_CONSTRUCTOR_NAME', 88, "Invalid constructor name");
1104 1196
1105 /** 1197 /**
1106 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately 1198 * 7.6.2 Factories: It is a compile-time error if <i>M</i> is not the name of the immediately
1107 * enclosing class. 1199 * enclosing class.
1108 */ 1200 */
1109 static const CompileTimeErrorCode INVALID_FACTORY_NAME_NOT_A_CLASS = const Com pileTimeErrorCode.con1('INVALID_FACTORY_NAME_NOT_A_CLASS', 90, "The name of the immediately enclosing class expected"); 1201 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");
1110 1202
1111 /** 1203 /**
1112 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable 1204 * 12.10 This: It is a compile-time error if this appears in a top-level funct ion or variable
1113 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the 1205 * initializer, in a factory constructor, or in a static method or variable in itializer, or in the
1114 * initializer of an instance variable. 1206 * initializer of an instance variable.
1115 */ 1207 */
1116 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode.con1('INVALID_REFERENCE_TO_THIS', 91, "Invalid reference to 'this' ex pression"); 1208 static const CompileTimeErrorCode INVALID_REFERENCE_TO_THIS = const CompileTim eErrorCode.con1('INVALID_REFERENCE_TO_THIS', 90, "Invalid reference to 'this' ex pression");
1117 1209
1118 /** 1210 /**
1119 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes 1211 * 12.6 Lists: It is a compile time error if the type argument of a constant l ist literal includes
1120 * a type parameter. 1212 * a type parameter.
1121 * 1213 *
1122 * @name the name of the type parameter 1214 * @name the name of the type parameter
1123 */ 1215 */
1124 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_LIST = const CompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_LIST', 92, "Constant l ist literals cannot include a type parameter as a type argument, such as '{0}'") ; 1216 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}'") ;
1125 1217
1126 /** 1218 /**
1127 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a 1219 * 12.7 Maps: It is a compile time error if the type arguments of a constant m ap literal include a
1128 * type parameter. 1220 * type parameter.
1129 * 1221 *
1130 * @name the name of the type parameter 1222 * @name the name of the type parameter
1131 */ 1223 */
1132 static const CompileTimeErrorCode INVALID_TYPE_ARGUMENT_IN_CONST_MAP = const C ompileTimeErrorCode.con1('INVALID_TYPE_ARGUMENT_IN_CONST_MAP', 93, "Constant map literals cannot include a type parameter as a type argument, such as '{0}'"); 1224 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}'");
1133 1225
1134 /** 1226 /**
1135 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 1227 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is
1136 * not a library declaration. 1228 * not a library declaration.
1137 * 1229 *
1138 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 1230 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is
1139 * not a library declaration. 1231 * not a library declaration.
1140 * 1232 *
1141 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1233 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
1142 * declaration. 1234 * declaration.
1143 * 1235 *
1144 * @param uri the URI that is invalid 1236 * @param uri the URI that is invalid
1145 * @see #URI_DOES_NOT_EXIST 1237 * @see #URI_DOES_NOT_EXIST
1146 */ 1238 */
1147 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con 1('INVALID_URI', 94, "Invalid URI syntax: '{0}'"); 1239 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode.con 1('INVALID_URI', 93, "Invalid URI syntax: '{0}'");
1148 1240
1149 /** 1241 /**
1150 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within 1242 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within
1151 * the innermost function in which <i>s<sub>b</sub></i> occurs. 1243 * the innermost function in which <i>s<sub>b</sub></i> occurs.
1152 * 1244 *
1153 * 13.14 Continue: It is a compile-time error if no such statement or case cla use 1245 * 13.14 Continue: It is a compile-time error if no such statement or case cla use
1154 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. 1246 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs.
1155 * 1247 *
1156 * @param labelName the name of the unresolvable label 1248 * @param labelName the name of the unresolvable label
1157 */ 1249 */
1158 static const CompileTimeErrorCode LABEL_IN_OUTER_SCOPE = const CompileTimeErro rCode.con1('LABEL_IN_OUTER_SCOPE', 95, "Cannot reference label '{0}' declared in an outer method"); 1250 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");
1159 1251
1160 /** 1252 /**
1161 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within 1253 * 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</su b></i> exists within
1162 * the innermost function in which <i>s<sub>b</sub></i> occurs. 1254 * the innermost function in which <i>s<sub>b</sub></i> occurs.
1163 * 1255 *
1164 * 13.14 Continue: It is a compile-time error if no such statement or case cla use 1256 * 13.14 Continue: It is a compile-time error if no such statement or case cla use
1165 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs. 1257 * <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub >c</sub></i> occurs.
1166 * 1258 *
1167 * @param labelName the name of the unresolvable label 1259 * @param labelName the name of the unresolvable label
1168 */ 1260 */
1169 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode .con1('LABEL_UNDEFINED', 96, "Cannot reference undefined label '{0}'"); 1261 static const CompileTimeErrorCode LABEL_UNDEFINED = const CompileTimeErrorCode .con1('LABEL_UNDEFINED', 95, "Cannot reference undefined label '{0}'");
1170
1171 /**
1172 * 12.6 Lists: A run-time list literal &lt;<i>E</i>&gt; [<i>e<sub>1</sub></i> ...
1173 * <i>e<sub>n</sub></i>] is evaluated as follows:
1174 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and second argument
1175 * <i>o<sub>i+1</sub></i><i>, 1 &lt;= i &lt;= n</i>
1176 *
1177 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1178 * <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;=
1179 * 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>.
1180 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1181 * j &lt;= m</i>.
1182 */
1183 static const CompileTimeErrorCode LIST_ELEMENT_TYPE_NOT_ASSIGNABLE = const Com pileTimeErrorCode.con1('LIST_ELEMENT_TYPE_NOT_ASSIGNABLE', 97, "The element type '{0}' cannot be assigned to the list type '{1}'");
1184
1185 /**
1186 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
1187 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
1188 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
1189 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
1190 *
1191 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1192 * <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;=
1193 * 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>.
1194 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1195 * j &lt;= m</i>.
1196 */
1197 static const CompileTimeErrorCode MAP_KEY_TYPE_NOT_ASSIGNABLE = const CompileT imeErrorCode.con1('MAP_KEY_TYPE_NOT_ASSIGNABLE', 98, "The element type '{0}' can not be assigned to the map key type '{1}'");
1198
1199 /**
1200 * 12.7 Map: A run-time map literal &lt;<i>K</i>, <i>V</i>&gt; [<i>k<sub>1</su b></i> :
1201 * <i>e<sub>1</sub></i> ... <i>k<sub>n</sub></i> : <i>e<sub>n</sub></i>] is ev aluated as follows:
1202 * * The operator []= is invoked on <i>m</i> with first argument <i>k<sub>i</s ub></i> and second
1203 * argument <i>e<sub>i</sub></i><i>, 1 &lt;= i &lt;= n</i>
1204 *
1205 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
1206 * <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;=
1207 * 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>.
1208 * It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S< sub>j</sub>, 1 &lt;=
1209 * j &lt;= m</i>.
1210 */
1211 static const CompileTimeErrorCode MAP_VALUE_TYPE_NOT_ASSIGNABLE = const Compil eTimeErrorCode.con1('MAP_VALUE_TYPE_NOT_ASSIGNABLE', 99, "The element type '{0}' cannot be assigned to the map value type '{1}'");
1212 1262
1213 /** 1263 /**
1214 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name 1264 * 7 Classes: It is a compile time error if a class <i>C</i> declares a member with the same name
1215 * as <i>C</i>. 1265 * as <i>C</i>.
1216 */ 1266 */
1217 static const CompileTimeErrorCode MEMBER_WITH_CLASS_NAME = const CompileTimeEr rorCode.con1('MEMBER_WITH_CLASS_NAME', 100, "Class members cannot have the same name as the enclosing class"); 1267 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");
1218 1268
1219 /** 1269 /**
1220 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same 1270 * 7.2 Getters: It is a compile-time error if a class has both a getter and a method with the same
1221 * name. 1271 * name.
1222 * 1272 *
1223 * @param name the conflicting name of the getter and method 1273 * @param name the conflicting name of the getter and method
1224 */ 1274 */
1225 static const CompileTimeErrorCode METHOD_AND_GETTER_WITH_SAME_NAME = const Com pileTimeErrorCode.con1('METHOD_AND_GETTER_WITH_SAME_NAME', 101, "'{0}' cannot be used to name a method, there is already a getter with the same name"); 1275 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");
1226 1276
1227 /** 1277 /**
1228 * 12.1 Constants: A constant expression is ... a constant list literal. 1278 * 12.1 Constants: A constant expression is ... a constant list literal.
1229 */ 1279 */
1230 static const CompileTimeErrorCode MISSING_CONST_IN_LIST_LITERAL = const Compil eTimeErrorCode.con1('MISSING_CONST_IN_LIST_LITERAL', 102, "List literals must be prefixed with 'const' when used as a constant expression"); 1280 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");
1231 1281
1232 /** 1282 /**
1233 * 12.1 Constants: A constant expression is ... a constant map literal. 1283 * 12.1 Constants: A constant expression is ... a constant map literal.
1234 */ 1284 */
1235 static const CompileTimeErrorCode MISSING_CONST_IN_MAP_LITERAL = const Compile TimeErrorCode.con1('MISSING_CONST_IN_MAP_LITERAL', 103, "Map literals must be pr efixed with 'const' when used as a constant expression"); 1285 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");
1236 1286
1237 /** 1287 /**
1238 * Enum proposal: It is a static warning if all of the following conditions ho ld: 1288 * Enum proposal: It is a static warning if all of the following conditions ho ld:
1239 * * The switch statement does not have a 'default' clause. 1289 * * The switch statement does not have a 'default' clause.
1240 * * The static type of <i>e</i> is an enumerated typed with elements <i>id<su b>1</sub></i>, 1290 * * The static type of <i>e</i> is an enumerated typed with elements <i>id<su b>1</sub></i>,
1241 * &hellip;, <i>id<sub>n</sub></i>. 1291 * &hellip;, <i>id<sub>n</sub></i>.
1242 * * The sets {<i>e<sub>1</sub></i>, &hellip;, <i>e<sub>k</sub></i>} and {<i>i d<sub>1</sub></i>, 1292 * * The sets {<i>e<sub>1</sub></i>, &hellip;, <i>e<sub>k</sub></i>} and {<i>i d<sub>1</sub></i>,
1243 * &hellip;, <i>id<sub>n</sub></i>} are not the same. 1293 * &hellip;, <i>id<sub>n</sub></i>} are not the same.
1244 * 1294 *
1245 * @param constantName the name of the constant that is missing 1295 * @param constantName the name of the constant that is missing
1246 */ 1296 */
1247 static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH = const Comp ileTimeErrorCode.con2('MISSING_ENUM_CONSTANT_IN_SWITCH', 104, "Missing case clau se for '{0}'", "Add a case clause for the missing constant or add a default clau se."); 1297 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.");
1248 1298
1249 /** 1299 /**
1250 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a 1300 * 9 Mixins: It is a compile-time error if a declared or derived mixin explici tly declares a
1251 * constructor. 1301 * constructor.
1252 * 1302 *
1253 * @param typeName the name of the mixin that is invalid 1303 * @param typeName the name of the mixin that is invalid
1254 */ 1304 */
1255 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi meErrorCode.con1('MIXIN_DECLARES_CONSTRUCTOR', 105, "The class '{0}' cannot be u sed as a mixin because it declares a constructor"); 1305 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");
1256 1306
1257 /** 1307 /**
1258 * 9.1 Mixin Application: It is a compile-time error if the with clause of a m ixin application 1308 * 9.1 Mixin Application: It is a compile-time error if the with clause of a m ixin application
1259 * <i>C</i> includes a deferred type expression. 1309 * <i>C</i> includes a deferred type expression.
1260 * 1310 *
1261 * @param typeName the name of the type that cannot be extended 1311 * @param typeName the name of the type that cannot be extended
1262 * @see #EXTENDS_DEFERRED_CLASS 1312 * @see #EXTENDS_DEFERRED_CLASS
1263 * @see #IMPLEMENTS_DEFERRED_CLASS 1313 * @see #IMPLEMENTS_DEFERRED_CLASS
1264 */ 1314 */
1265 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode.con1('MIXIN_DEFERRED_CLASS', 106, "This class cannot mixin the deferred cl ass '{0}'"); 1315 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro rCode.con1('MIXIN_DEFERRED_CLASS', 102, "This class cannot mixin the deferred cl ass '{0}'");
1266 1316
1267 /** 1317 /**
1268 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not 1318 * 9 Mixins: It is a compile-time error if a mixin is derived from a class who se superclass is not
1269 * Object. 1319 * Object.
1270 * 1320 *
1271 * @param typeName the name of the mixin that is invalid 1321 * @param typeName the name of the mixin that is invalid
1272 */ 1322 */
1273 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi leTimeErrorCode.con1('MIXIN_INHERITS_FROM_NOT_OBJECT', 107, "The class '{0}' can not be used as a mixin because it extends a class other than Object"); 1323 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");
1274 1324
1275 /** 1325 /**
1276 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null. 1326 * 12.2 Null: It is a compile-time error for a class to attempt to extend or i mplement Null.
1277 * 1327 *
1278 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int. 1328 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement int.
1279 * 1329 *
1280 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double. 1330 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend o r implement double.
1281 * 1331 *
1282 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to 1332 * 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
1283 * attempt to extend or implement num. 1333 * attempt to extend or implement num.
1284 * 1334 *
1285 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool. 1335 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
1286 * 1336 *
1287 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String. 1337 * 12.5 Strings: It is a compile-time error for a class to attempt to extend o r implement String.
1288 * 1338 *
1289 * @param typeName the name of the type that cannot be extended 1339 * @param typeName the name of the type that cannot be extended
1290 * @see #IMPLEMENTS_DISALLOWED_CLASS 1340 * @see #IMPLEMENTS_DISALLOWED_CLASS
1291 */ 1341 */
1292 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 108, "Classes cannot mixin '{0}'"); 1342 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim eErrorCode.con1('MIXIN_OF_DISALLOWED_CLASS', 104, "Classes cannot mixin '{0}'");
1293 1343
1294 /** 1344 /**
1295 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum. 1345 * Enum proposal: It is a compile-time error to subclass, mix-in or implement an enum.
1296 */ 1346 */
1297 static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode.c on1('MIXIN_OF_ENUM', 109, "Classes cannot mixin an enum"); 1347 static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode.c on1('MIXIN_OF_ENUM', 105, "Classes cannot mixin an enum");
1298 1348
1299 /** 1349 /**
1300 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin 1350 * 9.1 Mixin Application: It is a compile-time error if <i>M</i> does not deno te a class or mixin
1301 * available in the immediately enclosing scope. 1351 * available in the immediately enclosing scope.
1302 */ 1352 */
1303 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode.con1('MIXIN_OF_NON_CLASS', 110, "Classes can only mixin other classes"); 1353 static const CompileTimeErrorCode MIXIN_OF_NON_CLASS = const CompileTimeErrorC ode.con1('MIXIN_OF_NON_CLASS', 106, "Classes can only mixin other classes");
1304 1354
1305 /** 1355 /**
1306 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super. 1356 * 9 Mixins: It is a compile-time error if a declared or derived mixin refers to super.
1307 */ 1357 */
1308 static const CompileTimeErrorCode MIXIN_REFERENCES_SUPER = const CompileTimeEr rorCode.con1('MIXIN_REFERENCES_SUPER', 111, "The class '{0}' cannot be used as a mixin because it references 'super'"); 1358 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'");
1309 1359
1310 /** 1360 /**
1311 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available 1361 * 9.1 Mixin Application: It is a compile-time error if <i>S</i> does not deno te a class available
1312 * in the immediately enclosing scope. 1362 * in the immediately enclosing scope.
1313 */ 1363 */
1314 static const CompileTimeErrorCode MIXIN_WITH_NON_CLASS_SUPERCLASS = const Comp ileTimeErrorCode.con1('MIXIN_WITH_NON_CLASS_SUPERCLASS', 112, "Mixin can only be applied to class"); 1364 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");
1315 1365
1316 /** 1366 /**
1317 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1367 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1318 * only action is to invoke another generative constructor. 1368 * only action is to invoke another generative constructor.
1319 */ 1369 */
1320 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS ', 113, "Constructor may have at most one 'this' redirection"); 1370 static const CompileTimeErrorCode MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS = const CompileTimeErrorCode.con1('MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS ', 109, "Constructor may have at most one 'this' redirection");
1321 1371
1322 /** 1372 /**
1323 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may 1373 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Th en <i>k</i> may
1324 * include at most one superinitializer in its initializer list or a compile t ime error occurs. 1374 * include at most one superinitializer in its initializer list or a compile t ime error occurs.
1325 */ 1375 */
1326 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 114, "Constructor may have at m ost one 'super' initializer"); 1376 static const CompileTimeErrorCode MULTIPLE_SUPER_INITIALIZERS = const CompileT imeErrorCode.con1('MULTIPLE_SUPER_INITIALIZERS', 110, "Constructor may have at m ost one 'super' initializer");
1327 1377
1328 /** 1378 /**
1329 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1379 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1330 * character @, followed by a constant expression that must be either a refere nce to a 1380 * character @, followed by a constant expression that must be either a refere nce to a
1331 * compile-time constant variable, or a call to a constant constructor. 1381 * compile-time constant variable, or a call to a constant constructor.
1332 */ 1382 */
1333 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 115, "Annotatio n creation must have arguments"); 1383 static const CompileTimeErrorCode NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS = const CompileTimeErrorCode.con1('NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS', 111, "Annotatio n creation must have arguments");
1334 1384
1335 /** 1385 /**
1336 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer 1386 * 7.6.1 Generative Constructors: If no superinitializer is provided, an impli cit superinitializer
1337 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the 1387 * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer li st, unless the
1338 * enclosing class is class <i>Object</i>. 1388 * enclosing class is class <i>Object</i>.
1339 * 1389 *
1340 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a 1390 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
1341 * generative constructor named <i>S</i> (respectively <i>S.id</i>) 1391 * generative constructor named <i>S</i> (respectively <i>S.id</i>)
1342 */ 1392 */
1343 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 116, "The c lass '{0}' does not have a default constructor"); 1393 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");
1344 1394
1345 /** 1395 /**
1346 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a 1396 * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a
1347 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>. 1397 * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Obj ect</i>.
1348 * 1398 *
1349 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a 1399 * 7.6.1 Generative constructors. It is a compile-time error if class <i>S</i> does not declare a
1350 * generative constructor named <i>S</i> (respectively <i>S.id</i>) 1400 * generative constructor named <i>S</i> (respectively <i>S.id</i>)
1351 */ 1401 */
1352 static const CompileTimeErrorCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = cons t CompileTimeErrorCode.con1('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 117, "The c lass '{0}' does not have a default constructor"); 1402 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");
1353 1403
1354 /** 1404 /**
1355 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has 1405 * 13.2 Expression Statements: It is a compile-time error if a non-constant ma p literal that has
1356 * no explicit type arguments appears in a place where a statement is expected . 1406 * no explicit type arguments appears in a place where a statement is expected .
1357 */ 1407 */
1358 static const CompileTimeErrorCode NON_CONST_MAP_AS_EXPRESSION_STATEMENT = cons t CompileTimeErrorCode.con1('NON_CONST_MAP_AS_EXPRESSION_STATEMENT', 118, "A non -constant map literal without type arguments cannot be used as an expression sta tement"); 1408 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");
1359 1409
1360 /** 1410 /**
1361 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip; 1411 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip;
1362 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip; 1412 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip;
1363 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form 1413 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form
1364 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>: 1414 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>:
1365 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>: 1415 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>:
1366 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not 1416 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not
1367 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>. 1417 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
1368 */ 1418 */
1369 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 119, "Case expressions must b e constant"); 1419 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION = const Compile TimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION', 115, "Case expressions must b e constant");
1370 1420
1371 /** 1421 /**
1372 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip; 1422 * 13.9 Switch: Given a switch statement of the form <i>switch (e) { label<sub >11</sub> &hellip;
1373 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip; 1423 * label<sub>1j1</sub> case e<sub>1</sub>: s<sub>1</sub> &hellip; label<sub>n1 </sub> &hellip;
1374 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form 1424 * label<sub>njn</sub> case e<sub>n</sub>: s<sub>n</sub> default: s<sub>n+1</s ub>}</i> or the form
1375 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>: 1425 * <i>switch (e) { label<sub>11</sub> &hellip; label<sub>1j1</sub> case e<sub> 1</sub>:
1376 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>: 1426 * s<sub>1</sub> &hellip; label<sub>n1</sub> &hellip; label<sub>njn</sub> case e<sub>n</sub>:
1377 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not 1427 * s<sub>n</sub>}</i>, it is a compile-time error if the expressions <i>e<sub> k</sub></i> are not
1378 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>. 1428 * compile-time constants, for all <i>1 &lt;= k &lt;= n</i>.
1379 * 1429 *
1380 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1430 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1381 * deferred prefix. 1431 * deferred prefix.
1382 */ 1432 */
1383 static const CompileTimeErrorCode NON_CONSTANT_CASE_EXPRESSION_FROM_DEFERRED_L IBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_CASE_EXPRESSION_FROM_DEFE RRED_LIBRARY', 120, "Constant values from a deferred library cannot be used as a case expression"); 1433 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");
1384 1434
1385 /** 1435 /**
1386 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional 1436 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
1387 * parameter is not a compile-time constant. 1437 * parameter is not a compile-time constant.
1388 */ 1438 */
1389 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE = const CompileTi meErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE', 121, "Default values of an option al parameter must be constant"); 1439 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");
1390 1440
1391 /** 1441 /**
1392 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional 1442 * 6.2.2 Optional Formals: It is a compile-time error if the default value of an optional
1393 * parameter is not a compile-time constant. 1443 * parameter is not a compile-time constant.
1394 * 1444 *
1395 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1445 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1396 * deferred prefix. 1446 * deferred prefix.
1397 */ 1447 */
1398 static const CompileTimeErrorCode NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED_LIB RARY = const CompileTimeErrorCode.con1('NON_CONSTANT_DEFAULT_VALUE_FROM_DEFERRED _LIBRARY', 122, "Constant values from a deferred library cannot be used as a def ault parameter value"); 1448 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");
1399 1449
1400 /** 1450 /**
1401 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a 1451 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a
1402 * compile-time constant. 1452 * compile-time constant.
1403 */ 1453 */
1404 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 123, "'const' lists must have all c onstant values"); 1454 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT = const CompileTim eErrorCode.con1('NON_CONSTANT_LIST_ELEMENT', 119, "'const' lists must have all c onstant values");
1405 1455
1406 /** 1456 /**
1407 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a 1457 * 12.6 Lists: It is a compile time error if an element of a constant list lit eral is not a
1408 * compile-time constant. 1458 * compile-time constant.
1409 * 1459 *
1410 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1460 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1411 * deferred prefix. 1461 * deferred prefix.
1412 */ 1462 */
1413 static const CompileTimeErrorCode NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_LIBR ARY = const CompileTimeErrorCode.con1('NON_CONSTANT_LIST_ELEMENT_FROM_DEFERRED_L IBRARY', 124, "Constant values from a deferred library cannot be used as values in a 'const' list"); 1463 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");
1414 1464
1415 /** 1465 /**
1416 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1466 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1417 * literal is not a compile-time constant. 1467 * literal is not a compile-time constant.
1418 */ 1468 */
1419 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode.con1('NON_CONSTANT_MAP_KEY', 125, "The keys in a map must be constant"); 1469 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY = const CompileTimeErro rCode.con1('NON_CONSTANT_MAP_KEY', 121, "The keys in a map must be constant");
1420 1470
1421 /** 1471 /**
1422 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1472 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1423 * literal is not a compile-time constant. 1473 * literal is not a compile-time constant.
1424 * 1474 *
1425 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1475 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1426 * deferred prefix. 1476 * deferred prefix.
1427 */ 1477 */
1428 static const CompileTimeErrorCode NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_KEY_FROM_DEFERRED_LIBRARY', 1 26, "Constant values from a deferred library cannot be used as keys in a map"); 1478 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");
1429 1479
1430 /** 1480 /**
1431 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1481 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1432 * literal is not a compile-time constant. 1482 * literal is not a compile-time constant.
1433 */ 1483 */
1434 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE = const CompileTimeEr rorCode.con1('NON_CONSTANT_MAP_VALUE', 127, "The values in a 'const' map must be constant"); 1484 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");
1435 1485
1436 /** 1486 /**
1437 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map 1487 * 12.7 Maps: It is a compile time error if either a key or a value of an entr y in a constant map
1438 * literal is not a compile-time constant. 1488 * literal is not a compile-time constant.
1439 * 1489 *
1440 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1490 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1441 * deferred prefix. 1491 * deferred prefix.
1442 */ 1492 */
1443 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY ', 128, "Constant values from a deferred library cannot be used as values in a ' const' map"); 1493 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");
1444 1494
1445 /** 1495 /**
1446 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the 1496 * 11 Metadata: Metadata consists of a series of annotations, each of which be gin with the
1447 * character @, followed by a constant expression that must be either a refere nce to a 1497 * character @, followed by a constant expression that must be either a refere nce to a
1448 * compile-time constant variable, or a call to a constant constructor. 1498 * compile-time constant variable, or a call to a constant constructor.
1449 * 1499 *
1450 * "From deferred library" case is covered by 1500 * "From deferred library" case is covered by
1451 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]. 1501 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY].
1452 */ 1502 */
1453 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 129, "Annotatio n creation can use only 'const' constructor"); 1503 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const CompileTimeErrorCode.con1('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', 125, "Annotatio n creation can use only 'const' constructor");
1454 1504
1455 /** 1505 /**
1456 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a 1506 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a
1457 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. 1507 * constant constructor must be a potentially constant expression, or a compil e-time error occurs.
1458 */ 1508 */
1459 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co mpileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER', 130, "Initializer e xpressions in constant constructors must be constants"); 1509 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");
1460 1510
1461 /** 1511 /**
1462 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a 1512 * 7.6.3 Constant Constructors: Any expression that appears within the initial izer list of a
1463 * constant constructor must be a potentially constant expression, or a compil e-time error occurs. 1513 * constant constructor must be a potentially constant expression, or a compil e-time error occurs.
1464 * 1514 *
1465 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a 1515 * 12.1 Constants: A qualified reference to a static constant variable that is not qualified by a
1466 * deferred prefix. 1516 * deferred prefix.
1467 */ 1517 */
1468 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFER RED_LIBRARY = const CompileTimeErrorCode.con1('NON_CONSTANT_VALUE_IN_INITIALIZER _FROM_DEFERRED_LIBRARY', 131, "Constant values from a deferred library cannot be used as constant initializers"); 1518 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");
1469 1519
1470 /** 1520 /**
1471 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>. 1521 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>.
1472 * 1522 *
1473 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1523 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1474 * uncaught exception being thrown. 1524 * uncaught exception being thrown.
1475 * 1525 *
1476 * @param requiredCount the expected number of required arguments 1526 * @param requiredCount the expected number of required arguments
1477 * @param argumentCount the actual number of positional arguments given 1527 * @param argumentCount the actual number of positional arguments given
1478 */ 1528 */
1479 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 132, "{0} required argument (s) expected, but {1} found"); 1529 static const CompileTimeErrorCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const Compil eTimeErrorCode.con1('NOT_ENOUGH_REQUIRED_ARGUMENTS', 128, "{0} required argument (s) expected, but {1} found");
1480 1530
1481 /** 1531 /**
1482 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1532 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
1483 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1533 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
1484 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1534 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
1485 * (respectively <i>S.id</i>) 1535 * (respectively <i>S.id</i>)
1486 */ 1536 */
1487 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 133, "The generative constructor '{0}' expected, but factory found"); 1537 static const CompileTimeErrorCode NON_GENERATIVE_CONSTRUCTOR = const CompileTi meErrorCode.con1('NON_GENERATIVE_CONSTRUCTOR', 129, "The generative constructor '{0}' expected, but factory found");
1488 1538
1489 /** 1539 /**
1490 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object. 1540 * 7.9 Superclasses: It is a compile-time error to specify an extends clause f or class Object.
1491 */ 1541 */
1492 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 134, ""); 1542 static const CompileTimeErrorCode OBJECT_CANNOT_EXTEND_ANOTHER_CLASS = const C ompileTimeErrorCode.con1('OBJECT_CANNOT_EXTEND_ANOTHER_CLASS', 130, "");
1493 1543
1494 /** 1544 /**
1495 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator. 1545 * 7.1.1 Operators: It is a compile-time error to declare an optional paramete r in an operator.
1496 */ 1546 */
1497 static const CompileTimeErrorCode OPTIONAL_PARAMETER_IN_OPERATOR = const Compi leTimeErrorCode.con1('OPTIONAL_PARAMETER_IN_OPERATOR', 135, "Optional parameters are not allowed when defining an operator"); 1547 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");
1498 1548
1499 /** 1549 /**
1500 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1550 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
1501 * declaration. 1551 * declaration.
1502 * 1552 *
1503 * @param uri the uri pointing to a non-library declaration 1553 * @param uri the uri pointing to a non-library declaration
1504 */ 1554 */
1505 static const CompileTimeErrorCode PART_OF_NON_PART = const CompileTimeErrorCod e.con1('PART_OF_NON_PART', 136, "The included part '{0}' must have a part-of dir ective"); 1555 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");
1506 1556
1507 /** 1557 /**
1508 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member 1558 * 14.1 Imports: It is a compile-time error if the current library declares a top-level member
1509 * named <i>p</i>. 1559 * named <i>p</i>.
1510 */ 1560 */
1511 static const CompileTimeErrorCode PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER = cons t CompileTimeErrorCode.con1('PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER', 137, "The n ame '{0}' is already used as an import prefix and cannot be used to name a top-l evel element"); 1561 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");
1512 1562
1513 /** 1563 /**
1514 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter 1564 * 6.2.2 Optional Formals: It is a compile-time error if the name of a named o ptional parameter
1515 * begins with an '_' character. 1565 * begins with an '_' character.
1516 */ 1566 */
1517 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 138, "Named optional parameters c annot start with an underscore"); 1567 static const CompileTimeErrorCode PRIVATE_OPTIONAL_PARAMETER = const CompileTi meErrorCode.con1('PRIVATE_OPTIONAL_PARAMETER', 134, "Named optional parameters c annot start with an underscore");
1518 1568
1519 /** 1569 /**
1520 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression 1570 * 12.1 Constants: It is a compile-time error if the value of a compile-time c onstant expression
1521 * depends on itself. 1571 * depends on itself.
1522 */ 1572 */
1523 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 139, ""); 1573 static const CompileTimeErrorCode RECURSIVE_COMPILE_TIME_CONSTANT = const Comp ileTimeErrorCode.con1('RECURSIVE_COMPILE_TIME_CONSTANT', 135, "");
1524 1574
1525 /** 1575 /**
1526 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1576 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1527 * only action is to invoke another generative constructor. 1577 * only action is to invoke another generative constructor.
1528 * 1578 *
1529 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in 1579 * TODO(scheglov) review this later, there are no explicit "it is a compile-ti me error" in
1530 * specification. But it was added to the co19 and there is same error for fac tories. 1580 * specification. But it was added to the co19 and there is same error for fac tories.
1531 * 1581 *
1532 * https://code.google.com/p/dart/issues/detail?id=954 1582 * https://code.google.com/p/dart/issues/detail?id=954
1533 */ 1583 */
1534 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 140, "Cycle in redirectin g generative constructors"); 1584 static const CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = const Compi leTimeErrorCode.con1('RECURSIVE_CONSTRUCTOR_REDIRECT', 136, "Cycle in redirectin g generative constructors");
1535 1585
1536 /** 1586 /**
1537 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to 1587 * 7.6.2 Factories: It is a compile-time error if a redirecting factory constr uctor redirects to
1538 * itself, either directly or indirectly via a sequence of redirections. 1588 * itself, either directly or indirectly via a sequence of redirections.
1539 */ 1589 */
1540 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 141, "Cycle in redirecting factor y constructors"); 1590 static const CompileTimeErrorCode RECURSIVE_FACTORY_REDIRECT = const CompileTi meErrorCode.con1('RECURSIVE_FACTORY_REDIRECT', 137, "Cycle in redirecting factor y constructors");
1541 1591
1542 /** 1592 /**
1543 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1593 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1544 * superinterface of itself. 1594 * superinterface of itself.
1545 * 1595 *
1546 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1596 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1547 * 1597 *
1548 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1598 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1549 * 1599 *
1550 * @param className the name of the class that implements itself recursively 1600 * @param className the name of the class that implements itself recursively
1551 * @param strImplementsPath a string representation of the implements loop 1601 * @param strImplementsPath a string representation of the implements loop
1552 */ 1602 */
1553 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 142, "'{0}' cannot be a superinterface of itself: {1}"); 1603 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE = const Comp ileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE', 138, "'{0}' cannot be a superinterface of itself: {1}");
1554 1604
1555 /** 1605 /**
1556 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1606 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1557 * superinterface of itself. 1607 * superinterface of itself.
1558 * 1608 *
1559 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1609 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1560 * 1610 *
1561 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1611 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1562 * 1612 *
1563 * @param className the name of the class that implements itself recursively 1613 * @param className the name of the class that implements itself recursively
1564 */ 1614 */
1565 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EX TENDS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CA SE_EXTENDS', 143, "'{0}' cannot extend itself"); 1615 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");
1566 1616
1567 /** 1617 /**
1568 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1618 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1569 * superinterface of itself. 1619 * superinterface of itself.
1570 * 1620 *
1571 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1621 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1572 * 1622 *
1573 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1623 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1574 * 1624 *
1575 * @param className the name of the class that implements itself recursively 1625 * @param className the name of the class that implements itself recursively
1576 */ 1626 */
1577 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE _CASE_IMPLEMENTS', 144, "'{0}' cannot implement itself"); 1627 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IM PLEMENTS = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE _CASE_IMPLEMENTS', 140, "'{0}' cannot implement itself");
1578 1628
1579 /** 1629 /**
1580 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a 1630 * 7.10 Superinterfaces: It is a compile-time error if the interface of a clas s <i>C</i> is a
1581 * superinterface of itself. 1631 * superinterface of itself.
1582 * 1632 *
1583 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself. 1633 * 8.1 Superinterfaces: It is a compile-time error if an interface is a superi nterface of itself.
1584 * 1634 *
1585 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself. 1635 * 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a super class of itself.
1586 * 1636 *
1587 * @param className the name of the class that implements itself recursively 1637 * @param className the name of the class that implements itself recursively
1588 */ 1638 */
1589 static const CompileTimeErrorCode RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WI TH = const CompileTimeErrorCode.con1('RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_ WITH', 145, "'{0}' cannot use itself as a mixin"); 1639 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");
1590 1640
1591 /** 1641 /**
1592 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1642 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1593 * <i>k'</i> is not a constant constructor. 1643 * <i>k'</i> is not a constant constructor.
1594 */ 1644 */
1595 static const CompileTimeErrorCode REDIRECT_TO_MISSING_CONSTRUCTOR = const Comp ileTimeErrorCode.con1('REDIRECT_TO_MISSING_CONSTRUCTOR', 146, "The constructor ' {0}' could not be found in '{1}'"); 1645 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}'");
1596 1646
1597 /** 1647 /**
1598 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1648 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1599 * <i>k'</i> is not a constant constructor. 1649 * <i>k'</i> is not a constant constructor.
1600 */ 1650 */
1601 static const CompileTimeErrorCode REDIRECT_TO_NON_CLASS = const CompileTimeErr orCode.con1('REDIRECT_TO_NON_CLASS', 147, "The name '{0}' is not a type and cann ot be used in a redirected constructor"); 1651 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");
1602 1652
1603 /** 1653 /**
1604 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but 1654 * 7.6.2 Factories: It is a compile-time error if <i>k</i> is prefixed with th e const modifier but
1605 * <i>k'</i> is not a constant constructor. 1655 * <i>k'</i> is not a constant constructor.
1606 */ 1656 */
1607 static const CompileTimeErrorCode REDIRECT_TO_NON_CONST_CONSTRUCTOR = const Co mpileTimeErrorCode.con1('REDIRECT_TO_NON_CONST_CONSTRUCTOR', 148, "Constant fact ory constructor cannot delegate to a non-constant constructor"); 1657 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");
1608 1658
1609 /** 1659 /**
1610 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which 1660 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which
1611 * case its only action is to invoke another generative constructor. 1661 * case its only action is to invoke another generative constructor.
1612 */ 1662 */
1613 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR', 1 49, "The constructor '{0}' could not be found in '{1}'"); 1663 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}'");
1614 1664
1615 /** 1665 /**
1616 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which 1666 * 7.6.1 Generative constructors: A generative constructor may be <i>redirecti ng</i>, in which
1617 * case its only action is to invoke another generative constructor. 1667 * case its only action is to invoke another generative constructor.
1618 */ 1668 */
1619 static const CompileTimeErrorCode REDIRECT_GENERATIVE_TO_NON_GENERATIVE_CONSTR UCTOR = const CompileTimeErrorCode.con1('REDIRECT_GENERATIVE_TO_NON_GENERATIVE_C ONSTRUCTOR', 150, "Generative constructor cannot redirect to a factory construct or"); 1669 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");
1620 1670
1621 /** 1671 /**
1622 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after 1672 * 5 Variables: A local variable may only be referenced at a source code locat ion that is after
1623 * its initializer, if any, is complete, or a compile-time error occurs. 1673 * its initializer, if any, is complete, or a compile-time error occurs.
1624 */ 1674 */
1625 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 151, "Local variables canno t be referenced before they are declared"); 1675 static const CompileTimeErrorCode REFERENCED_BEFORE_DECLARATION = const Compil eTimeErrorCode.con1('REFERENCED_BEFORE_DECLARATION', 147, "Local variables canno t be referenced before they are declared");
1626 1676
1627 /** 1677 /**
1628 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not 1678 * 12.8.1 Rethrow: It is a compile-time error if an expression of the form <i> rethrow;</i> is not
1629 * enclosed within a on-catch clause. 1679 * enclosed within a on-catch clause.
1630 */ 1680 */
1631 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode.con1('RETHROW_OUTSIDE_CATCH', 152, "rethrow must be inside of a catch cla use"); 1681 static const CompileTimeErrorCode RETHROW_OUTSIDE_CATCH = const CompileTimeErr orCode.con1('RETHROW_OUTSIDE_CATCH', 148, "rethrow must be inside of a catch cla use");
1632 1682
1633 /** 1683 /**
1634 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i> 1684 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
1635 * appears in a generative constructor. 1685 * appears in a generative constructor.
1636 */ 1686 */
1637 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 153, "Constructors ca nnot return a value"); 1687 static const CompileTimeErrorCode RETURN_IN_GENERATIVE_CONSTRUCTOR = const Com pileTimeErrorCode.con1('RETURN_IN_GENERATIVE_CONSTRUCTOR', 149, "Constructors ca nnot return a value");
1638 1688
1639 /** 1689 /**
1640 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i> 1690 * 13.12 Return: It is a compile-time error if a return statement of the form <i>return e;</i>
1641 * appears in a generator function. 1691 * appears in a generator function.
1642 */ 1692 */
1643 static const CompileTimeErrorCode RETURN_IN_GENERATOR = const CompileTimeError Code.con1('RETURN_IN_GENERATOR', 154, "Cannot return a value from a generator fu nction (one marked with either 'async*' or 'sync*')"); 1693 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*')");
1644 1694
1645 /** 1695 /**
1646 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred imp ort is used in 1696 * 14.1 Imports: It is a compile-time error if a prefix used in a deferred imp ort is used in
1647 * another import clause. 1697 * another import clause.
1648 */ 1698 */
1649 static const CompileTimeErrorCode SHARED_DEFERRED_PREFIX = const CompileTimeEr rorCode.con1('SHARED_DEFERRED_PREFIX', 155, "The prefix of a deferred import can not be used in other import directives"); 1699 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");
1650 1700
1651 /** 1701 /**
1652 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form 1702 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
1653 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip; 1703 * <i>super.m(a<sub>1</sub>, &hellip;, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n +1</sub>, &hellip;
1654 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation 1704 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a compile-time error if a supe r method invocation
1655 * occurs in a top-level function or variable initializer, in an instance vari able initializer or 1705 * occurs in a top-level function or variable initializer, in an instance vari able initializer or
1656 * initializer list, in class Object, in a factory constructor, or in a static method or variable 1706 * initializer list, in class Object, in a factory constructor, or in a static method or variable
1657 * initializer. 1707 * initializer.
1658 */ 1708 */
1659 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 156, "Invalid context for 'super' inv ocation"); 1709 static const CompileTimeErrorCode SUPER_IN_INVALID_CONTEXT = const CompileTime ErrorCode.con1('SUPER_IN_INVALID_CONTEXT', 152, "Invalid context for 'super' inv ocation");
1660 1710
1661 /** 1711 /**
1662 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its 1712 * 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
1663 * only action is to invoke another generative constructor. 1713 * only action is to invoke another generative constructor.
1664 */ 1714 */
1665 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 157, "The redirecting constructor cannot have a 'super' initializer"); 1715 static const CompileTimeErrorCode SUPER_IN_REDIRECTING_CONSTRUCTOR = const Com pileTimeErrorCode.con1('SUPER_IN_REDIRECTING_CONSTRUCTOR', 153, "The redirecting constructor cannot have a 'super' initializer");
1666 1716
1667 /** 1717 /**
1668 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time 1718 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It is a compile-time
1669 * error if a generative constructor of class Object includes a superinitializ er. 1719 * error if a generative constructor of class Object includes a superinitializ er.
1670 */ 1720 */
1671 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 158, ""); 1721 static const CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = const CompileT imeErrorCode.con1('SUPER_INITIALIZER_IN_OBJECT', 154, "");
1672 1722
1673 /** 1723 /**
1674 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a 1724 * 12.11 Instance Creation: It is a static type warning if any of the type arg uments to a
1675 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object 1725 * constructor of a generic type <i>G</i> invoked by a new expression or a con stant object
1676 * expression are not subtypes of the bounds of the corresponding formal type parameters of 1726 * expression are not subtypes of the bounds of the corresponding formal type parameters of
1677 * <i>G</i>. 1727 * <i>G</i>.
1678 * 1728 *
1679 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a 1729 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if T is mal-bounded a
1680 * dynamic error occurs. 1730 * dynamic error occurs.
1681 * 1731 *
1682 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise 1732 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time constant would raise
1683 * an exception. 1733 * an exception.
1684 * 1734 *
1685 * @param boundedTypeName the name of the type used in the instance creation t hat should be 1735 * @param boundedTypeName the name of the type used in the instance creation t hat should be
1686 * limited by the bound as specified in the class declaration 1736 * limited by the bound as specified in the class declaration
1687 * @param boundingTypeName the name of the bounding type 1737 * @param boundingTypeName the name of the bounding type
1688 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS 1738 * @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
1689 */ 1739 */
1690 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 159, "'{0}' does no t extend '{1}'"); 1740 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co mpileTimeErrorCode.con1('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', 155, "'{0}' does no t extend '{1}'");
1691 1741
1692 /** 1742 /**
1693 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a 1743 * 15.3.1 Typedef: Any self reference, either directly, or recursively via ano ther typedef, is a
1694 * compile time error. 1744 * compile time error.
1695 */ 1745 */
1696 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C ompileTimeErrorCode.con1('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', 160, "Type alias cannot reference itself directly or recursively via another typedef"); 1746 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");
1697 1747
1698 /** 1748 /**
1699 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current 1749 * 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class access ible in the current
1700 * scope, optionally followed by type arguments. 1750 * scope, optionally followed by type arguments.
1701 */ 1751 */
1702 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode .con1('UNDEFINED_CLASS', 161, "Undefined class '{0}'"); 1752 static const CompileTimeErrorCode UNDEFINED_CLASS = const CompileTimeErrorCode .con1('UNDEFINED_CLASS', 157, "Undefined class '{0}'");
1703 1753
1704 /** 1754 /**
1705 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1755 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
1706 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1756 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
1707 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1757 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
1708 * (respectively <i>S.id</i>) 1758 * (respectively <i>S.id</i>)
1709 */ 1759 */
1710 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 162, "The cla ss '{0}' does not have a generative constructor '{1}'"); 1760 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}'");
1711 1761
1712 /** 1762 /**
1713 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears 1763 * 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the super initializer appears
1714 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is 1764 * and let <i>S</i> be the superclass of <i>C</i>. Let <i>k</i> be a generativ e constructor. It is
1715 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i> 1765 * a compile-time error if class <i>S</i> does not declare a generative constr uctor named <i>S</i>
1716 * (respectively <i>S.id</i>) 1766 * (respectively <i>S.id</i>)
1717 */ 1767 */
1718 static const CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = const CompileTimeErrorCode.con1('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT ', 163, "The class '{0}' does not have a default generative constructor"); 1768 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");
1719 1769
1720 /** 1770 /**
1721 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>, 1771 * 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
1722 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ... 1772 * must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i > ...
1723 * <i>p<sub>n+k</sub></i>} or a static warning occurs. 1773 * <i>p<sub>n+k</sub></i>} or a static warning occurs.
1724 * 1774 *
1725 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an 1775 * 12.11.2 Const: It is a compile-time error if evaluation of a constant objec t results in an
1726 * uncaught exception being thrown. 1776 * uncaught exception being thrown.
1727 * 1777 *
1728 * @param name the name of the requested named parameter 1778 * @param name the name of the requested named parameter
1729 */ 1779 */
1730 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 164, "The named parameter '{0}' is not defined"); 1780 static const CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = const CompileTim eErrorCode.con1('UNDEFINED_NAMED_PARAMETER', 160, "The named parameter '{0}' is not defined");
1731 1781
1732 /** 1782 /**
1733 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is 1783 * 14.2 Exports: It is a compile-time error if the compilation unit found at t he specified URI is
1734 * not a library declaration. 1784 * not a library declaration.
1735 * 1785 *
1736 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is 1786 * 14.1 Imports: It is a compile-time error if the compilation unit found at t he specified URI is
1737 * not a library declaration. 1787 * not a library declaration.
1738 * 1788 *
1739 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part 1789 * 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
1740 * declaration. 1790 * declaration.
1741 * 1791 *
1742 * @param uri the URI pointing to a non-existent file 1792 * @param uri the URI pointing to a non-existent file
1743 * @see #INVALID_URI 1793 * @see #INVALID_URI
1744 */ 1794 */
1745 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode.con1('URI_DOES_NOT_EXIST', 165, "Target of URI does not exist: '{0}'"); 1795 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC ode.con1('URI_DOES_NOT_EXIST', 161, "Target of URI does not exist: '{0}'");
1746 1796
1747 /** 1797 /**
1748 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if 1798 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if
1749 * <i>x</i> involves string interpolation. 1799 * <i>x</i> involves string interpolation.
1750 * 1800 *
1751 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if 1801 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time co nstant, or if
1752 * <i>s</i> involves string interpolation. 1802 * <i>s</i> involves string interpolation.
1753 * 1803 *
1754 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is 1804 * 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that d escribes a URI is
1755 * not a compile-time constant, or if <i>x</i> involves string interpolation. 1805 * not a compile-time constant, or if <i>x</i> involves string interpolation.
1756 */ 1806 */
1757 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode.con1('URI_WITH_INTERPOLATION', 166, "URIs cannot use string interpolatio n"); 1807 static const CompileTimeErrorCode URI_WITH_INTERPOLATION = const CompileTimeEr rorCode.con1('URI_WITH_INTERPOLATION', 162, "URIs cannot use string interpolatio n");
1758 1808
1759 /** 1809 /**
1760 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is 1810 * 7.1.1 Operators: It is a compile-time error if the arity of the user-declar ed operator []= is
1761 * not 2. It is a compile time error if the arity of a user-declared operator with one of the 1811 * not 2. It is a compile time error if the arity of a user-declared operator with one of the
1762 * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt ;&gt;, [] is not 1. 1812 * names: &lt;, &gt;, &lt;=, &gt;=, ==, +, /, ~/, *, %, |, ^, &, &lt;&lt;, &gt ;&gt;, [] is not 1.
1763 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a 1813 * It is a compile time error if the arity of the user-declared operator - is not 0 or 1. It is a
1764 * compile time error if the arity of the user-declared operator ~ is not 0. 1814 * compile time error if the arity of the user-declared operator ~ is not 0.
1765 * 1815 *
1766 * @param operatorName the name of the declared operator 1816 * @param operatorName the name of the declared operator
1767 * @param expectedNumberOfParameters the number of parameters expected 1817 * @param expectedNumberOfParameters the number of parameters expected
1768 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration 1818 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration
1769 */ 1819 */
1770 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = co nst CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 167, "O perator '{0}' should declare exactly {1} parameter(s), but {2} found"); 1820 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");
1771 1821
1772 /** 1822 /**
1773 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not 1823 * 7.1.1 Operators: It is a compile time error if the arity of the user-declar ed operator - is not
1774 * 0 or 1. 1824 * 0 or 1.
1775 * 1825 *
1776 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration 1826 * @param actualNumberOfParameters the number of parameters found in the opera tor declaration
1777 */ 1827 */
1778 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINU S = const CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MIN US', 168, "Operator '-' should declare 0 or 1 parameter, but {0} found"); 1828 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");
1779 1829
1780 /** 1830 /**
1781 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include 1831 * 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include
1782 * exactly one required formal parameter <i>p</i>. 1832 * exactly one required formal parameter <i>p</i>.
1783 */ 1833 */
1784 static const CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = cons t CompileTimeErrorCode.con1('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 169, "Sette rs should declare exactly one required parameter"); 1834 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");
1785 1835
1786 /** 1836 /**
1787 * ?? Yield: It is a compile-time error if a yield statement appears in a func tion that is not a 1837 * ?? Yield: It is a compile-time error if a yield statement appears in a func tion that is not a
1788 * generator function. 1838 * generator function.
1789 */ 1839 */
1790 static const CompileTimeErrorCode YIELD_EACH_IN_NON_GENERATOR = const CompileT imeErrorCode.con1('YIELD_EACH_IN_NON_GENERATOR', 170, "Yield-each statements mus t be in a generator function (one marked with either 'async*' or 'sync*')"); 1840 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*')");
1791 1841
1792 /** 1842 /**
1793 * ?? Yield: It is a compile-time error if a yield statement appears in a func tion that is not a 1843 * ?? Yield: It is a compile-time error if a yield statement appears in a func tion that is not a
1794 * generator function. 1844 * generator function.
1795 */ 1845 */
1796 static const CompileTimeErrorCode YIELD_IN_NON_GENERATOR = const CompileTimeEr rorCode.con1('YIELD_IN_NON_GENERATOR', 171, "Yield statements must be in a gener ator function (one marked with either 'async*' or 'sync*')"); 1846 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*')");
1797 1847
1798 static const List<CompileTimeErrorCode> values = const [ 1848 static const List<CompileTimeErrorCode> values = const [
1799 ACCESS_PRIVATE_ENUM_FIELD, 1849 ACCESS_PRIVATE_ENUM_FIELD,
1800 AMBIGUOUS_EXPORT, 1850 AMBIGUOUS_EXPORT,
1801 ARGUMENT_DEFINITION_TEST_NON_PARAMETER, 1851 ARGUMENT_DEFINITION_TEST_NON_PARAMETER,
1802 ASYNC_FOR_IN_WRONG_CONTEXT, 1852 ASYNC_FOR_IN_WRONG_CONTEXT,
1803 AWAIT_IN_WRONG_CONTEXT, 1853 AWAIT_IN_WRONG_CONTEXT,
1804 BUILT_IN_IDENTIFIER_AS_TYPE, 1854 BUILT_IN_IDENTIFIER_AS_TYPE,
1805 BUILT_IN_IDENTIFIER_AS_TYPE_NAME, 1855 BUILT_IN_IDENTIFIER_AS_TYPE_NAME,
1806 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, 1856 BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME,
1807 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME, 1857 BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME,
1808 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, 1858 CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
1809 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, 1859 COMPILE_TIME_CONSTANT_RAISES_EXCEPTION,
1810 CONFLICTING_GETTER_AND_METHOD, 1860 CONFLICTING_GETTER_AND_METHOD,
1811 CONFLICTING_METHOD_AND_GETTER, 1861 CONFLICTING_METHOD_AND_GETTER,
1812 CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, 1862 CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD,
1813 CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, 1863 CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD,
1814 CONFLICTING_TYPE_VARIABLE_AND_CLASS, 1864 CONFLICTING_TYPE_VARIABLE_AND_CLASS,
1815 CONFLICTING_TYPE_VARIABLE_AND_MEMBER, 1865 CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
1816 CONST_CONSTRUCTOR_THROWS_EXCEPTION, 1866 CONST_CONSTRUCTOR_THROWS_EXCEPTION,
1817 CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST, 1867 CONST_CONSTRUCTOR_WITH_FIELD_INITIALIZED_BY_NON_CONST,
1818 CONST_CONSTRUCTOR_WITH_MIXIN, 1868 CONST_CONSTRUCTOR_WITH_MIXIN,
1819 CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER, 1869 CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
1820 CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, 1870 CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD,
1821 CONST_DEFERRED_CLASS, 1871 CONST_DEFERRED_CLASS,
1822 CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
1823 CONST_FORMAL_PARAMETER, 1872 CONST_FORMAL_PARAMETER,
1824 CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, 1873 CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE,
1825 CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY, 1874 CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE_FROM_DEFERRED_LIBRARY,
1826 CONST_INSTANCE_FIELD, 1875 CONST_INSTANCE_FIELD,
1827 CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, 1876 CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS,
1828 CONST_NOT_INITIALIZED, 1877 CONST_NOT_INITIALIZED,
1829 CONST_EVAL_TYPE_BOOL, 1878 CONST_EVAL_TYPE_BOOL,
1830 CONST_EVAL_TYPE_BOOL_NUM_STRING, 1879 CONST_EVAL_TYPE_BOOL_NUM_STRING,
1831 CONST_EVAL_TYPE_INT, 1880 CONST_EVAL_TYPE_INT,
1832 CONST_EVAL_TYPE_NUM, 1881 CONST_EVAL_TYPE_NUM,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 INVALID_MODIFIER_ON_SETTER, 1935 INVALID_MODIFIER_ON_SETTER,
1887 INVALID_CONSTANT, 1936 INVALID_CONSTANT,
1888 INVALID_CONSTRUCTOR_NAME, 1937 INVALID_CONSTRUCTOR_NAME,
1889 INVALID_FACTORY_NAME_NOT_A_CLASS, 1938 INVALID_FACTORY_NAME_NOT_A_CLASS,
1890 INVALID_REFERENCE_TO_THIS, 1939 INVALID_REFERENCE_TO_THIS,
1891 INVALID_TYPE_ARGUMENT_IN_CONST_LIST, 1940 INVALID_TYPE_ARGUMENT_IN_CONST_LIST,
1892 INVALID_TYPE_ARGUMENT_IN_CONST_MAP, 1941 INVALID_TYPE_ARGUMENT_IN_CONST_MAP,
1893 INVALID_URI, 1942 INVALID_URI,
1894 LABEL_IN_OUTER_SCOPE, 1943 LABEL_IN_OUTER_SCOPE,
1895 LABEL_UNDEFINED, 1944 LABEL_UNDEFINED,
1896 LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,
1897 MAP_KEY_TYPE_NOT_ASSIGNABLE,
1898 MAP_VALUE_TYPE_NOT_ASSIGNABLE,
1899 MEMBER_WITH_CLASS_NAME, 1945 MEMBER_WITH_CLASS_NAME,
1900 METHOD_AND_GETTER_WITH_SAME_NAME, 1946 METHOD_AND_GETTER_WITH_SAME_NAME,
1901 MISSING_CONST_IN_LIST_LITERAL, 1947 MISSING_CONST_IN_LIST_LITERAL,
1902 MISSING_CONST_IN_MAP_LITERAL, 1948 MISSING_CONST_IN_MAP_LITERAL,
1903 MISSING_ENUM_CONSTANT_IN_SWITCH, 1949 MISSING_ENUM_CONSTANT_IN_SWITCH,
1904 MIXIN_DECLARES_CONSTRUCTOR, 1950 MIXIN_DECLARES_CONSTRUCTOR,
1905 MIXIN_DEFERRED_CLASS, 1951 MIXIN_DEFERRED_CLASS,
1906 MIXIN_INHERITS_FROM_NOT_OBJECT, 1952 MIXIN_INHERITS_FROM_NOT_OBJECT,
1907 MIXIN_OF_DISALLOWED_CLASS, 1953 MIXIN_OF_DISALLOWED_CLASS,
1908 MIXIN_OF_ENUM, 1954 MIXIN_OF_ENUM,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 */ 2143 */
2098 ErrorReporter(this._errorListener, this._defaultSource) { 2144 ErrorReporter(this._errorListener, this._defaultSource) {
2099 if (_errorListener == null) { 2145 if (_errorListener == null) {
2100 throw new IllegalArgumentException("An error listener must be provided"); 2146 throw new IllegalArgumentException("An error listener must be provided");
2101 } else if (_defaultSource == null) { 2147 } else if (_defaultSource == null) {
2102 throw new IllegalArgumentException("A default source must be provided"); 2148 throw new IllegalArgumentException("A default source must be provided");
2103 } 2149 }
2104 this._source = _defaultSource; 2150 this._source = _defaultSource;
2105 } 2151 }
2106 2152
2153 Source get source => _source;
2154
2107 /** 2155 /**
2108 * Creates an error with properties with the given error code and arguments. 2156 * Creates an error with properties with the given error code and arguments.
2109 * 2157 *
2110 * @param errorCode the error code of the error to be reported 2158 * @param errorCode the error code of the error to be reported
2111 * @param node the node specifying the location of the error 2159 * @param node the node specifying the location of the error
2112 * @param arguments the arguments to the error, used to compose the error mess age 2160 * @param arguments the arguments to the error, used to compose the error mess age
2113 */ 2161 */
2114 AnalysisErrorWithProperties newErrorWithProperties(ErrorCode errorCode, AstNod e node, List<Object> arguments) => new AnalysisErrorWithProperties.con2(_source, node.offset, node.length, errorCode, arguments); 2162 AnalysisErrorWithProperties newErrorWithProperties(ErrorCode errorCode, AstNod e node, List<Object> arguments) => new AnalysisErrorWithProperties.con2(_source, node.offset, node.length, errorCode, arguments);
2115 2163
2116 /** 2164 /**
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
2324 */ 2372 */
2325 static const ErrorType HINT = const ErrorType('HINT', 1, ErrorSeverity.INFO); 2373 static const ErrorType HINT = const ErrorType('HINT', 1, ErrorSeverity.INFO);
2326 2374
2327 /** 2375 /**
2328 * Compile-time errors are errors that preclude execution. A compile time erro r must be reported 2376 * Compile-time errors are errors that preclude execution. A compile time erro r must be reported
2329 * by a Dart compiler before the erroneous code is executed. 2377 * by a Dart compiler before the erroneous code is executed.
2330 */ 2378 */
2331 static const ErrorType COMPILE_TIME_ERROR = const ErrorType('COMPILE_TIME_ERRO R', 2, ErrorSeverity.ERROR); 2379 static const ErrorType COMPILE_TIME_ERROR = const ErrorType('COMPILE_TIME_ERRO R', 2, ErrorSeverity.ERROR);
2332 2380
2333 /** 2381 /**
2382 * Checked mode compile-time errors are errors that preclude execution in chec ked mode.
2383 */
2384 static const ErrorType CHECKED_MODE_COMPILE_TIME_ERROR = const ErrorType('CHEC KED_MODE_COMPILE_TIME_ERROR', 3, ErrorSeverity.INFO);
2385
2386 /**
2334 * Suggestions made in situations where the user has deviated from recommended pub programming 2387 * Suggestions made in situations where the user has deviated from recommended pub programming
2335 * practices. 2388 * practices.
2336 */ 2389 */
2337 static const ErrorType PUB_SUGGESTION = const ErrorType('PUB_SUGGESTION', 3, E rrorSeverity.WARNING); 2390 static const ErrorType PUB_SUGGESTION = const ErrorType('PUB_SUGGESTION', 4, E rrorSeverity.WARNING);
2338 2391
2339 /** 2392 /**
2340 * Static warnings are those warnings reported by the static checker. They hav e no effect on 2393 * Static warnings are those warnings reported by the static checker. They hav e no effect on
2341 * execution. Static warnings must be provided by Dart compilers used during d evelopment. 2394 * execution. Static warnings must be provided by Dart compilers used during d evelopment.
2342 */ 2395 */
2343 static const ErrorType STATIC_WARNING = const ErrorType('STATIC_WARNING', 4, E rrorSeverity.WARNING); 2396 static const ErrorType STATIC_WARNING = const ErrorType('STATIC_WARNING', 5, E rrorSeverity.WARNING);
2344 2397
2345 /** 2398 /**
2346 * Many, but not all, static warnings relate to types, in which case they are known as static type 2399 * Many, but not all, static warnings relate to types, in which case they are known as static type
2347 * warnings. 2400 * warnings.
2348 */ 2401 */
2349 static const ErrorType STATIC_TYPE_WARNING = const ErrorType('STATIC_TYPE_WARN ING', 5, ErrorSeverity.WARNING); 2402 static const ErrorType STATIC_TYPE_WARNING = const ErrorType('STATIC_TYPE_WARN ING', 6, ErrorSeverity.WARNING);
2350 2403
2351 /** 2404 /**
2352 * Syntactic errors are errors produced as a result of input that does not con form to the grammar. 2405 * Syntactic errors are errors produced as a result of input that does not con form to the grammar.
2353 */ 2406 */
2354 static const ErrorType SYNTACTIC_ERROR = const ErrorType('SYNTACTIC_ERROR', 6, ErrorSeverity.ERROR); 2407 static const ErrorType SYNTACTIC_ERROR = const ErrorType('SYNTACTIC_ERROR', 7, ErrorSeverity.ERROR);
2355 2408
2356 /** 2409 /**
2357 * Angular specific semantic problems. 2410 * Angular specific semantic problems.
2358 */ 2411 */
2359 static const ErrorType ANGULAR = const ErrorType('ANGULAR', 7, ErrorSeverity.I NFO); 2412 static const ErrorType ANGULAR = const ErrorType('ANGULAR', 8, ErrorSeverity.I NFO);
2360 2413
2361 /** 2414 /**
2362 * Polymer specific semantic problems. 2415 * Polymer specific semantic problems.
2363 */ 2416 */
2364 static const ErrorType POLYMER = const ErrorType('POLYMER', 8, ErrorSeverity.I NFO); 2417 static const ErrorType POLYMER = const ErrorType('POLYMER', 9, ErrorSeverity.I NFO);
2365 2418
2366 static const List<ErrorType> values = const [ 2419 static const List<ErrorType> values = const [
2367 TODO, 2420 TODO,
2368 HINT, 2421 HINT,
2369 COMPILE_TIME_ERROR, 2422 COMPILE_TIME_ERROR,
2423 CHECKED_MODE_COMPILE_TIME_ERROR,
2370 PUB_SUGGESTION, 2424 PUB_SUGGESTION,
2371 STATIC_WARNING, 2425 STATIC_WARNING,
2372 STATIC_TYPE_WARNING, 2426 STATIC_TYPE_WARNING,
2373 SYNTACTIC_ERROR, 2427 SYNTACTIC_ERROR,
2374 ANGULAR, 2428 ANGULAR,
2375 POLYMER]; 2429 POLYMER];
2376 2430
2377 /** 2431 /**
2378 * The severity of this type of error. 2432 * The severity of this type of error.
2379 */ 2433 */
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
4169 4223
4170 @override 4224 @override
4171 String get message => "{0}"; 4225 String get message => "{0}";
4172 4226
4173 @override 4227 @override
4174 ErrorType get type => ErrorType.TODO; 4228 ErrorType get type => ErrorType.TODO;
4175 4229
4176 @override 4230 @override
4177 String get uniqueName => "${runtimeType.toString()}.${name}"; 4231 String get uniqueName => "${runtimeType.toString()}.${name}";
4178 } 4232 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698