| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.error; | 4 library engine.error; |
| 5 | 5 |
| 6 import 'java_core.dart'; | 6 import 'java_core.dart'; |
| 7 import 'source.dart'; | 7 import 'source.dart'; |
| 8 import 'scanner.dart' show Token; | 8 import 'scanner.dart' show Token; |
| 9 import 'ast.dart' show ASTNode; | 9 import 'ast.dart' show ASTNode; |
| 10 import 'element.dart' show Element; | 10 import 'element.dart' show Element; |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 * Hint for the `x is! double` type checks. | 549 * Hint for the `x is! double` type checks. |
| 550 */ | 550 */ |
| 551 static final HintCode IS_NOT_DOUBLE = new HintCode.con1('IS_NOT_DOUBLE', 8, "W
hen compiled to JS, this test might return false when the left hand side is an i
nt"); | 551 static final HintCode IS_NOT_DOUBLE = new HintCode.con1('IS_NOT_DOUBLE', 8, "W
hen compiled to JS, this test might return false when the left hand side is an i
nt"); |
| 552 | 552 |
| 553 /** | 553 /** |
| 554 * Hint for the `x is! int` type checks. | 554 * Hint for the `x is! int` type checks. |
| 555 */ | 555 */ |
| 556 static final HintCode IS_NOT_INT = new HintCode.con1('IS_NOT_INT', 9, "When co
mpiled to JS, this test might return false when the left hand side is a double")
; | 556 static final HintCode IS_NOT_INT = new HintCode.con1('IS_NOT_INT', 9, "When co
mpiled to JS, this test might return false when the left hand side is a double")
; |
| 557 | 557 |
| 558 /** | 558 /** |
| 559 * Generate a hint for methods or functions that have a return type, but do no
t have a non-void |
| 560 * return statement on all branches. At the end of methods or functions with n
o return, Dart |
| 561 * implicitly returns `null`, avoiding these implicit returns is considered a
best practice. |
| 562 * |
| 563 * @param returnType the name of the declared return type |
| 564 */ |
| 565 static final HintCode MISSING_RETURN = new HintCode.con2('MISSING_RETURN', 10,
"This function declares a return type of '%s', but does not end with a return s
tatement.", "Either add a return statement or change the return type to 'void'."
); |
| 566 |
| 567 /** |
| 559 * It is not in best practice to declare a private method that happens to over
ride the method in a | 568 * It is not in best practice to declare a private method that happens to over
ride the method in a |
| 560 * superclass- depending on where the superclass is (either in the same librar
y, or out of the | 569 * superclass- depending on where the superclass is (either in the same librar
y, or out of the |
| 561 * same library), behavior can be different. | 570 * same library), behavior can be different. |
| 562 * | 571 * |
| 563 * @param memberType this is either "method", "getter" or "setter" | 572 * @param memberType this is either "method", "getter" or "setter" |
| 564 * @param memberName some private member name | 573 * @param memberName some private member name |
| 565 * @param className the class name where the member is overriding the function
ality | 574 * @param className the class name where the member is overriding the function
ality |
| 566 */ | 575 */ |
| 567 static final HintCode OVERRIDDING_PRIVATE_MEMBER = new HintCode.con1('OVERRIDD
ING_PRIVATE_MEMBER', 10, "The %s '%s' does not override the definition from '%s'
because it is private and in a different library"); | 576 static final HintCode OVERRIDDING_PRIVATE_MEMBER = new HintCode.con1('OVERRIDD
ING_PRIVATE_MEMBER', 11, "The %s '%s' does not override the definition from '%s'
because it is private and in a different library"); |
| 568 | 577 |
| 569 /** | 578 /** |
| 570 * Hint for classes that override equals, but not hashCode. | 579 * Hint for classes that override equals, but not hashCode. |
| 571 * | 580 * |
| 572 * @param className the name of the current class | 581 * @param className the name of the current class |
| 573 */ | 582 */ |
| 574 static final HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = new HintCode.con1('O
VERRIDE_EQUALS_BUT_NOT_HASH_CODE', 11, "The class '%s' overrides 'operator==', b
ut not 'get hashCode'"); | 583 static final HintCode OVERRIDE_EQUALS_BUT_NOT_HASH_CODE = new HintCode.con1('O
VERRIDE_EQUALS_BUT_NOT_HASH_CODE', 12, "The class '%s' overrides 'operator==', b
ut not 'get hashCode'"); |
| 575 | 584 |
| 576 /** | 585 /** |
| 577 * Type checks of the type `x is! Null` should be done with `x != null`. | 586 * Type checks of the type `x is! Null` should be done with `x != null`. |
| 578 */ | 587 */ |
| 579 static final HintCode TYPE_CHECK_IS_NOT_NULL = new HintCode.con1('TYPE_CHECK_I
S_NOT_NULL', 12, "Tests for non-null should be done with '!= null'"); | 588 static final HintCode TYPE_CHECK_IS_NOT_NULL = new HintCode.con1('TYPE_CHECK_I
S_NOT_NULL', 13, "Tests for non-null should be done with '!= null'"); |
| 580 | 589 |
| 581 /** | 590 /** |
| 582 * Type checks of the type `x is Null` should be done with `x == null`. | 591 * Type checks of the type `x is Null` should be done with `x == null`. |
| 583 */ | 592 */ |
| 584 static final HintCode TYPE_CHECK_IS_NULL = new HintCode.con1('TYPE_CHECK_IS_NU
LL', 13, "Tests for null should be done with '== null'"); | 593 static final HintCode TYPE_CHECK_IS_NULL = new HintCode.con1('TYPE_CHECK_IS_NU
LL', 14, "Tests for null should be done with '== null'"); |
| 585 | 594 |
| 586 /** | 595 /** |
| 587 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
GETTER] or | 596 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
GETTER] or |
| 588 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used
propagated | 597 * [StaticWarningCode#UNDEFINED_GETTER] would have been generated, if we used
propagated |
| 589 * information for the warnings. | 598 * information for the warnings. |
| 590 * | 599 * |
| 591 * @param getterName the name of the getter | 600 * @param getterName the name of the getter |
| 592 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for | 601 * @param enclosingType the name of the enclosing type where the getter is bei
ng looked for |
| 593 * @see StaticTypeWarningCode#UNDEFINED_GETTER | 602 * @see StaticTypeWarningCode#UNDEFINED_GETTER |
| 594 * @see StaticWarningCode#UNDEFINED_GETTER | 603 * @see StaticWarningCode#UNDEFINED_GETTER |
| 595 */ | 604 */ |
| 596 static final HintCode UNDEFINED_GETTER = new HintCode.con1('UNDEFINED_GETTER',
14, StaticTypeWarningCode.UNDEFINED_GETTER.message); | 605 static final HintCode UNDEFINED_GETTER = new HintCode.con1('UNDEFINED_GETTER',
15, StaticTypeWarningCode.UNDEFINED_GETTER.message); |
| 597 | 606 |
| 598 /** | 607 /** |
| 599 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
METHOD] would | 608 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
METHOD] would |
| 600 * have been generated, if we used propagated information for the warnings. | 609 * have been generated, if we used propagated information for the warnings. |
| 601 * | 610 * |
| 602 * @param methodName the name of the method that is undefined | 611 * @param methodName the name of the method that is undefined |
| 603 * @param typeName the resolved type name that the method lookup is happening
on | 612 * @param typeName the resolved type name that the method lookup is happening
on |
| 604 * @see StaticTypeWarningCode#UNDEFINED_METHOD | 613 * @see StaticTypeWarningCode#UNDEFINED_METHOD |
| 605 */ | 614 */ |
| 606 static final HintCode UNDEFINED_METHOD = new HintCode.con1('UNDEFINED_METHOD',
15, StaticTypeWarningCode.UNDEFINED_METHOD.message); | 615 static final HintCode UNDEFINED_METHOD = new HintCode.con1('UNDEFINED_METHOD',
16, StaticTypeWarningCode.UNDEFINED_METHOD.message); |
| 607 | 616 |
| 608 /** | 617 /** |
| 609 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
OPERATOR] | 618 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
OPERATOR] |
| 610 * would have been generated, if we used propagated information for the warnin
gs. | 619 * would have been generated, if we used propagated information for the warnin
gs. |
| 611 * | 620 * |
| 612 * @param operator the name of the operator | 621 * @param operator the name of the operator |
| 613 * @param enclosingType the name of the enclosing type where the operator is b
eing looked for | 622 * @param enclosingType the name of the enclosing type where the operator is b
eing looked for |
| 614 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR | 623 * @see StaticTypeWarningCode#UNDEFINED_OPERATOR |
| 615 */ | 624 */ |
| 616 static final HintCode UNDEFINED_OPERATOR = new HintCode.con1('UNDEFINED_OPERAT
OR', 16, StaticTypeWarningCode.UNDEFINED_OPERATOR.message); | 625 static final HintCode UNDEFINED_OPERATOR = new HintCode.con1('UNDEFINED_OPERAT
OR', 17, StaticTypeWarningCode.UNDEFINED_OPERATOR.message); |
| 617 | 626 |
| 618 /** | 627 /** |
| 619 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
SETTER] or | 628 * This hint is generated anywhere where the [StaticTypeWarningCode#UNDEFINED_
SETTER] or |
| 620 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used
propagated | 629 * [StaticWarningCode#UNDEFINED_SETTER] would have been generated, if we used
propagated |
| 621 * information for the warnings. | 630 * information for the warnings. |
| 622 * | 631 * |
| 623 * @param setterName the name of the setter | 632 * @param setterName the name of the setter |
| 624 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for | 633 * @param enclosingType the name of the enclosing type where the setter is bei
ng looked for |
| 625 * @see StaticTypeWarningCode#UNDEFINED_SETTER | 634 * @see StaticTypeWarningCode#UNDEFINED_SETTER |
| 626 * @see StaticWarningCode#UNDEFINED_SETTER | 635 * @see StaticWarningCode#UNDEFINED_SETTER |
| 627 */ | 636 */ |
| 628 static final HintCode UNDEFINED_SETTER = new HintCode.con1('UNDEFINED_SETTER',
17, StaticTypeWarningCode.UNDEFINED_SETTER.message); | 637 static final HintCode UNDEFINED_SETTER = new HintCode.con1('UNDEFINED_SETTER',
18, StaticTypeWarningCode.UNDEFINED_SETTER.message); |
| 629 | 638 |
| 630 /** | 639 /** |
| 631 * Unnecessary cast. | 640 * Unnecessary cast. |
| 632 */ | 641 */ |
| 633 static final HintCode UNNECESSARY_CAST = new HintCode.con1('UNNECESSARY_CAST',
18, "Unnecessary cast"); | 642 static final HintCode UNNECESSARY_CAST = new HintCode.con1('UNNECESSARY_CAST',
19, "Unnecessary cast"); |
| 634 | 643 |
| 635 /** | 644 /** |
| 636 * Unnecessary type checks, the result is always true. | 645 * Unnecessary type checks, the result is always true. |
| 637 */ | 646 */ |
| 638 static final HintCode UNNECESSARY_TYPE_CHECK_FALSE = new HintCode.con1('UNNECE
SSARY_TYPE_CHECK_FALSE', 19, "Unnecessary type check, the result is always false
"); | 647 static final HintCode UNNECESSARY_TYPE_CHECK_FALSE = new HintCode.con1('UNNECE
SSARY_TYPE_CHECK_FALSE', 20, "Unnecessary type check, the result is always false
"); |
| 639 | 648 |
| 640 /** | 649 /** |
| 641 * Unnecessary type checks, the result is always false. | 650 * Unnecessary type checks, the result is always false. |
| 642 */ | 651 */ |
| 643 static final HintCode UNNECESSARY_TYPE_CHECK_TRUE = new HintCode.con1('UNNECES
SARY_TYPE_CHECK_TRUE', 20, "Unnecessary type check, the result is always true"); | 652 static final HintCode UNNECESSARY_TYPE_CHECK_TRUE = new HintCode.con1('UNNECES
SARY_TYPE_CHECK_TRUE', 21, "Unnecessary type check, the result is always true"); |
| 644 | 653 |
| 645 /** | 654 /** |
| 646 * Unused imports are imports which are never not used. | 655 * Unused imports are imports which are never not used. |
| 647 */ | 656 */ |
| 648 static final HintCode UNUSED_IMPORT = new HintCode.con1('UNUSED_IMPORT', 21, "
Unused import"); | 657 static final HintCode UNUSED_IMPORT = new HintCode.con1('UNUSED_IMPORT', 22, "
Unused import"); |
| 649 | 658 |
| 650 static final List<HintCode> values = [ | 659 static final List<HintCode> values = [ |
| 651 DEAD_CODE, | 660 DEAD_CODE, |
| 652 DEAD_CODE_CATCH_FOLLOWING_CATCH, | 661 DEAD_CODE_CATCH_FOLLOWING_CATCH, |
| 653 DEAD_CODE_ON_CATCH_SUBTYPE, | 662 DEAD_CODE_ON_CATCH_SUBTYPE, |
| 654 DEPRECATED_MEMBER_USE, | 663 DEPRECATED_MEMBER_USE, |
| 655 DUPLICATE_IMPORT, | 664 DUPLICATE_IMPORT, |
| 656 DIVISION_OPTIMIZATION, | 665 DIVISION_OPTIMIZATION, |
| 657 IS_DOUBLE, | 666 IS_DOUBLE, |
| 658 IS_INT, | 667 IS_INT, |
| 659 IS_NOT_DOUBLE, | 668 IS_NOT_DOUBLE, |
| 660 IS_NOT_INT, | 669 IS_NOT_INT, |
| 670 MISSING_RETURN, |
| 661 OVERRIDDING_PRIVATE_MEMBER, | 671 OVERRIDDING_PRIVATE_MEMBER, |
| 662 OVERRIDE_EQUALS_BUT_NOT_HASH_CODE, | 672 OVERRIDE_EQUALS_BUT_NOT_HASH_CODE, |
| 663 TYPE_CHECK_IS_NOT_NULL, | 673 TYPE_CHECK_IS_NOT_NULL, |
| 664 TYPE_CHECK_IS_NULL, | 674 TYPE_CHECK_IS_NULL, |
| 665 UNDEFINED_GETTER, | 675 UNDEFINED_GETTER, |
| 666 UNDEFINED_METHOD, | 676 UNDEFINED_METHOD, |
| 667 UNDEFINED_OPERATOR, | 677 UNDEFINED_OPERATOR, |
| 668 UNDEFINED_SETTER, | 678 UNDEFINED_SETTER, |
| 669 UNNECESSARY_CAST, | 679 UNNECESSARY_CAST, |
| 670 UNNECESSARY_TYPE_CHECK_FALSE, | 680 UNNECESSARY_TYPE_CHECK_FALSE, |
| (...skipping 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3536 StaticTypeWarningCode.con2(String name, int ordinal, this.message, String corr
ection) : super(name, ordinal) { | 3546 StaticTypeWarningCode.con2(String name, int ordinal, this.message, String corr
ection) : super(name, ordinal) { |
| 3537 this.correction6 = correction; | 3547 this.correction6 = correction; |
| 3538 } | 3548 } |
| 3539 | 3549 |
| 3540 String get correction => correction6; | 3550 String get correction => correction6; |
| 3541 | 3551 |
| 3542 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; | 3552 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; |
| 3543 | 3553 |
| 3544 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; | 3554 ErrorType get type => ErrorType.STATIC_TYPE_WARNING; |
| 3545 } | 3555 } |
| OLD | NEW |