| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library engine.error; | 5 library engine.error; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'ast.dart' show AstNode; | 9 import 'ast.dart' show AstNode; |
| 10 import 'element.dart'; | 10 import 'element.dart'; |
| (...skipping 3035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3046 'IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', | 3046 'IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', |
| 3047 "The library '{0}' defines a top-level function named 'loadLibrary' wh
ich is hidden by deferring this library"); | 3047 "The library '{0}' defines a top-level function named 'loadLibrary' wh
ich is hidden by deferring this library"); |
| 3048 | 3048 |
| 3049 /** | 3049 /** |
| 3050 * This hint is generated anywhere where the | 3050 * This hint is generated anywhere where the |
| 3051 * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we | 3051 * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we |
| 3052 * used propagated information for the warnings. | 3052 * used propagated information for the warnings. |
| 3053 * | 3053 * |
| 3054 * @param rhsTypeName the name of the right hand side type | 3054 * @param rhsTypeName the name of the right hand side type |
| 3055 * @param lhsTypeName the name of the left hand side type | 3055 * @param lhsTypeName the name of the left hand side type |
| 3056 * See [StaticTypeWarningCode.INVALID_ASSIGNMENT]. | |
| 3057 */ | 3056 */ |
| 3058 static const HintCode INVALID_ASSIGNMENT = const HintCode( | 3057 static const HintCode INVALID_ASSIGNMENT = const HintCode( |
| 3059 'INVALID_ASSIGNMENT', | 3058 'INVALID_ASSIGNMENT', |
| 3060 "A value of type '{0}' cannot be assigned to a variable of type '{1}'"); | 3059 "A value of type '{0}' cannot be assigned to a variable of type '{1}'"); |
| 3061 | 3060 |
| 3062 /** | 3061 /** |
| 3063 * Generate a hint for methods or functions that have a return type, but do | 3062 * Generate a hint for methods or functions that have a return type, but do |
| 3064 * not have a non-void return statement on all branches. At the end of methods | 3063 * not have a non-void return statement on all branches. At the end of methods |
| 3065 * or functions with no return, Dart implicitly returns `null`, avoiding these | 3064 * or functions with no return, Dart implicitly returns `null`, avoiding these |
| 3066 * implicit returns is considered a best practice. | 3065 * implicit returns is considered a best practice. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3118 | 3117 |
| 3119 /** | 3118 /** |
| 3120 * This hint is generated anywhere where the | 3119 * This hint is generated anywhere where the |
| 3121 * [StaticTypeWarningCode.UNDEFINED_GETTER] or | 3120 * [StaticTypeWarningCode.UNDEFINED_GETTER] or |
| 3122 * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used | 3121 * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used |
| 3123 * propagated information for the warnings. | 3122 * propagated information for the warnings. |
| 3124 * | 3123 * |
| 3125 * @param getterName the name of the getter | 3124 * @param getterName the name of the getter |
| 3126 * @param enclosingType the name of the enclosing type where the getter is | 3125 * @param enclosingType the name of the enclosing type where the getter is |
| 3127 * being looked for | 3126 * being looked for |
| 3128 * See [StaticTypeWarningCode.UNDEFINED_GETTER], and | |
| 3129 * [StaticWarningCode.UNDEFINED_GETTER]. | |
| 3130 */ | 3127 */ |
| 3131 static const HintCode UNDEFINED_GETTER = | 3128 static const HintCode UNDEFINED_GETTER = |
| 3132 const HintCode('UNDEFINED_GETTER', "There is no such getter '{0}' in '{1}'
"); | 3129 const HintCode( |
| 3130 'UNDEFINED_GETTER', |
| 3131 "The getter '{0}' is not defined for the class '{1}'"); |
| 3133 | 3132 |
| 3134 /** | 3133 /** |
| 3135 * This hint is generated anywhere where the | 3134 * This hint is generated anywhere where the |
| 3136 * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we | 3135 * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we |
| 3137 * used propagated information for the warnings. | 3136 * used propagated information for the warnings. |
| 3138 * | 3137 * |
| 3139 * @param methodName the name of the method that is undefined | 3138 * @param methodName the name of the method that is undefined |
| 3140 * @param typeName the resolved type name that the method lookup is happening | 3139 * @param typeName the resolved type name that the method lookup is happening |
| 3141 * on | 3140 * on |
| 3142 * See [StaticTypeWarningCode.UNDEFINED_METHOD]. | |
| 3143 */ | 3141 */ |
| 3144 static const HintCode UNDEFINED_METHOD = const HintCode( | 3142 static const HintCode UNDEFINED_METHOD = const HintCode( |
| 3145 'UNDEFINED_METHOD', | 3143 'UNDEFINED_METHOD', |
| 3146 "The method '{0}' is not defined for the class '{1}'"); | 3144 "The method '{0}' is not defined for the class '{1}'"); |
| 3147 | 3145 |
| 3148 /** | 3146 /** |
| 3149 * This hint is generated anywhere where the | 3147 * This hint is generated anywhere where the |
| 3150 * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we | 3148 * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we |
| 3151 * used propagated information for the warnings. | 3149 * used propagated information for the warnings. |
| 3152 * | 3150 * |
| 3153 * @param operator the name of the operator | 3151 * @param operator the name of the operator |
| 3154 * @param enclosingType the name of the enclosing type where the operator is | 3152 * @param enclosingType the name of the enclosing type where the operator is |
| 3155 * being looked for | 3153 * being looked for |
| 3156 * See [StaticTypeWarningCode.UNDEFINED_OPERATOR]. | |
| 3157 */ | 3154 */ |
| 3158 static const HintCode UNDEFINED_OPERATOR = const HintCode( | 3155 static const HintCode UNDEFINED_OPERATOR = const HintCode( |
| 3159 'UNDEFINED_OPERATOR', | 3156 'UNDEFINED_OPERATOR', |
| 3160 "There is no such operator '{0}' in '{1}'"); | 3157 "The operator '{0}' is not defined for the class '{1}'"); |
| 3161 | 3158 |
| 3162 /** | 3159 /** |
| 3163 * This hint is generated anywhere where the | 3160 * This hint is generated anywhere where the |
| 3164 * [StaticTypeWarningCode.UNDEFINED_SETTER] or | 3161 * [StaticTypeWarningCode.UNDEFINED_SETTER] or |
| 3165 * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used | 3162 * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used |
| 3166 * propagated information for the warnings. | 3163 * propagated information for the warnings. |
| 3167 * | 3164 * |
| 3168 * @param setterName the name of the setter | 3165 * @param setterName the name of the setter |
| 3169 * @param enclosingType the name of the enclosing type where the setter is | 3166 * @param enclosingType the name of the enclosing type where the setter is |
| 3170 * being looked for | 3167 * being looked for |
| 3171 * See [StaticTypeWarningCode.UNDEFINED_SETTER], and | |
| 3172 * [StaticWarningCode.UNDEFINED_SETTER]. | |
| 3173 */ | 3168 */ |
| 3174 static const HintCode UNDEFINED_SETTER = | 3169 static const HintCode UNDEFINED_SETTER = |
| 3175 const HintCode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'
"); | 3170 const HintCode( |
| 3171 'UNDEFINED_SETTER', |
| 3172 "The setter '{0}' is not defined for the class '{1}'"); |
| 3176 | 3173 |
| 3177 /** | 3174 /** |
| 3178 * Unnecessary cast. | 3175 * Unnecessary cast. |
| 3179 */ | 3176 */ |
| 3180 static const HintCode UNNECESSARY_CAST = | 3177 static const HintCode UNNECESSARY_CAST = |
| 3181 const HintCode('UNNECESSARY_CAST', "Unnecessary cast"); | 3178 const HintCode('UNNECESSARY_CAST', "Unnecessary cast"); |
| 3182 | 3179 |
| 3183 /** | 3180 /** |
| 3184 * Unnecessary type checks, the result is always true. | 3181 * Unnecessary type checks, the result is always true. |
| 3185 */ | 3182 */ |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3671 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is | 3668 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is |
| 3672 * a static type warning if <i>T</i> does not have a getter named <i>m</i>. | 3669 * a static type warning if <i>T</i> does not have a getter named <i>m</i>. |
| 3673 * | 3670 * |
| 3674 * @param getterName the name of the getter | 3671 * @param getterName the name of the getter |
| 3675 * @param enclosingType the name of the enclosing type where the getter is | 3672 * @param enclosingType the name of the enclosing type where the getter is |
| 3676 * being looked for | 3673 * being looked for |
| 3677 */ | 3674 */ |
| 3678 static const StaticTypeWarningCode UNDEFINED_GETTER = | 3675 static const StaticTypeWarningCode UNDEFINED_GETTER = |
| 3679 const StaticTypeWarningCode( | 3676 const StaticTypeWarningCode( |
| 3680 'UNDEFINED_GETTER', | 3677 'UNDEFINED_GETTER', |
| 3681 "There is no such getter '{0}' in '{1}'"); | 3678 "The getter '{0}' is not defined for the class '{1}'"); |
| 3682 | 3679 |
| 3683 /** | 3680 /** |
| 3684 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. | 3681 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. |
| 3685 * It is a static type warning if <i>T</i> does not have an accessible | 3682 * It is a static type warning if <i>T</i> does not have an accessible |
| 3686 * instance member named <i>m</i>. | 3683 * instance member named <i>m</i>. |
| 3687 * | 3684 * |
| 3688 * @param methodName the name of the method that is undefined | 3685 * @param methodName the name of the method that is undefined |
| 3689 * @param typeName the resolved type name that the method lookup is happening | 3686 * @param typeName the resolved type name that the method lookup is happening |
| 3690 * on | 3687 * on |
| 3691 */ | 3688 */ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 3710 * It is a static type warning if <i>T</i> does not have an accessible | 3707 * It is a static type warning if <i>T</i> does not have an accessible |
| 3711 * instance member named <i>m</i>. | 3708 * instance member named <i>m</i>. |
| 3712 * | 3709 * |
| 3713 * @param operator the name of the operator | 3710 * @param operator the name of the operator |
| 3714 * @param enclosingType the name of the enclosing type where the operator is | 3711 * @param enclosingType the name of the enclosing type where the operator is |
| 3715 * being looked for | 3712 * being looked for |
| 3716 */ | 3713 */ |
| 3717 static const StaticTypeWarningCode UNDEFINED_OPERATOR = | 3714 static const StaticTypeWarningCode UNDEFINED_OPERATOR = |
| 3718 const StaticTypeWarningCode( | 3715 const StaticTypeWarningCode( |
| 3719 'UNDEFINED_OPERATOR', | 3716 'UNDEFINED_OPERATOR', |
| 3720 "There is no such operator '{0}' in '{1}'"); | 3717 "The operator '{0}' is not defined for the class '{1}'"); |
| 3721 | 3718 |
| 3722 /** | 3719 /** |
| 3723 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. | 3720 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. |
| 3724 * It is a static type warning if <i>T</i> does not have an accessible | 3721 * It is a static type warning if <i>T</i> does not have an accessible |
| 3725 * instance setter named <i>v=</i>. | 3722 * instance setter named <i>v=</i>. |
| 3726 * | 3723 * |
| 3727 * @param setterName the name of the setter | 3724 * @param setterName the name of the setter |
| 3728 * @param enclosingType the name of the enclosing type where the setter is | 3725 * @param enclosingType the name of the enclosing type where the setter is |
| 3729 * being looked for | 3726 * being looked for |
| 3730 * See [INACCESSIBLE_SETTER]. | 3727 * See [INACCESSIBLE_SETTER]. |
| 3731 */ | 3728 */ |
| 3732 static const StaticTypeWarningCode UNDEFINED_SETTER = | 3729 static const StaticTypeWarningCode UNDEFINED_SETTER = |
| 3733 const StaticTypeWarningCode( | 3730 const StaticTypeWarningCode( |
| 3734 'UNDEFINED_SETTER', | 3731 'UNDEFINED_SETTER', |
| 3735 "There is no such setter '{0}' in '{1}'"); | 3732 "The setter '{0}' is not defined for the class '{1}'"); |
| 3733 |
| 3734 /** |
| 3735 * 12.17 Getter Invocation: Let <i>T</i> be the static type of <i>e</i>. It is |
| 3736 * a static type warning if <i>T</i> does not have a getter named <i>m</i>. |
| 3737 * |
| 3738 * @param getterName the name of the getter |
| 3739 * @param enclosingType the name of the enclosing type where the getter is |
| 3740 * being looked for |
| 3741 */ |
| 3742 static const StaticTypeWarningCode UNDEFINED_SUPER_GETTER = |
| 3743 const StaticTypeWarningCode( |
| 3744 'UNDEFINED_SUPER_GETTER', |
| 3745 "The getter '{0}' is not defined in a superclass of '{1}'"); |
| 3736 | 3746 |
| 3737 /** | 3747 /** |
| 3738 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | 3748 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form |
| 3739 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: | 3749 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: |
| 3740 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a | 3750 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a |
| 3741 * static type warning if <i>S</i> does not have an accessible instance member | 3751 * static type warning if <i>S</i> does not have an accessible instance member |
| 3742 * named <i>m</i>. | 3752 * named <i>m</i>. |
| 3743 * | 3753 * |
| 3744 * @param methodName the name of the method that is undefined | 3754 * @param methodName the name of the method that is undefined |
| 3745 * @param typeName the resolved type name that the method lookup is happening | 3755 * @param typeName the resolved type name that the method lookup is happening |
| 3746 * on | 3756 * on |
| 3747 */ | 3757 */ |
| 3748 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = | 3758 static const StaticTypeWarningCode UNDEFINED_SUPER_METHOD = |
| 3749 const StaticTypeWarningCode( | 3759 const StaticTypeWarningCode( |
| 3750 'UNDEFINED_SUPER_METHOD', | 3760 'UNDEFINED_SUPER_METHOD', |
| 3751 "There is no such method '{0}' in '{1}'"); | 3761 "The method '{0}' is not defined in a superclass of '{1}'"); |
| 3762 |
| 3763 /** |
| 3764 * 12.18 Assignment: Evaluation of an assignment of the form |
| 3765 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] = <i>e<sub>3</sub></i> is |
| 3766 * equivalent to the evaluation of the expression (a, i, e){a.[]=(i, e); |
| 3767 * return e;} (<i>e<sub>1</sub></i>, <i>e<sub>2</sub></i>, |
| 3768 * <i>e<sub>2</sub></i>). |
| 3769 * |
| 3770 * 12.29 Assignable Expressions: An assignable expression of the form |
| 3771 * <i>e<sub>1</sub></i>[<i>e<sub>2</sub></i>] is evaluated as a method |
| 3772 * invocation of the operator method [] on <i>e<sub>1</sub></i> with argument |
| 3773 * <i>e<sub>2</sub></i>. |
| 3774 * |
| 3775 * 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. |
| 3776 * It is a static type warning if <i>T</i> does not have an accessible |
| 3777 * instance member named <i>m</i>. |
| 3778 * |
| 3779 * @param operator the name of the operator |
| 3780 * @param enclosingType the name of the enclosing type where the operator is |
| 3781 * being looked for |
| 3782 */ |
| 3783 static const StaticTypeWarningCode UNDEFINED_SUPER_OPERATOR = |
| 3784 const StaticTypeWarningCode( |
| 3785 'UNDEFINED_SUPER_OPERATOR', |
| 3786 "The operator '{0}' is not defined in a superclass of '{1}'"); |
| 3787 |
| 3788 /** |
| 3789 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. |
| 3790 * It is a static type warning if <i>T</i> does not have an accessible |
| 3791 * instance setter named <i>v=</i>. |
| 3792 * |
| 3793 * @param setterName the name of the setter |
| 3794 * @param enclosingType the name of the enclosing type where the setter is |
| 3795 * being looked for |
| 3796 * See [INACCESSIBLE_SETTER]. |
| 3797 */ |
| 3798 static const StaticTypeWarningCode UNDEFINED_SUPER_SETTER = |
| 3799 const StaticTypeWarningCode( |
| 3800 'UNDEFINED_SUPER_SETTER', |
| 3801 "The setter '{0}' is not defined in a superclass of '{1}'"); |
| 3752 | 3802 |
| 3753 /** | 3803 /** |
| 3754 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does | 3804 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does |
| 3755 * not have an accessible (3.2) instance member named <i>m</i>. | 3805 * not have an accessible (3.2) instance member named <i>m</i>. |
| 3756 * | 3806 * |
| 3757 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used | 3807 * This is a specialization of [INSTANCE_ACCESS_TO_STATIC_MEMBER] that is used |
| 3758 * when we are able to find the name defined in a supertype. It exists to | 3808 * when we are able to find the name defined in a supertype. It exists to |
| 3759 * provide a more informative error message. | 3809 * provide a more informative error message. |
| 3760 */ | 3810 */ |
| 3761 static const StaticTypeWarningCode | 3811 static const StaticTypeWarningCode |
| (...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4887 * 12.17 Getter Invocation: It is a static warning if there is no class | 4937 * 12.17 Getter Invocation: It is a static warning if there is no class |
| 4888 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does | 4938 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does |
| 4889 * not declare, implicitly or explicitly, a getter named <i>m</i>. | 4939 * not declare, implicitly or explicitly, a getter named <i>m</i>. |
| 4890 * | 4940 * |
| 4891 * @param getterName the name of the getter | 4941 * @param getterName the name of the getter |
| 4892 * @param enclosingType the name of the enclosing type where the getter is | 4942 * @param enclosingType the name of the enclosing type where the getter is |
| 4893 * being looked for | 4943 * being looked for |
| 4894 */ | 4944 */ |
| 4895 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode( | 4945 static const StaticWarningCode UNDEFINED_GETTER = const StaticWarningCode( |
| 4896 'UNDEFINED_GETTER', | 4946 'UNDEFINED_GETTER', |
| 4897 "There is no such getter '{0}' in '{1}'"); | 4947 "The getter '{0}' is not defined for the class '{1}'"); |
| 4898 | 4948 |
| 4899 /** | 4949 /** |
| 4900 * 12.30 Identifier Reference: It is as static warning if an identifier | 4950 * 12.30 Identifier Reference: It is as static warning if an identifier |
| 4901 * expression of the form <i>id</i> occurs inside a top level or static | 4951 * expression of the form <i>id</i> occurs inside a top level or static |
| 4902 * function (be it function, method, getter, or setter) or variable | 4952 * function (be it function, method, getter, or setter) or variable |
| 4903 * initializer and there is no declaration <i>d</i> with name <i>id</i> in the | 4953 * initializer and there is no declaration <i>d</i> with name <i>id</i> in the |
| 4904 * lexical scope enclosing the expression. | 4954 * lexical scope enclosing the expression. |
| 4905 * | 4955 * |
| 4906 * @param name the name of the identifier | 4956 * @param name the name of the identifier |
| 4907 */ | 4957 */ |
| (...skipping 23 matching lines...) Expand all Loading... |
| 4931 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in | 4981 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in |
| 4932 * the enclosing lexical scope of the assignment, or if <i>C</i> does not | 4982 * the enclosing lexical scope of the assignment, or if <i>C</i> does not |
| 4933 * declare, implicitly or explicitly, a setter <i>v=</i>. | 4983 * declare, implicitly or explicitly, a setter <i>v=</i>. |
| 4934 * | 4984 * |
| 4935 * @param setterName the name of the getter | 4985 * @param setterName the name of the getter |
| 4936 * @param enclosingType the name of the enclosing type where the setter is | 4986 * @param enclosingType the name of the enclosing type where the setter is |
| 4937 * being looked for | 4987 * being looked for |
| 4938 */ | 4988 */ |
| 4939 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode( | 4989 static const StaticWarningCode UNDEFINED_SETTER = const StaticWarningCode( |
| 4940 'UNDEFINED_SETTER', | 4990 'UNDEFINED_SETTER', |
| 4941 "There is no such setter '{0}' in '{1}'"); | 4991 "The setter '{0}' is not defined for the class '{1}'"); |
| 4942 | 4992 |
| 4943 /** | 4993 /** |
| 4944 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not | 4994 * 12.16.3 Static Invocation: It is a static warning if <i>C</i> does not |
| 4945 * declare a static method or getter <i>m</i>. | 4995 * declare a static method or getter <i>m</i>. |
| 4946 * | 4996 * |
| 4947 * @param methodName the name of the method | 4997 * @param methodName the name of the method |
| 4948 * @param enclosingType the name of the enclosing type where the method is | 4998 * @param enclosingType the name of the enclosing type where the method is |
| 4949 * being looked for | 4999 * being looked for |
| 4950 */ | 5000 */ |
| 4951 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = | 5001 static const StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = |
| 4952 const StaticWarningCode( | 5002 const StaticWarningCode( |
| 4953 'UNDEFINED_STATIC_METHOD_OR_GETTER', | 5003 'UNDEFINED_STATIC_METHOD_OR_GETTER', |
| 4954 "There is no such static method, getter or setter '{0}' in '{1}'"); | 5004 "The static method, getter or setter '{0}' is not defined for the clas
s '{1}'"); |
| 5005 |
| 5006 /** |
| 5007 * 12.17 Getter Invocation: It is a static warning if there is no class |
| 5008 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does |
| 5009 * not declare, implicitly or explicitly, a getter named <i>m</i>. |
| 5010 * |
| 5011 * @param getterName the name of the getter |
| 5012 * @param enclosingType the name of the enclosing type where the getter is |
| 5013 * being looked for |
| 5014 */ |
| 5015 static const StaticWarningCode UNDEFINED_SUPER_GETTER = const StaticWarningCod
e( |
| 5016 'UNDEFINED_SUPER_GETTER', |
| 5017 "The getter '{0}' is not defined in a superclass of '{1}'"); |
| 5018 |
| 5019 /** |
| 5020 * 12.18 Assignment: It is as static warning if an assignment of the form |
| 5021 * <i>v = e</i> occurs inside a top level or static function (be it function, |
| 5022 * method, getter, or setter) or variable initializer and there is no |
| 5023 * declaration <i>d</i> with name <i>v=</i> in the lexical scope enclosing the |
| 5024 * assignment. |
| 5025 * |
| 5026 * 12.18 Assignment: It is a static warning if there is no class <i>C</i> in |
| 5027 * the enclosing lexical scope of the assignment, or if <i>C</i> does not |
| 5028 * declare, implicitly or explicitly, a setter <i>v=</i>. |
| 5029 * |
| 5030 * @param setterName the name of the getter |
| 5031 * @param enclosingType the name of the enclosing type where the setter is |
| 5032 * being looked for |
| 5033 */ |
| 5034 static const StaticWarningCode UNDEFINED_SUPER_SETTER = const StaticWarningCod
e( |
| 5035 'UNDEFINED_SUPER_SETTER', |
| 5036 "The setter '{0}' is not defined in a superclass of '{1}'"); |
| 4955 | 5037 |
| 4956 /** | 5038 /** |
| 4957 * 7.2 Getters: It is a static warning if the return type of a getter is void. | 5039 * 7.2 Getters: It is a static warning if the return type of a getter is void. |
| 4958 */ | 5040 */ |
| 4959 static const StaticWarningCode VOID_RETURN_FOR_GETTER = | 5041 static const StaticWarningCode VOID_RETURN_FOR_GETTER = |
| 4960 const StaticWarningCode( | 5042 const StaticWarningCode( |
| 4961 'VOID_RETURN_FOR_GETTER', | 5043 'VOID_RETURN_FOR_GETTER', |
| 4962 "The return type of the getter must not be 'void'"); | 5044 "The return type of the getter must not be 'void'"); |
| 4963 | 5045 |
| 4964 /** | 5046 /** |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5006 * Initialize a newly created error code to have the given [name]. | 5088 * Initialize a newly created error code to have the given [name]. |
| 5007 */ | 5089 */ |
| 5008 const TodoCode(String name) : super(name, "{0}"); | 5090 const TodoCode(String name) : super(name, "{0}"); |
| 5009 | 5091 |
| 5010 @override | 5092 @override |
| 5011 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 5093 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
| 5012 | 5094 |
| 5013 @override | 5095 @override |
| 5014 ErrorType get type => ErrorType.TODO; | 5096 ErrorType get type => ErrorType.TODO; |
| 5015 } | 5097 } |
| OLD | NEW |