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 analyzer.src.error.codes; | 5 library analyzer.src.error.codes; |
6 | 6 |
7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
8 | 8 |
9 export 'package:analyzer/src/analysis_options/error/option_codes.dart'; | 9 export 'package:analyzer/src/analysis_options/error/option_codes.dart'; |
10 export 'package:analyzer/src/dart/error/hint_codes.dart'; | 10 export 'package:analyzer/src/dart/error/hint_codes.dart'; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 * immediately enclosing _a_ is not declared asynchronous. (Where _a_ is the | 242 * immediately enclosing _a_ is not declared asynchronous. (Where _a_ is the |
243 * await expression.) | 243 * await expression.) |
244 */ | 244 */ |
245 static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT = | 245 static const CompileTimeErrorCode AWAIT_IN_WRONG_CONTEXT = |
246 const CompileTimeErrorCode( | 246 const CompileTimeErrorCode( |
247 'AWAIT_IN_WRONG_CONTEXT', | 247 'AWAIT_IN_WRONG_CONTEXT', |
248 "The await expression can only be used in an asynchronous function.", | 248 "The await expression can only be used in an asynchronous function.", |
249 "Try marking the function body with either 'async' or 'async*'."); | 249 "Try marking the function body with either 'async' or 'async*'."); |
250 | 250 |
251 /** | 251 /** |
| 252 * 16.33 Identifier Reference: It is a compile-time error if a built-in |
| 253 * identifier is used as the declared name of a prefix, class, type parameter |
| 254 * or type alias. |
| 255 * |
| 256 * Parameters: |
| 257 * 0: the built-in identifier that is being used |
| 258 */ |
| 259 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_PREFIX_NAME = |
| 260 const CompileTimeErrorCode( |
| 261 'BUILT_IN_IDENTIFIER_AS_PREFIX_NAME', |
| 262 "The built-in identifier '{0}' can't be used as a prefix name.", |
| 263 "Try choosing a different name for the prefix."); |
| 264 |
| 265 /** |
252 * 12.30 Identifier Reference: It is a compile-time error to use a built-in | 266 * 12.30 Identifier Reference: It is a compile-time error to use a built-in |
253 * identifier other than dynamic as a type annotation. | 267 * identifier other than dynamic as a type annotation. |
254 * | 268 * |
255 * Parameters: | 269 * Parameters: |
256 * 0: the built-in identifier that is being used | 270 * 0: the built-in identifier that is being used |
257 */ | 271 */ |
258 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = | 272 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE = |
259 const CompileTimeErrorCode( | 273 const CompileTimeErrorCode( |
260 'BUILT_IN_IDENTIFIER_AS_TYPE', | 274 'BUILT_IN_IDENTIFIER_AS_TYPE', |
261 "The built-in identifier '{0}' can't be used as a type.", | 275 "The built-in identifier '{0}' can't be used as a type.", |
262 "Try correcting the name to match an existing type."); | 276 "Try correcting the name to match an existing type."); |
263 | 277 |
264 /** | 278 /** |
265 * 12.30 Identifier Reference: It is a compile-time error if a built-in | 279 * 16.33 Identifier Reference: It is a compile-time error if a built-in |
266 * identifier is used as the declared name of a class, type parameter or type | 280 * identifier is used as the declared name of a prefix, class, type parameter |
267 * alias. | 281 * or type alias. |
268 * | 282 * |
269 * Parameters: | 283 * Parameters: |
270 * 0: the built-in identifier that is being used | 284 * 0: the built-in identifier that is being used |
271 */ | 285 */ |
272 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = | 286 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_NAME = |
273 const CompileTimeErrorCode( | 287 const CompileTimeErrorCode( |
274 'BUILT_IN_IDENTIFIER_AS_TYPE_NAME', | 288 'BUILT_IN_IDENTIFIER_AS_TYPE_NAME', |
275 "The built-in identifier '{0}' can't be used as a type name.", | 289 "The built-in identifier '{0}' can't be used as a type name.", |
276 "Try choosing a different name for the type."); | 290 "Try choosing a different name for the type."); |
277 | 291 |
278 /** | 292 /** |
279 * 12.30 Identifier Reference: It is a compile-time error if a built-in | 293 * 16.33 Identifier Reference: It is a compile-time error if a built-in |
280 * identifier is used as the declared name of a class, type parameter or type | 294 * identifier is used as the declared name of a prefix, class, type parameter |
281 * alias. | 295 * or type alias. |
282 * | 296 * |
283 * Parameters: | 297 * Parameters: |
284 * 0: the built-in identifier that is being used | 298 * 0: the built-in identifier that is being used |
285 */ | 299 */ |
286 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = | 300 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME = |
287 const CompileTimeErrorCode( | 301 const CompileTimeErrorCode( |
288 'BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', | 302 'BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME', |
289 "The built-in identifier '{0}' can't be used as a typedef name.", | 303 "The built-in identifier '{0}' can't be used as a typedef name.", |
290 "Try choosing a different name for the typedef."); | 304 "Try choosing a different name for the typedef."); |
291 | 305 |
292 /** | 306 /** |
293 * 12.30 Identifier Reference: It is a compile-time error if a built-in | 307 * 16.33 Identifier Reference: It is a compile-time error if a built-in |
294 * identifier is used as the declared name of a class, type parameter or type | 308 * identifier is used as the declared name of a prefix, class, type parameter |
295 * alias. | 309 * or type alias. |
296 * | 310 * |
297 * Parameters: | 311 * Parameters: |
298 * 0: the built-in identifier that is being used | 312 * 0: the built-in identifier that is being used |
299 */ | 313 */ |
300 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = | 314 static const CompileTimeErrorCode BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME = |
301 const CompileTimeErrorCode( | 315 const CompileTimeErrorCode( |
302 'BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', | 316 'BUILT_IN_IDENTIFIER_AS_TYPE_PARAMETER_NAME', |
303 "The built-in identifier '{0}' can't be used as a type parameter name.
", | 317 "The built-in identifier '{0}' can't be used as a type parameter name.
", |
304 "Try choosing a different name for the type parameter."); | 318 "Try choosing a different name for the type parameter."); |
305 | 319 |
(...skipping 4637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4943 * created from the optional [correction] template. | 4957 * created from the optional [correction] template. |
4944 */ | 4958 */ |
4945 const StrongModeCode(ErrorType type, String name, String message, | 4959 const StrongModeCode(ErrorType type, String name, String message, |
4946 [String correction]) | 4960 [String correction]) |
4947 : type = type, | 4961 : type = type, |
4948 super('STRONG_MODE_$name', message, correction); | 4962 super('STRONG_MODE_$name', message, correction); |
4949 | 4963 |
4950 @override | 4964 @override |
4951 ErrorSeverity get errorSeverity => type.severity; | 4965 ErrorSeverity get errorSeverity => type.severity; |
4952 } | 4966 } |
OLD | NEW |