| 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 import 'java_core.dart'; | 8 import 'java_core.dart'; |
| 9 import 'source.dart'; | 9 import 'source.dart'; |
| 10 import 'scanner.dart' show Token; | 10 import 'scanner.dart' show Token; |
| 11 import 'ast.dart' show AstNode; | 11 import 'ast.dart' show AstNode; |
| 12 import 'element.dart'; | 12 import 'element.dart'; |
| 13 | 13 |
| 14 /** | 14 /** |
| 15 * Instances of the class `AnalysisError` represent an error discovered during t
he analysis of | 15 * Instances of the class `AnalysisError` represent an error discovered during t
he analysis of |
| 16 * some Dart code. | 16 * some Dart code. |
| 17 * | 17 * |
| 18 * @see AnalysisErrorListener | 18 * See [AnalysisErrorListener]. |
| 19 */ | 19 */ |
| 20 class AnalysisError { | 20 class AnalysisError { |
| 21 /** | 21 /** |
| 22 * An empty array of errors used when no errors are expected. | 22 * An empty array of errors used when no errors are expected. |
| 23 */ | 23 */ |
| 24 static List<AnalysisError> NO_ERRORS = new List<AnalysisError>(0); | 24 static List<AnalysisError> NO_ERRORS = new List<AnalysisError>(0); |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * A [Comparator] that sorts by the name of the file that the [AnalysisError]
was | 27 * A [Comparator] that sorts by the name of the file that the [AnalysisError]
was |
| 28 * found. | 28 * found. |
| (...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE
rrorCode('CONST_EVAL_THROWS_IDBZE', "Evaluation of this constant expression thro
ws IntegerDivisionByZeroException"); | 796 static const CompileTimeErrorCode CONST_EVAL_THROWS_IDBZE = const CompileTimeE
rrorCode('CONST_EVAL_THROWS_IDBZE', "Evaluation of this constant expression thro
ws IntegerDivisionByZeroException"); |
| 797 | 797 |
| 798 /** | 798 /** |
| 799 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S<U<sub>1</sub>, | 799 * 12.11.2 Const: If <i>T</i> is a parameterized type <i>S<U<sub>1</sub>, |
| 800 * …, U<sub>m</sub>></i>, let <i>R = S</i>; It is a compile time | 800 * …, U<sub>m</sub>></i>, let <i>R = S</i>; It is a compile time |
| 801 * error if <i>S</i> is not a generic type with <i>m</i> type parameters. | 801 * error if <i>S</i> is not a generic type with <i>m</i> type parameters. |
| 802 * | 802 * |
| 803 * @param typeName the name of the type being referenced (<i>S</i>) | 803 * @param typeName the name of the type being referenced (<i>S</i>) |
| 804 * @param parameterCount the number of type parameters that were declared | 804 * @param parameterCount the number of type parameters that were declared |
| 805 * @param argumentCount the number of type arguments provided | 805 * @param argumentCount the number of type arguments provided |
| 806 * @see CompileTimeErrorCode#NEW_WITH_INVALID_TYPE_PARAMETERS | 806 * See [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS], and |
| 807 * @see StaticTypeWarningCode#WRONG_NUMBER_OF_TYPE_ARGUMENTS | 807 * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]. |
| 808 */ | 808 */ |
| 809 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const C
ompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is dec
lared with {1} type parameters, but {2} type arguments were given"); | 809 static const CompileTimeErrorCode CONST_WITH_INVALID_TYPE_PARAMETERS = const C
ompileTimeErrorCode('CONST_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is dec
lared with {1} type parameters, but {2} type arguments were given"); |
| 810 | 810 |
| 811 /** | 811 /** |
| 812 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, | 812 * 12.11.2 Const: If <i>e</i> is of the form <i>const T(a<sub>1</sub>, |
| 813 * …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, …, | 813 * …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, …, |
| 814 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if the | 814 * x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a compile-time error if the |
| 815 * type <i>T</i> does not declare a constant constructor with the same name as | 815 * type <i>T</i> does not declare a constant constructor with the same name as |
| 816 * the declaration of <i>T</i>. | 816 * the declaration of <i>T</i>. |
| 817 */ | 817 */ |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 /** | 912 /** |
| 913 * 7. Classes: It is a compile-time error if a class has an instance member | 913 * 7. Classes: It is a compile-time error if a class has an instance member |
| 914 * and a static member with the same name. | 914 * and a static member with the same name. |
| 915 * | 915 * |
| 916 * This covers the additional duplicate definition cases where inheritance has | 916 * This covers the additional duplicate definition cases where inheritance has |
| 917 * to be considered. | 917 * to be considered. |
| 918 * | 918 * |
| 919 * @param className the name of the class that has conflicting instance/static | 919 * @param className the name of the class that has conflicting instance/static |
| 920 * members | 920 * members |
| 921 * @param name the name of the conflicting members | 921 * @param name the name of the conflicting members |
| 922 * @see [DUPLICATE_DEFINITION] | 922 * See [DUPLICATE_DEFINITION]. |
| 923 */ | 923 */ |
| 924 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com
pileTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE', "The name '{0}' is already
defined in '{1}'"); | 924 static const CompileTimeErrorCode DUPLICATE_DEFINITION_INHERITANCE = const Com
pileTimeErrorCode('DUPLICATE_DEFINITION_INHERITANCE', "The name '{0}' is already
defined in '{1}'"); |
| 925 | 925 |
| 926 /** | 926 /** |
| 927 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if | 927 * 12.14.2 Binding Actuals to Formals: It is a compile-time error if |
| 928 * <i>q<sub>i</sub> = q<sub>j</sub></i> for any <i>i != j</i> [where | 928 * <i>q<sub>i</sub> = q<sub>j</sub></i> for any <i>i != j</i> [where |
| 929 * <i>q<sub>i</sub></i> is the label for a named argument]. | 929 * <i>q<sub>i</sub></i> is the label for a named argument]. |
| 930 */ | 930 */ |
| 931 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTime
ErrorCode('DUPLICATE_NAMED_ARGUMENT', "The argument for the named parameter '{0}
' was already specified"); | 931 static const CompileTimeErrorCode DUPLICATE_NAMED_ARGUMENT = const CompileTime
ErrorCode('DUPLICATE_NAMED_ARGUMENT', "The argument for the named parameter '{0}
' was already specified"); |
| 932 | 932 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 * int and double to | 974 * int and double to |
| 975 * attempt to extend or implement num. | 975 * attempt to extend or implement num. |
| 976 * | 976 * |
| 977 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend | 977 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend |
| 978 * or implement bool. | 978 * or implement bool. |
| 979 * | 979 * |
| 980 * 12.5 Strings: It is a compile-time error for a class to attempt to extend | 980 * 12.5 Strings: It is a compile-time error for a class to attempt to extend |
| 981 * or implement String. | 981 * or implement String. |
| 982 * | 982 * |
| 983 * @param typeName the name of the type that cannot be extended | 983 * @param typeName the name of the type that cannot be extended |
| 984 * @see [IMPLEMENTS_DISALLOWED_CLASS] | 984 * See [IMPLEMENTS_DISALLOWED_CLASS]. |
| 985 */ | 985 */ |
| 986 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime
ErrorCode('EXTENDS_DISALLOWED_CLASS', "Classes cannot extend '{0}'"); | 986 static const CompileTimeErrorCode EXTENDS_DISALLOWED_CLASS = const CompileTime
ErrorCode('EXTENDS_DISALLOWED_CLASS', "Classes cannot extend '{0}'"); |
| 987 | 987 |
| 988 /** | 988 /** |
| 989 * 7.9 Superclasses: It is a compile-time error if the extends clause of a | 989 * 7.9 Superclasses: It is a compile-time error if the extends clause of a |
| 990 * class <i>C</i> includes a deferred type expression. | 990 * class <i>C</i> includes a deferred type expression. |
| 991 * | 991 * |
| 992 * @param typeName the name of the type that cannot be extended | 992 * @param typeName the name of the type that cannot be extended |
| 993 * @see [IMPLEMENTS_DEFERRED_CLASS] | 993 * See [IMPLEMENTS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS]. |
| 994 * @see [MIXIN_DEFERRED_CLASS] | |
| 995 */ | 994 */ |
| 996 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeEr
rorCode('EXTENDS_DEFERRED_CLASS', "This class cannot extend the deferred class '
{0}'"); | 995 static const CompileTimeErrorCode EXTENDS_DEFERRED_CLASS = const CompileTimeEr
rorCode('EXTENDS_DEFERRED_CLASS', "This class cannot extend the deferred class '
{0}'"); |
| 997 | 996 |
| 998 /** | 997 /** |
| 999 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < | 998 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < |
| 1000 * h</i> or if <i>m > n</i>. | 999 * h</i> or if <i>m > n</i>. |
| 1001 * | 1000 * |
| 1002 * 12.11.2 Const: It is a compile-time error if evaluation of a constant | 1001 * 12.11.2 Const: It is a compile-time error if evaluation of a constant |
| 1003 * object results in an uncaught exception being thrown. | 1002 * object results in an uncaught exception being thrown. |
| 1004 * | 1003 * |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 * @param name the conflicting name of the getter and method | 1061 * @param name the conflicting name of the getter and method |
| 1063 */ | 1062 */ |
| 1064 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const Com
pileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', "'{0}' cannot be used to n
ame a getter, there is already a method with the same name"); | 1063 static const CompileTimeErrorCode GETTER_AND_METHOD_WITH_SAME_NAME = const Com
pileTimeErrorCode('GETTER_AND_METHOD_WITH_SAME_NAME', "'{0}' cannot be used to n
ame a getter, there is already a method with the same name"); |
| 1065 | 1064 |
| 1066 /** | 1065 /** |
| 1067 * 7.10 Superinterfaces: It is a compile-time error if the implements clause | 1066 * 7.10 Superinterfaces: It is a compile-time error if the implements clause |
| 1068 * of a class <i>C</i> specifies a malformed type or deferred type as a | 1067 * of a class <i>C</i> specifies a malformed type or deferred type as a |
| 1069 * superinterface. | 1068 * superinterface. |
| 1070 * | 1069 * |
| 1071 * @param typeName the name of the type that cannot be extended | 1070 * @param typeName the name of the type that cannot be extended |
| 1072 * @see [EXTENDS_DEFERRED_CLASS] | 1071 * See [EXTENDS_DEFERRED_CLASS], and [MIXIN_DEFERRED_CLASS]. |
| 1073 * @see [MIXIN_DEFERRED_CLASS] | |
| 1074 */ | 1072 */ |
| 1075 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTim
eErrorCode('IMPLEMENTS_DEFERRED_CLASS', "This class cannot implement the deferre
d class '{0}'"); | 1073 static const CompileTimeErrorCode IMPLEMENTS_DEFERRED_CLASS = const CompileTim
eErrorCode('IMPLEMENTS_DEFERRED_CLASS', "This class cannot implement the deferre
d class '{0}'"); |
| 1076 | 1074 |
| 1077 /** | 1075 /** |
| 1078 * 12.2 Null: It is a compile-time error for a class to attempt to extend or | 1076 * 12.2 Null: It is a compile-time error for a class to attempt to extend or |
| 1079 * implement Null. | 1077 * implement Null. |
| 1080 * | 1078 * |
| 1081 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend | 1079 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend |
| 1082 * or implement int. | 1080 * or implement int. |
| 1083 * | 1081 * |
| 1084 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend | 1082 * 12.3 Numbers: It is a compile-time error for a class to attempt to extend |
| 1085 * or implement double. | 1083 * or implement double. |
| 1086 * | 1084 * |
| 1087 * 12.3 Numbers: It is a compile-time error for any type other than the types | 1085 * 12.3 Numbers: It is a compile-time error for any type other than the types |
| 1088 * int and double to | 1086 * int and double to |
| 1089 * attempt to extend or implement num. | 1087 * attempt to extend or implement num. |
| 1090 * | 1088 * |
| 1091 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend | 1089 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend |
| 1092 * or implement bool. | 1090 * or implement bool. |
| 1093 * | 1091 * |
| 1094 * 12.5 Strings: It is a compile-time error for a class to attempt to extend | 1092 * 12.5 Strings: It is a compile-time error for a class to attempt to extend |
| 1095 * or implement String. | 1093 * or implement String. |
| 1096 * | 1094 * |
| 1097 * @param typeName the name of the type that cannot be implemented | 1095 * @param typeName the name of the type that cannot be implemented |
| 1098 * @see [EXTENDS_DISALLOWED_CLASS] | 1096 * See [EXTENDS_DISALLOWED_CLASS]. |
| 1099 */ | 1097 */ |
| 1100 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT
imeErrorCode('IMPLEMENTS_DISALLOWED_CLASS', "Classes cannot implement '{0}'"); | 1098 static const CompileTimeErrorCode IMPLEMENTS_DISALLOWED_CLASS = const CompileT
imeErrorCode('IMPLEMENTS_DISALLOWED_CLASS', "Classes cannot implement '{0}'"); |
| 1101 | 1099 |
| 1102 /** | 1100 /** |
| 1103 * 7.10 Superinterfaces: It is a compile-time error if the implements clause | 1101 * 7.10 Superinterfaces: It is a compile-time error if the implements clause |
| 1104 * of a class includes type dynamic. | 1102 * of a class includes type dynamic. |
| 1105 */ | 1103 */ |
| 1106 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC
ode('IMPLEMENTS_DYNAMIC', "Classes cannot implement 'dynamic'"); | 1104 static const CompileTimeErrorCode IMPLEMENTS_DYNAMIC = const CompileTimeErrorC
ode('IMPLEMENTS_DYNAMIC', "Classes cannot implement 'dynamic'"); |
| 1107 | 1105 |
| 1108 /** | 1106 /** |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 * | 1153 * |
| 1156 * @param uri the uri pointing to a library | 1154 * @param uri the uri pointing to a library |
| 1157 */ | 1155 */ |
| 1158 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE
rrorCode('IMPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and cannot be
imported"); | 1156 static const CompileTimeErrorCode IMPORT_INTERNAL_LIBRARY = const CompileTimeE
rrorCode('IMPORT_INTERNAL_LIBRARY', "The library '{0}' is internal and cannot be
imported"); |
| 1159 | 1157 |
| 1160 /** | 1158 /** |
| 1161 * 14.1 Imports: It is a compile-time error if the specified URI of an | 1159 * 14.1 Imports: It is a compile-time error if the specified URI of an |
| 1162 * immediate import does not refer to a library declaration. | 1160 * immediate import does not refer to a library declaration. |
| 1163 * | 1161 * |
| 1164 * @param uri the uri pointing to a non-library declaration | 1162 * @param uri the uri pointing to a non-library declaration |
| 1165 * @see [StaticWarningCode.IMPORT_OF_NON_LIBRARY] | 1163 * See [StaticWarningCode.IMPORT_OF_NON_LIBRARY]. |
| 1166 */ | 1164 */ |
| 1167 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErr
orCode('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part
-of directive"); | 1165 static const CompileTimeErrorCode IMPORT_OF_NON_LIBRARY = const CompileTimeErr
orCode('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part
-of directive"); |
| 1168 | 1166 |
| 1169 /** | 1167 /** |
| 1170 * 13.9 Switch: It is a compile-time error if values of the expressions | 1168 * 13.9 Switch: It is a compile-time error if values of the expressions |
| 1171 * <i>e<sub>k</sub></i> are not instances of the same class <i>C</i>, for all | 1169 * <i>e<sub>k</sub></i> are not instances of the same class <i>C</i>, for all |
| 1172 * <i>1 <= k <= n</i>. | 1170 * <i>1 <= k <= n</i>. |
| 1173 * | 1171 * |
| 1174 * @param expressionSource the expression source code that is the unexpected | 1172 * @param expressionSource the expression source code that is the unexpected |
| 1175 * type | 1173 * type |
| 1176 * @param expectedType the name of the expected type | 1174 * @param expectedType the name of the expected type |
| 1177 */ | 1175 */ |
| 1178 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const C
ompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES', "Case expressions must
have the same types, '{0}' is not a '{1}'"); | 1176 static const CompileTimeErrorCode INCONSISTENT_CASE_EXPRESSION_TYPES = const C
ompileTimeErrorCode('INCONSISTENT_CASE_EXPRESSION_TYPES', "Case expressions must
have the same types, '{0}' is not a '{1}'"); |
| 1179 | 1177 |
| 1180 /** | 1178 /** |
| 1181 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It | 1179 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It |
| 1182 * is a compile-time error if <i>k</i>'s initializer list contains an | 1180 * is a compile-time error if <i>k</i>'s initializer list contains an |
| 1183 * initializer for a variable that is not an instance variable declared in the | 1181 * initializer for a variable that is not an instance variable declared in the |
| 1184 * immediately surrounding class. | 1182 * immediately surrounding class. |
| 1185 * | 1183 * |
| 1186 * @param id the name of the initializing formal that is not an instance | 1184 * @param id the name of the initializing formal that is not an instance |
| 1187 * variable in the immediately enclosing class | 1185 * variable in the immediately enclosing class |
| 1188 * @see [INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD] | 1186 * See [INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD]. |
| 1189 */ | 1187 */ |
| 1190 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = const C
ompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTENT_FIELD', "'{0}' is not a variab
le in the enclosing class"); | 1188 static const CompileTimeErrorCode INITIALIZER_FOR_NON_EXISTENT_FIELD = const C
ompileTimeErrorCode('INITIALIZER_FOR_NON_EXISTENT_FIELD', "'{0}' is not a variab
le in the enclosing class"); |
| 1191 | 1189 |
| 1192 /** | 1190 /** |
| 1193 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It | 1191 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It |
| 1194 * is a compile-time error if <i>k</i>'s initializer list contains an | 1192 * is a compile-time error if <i>k</i>'s initializer list contains an |
| 1195 * initializer for a variable that is not an instance variable declared in the | 1193 * initializer for a variable that is not an instance variable declared in the |
| 1196 * immediately surrounding class. | 1194 * immediately surrounding class. |
| 1197 * | 1195 * |
| 1198 * @param id the name of the initializing formal that is a static variable in | 1196 * @param id the name of the initializing formal that is a static variable in |
| 1199 * the immediately enclosing class | 1197 * the immediately enclosing class |
| 1200 * @see #INITIALIZING_FORMAL_FOR_STATIC_FIELD | 1198 * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD]. |
| 1201 */ | 1199 */ |
| 1202 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const Compile
TimeErrorCode('INITIALIZER_FOR_STATIC_FIELD', "'{0}' is a static variable in the
enclosing class, variables initialized in a constructor cannot be static"); | 1200 static const CompileTimeErrorCode INITIALIZER_FOR_STATIC_FIELD = const Compile
TimeErrorCode('INITIALIZER_FOR_STATIC_FIELD', "'{0}' is a static variable in the
enclosing class, variables initialized in a constructor cannot be static"); |
| 1203 | 1201 |
| 1204 /** | 1202 /** |
| 1205 * 7.6.1 Generative Constructors: An initializing formal has the form | 1203 * 7.6.1 Generative Constructors: An initializing formal has the form |
| 1206 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of | 1204 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of |
| 1207 * an instance variable of the immediately enclosing class. | 1205 * an instance variable of the immediately enclosing class. |
| 1208 * | 1206 * |
| 1209 * @param id the name of the initializing formal that is not an instance | 1207 * @param id the name of the initializing formal that is not an instance |
| 1210 * variable in the immediately enclosing class | 1208 * variable in the immediately enclosing class |
| 1211 * @see [INITIALIZING_FORMAL_FOR_STATIC_FIELD] | 1209 * See [INITIALIZING_FORMAL_FOR_STATIC_FIELD], and |
| 1212 * @see [INITIALIZER_FOR_NON_EXISTENT_FIELD] | 1210 * [INITIALIZER_FOR_NON_EXISTENT_FIELD]. |
| 1213 */ | 1211 */ |
| 1214 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD =
const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', "'{0}'
is not a variable in the enclosing class"); | 1212 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD =
const CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD', "'{0}'
is not a variable in the enclosing class"); |
| 1215 | 1213 |
| 1216 /** | 1214 /** |
| 1217 * 7.6.1 Generative Constructors: An initializing formal has the form | 1215 * 7.6.1 Generative Constructors: An initializing formal has the form |
| 1218 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of | 1216 * <i>this.id</i>. It is a compile-time error if <i>id</i> is not the name of |
| 1219 * an instance variable of the immediately enclosing class. | 1217 * an instance variable of the immediately enclosing class. |
| 1220 * | 1218 * |
| 1221 * @param id the name of the initializing formal that is a static variable in | 1219 * @param id the name of the initializing formal that is a static variable in |
| 1222 * the immediately enclosing class | 1220 * the immediately enclosing class |
| 1223 * @see [INITIALIZER_FOR_STATIC_FIELD] | 1221 * See [INITIALIZER_FOR_STATIC_FIELD]. |
| 1224 */ | 1222 */ |
| 1225 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const
CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD', "'{0}' is a static
field in the enclosing class, fields initialized in a constructor cannot be sta
tic"); | 1223 static const CompileTimeErrorCode INITIALIZING_FORMAL_FOR_STATIC_FIELD = const
CompileTimeErrorCode('INITIALIZING_FORMAL_FOR_STATIC_FIELD', "'{0}' is a static
field in the enclosing class, fields initialized in a constructor cannot be sta
tic"); |
| 1226 | 1224 |
| 1227 /** | 1225 /** |
| 1228 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property | 1226 * 12.30 Identifier Reference: Otherwise, e is equivalent to the property |
| 1229 * extraction <b>this</b>.<i>id</i>. | 1227 * extraction <b>this</b>.<i>id</i>. |
| 1230 */ | 1228 */ |
| 1231 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const
CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', "Instance members ca
nnot be accessed from a factory constructor"); | 1229 static const CompileTimeErrorCode INSTANCE_MEMBER_ACCESS_FROM_FACTORY = const
CompileTimeErrorCode('INSTANCE_MEMBER_ACCESS_FROM_FACTORY', "Instance members ca
nnot be accessed from a factory constructor"); |
| 1232 | 1230 |
| 1233 /** | 1231 /** |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 * 14.2 Exports: It is a compile-time error if the compilation unit found at | 1327 * 14.2 Exports: It is a compile-time error if the compilation unit found at |
| 1330 * the specified URI is not a library declaration. | 1328 * the specified URI is not a library declaration. |
| 1331 * | 1329 * |
| 1332 * 14.1 Imports: It is a compile-time error if the compilation unit found at | 1330 * 14.1 Imports: It is a compile-time error if the compilation unit found at |
| 1333 * the specified URI is not a library declaration. | 1331 * the specified URI is not a library declaration. |
| 1334 * | 1332 * |
| 1335 * 14.3 Parts: It is a compile time error if the contents of the URI are not a | 1333 * 14.3 Parts: It is a compile time error if the contents of the URI are not a |
| 1336 * valid part declaration. | 1334 * valid part declaration. |
| 1337 * | 1335 * |
| 1338 * @param uri the URI that is invalid | 1336 * @param uri the URI that is invalid |
| 1339 * @see [URI_DOES_NOT_EXIST] | 1337 * See [URI_DOES_NOT_EXIST]. |
| 1340 */ | 1338 */ |
| 1341 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode('IN
VALID_URI', "Invalid URI syntax: '{0}'"); | 1339 static const CompileTimeErrorCode INVALID_URI = const CompileTimeErrorCode('IN
VALID_URI', "Invalid URI syntax: '{0}'"); |
| 1342 | 1340 |
| 1343 /** | 1341 /** |
| 1344 * 13.13 Break: It is a compile-time error if no such statement | 1342 * 13.13 Break: It is a compile-time error if no such statement |
| 1345 * <i>s<sub>E</sub></i> exists within the innermost function in which | 1343 * <i>s<sub>E</sub></i> exists within the innermost function in which |
| 1346 * <i>s<sub>b</sub></i> occurs. | 1344 * <i>s<sub>b</sub></i> occurs. |
| 1347 * | 1345 * |
| 1348 * 13.14 Continue: It is a compile-time error if no such statement or case | 1346 * 13.14 Continue: It is a compile-time error if no such statement or case |
| 1349 * clause <i>s<sub>E</sub></i> exists within the innermost function in which | 1347 * clause <i>s<sub>E</sub></i> exists within the innermost function in which |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 * | 1407 * |
| 1410 * @param typeName the name of the mixin that is invalid | 1408 * @param typeName the name of the mixin that is invalid |
| 1411 */ | 1409 */ |
| 1412 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi
meErrorCode('MIXIN_DECLARES_CONSTRUCTOR', "The class '{0}' cannot be used as a m
ixin because it declares a constructor"); | 1410 static const CompileTimeErrorCode MIXIN_DECLARES_CONSTRUCTOR = const CompileTi
meErrorCode('MIXIN_DECLARES_CONSTRUCTOR', "The class '{0}' cannot be used as a m
ixin because it declares a constructor"); |
| 1413 | 1411 |
| 1414 /** | 1412 /** |
| 1415 * 9.1 Mixin Application: It is a compile-time error if the with clause of a | 1413 * 9.1 Mixin Application: It is a compile-time error if the with clause of a |
| 1416 * mixin application <i>C</i> includes a deferred type expression. | 1414 * mixin application <i>C</i> includes a deferred type expression. |
| 1417 * | 1415 * |
| 1418 * @param typeName the name of the type that cannot be extended | 1416 * @param typeName the name of the type that cannot be extended |
| 1419 * @see #EXTENDS_DEFERRED_CLASS | 1417 * See [EXTENDS_DEFERRED_CLASS], and [IMPLEMENTS_DEFERRED_CLASS]. |
| 1420 * @see #IMPLEMENTS_DEFERRED_CLASS | |
| 1421 */ | 1418 */ |
| 1422 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro
rCode('MIXIN_DEFERRED_CLASS', "This class cannot mixin the deferred class '{0}'"
); | 1419 static const CompileTimeErrorCode MIXIN_DEFERRED_CLASS = const CompileTimeErro
rCode('MIXIN_DEFERRED_CLASS', "This class cannot mixin the deferred class '{0}'"
); |
| 1423 | 1420 |
| 1424 /** | 1421 /** |
| 1425 * 9 Mixins: It is a compile-time error if a mixin is derived from a class | 1422 * 9 Mixins: It is a compile-time error if a mixin is derived from a class |
| 1426 * whose superclass is not Object. | 1423 * whose superclass is not Object. |
| 1427 * | 1424 * |
| 1428 * @param typeName the name of the mixin that is invalid | 1425 * @param typeName the name of the mixin that is invalid |
| 1429 */ | 1426 */ |
| 1430 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi
leTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', "The class '{0}' cannot be use
d as a mixin because it extends a class other than Object"); | 1427 static const CompileTimeErrorCode MIXIN_INHERITS_FROM_NOT_OBJECT = const Compi
leTimeErrorCode('MIXIN_INHERITS_FROM_NOT_OBJECT', "The class '{0}' cannot be use
d as a mixin because it extends a class other than Object"); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1442 * 12.3 Numbers: It is a compile-time error for any type other than the types | 1439 * 12.3 Numbers: It is a compile-time error for any type other than the types |
| 1443 * int and double to attempt to extend or implement num. | 1440 * int and double to attempt to extend or implement num. |
| 1444 * | 1441 * |
| 1445 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend | 1442 * 12.4 Booleans: It is a compile-time error for a class to attempt to extend |
| 1446 * or implement bool. | 1443 * or implement bool. |
| 1447 * | 1444 * |
| 1448 * 12.5 Strings: It is a compile-time error for a class to attempt to extend | 1445 * 12.5 Strings: It is a compile-time error for a class to attempt to extend |
| 1449 * or implement String. | 1446 * or implement String. |
| 1450 * | 1447 * |
| 1451 * @param typeName the name of the type that cannot be extended | 1448 * @param typeName the name of the type that cannot be extended |
| 1452 * @see [IMPLEMENTS_DISALLOWED_CLASS] | 1449 * See [IMPLEMENTS_DISALLOWED_CLASS]. |
| 1453 */ | 1450 */ |
| 1454 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim
eErrorCode('MIXIN_OF_DISALLOWED_CLASS', "Classes cannot mixin '{0}'"); | 1451 static const CompileTimeErrorCode MIXIN_OF_DISALLOWED_CLASS = const CompileTim
eErrorCode('MIXIN_OF_DISALLOWED_CLASS', "Classes cannot mixin '{0}'"); |
| 1455 | 1452 |
| 1456 /** | 1453 /** |
| 1457 * Enum proposal: It is a compile-time error to subclass, mix-in or implement | 1454 * Enum proposal: It is a compile-time error to subclass, mix-in or implement |
| 1458 * an enum. | 1455 * an enum. |
| 1459 */ | 1456 */ |
| 1460 static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode('
MIXIN_OF_ENUM', "Classes cannot mixin an enum"); | 1457 static const CompileTimeErrorCode MIXIN_OF_ENUM = const CompileTimeErrorCode('
MIXIN_OF_ENUM', "Classes cannot mixin an enum"); |
| 1461 | 1458 |
| 1462 /** | 1459 /** |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 */ | 1614 */ |
| 1618 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY
= const CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY', "C
onstant values from a deferred library cannot be used as values in a 'const' map
"); | 1615 static const CompileTimeErrorCode NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY
= const CompileTimeErrorCode('NON_CONSTANT_MAP_VALUE_FROM_DEFERRED_LIBRARY', "C
onstant values from a deferred library cannot be used as values in a 'const' map
"); |
| 1619 | 1616 |
| 1620 /** | 1617 /** |
| 1621 * 11 Metadata: Metadata consists of a series of annotations, each of which | 1618 * 11 Metadata: Metadata consists of a series of annotations, each of which |
| 1622 * begin with the character @, followed by a constant expression that must be | 1619 * begin with the character @, followed by a constant expression that must be |
| 1623 * either a reference to a compile-time constant variable, or a call to a | 1620 * either a reference to a compile-time constant variable, or a call to a |
| 1624 * constant constructor. | 1621 * constant constructor. |
| 1625 * | 1622 * |
| 1626 * "From deferred library" case is covered by | 1623 * "From deferred library" case is covered by |
| 1627 * [CompileTimeErrorCode#INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]. | 1624 * [CompileTimeErrorCode.INVALID_ANNOTATION_FROM_DEFERRED_LIBRARY]. |
| 1628 */ | 1625 */ |
| 1629 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const
CompileTimeErrorCode('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', "Annotation creation
can use only 'const' constructor"); | 1626 static const CompileTimeErrorCode NON_CONSTANT_ANNOTATION_CONSTRUCTOR = const
CompileTimeErrorCode('NON_CONSTANT_ANNOTATION_CONSTRUCTOR', "Annotation creation
can use only 'const' constructor"); |
| 1630 | 1627 |
| 1631 /** | 1628 /** |
| 1632 * 7.6.3 Constant Constructors: Any expression that appears within the | 1629 * 7.6.3 Constant Constructors: Any expression that appears within the |
| 1633 * initializer list of a constant constructor must be a potentially constant | 1630 * initializer list of a constant constructor must be a potentially constant |
| 1634 * expression, or a compile-time error occurs. | 1631 * expression, or a compile-time error occurs. |
| 1635 */ | 1632 */ |
| 1636 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co
mpileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', "Initializer expressions
in constant constructors must be constants"); | 1633 static const CompileTimeErrorCode NON_CONSTANT_VALUE_IN_INITIALIZER = const Co
mpileTimeErrorCode('NON_CONSTANT_VALUE_IN_INITIALIZER', "Initializer expressions
in constant constructors must be constants"); |
| 1637 | 1634 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1876 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if | 1873 * 12.11.1 New: If T is malformed a dynamic error occurs. In checked mode, if |
| 1877 * T is mal-bounded a dynamic error occurs. | 1874 * T is mal-bounded a dynamic error occurs. |
| 1878 * | 1875 * |
| 1879 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time | 1876 * 12.1 Constants: It is a compile-time error if evaluation of a compile-time |
| 1880 * constant would raise an exception. | 1877 * constant would raise an exception. |
| 1881 * | 1878 * |
| 1882 * @param boundedTypeName the name of the type used in the instance creation | 1879 * @param boundedTypeName the name of the type used in the instance creation |
| 1883 * that should be limited by the bound as specified in the class | 1880 * that should be limited by the bound as specified in the class |
| 1884 * declaration | 1881 * declaration |
| 1885 * @param boundingTypeName the name of the bounding type | 1882 * @param boundingTypeName the name of the bounding type |
| 1886 * @see [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS] | 1883 * See [StaticTypeWarningCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]. |
| 1887 */ | 1884 */ |
| 1888 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co
mpileTimeErrorCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '
{1}'"); | 1885 static const CompileTimeErrorCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const Co
mpileTimeErrorCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend '
{1}'"); |
| 1889 | 1886 |
| 1890 /** | 1887 /** |
| 1891 * 15.3.1 Typedef: Any self reference, either directly, or recursively via | 1888 * 15.3.1 Typedef: Any self reference, either directly, or recursively via |
| 1892 * another typedef, is a compile time error. | 1889 * another typedef, is a compile time error. |
| 1893 */ | 1890 */ |
| 1894 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C
ompileTimeErrorCode('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', "Type alias cannot ref
erence itself directly or recursively via another typedef"); | 1891 static const CompileTimeErrorCode TYPE_ALIAS_CANNOT_REFERENCE_ITSELF = const C
ompileTimeErrorCode('TYPE_ALIAS_CANNOT_REFERENCE_ITSELF', "Type alias cannot ref
erence itself directly or recursively via another typedef"); |
| 1895 | 1892 |
| 1896 /** | 1893 /** |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 * 14.2 Exports: It is a compile-time error if the compilation unit found at | 1931 * 14.2 Exports: It is a compile-time error if the compilation unit found at |
| 1935 * the specified URI is not a library declaration. | 1932 * the specified URI is not a library declaration. |
| 1936 * | 1933 * |
| 1937 * 14.1 Imports: It is a compile-time error if the compilation unit found at | 1934 * 14.1 Imports: It is a compile-time error if the compilation unit found at |
| 1938 * the specified URI is not a library declaration. | 1935 * the specified URI is not a library declaration. |
| 1939 * | 1936 * |
| 1940 * 14.3 Parts: It is a compile time error if the contents of the URI are not a | 1937 * 14.3 Parts: It is a compile time error if the contents of the URI are not a |
| 1941 * valid part declaration. | 1938 * valid part declaration. |
| 1942 * | 1939 * |
| 1943 * @param uri the URI pointing to a non-existent file | 1940 * @param uri the URI pointing to a non-existent file |
| 1944 * @see [INVALID_URI] | 1941 * See [INVALID_URI]. |
| 1945 */ | 1942 */ |
| 1946 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC
ode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'"); | 1943 static const CompileTimeErrorCode URI_DOES_NOT_EXIST = const CompileTimeErrorC
ode('URI_DOES_NOT_EXIST', "Target of URI does not exist: '{0}'"); |
| 1947 | 1944 |
| 1948 /** | 1945 /** |
| 1949 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time | 1946 * 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time |
| 1950 * constant, or if <i>x</i> involves string interpolation. | 1947 * constant, or if <i>x</i> involves string interpolation. |
| 1951 * | 1948 * |
| 1952 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time | 1949 * 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time |
| 1953 * constant, or if <i>s</i> involves string interpolation. | 1950 * constant, or if <i>s</i> involves string interpolation. |
| 1954 * | 1951 * |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2486 */ | 2483 */ |
| 2487 static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintC
ode('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', "The library '{0}' defines a t
op-level function named 'loadLibrary' which is hidden by deferring this library"
); | 2484 static const HintCode IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION = const HintC
ode('IMPORT_DEFERRED_LIBRARY_WITH_LOAD_FUNCTION', "The library '{0}' defines a t
op-level function named 'loadLibrary' which is hidden by deferring this library"
); |
| 2488 | 2485 |
| 2489 /** | 2486 /** |
| 2490 * This hint is generated anywhere where the | 2487 * This hint is generated anywhere where the |
| 2491 * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we | 2488 * [StaticTypeWarningCode.INVALID_ASSIGNMENT] would have been generated, if we |
| 2492 * used propagated information for the warnings. | 2489 * used propagated information for the warnings. |
| 2493 * | 2490 * |
| 2494 * @param rhsTypeName the name of the right hand side type | 2491 * @param rhsTypeName the name of the right hand side type |
| 2495 * @param lhsTypeName the name of the left hand side type | 2492 * @param lhsTypeName the name of the left hand side type |
| 2496 * @see [StaticTypeWarningCode.INVALID_ASSIGNMENT] | 2493 * See [StaticTypeWarningCode.INVALID_ASSIGNMENT]. |
| 2497 */ | 2494 */ |
| 2498 static const HintCode INVALID_ASSIGNMENT = const HintCode('INVALID_ASSIGNMENT'
, "A value of type '{0}' cannot be assigned to a variable of type '{1}'"); | 2495 static const HintCode INVALID_ASSIGNMENT = const HintCode('INVALID_ASSIGNMENT'
, "A value of type '{0}' cannot be assigned to a variable of type '{1}'"); |
| 2499 | 2496 |
| 2500 /** | 2497 /** |
| 2501 * Generate a hint for methods or functions that have a return type, but do | 2498 * Generate a hint for methods or functions that have a return type, but do |
| 2502 * not have a non-void return statement on all branches. At the end of methods | 2499 * not have a non-void return statement on all branches. At the end of methods |
| 2503 * or functions with no return, Dart implicitly returns `null`, avoiding these | 2500 * or functions with no return, Dart implicitly returns `null`, avoiding these |
| 2504 * implicit returns is considered a best practice. | 2501 * implicit returns is considered a best practice. |
| 2505 * | 2502 * |
| 2506 * @param returnType the name of the declared return type | 2503 * @param returnType the name of the declared return type |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2541 | 2538 |
| 2542 /** | 2539 /** |
| 2543 * This hint is generated anywhere where the | 2540 * This hint is generated anywhere where the |
| 2544 * [StaticTypeWarningCode.UNDEFINED_GETTER] or | 2541 * [StaticTypeWarningCode.UNDEFINED_GETTER] or |
| 2545 * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used | 2542 * [StaticWarningCode.UNDEFINED_GETTER] would have been generated, if we used |
| 2546 * propagated information for the warnings. | 2543 * propagated information for the warnings. |
| 2547 * | 2544 * |
| 2548 * @param getterName the name of the getter | 2545 * @param getterName the name of the getter |
| 2549 * @param enclosingType the name of the enclosing type where the getter is | 2546 * @param enclosingType the name of the enclosing type where the getter is |
| 2550 * being looked for | 2547 * being looked for |
| 2551 * @see [StaticTypeWarningCode.UNDEFINED_GETTER] | 2548 * See [StaticTypeWarningCode.UNDEFINED_GETTER], and |
| 2552 * @see [StaticWarningCode.UNDEFINED_GETTER] | 2549 * [StaticWarningCode.UNDEFINED_GETTER]. |
| 2553 */ | 2550 */ |
| 2554 static const HintCode UNDEFINED_GETTER = const HintCode('UNDEFINED_GETTER', "T
here is no such getter '{0}' in '{1}'"); | 2551 static const HintCode UNDEFINED_GETTER = const HintCode('UNDEFINED_GETTER', "T
here is no such getter '{0}' in '{1}'"); |
| 2555 | 2552 |
| 2556 /** | 2553 /** |
| 2557 * This hint is generated anywhere where the | 2554 * This hint is generated anywhere where the |
| 2558 * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we | 2555 * [StaticTypeWarningCode.UNDEFINED_METHOD] would have been generated, if we |
| 2559 * used propagated information for the warnings. | 2556 * used propagated information for the warnings. |
| 2560 * | 2557 * |
| 2561 * @param methodName the name of the method that is undefined | 2558 * @param methodName the name of the method that is undefined |
| 2562 * @param typeName the resolved type name that the method lookup is happening | 2559 * @param typeName the resolved type name that the method lookup is happening |
| 2563 * on | 2560 * on |
| 2564 * @see [StaticTypeWarningCode.UNDEFINED_METHOD] | 2561 * See [StaticTypeWarningCode.UNDEFINED_METHOD]. |
| 2565 */ | 2562 */ |
| 2566 static const HintCode UNDEFINED_METHOD = const HintCode('UNDEFINED_METHOD', "T
he method '{0}' is not defined for the class '{1}'"); | 2563 static const HintCode UNDEFINED_METHOD = const HintCode('UNDEFINED_METHOD', "T
he method '{0}' is not defined for the class '{1}'"); |
| 2567 | 2564 |
| 2568 /** | 2565 /** |
| 2569 * This hint is generated anywhere where the | 2566 * This hint is generated anywhere where the |
| 2570 * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we | 2567 * [StaticTypeWarningCode.UNDEFINED_OPERATOR] would have been generated, if we |
| 2571 * used propagated information for the warnings. | 2568 * used propagated information for the warnings. |
| 2572 * | 2569 * |
| 2573 * @param operator the name of the operator | 2570 * @param operator the name of the operator |
| 2574 * @param enclosingType the name of the enclosing type where the operator is | 2571 * @param enclosingType the name of the enclosing type where the operator is |
| 2575 * being looked for | 2572 * being looked for |
| 2576 * @see [StaticTypeWarningCode.UNDEFINED_OPERATOR] | 2573 * See [StaticTypeWarningCode.UNDEFINED_OPERATOR]. |
| 2577 */ | 2574 */ |
| 2578 static const HintCode UNDEFINED_OPERATOR = const HintCode('UNDEFINED_OPERATOR'
, "There is no such operator '{0}' in '{1}'"); | 2575 static const HintCode UNDEFINED_OPERATOR = const HintCode('UNDEFINED_OPERATOR'
, "There is no such operator '{0}' in '{1}'"); |
| 2579 | 2576 |
| 2580 /** | 2577 /** |
| 2581 * This hint is generated anywhere where the | 2578 * This hint is generated anywhere where the |
| 2582 * [StaticTypeWarningCode.UNDEFINED_SETTER] or | 2579 * [StaticTypeWarningCode.UNDEFINED_SETTER] or |
| 2583 * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used | 2580 * [StaticWarningCode.UNDEFINED_SETTER] would have been generated, if we used |
| 2584 * propagated information for the warnings. | 2581 * propagated information for the warnings. |
| 2585 * | 2582 * |
| 2586 * @param setterName the name of the setter | 2583 * @param setterName the name of the setter |
| 2587 * @param enclosingType the name of the enclosing type where the setter is | 2584 * @param enclosingType the name of the enclosing type where the setter is |
| 2588 * being looked for | 2585 * being looked for |
| 2589 * @see [StaticTypeWarningCode.UNDEFINED_SETTER] | 2586 * See [StaticTypeWarningCode.UNDEFINED_SETTER], and |
| 2590 * @see [StaticWarningCode.UNDEFINED_SETTER] | 2587 * [StaticWarningCode.UNDEFINED_SETTER]. |
| 2591 */ | 2588 */ |
| 2592 static const HintCode UNDEFINED_SETTER = const HintCode('UNDEFINED_SETTER', "T
here is no such setter '{0}' in '{1}'"); | 2589 static const HintCode UNDEFINED_SETTER = const HintCode('UNDEFINED_SETTER', "T
here is no such setter '{0}' in '{1}'"); |
| 2593 | 2590 |
| 2594 /** | 2591 /** |
| 2595 * Unnecessary cast. | 2592 * Unnecessary cast. |
| 2596 */ | 2593 */ |
| 2597 static const HintCode UNNECESSARY_CAST = const HintCode('UNNECESSARY_CAST', "U
nnecessary cast"); | 2594 static const HintCode UNNECESSARY_CAST = const HintCode('UNNECESSARY_CAST', "U
nnecessary cast"); |
| 2598 | 2595 |
| 2599 /** | 2596 /** |
| 2600 * Unnecessary type checks, the result is always true. | 2597 * Unnecessary type checks, the result is always true. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2759 * | 2756 * |
| 2760 * @param numTypeArgument the number of provided type arguments | 2757 * @param numTypeArgument the number of provided type arguments |
| 2761 */ | 2758 */ |
| 2762 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const Sta
ticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', "Map literal requires exac
tly two type arguments or none, but {0} found"); | 2759 static const StaticTypeWarningCode EXPECTED_TWO_MAP_TYPE_ARGUMENTS = const Sta
ticTypeWarningCode('EXPECTED_TWO_MAP_TYPE_ARGUMENTS', "Map literal requires exac
tly two type arguments or none, but {0} found"); |
| 2763 | 2760 |
| 2764 /** | 2761 /** |
| 2765 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. | 2762 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. |
| 2766 * It is a static type warning if <i>T</i> does not have an accessible | 2763 * It is a static type warning if <i>T</i> does not have an accessible |
| 2767 * instance setter named <i>v=</i>. | 2764 * instance setter named <i>v=</i>. |
| 2768 * | 2765 * |
| 2769 * @see [UNDEFINED_SETTER] | 2766 * See [UNDEFINED_SETTER]. |
| 2770 */ | 2767 */ |
| 2771 static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarni
ngCode('INACCESSIBLE_SETTER', ""); | 2768 static const StaticTypeWarningCode INACCESSIBLE_SETTER = const StaticTypeWarni
ngCode('INACCESSIBLE_SETTER', ""); |
| 2772 | 2769 |
| 2773 /** | 2770 /** |
| 2774 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause | 2771 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause |
| 2775 * multiple members <i>m<sub>1</sub>, …, m<sub>k</sub></i> with the | 2772 * multiple members <i>m<sub>1</sub>, …, m<sub>k</sub></i> with the |
| 2776 * same name <i>n</i> that would be inherited (because identically named | 2773 * same name <i>n</i> that would be inherited (because identically named |
| 2777 * members existed in several superinterfaces) then at most one member is | 2774 * members existed in several superinterfaces) then at most one member is |
| 2778 * inherited. | 2775 * inherited. |
| 2779 * | 2776 * |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2798 * * Otherwise none of the members <i>m<sub>1</sub>, …, | 2795 * * Otherwise none of the members <i>m<sub>1</sub>, …, |
| 2799 * m<sub>k</sub></i> is inherited. | 2796 * m<sub>k</sub></i> is inherited. |
| 2800 */ | 2797 */ |
| 2801 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const Sta
ticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', "'{0}' is inherited by at
least two interfaces inconsistently, from {1}"); | 2798 static const StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = const Sta
ticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', "'{0}' is inherited by at
least two interfaces inconsistently, from {1}"); |
| 2802 | 2799 |
| 2803 /** | 2800 /** |
| 2804 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does | 2801 * 12.15.1 Ordinary Invocation: It is a static type warning if <i>T</i> does |
| 2805 * not have an accessible (3.2) instance member named <i>m</i>. | 2802 * not have an accessible (3.2) instance member named <i>m</i>. |
| 2806 * | 2803 * |
| 2807 * @param memberName the name of the static member | 2804 * @param memberName the name of the static member |
| 2808 * @see [UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER] | 2805 * See [UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER]. |
| 2809 */ | 2806 */ |
| 2810 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const St
aticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', "Static member '{0}' can
not be accessed using instance access"); | 2807 static const StaticTypeWarningCode INSTANCE_ACCESS_TO_STATIC_MEMBER = const St
aticTypeWarningCode('INSTANCE_ACCESS_TO_STATIC_MEMBER', "Static member '{0}' can
not be accessed using instance access"); |
| 2811 | 2808 |
| 2812 /** | 2809 /** |
| 2813 * 12.18 Assignment: It is a static type warning if the static type of | 2810 * 12.18 Assignment: It is a static type warning if the static type of |
| 2814 * <i>e</i> may not be assigned to the static type of <i>v</i>. The static | 2811 * <i>e</i> may not be assigned to the static type of <i>v</i>. The static |
| 2815 * type of the expression <i>v = e</i> is the static type of <i>e</i>. | 2812 * type of the expression <i>v = e</i> is the static type of <i>e</i>. |
| 2816 * | 2813 * |
| 2817 * 12.18 Assignment: It is a static type warning if the static type of | 2814 * 12.18 Assignment: It is a static type warning if the static type of |
| 2818 * <i>e</i> may not be assigned to the static type of <i>C.v</i>. The static | 2815 * <i>e</i> may not be assigned to the static type of <i>C.v</i>. The static |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2938 * i <= n</i>. | 2935 * i <= n</i>. |
| 2939 * | 2936 * |
| 2940 * 7.6.2 Factories: It is a static type warning if any of the type arguments | 2937 * 7.6.2 Factories: It is a static type warning if any of the type arguments |
| 2941 * to <i>k'</i> are not subtypes of the bounds of the corresponding formal | 2938 * to <i>k'</i> are not subtypes of the bounds of the corresponding formal |
| 2942 * type parameters of type. | 2939 * type parameters of type. |
| 2943 * | 2940 * |
| 2944 * @param boundedTypeName the name of the type used in the instance creation | 2941 * @param boundedTypeName the name of the type used in the instance creation |
| 2945 * that should be limited by the bound as specified in the class | 2942 * that should be limited by the bound as specified in the class |
| 2946 * declaration | 2943 * declaration |
| 2947 * @param boundingTypeName the name of the bounding type | 2944 * @param boundingTypeName the name of the bounding type |
| 2948 * @see [TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND] | 2945 * See [TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND]. |
| 2949 */ | 2946 */ |
| 2950 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const S
taticTypeWarningCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend
'{1}'"); | 2947 static const StaticTypeWarningCode TYPE_ARGUMENT_NOT_MATCHING_BOUNDS = const S
taticTypeWarningCode('TYPE_ARGUMENT_NOT_MATCHING_BOUNDS', "'{0}' does not extend
'{1}'"); |
| 2951 | 2948 |
| 2952 /** | 2949 /** |
| 2953 * 10 Generics: It is a static type warning if a type parameter is a supertype | 2950 * 10 Generics: It is a static type warning if a type parameter is a supertype |
| 2954 * of its upper bound. | 2951 * of its upper bound. |
| 2955 * | 2952 * |
| 2956 * @param typeParameterName the name of the type parameter | 2953 * @param typeParameterName the name of the type parameter |
| 2957 * @see [TYPE_ARGUMENT_NOT_MATCHING_BOUNDS] | 2954 * See [TYPE_ARGUMENT_NOT_MATCHING_BOUNDS]. |
| 2958 */ | 2955 */ |
| 2959 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = con
st StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', "'{0}' cannot
be a supertype of its upper bound"); | 2956 static const StaticTypeWarningCode TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND = con
st StaticTypeWarningCode('TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND', "'{0}' cannot
be a supertype of its upper bound"); |
| 2960 | 2957 |
| 2961 /** | 2958 /** |
| 2962 * 12.17 Getter Invocation: It is a static warning if there is no class | 2959 * 12.17 Getter Invocation: It is a static warning if there is no class |
| 2963 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does | 2960 * <i>C</i> in the enclosing lexical scope of <i>i</i>, or if <i>C</i> does |
| 2964 * not declare, implicitly or explicitly, a getter named <i>m</i>. | 2961 * not declare, implicitly or explicitly, a getter named <i>m</i>. |
| 2965 * | 2962 * |
| 2966 * @param constantName the name of the enumeration constant that is not | 2963 * @param constantName the name of the enumeration constant that is not |
| 2967 * defined | 2964 * defined |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3026 static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarnin
gCode('UNDEFINED_OPERATOR', "There is no such operator '{0}' in '{1}'"); | 3023 static const StaticTypeWarningCode UNDEFINED_OPERATOR = const StaticTypeWarnin
gCode('UNDEFINED_OPERATOR', "There is no such operator '{0}' in '{1}'"); |
| 3027 | 3024 |
| 3028 /** | 3025 /** |
| 3029 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. | 3026 * 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. |
| 3030 * It is a static type warning if <i>T</i> does not have an accessible | 3027 * It is a static type warning if <i>T</i> does not have an accessible |
| 3031 * instance setter named <i>v=</i>. | 3028 * instance setter named <i>v=</i>. |
| 3032 * | 3029 * |
| 3033 * @param setterName the name of the setter | 3030 * @param setterName the name of the setter |
| 3034 * @param enclosingType the name of the enclosing type where the setter is | 3031 * @param enclosingType the name of the enclosing type where the setter is |
| 3035 * being looked for | 3032 * being looked for |
| 3036 * @see [INACCESSIBLE_SETTER] | 3033 * See [INACCESSIBLE_SETTER]. |
| 3037 */ | 3034 */ |
| 3038 static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningC
ode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'"); | 3035 static const StaticTypeWarningCode UNDEFINED_SETTER = const StaticTypeWarningC
ode('UNDEFINED_SETTER', "There is no such setter '{0}' in '{1}'"); |
| 3039 | 3036 |
| 3040 /** | 3037 /** |
| 3041 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form | 3038 * 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form |
| 3042 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: | 3039 * <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: |
| 3043 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a | 3040 * a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a |
| 3044 * static type warning if <i>S</i> does not have an accessible instance member | 3041 * static type warning if <i>S</i> does not have an accessible instance member |
| 3045 * named <i>m</i>. | 3042 * named <i>m</i>. |
| 3046 * | 3043 * |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3060 */ | 3057 */ |
| 3061 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M
EMBER = const StaticTypeWarningCode('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M
EMBER', "Static members from supertypes must be qualified by the name of the def
ining type"); | 3058 static const StaticTypeWarningCode UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M
EMBER = const StaticTypeWarningCode('UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_M
EMBER', "Static members from supertypes must be qualified by the name of the def
ining type"); |
| 3062 | 3059 |
| 3063 /** | 3060 /** |
| 3064 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a | 3061 * 15.8 Parameterized Types: It is a static type warning if <i>G</i> is not a |
| 3065 * generic type with exactly <i>n</i> type parameters. | 3062 * generic type with exactly <i>n</i> type parameters. |
| 3066 * | 3063 * |
| 3067 * @param typeName the name of the type being referenced (<i>G</i>) | 3064 * @param typeName the name of the type being referenced (<i>G</i>) |
| 3068 * @param parameterCount the number of type parameters that were declared | 3065 * @param parameterCount the number of type parameters that were declared |
| 3069 * @param argumentCount the number of type arguments provided | 3066 * @param argumentCount the number of type arguments provided |
| 3070 * @see [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS] | 3067 * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and |
| 3071 * @see [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS] | 3068 * [CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS]. |
| 3072 */ | 3069 */ |
| 3073 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const Stat
icTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', "The type '{0}' is declared
with {1} type parameters, but {2} type arguments were given"); | 3070 static const StaticTypeWarningCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = const Stat
icTypeWarningCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', "The type '{0}' is declared
with {1} type parameters, but {2} type arguments were given"); |
| 3074 | 3071 |
| 3075 /** | 3072 /** |
| 3076 * Initialize a newly created error code to have the given [name]. The message | 3073 * Initialize a newly created error code to have the given [name]. The message |
| 3077 * associated with the error will be created from the given [message] | 3074 * associated with the error will be created from the given [message] |
| 3078 * template. The correction associated with the error will be created from the | 3075 * template. The correction associated with the error will be created from the |
| 3079 * given [correction] template. | 3076 * given [correction] template. |
| 3080 */ | 3077 */ |
| 3081 const StaticTypeWarningCode(String name, String message, [String correction])
: super(name, message, correction); | 3078 const StaticTypeWarningCode(String name, String message, [String correction])
: super(name, message, correction); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3296 = const StaticWarningCode( | 3293 = const StaticWarningCode( |
| 3297 'EXPORT_DUPLICATED_LIBRARY_UNNAMED', | 3294 'EXPORT_DUPLICATED_LIBRARY_UNNAMED', |
| 3298 "The exported libraries '{0}' and '{1}' cannot both be unnamed"); | 3295 "The exported libraries '{0}' and '{1}' cannot both be unnamed"); |
| 3299 | 3296 |
| 3300 /** | 3297 /** |
| 3301 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < | 3298 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < |
| 3302 * h</i> or if <i>m > n</i>. | 3299 * h</i> or if <i>m > n</i>. |
| 3303 * | 3300 * |
| 3304 * @param requiredCount the maximum number of positional arguments | 3301 * @param requiredCount the maximum number of positional arguments |
| 3305 * @param argumentCount the actual number of positional arguments given | 3302 * @param argumentCount the actual number of positional arguments given |
| 3306 * @see [NOT_ENOUGH_REQUIRED_ARGUMENTS] | 3303 * See [NOT_ENOUGH_REQUIRED_ARGUMENTS]. |
| 3307 */ | 3304 */ |
| 3308 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarnin
gCode('EXTRA_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, but {1}
found"); | 3305 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = const StaticWarnin
gCode('EXTRA_POSITIONAL_ARGUMENTS', "{0} positional arguments expected, but {1}
found"); |
| 3309 | 3306 |
| 3310 /** | 3307 /** |
| 3311 * 5. Variables: It is a static warning if a final instance variable that has | 3308 * 5. Variables: It is a static warning if a final instance variable that has |
| 3312 * been initialized at its point of declaration is also initialized in a | 3309 * been initialized at its point of declaration is also initialized in a |
| 3313 * constructor. | 3310 * constructor. |
| 3314 */ | 3311 */ |
| 3315 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO
N = const StaticWarningCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION',
"Values cannot be set in the constructor if they are final, and have already bee
n set"); | 3312 static const StaticWarningCode FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATIO
N = const StaticWarningCode('FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION',
"Values cannot be set in the constructor if they are final, and have already bee
n set"); |
| 3316 | 3313 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3397 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_UNNAMED | 3394 static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_UNNAMED |
| 3398 = const StaticWarningCode( | 3395 = const StaticWarningCode( |
| 3399 'IMPORT_DUPLICATED_LIBRARY_UNNAMED', | 3396 'IMPORT_DUPLICATED_LIBRARY_UNNAMED', |
| 3400 "The imported libraries '{0}' and '{1}' cannot both be unnamed"); | 3397 "The imported libraries '{0}' and '{1}' cannot both be unnamed"); |
| 3401 | 3398 |
| 3402 /** | 3399 /** |
| 3403 * 14.1 Imports: It is a static warning if the specified URI of a deferred | 3400 * 14.1 Imports: It is a static warning if the specified URI of a deferred |
| 3404 * import does not refer to a library declaration. | 3401 * import does not refer to a library declaration. |
| 3405 * | 3402 * |
| 3406 * @param uri the uri pointing to a non-library declaration | 3403 * @param uri the uri pointing to a non-library declaration |
| 3407 * @see [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY] | 3404 * See [CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]. |
| 3408 */ | 3405 */ |
| 3409 static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode
('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part-of di
rective"); | 3406 static const StaticWarningCode IMPORT_OF_NON_LIBRARY = const StaticWarningCode
('IMPORT_OF_NON_LIBRARY', "The imported library '{0}' must not have a part-of di
rective"); |
| 3410 | 3407 |
| 3411 /** | 3408 /** |
| 3412 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause | 3409 * 8.1.1 Inheritance and Overriding: However, if the above rules would cause |
| 3413 * multiple members <i>m<sub>1</sub>, …, m<sub>k</sub></i> with the | 3410 * multiple members <i>m<sub>1</sub>, …, m<sub>k</sub></i> with the |
| 3414 * same name <i>n</i> that would be inherited (because identically named | 3411 * same name <i>n</i> that would be inherited (because identically named |
| 3415 * members existed in several superinterfaces) then at most one member is | 3412 * members existed in several superinterfaces) then at most one member is |
| 3416 * inherited. | 3413 * inherited. |
| 3417 * | 3414 * |
| (...skipping 17 matching lines...) Expand all Loading... |
| 3435 /** | 3432 /** |
| 3436 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a | 3433 * 7.2 Getters: It is a static warning if a getter <i>m1</i> overrides a |
| 3437 * getter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of | 3434 * getter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of |
| 3438 * <i>m2</i>. | 3435 * <i>m2</i>. |
| 3439 * | 3436 * |
| 3440 * @param actualReturnTypeName the name of the expected return type | 3437 * @param actualReturnTypeName the name of the expected return type |
| 3441 * @param expectedReturnType the name of the actual return type, not | 3438 * @param expectedReturnType the name of the actual return type, not |
| 3442 * assignable to the actualReturnTypeName | 3439 * assignable to the actualReturnTypeName |
| 3443 * @param className the name of the class where the overridden getter is | 3440 * @param className the name of the class where the overridden getter is |
| 3444 * declared | 3441 * declared |
| 3445 * @see [INVALID_METHOD_OVERRIDE_RETURN_TYPE] | 3442 * See [INVALID_METHOD_OVERRIDE_RETURN_TYPE]. |
| 3446 */ | 3443 */ |
| 3447 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const Sta
ticWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE', "The return type '{0}' is
not assignable to '{1}' as required by the getter it is overriding from '{2}'"); | 3444 static const StaticWarningCode INVALID_GETTER_OVERRIDE_RETURN_TYPE = const Sta
ticWarningCode('INVALID_GETTER_OVERRIDE_RETURN_TYPE', "The return type '{0}' is
not assignable to '{1}' as required by the getter it is overriding from '{2}'"); |
| 3448 | 3445 |
| 3449 /** | 3446 /** |
| 3450 * 7.1 Instance Methods: It is a static warning if an instance method | 3447 * 7.1 Instance Methods: It is a static warning if an instance method |
| 3451 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> | 3448 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> |
| 3452 * is not a subtype of the type of <i>m2</i>. | 3449 * is not a subtype of the type of <i>m2</i>. |
| 3453 * | 3450 * |
| 3454 * @param actualParamTypeName the name of the expected parameter type | 3451 * @param actualParamTypeName the name of the expected parameter type |
| 3455 * @param expectedParamType the name of the actual parameter type, not | 3452 * @param expectedParamType the name of the actual parameter type, not |
| 3456 * assignable to the actualParamTypeName | 3453 * assignable to the actualParamTypeName |
| 3457 * @param className the name of the class where the overridden method is | 3454 * @param className the name of the class where the overridden method is |
| 3458 * declared | 3455 * declared |
| 3459 */ | 3456 */ |
| 3460 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = cons
t StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', "The parameter t
ype '{0}' is not assignable to '{1}' as required by the method it is overriding
from '{2}'"); | 3457 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE = cons
t StaticWarningCode('INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE', "The parameter t
ype '{0}' is not assignable to '{1}' as required by the method it is overriding
from '{2}'"); |
| 3461 | 3458 |
| 3462 /** | 3459 /** |
| 3463 * 7.1 Instance Methods: It is a static warning if an instance method | 3460 * 7.1 Instance Methods: It is a static warning if an instance method |
| 3464 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> | 3461 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> |
| 3465 * is not a subtype of the type of <i>m2</i>. | 3462 * is not a subtype of the type of <i>m2</i>. |
| 3466 * | 3463 * |
| 3467 * @param actualParamTypeName the name of the expected parameter type | 3464 * @param actualParamTypeName the name of the expected parameter type |
| 3468 * @param expectedParamType the name of the actual parameter type, not | 3465 * @param expectedParamType the name of the actual parameter type, not |
| 3469 * assignable to the actualParamTypeName | 3466 * assignable to the actualParamTypeName |
| 3470 * @param className the name of the class where the overridden method is | 3467 * @param className the name of the class where the overridden method is |
| 3471 * declared | 3468 * declared |
| 3472 * @see [INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE] | 3469 * See [INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE]. |
| 3473 */ | 3470 */ |
| 3474 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = con
st StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter
type '{0}' is not assignable to '{1}' as required by the method it is overridin
g from '{2}'"); | 3471 static const StaticWarningCode INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE = con
st StaticWarningCode('INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter
type '{0}' is not assignable to '{1}' as required by the method it is overridin
g from '{2}'"); |
| 3475 | 3472 |
| 3476 /** | 3473 /** |
| 3477 * 7.1 Instance Methods: It is a static warning if an instance method | 3474 * 7.1 Instance Methods: It is a static warning if an instance method |
| 3478 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> | 3475 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> |
| 3479 * is not a subtype of the type of <i>m2</i>. | 3476 * is not a subtype of the type of <i>m2</i>. |
| 3480 * | 3477 * |
| 3481 * @param actualParamTypeName the name of the expected parameter type | 3478 * @param actualParamTypeName the name of the expected parameter type |
| 3482 * @param expectedParamType the name of the actual parameter type, not | 3479 * @param expectedParamType the name of the actual parameter type, not |
| 3483 * assignable to the actualParamTypeName | 3480 * assignable to the actualParamTypeName |
| 3484 * @param className the name of the class where the overridden method is | 3481 * @param className the name of the class where the overridden method is |
| 3485 * declared | 3482 * declared |
| 3486 */ | 3483 */ |
| 3487 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = c
onst StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', "The param
eter type '{0}' is not assignable to '{1}' as required by the method it is overr
iding from '{2}'"); | 3484 static const StaticWarningCode INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE = c
onst StaticWarningCode('INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE', "The param
eter type '{0}' is not assignable to '{1}' as required by the method it is overr
iding from '{2}'"); |
| 3488 | 3485 |
| 3489 /** | 3486 /** |
| 3490 * 7.1 Instance Methods: It is a static warning if an instance method | 3487 * 7.1 Instance Methods: It is a static warning if an instance method |
| 3491 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> | 3488 * <i>m1</i> overrides an instance method <i>m2</i> and the type of <i>m1</i> |
| 3492 * is not a subtype of the type of <i>m2</i>. | 3489 * is not a subtype of the type of <i>m2</i>. |
| 3493 * | 3490 * |
| 3494 * @param actualReturnTypeName the name of the expected return type | 3491 * @param actualReturnTypeName the name of the expected return type |
| 3495 * @param expectedReturnType the name of the actual return type, not | 3492 * @param expectedReturnType the name of the actual return type, not |
| 3496 * assignable to the actualReturnTypeName | 3493 * assignable to the actualReturnTypeName |
| 3497 * @param className the name of the class where the overridden method is | 3494 * @param className the name of the class where the overridden method is |
| 3498 * declared | 3495 * declared |
| 3499 * @see [INVALID_GETTER_OVERRIDE_RETURN_TYPE] | 3496 * See [INVALID_GETTER_OVERRIDE_RETURN_TYPE]. |
| 3500 */ | 3497 */ |
| 3501 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const Sta
ticWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE', "The return type '{0}' is
not assignable to '{1}' as required by the method it is overriding from '{2}'"); | 3498 static const StaticWarningCode INVALID_METHOD_OVERRIDE_RETURN_TYPE = const Sta
ticWarningCode('INVALID_METHOD_OVERRIDE_RETURN_TYPE', "The return type '{0}' is
not assignable to '{1}' as required by the method it is overriding from '{2}'"); |
| 3502 | 3499 |
| 3503 /** | 3500 /** |
| 3504 * 7.1 Instance Methods: It is a static warning if an instance method | 3501 * 7.1 Instance Methods: It is a static warning if an instance method |
| 3505 * <i>m1</i> overrides an instance member <i>m2</i>, the signature of | 3502 * <i>m1</i> overrides an instance member <i>m2</i>, the signature of |
| 3506 * <i>m2</i> explicitly specifies a default value for a formal parameter | 3503 * <i>m2</i> explicitly specifies a default value for a formal parameter |
| 3507 * <i>p</i> and the signature of <i>m1</i> specifies a different default value | 3504 * <i>p</i> and the signature of <i>m1</i> specifies a different default value |
| 3508 * for <i>p</i>. | 3505 * for <i>p</i>. |
| 3509 */ | 3506 */ |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3553 /** | 3550 /** |
| 3554 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a | 3551 * 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a |
| 3555 * setter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of | 3552 * setter <i>m2</i> and the type of <i>m1</i> is not a subtype of the type of |
| 3556 * <i>m2</i>. | 3553 * <i>m2</i>. |
| 3557 * | 3554 * |
| 3558 * @param actualParamTypeName the name of the expected parameter type | 3555 * @param actualParamTypeName the name of the expected parameter type |
| 3559 * @param expectedParamType the name of the actual parameter type, not | 3556 * @param expectedParamType the name of the actual parameter type, not |
| 3560 * assignable to the actualParamTypeName | 3557 * assignable to the actualParamTypeName |
| 3561 * @param className the name of the class where the overridden setter is | 3558 * @param className the name of the class where the overridden setter is |
| 3562 * declared | 3559 * declared |
| 3563 * @see [INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE] | 3560 * See [INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE]. |
| 3564 */ | 3561 */ |
| 3565 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = con
st StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter
type '{0}' is not assignable to '{1}' as required by the setter it is overridin
g from '{2}'"); | 3562 static const StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = con
st StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', "The parameter
type '{0}' is not assignable to '{1}' as required by the setter it is overridin
g from '{2}'"); |
| 3566 | 3563 |
| 3567 /** | 3564 /** |
| 3568 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i> | 3565 * 12.6 Lists: A run-time list literal <<i>E</i>> [<i>e<sub>1</sub></i> |
| 3569 * … <i>e<sub>n</sub></i>] is evaluated as follows: | 3566 * … <i>e<sub>n</sub></i>] is evaluated as follows: |
| 3570 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and | 3567 * * The operator []= is invoked on <i>a</i> with first argument <i>i</i> and |
| 3571 * second argument <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> | 3568 * second argument <i>o<sub>i+1</sub></i><i>, 1 <= i <= n</i> |
| 3572 * | 3569 * |
| 3573 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static | 3570 * 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3640 */ | 3637 */ |
| 3641 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCo
de('NEW_WITH_ABSTRACT_CLASS', "Abstract classes cannot be created with a 'new' e
xpression"); | 3638 static const StaticWarningCode NEW_WITH_ABSTRACT_CLASS = const StaticWarningCo
de('NEW_WITH_ABSTRACT_CLASS', "Abstract classes cannot be created with a 'new' e
xpression"); |
| 3642 | 3639 |
| 3643 /** | 3640 /** |
| 3644 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a | 3641 * 15.8 Parameterized Types: Any use of a malbounded type gives rise to a |
| 3645 * static warning. | 3642 * static warning. |
| 3646 * | 3643 * |
| 3647 * @param typeName the name of the type being referenced (<i>S</i>) | 3644 * @param typeName the name of the type being referenced (<i>S</i>) |
| 3648 * @param parameterCount the number of type parameters that were declared | 3645 * @param parameterCount the number of type parameters that were declared |
| 3649 * @param argumentCount the number of type arguments provided | 3646 * @param argumentCount the number of type arguments provided |
| 3650 * @see [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS] | 3647 * See [CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS], and |
| 3651 * @see [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS] | 3648 * [StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS]. |
| 3652 */ | 3649 */ |
| 3653 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const Static
WarningCode('NEW_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is declared with
{1} type parameters, but {2} type arguments were given"); | 3650 static const StaticWarningCode NEW_WITH_INVALID_TYPE_PARAMETERS = const Static
WarningCode('NEW_WITH_INVALID_TYPE_PARAMETERS', "The type '{0}' is declared with
{1} type parameters, but {2} type arguments were given"); |
| 3654 | 3651 |
| 3655 /** | 3652 /** |
| 3656 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible | 3653 * 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible |
| 3657 * in the current scope, optionally followed by type arguments. | 3654 * in the current scope, optionally followed by type arguments. |
| 3658 * | 3655 * |
| 3659 * @param name the name of the non-type element | 3656 * @param name the name of the non-type element |
| 3660 */ | 3657 */ |
| 3661 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode('NE
W_WITH_NON_TYPE', "The name '{0}' is not a class"); | 3658 static const StaticWarningCode NEW_WITH_NON_TYPE = const StaticWarningCode('NE
W_WITH_NON_TYPE', "The name '{0}' is not a class"); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3828 * @param nonTypeName the name that is not a type | 3825 * @param nonTypeName the name that is not a type |
| 3829 */ | 3826 */ |
| 3830 static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode('NOT_A_TYP
E', "{0} is not a type"); | 3827 static const StaticWarningCode NOT_A_TYPE = const StaticWarningCode('NOT_A_TYP
E', "{0} is not a type"); |
| 3831 | 3828 |
| 3832 /** | 3829 /** |
| 3833 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < | 3830 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < |
| 3834 * h</i> or if <i>m > n</i>. | 3831 * h</i> or if <i>m > n</i>. |
| 3835 * | 3832 * |
| 3836 * @param requiredCount the expected number of required arguments | 3833 * @param requiredCount the expected number of required arguments |
| 3837 * @param argumentCount the actual number of positional arguments given | 3834 * @param argumentCount the actual number of positional arguments given |
| 3838 * @see [EXTRA_POSITIONAL_ARGUMENTS] | 3835 * See [EXTRA_POSITIONAL_ARGUMENTS]. |
| 3839 */ | 3836 */ |
| 3840 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWar
ningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', "{0} required argument(s) expected, bu
t {1} found"); | 3837 static const StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = const StaticWar
ningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', "{0} required argument(s) expected, bu
t {1} found"); |
| 3841 | 3838 |
| 3842 /** | 3839 /** |
| 3843 * 14.3 Parts: It is a static warning if the referenced part declaration | 3840 * 14.3 Parts: It is a static warning if the referenced part declaration |
| 3844 * <i>p</i> names a library other than the current library as the library to | 3841 * <i>p</i> names a library other than the current library as the library to |
| 3845 * which <i>p</i> belongs. | 3842 * which <i>p</i> belongs. |
| 3846 * | 3843 * |
| 3847 * @param expectedLibraryName the name of expected library name | 3844 * @param expectedLibraryName the name of expected library name |
| 3848 * @param actualLibraryName the non-matching actual library name from the | 3845 * @param actualLibraryName the non-matching actual library name from the |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4054 * Initialize a newly created error code to have the given [name]. | 4051 * Initialize a newly created error code to have the given [name]. |
| 4055 */ | 4052 */ |
| 4056 const TodoCode(String name) : super(name, "{0}"); | 4053 const TodoCode(String name) : super(name, "{0}"); |
| 4057 | 4054 |
| 4058 @override | 4055 @override |
| 4059 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 4056 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
| 4060 | 4057 |
| 4061 @override | 4058 @override |
| 4062 ErrorType get type => ErrorType.TODO; | 4059 ErrorType get type => ErrorType.TODO; |
| 4063 } | 4060 } |
| OLD | NEW |