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.generated.error; | 5 library analyzer.src.generated.error; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; | 9 import 'package:analyzer/dart/ast/ast.dart' show AstNode; |
10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
(...skipping 2725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2736 StaticTypeWarningCode.UNDEFINED_METHOD_WITH_CONSTRUCTOR, | 2736 StaticTypeWarningCode.UNDEFINED_METHOD_WITH_CONSTRUCTOR, |
2737 StaticTypeWarningCode.UNDEFINED_OPERATOR, | 2737 StaticTypeWarningCode.UNDEFINED_OPERATOR, |
2738 StaticTypeWarningCode.UNDEFINED_SETTER, | 2738 StaticTypeWarningCode.UNDEFINED_SETTER, |
2739 StaticTypeWarningCode.UNDEFINED_SUPER_GETTER, | 2739 StaticTypeWarningCode.UNDEFINED_SUPER_GETTER, |
2740 StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, | 2740 StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, |
2741 StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, | 2741 StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, |
2742 StaticTypeWarningCode.UNDEFINED_SUPER_SETTER, | 2742 StaticTypeWarningCode.UNDEFINED_SUPER_SETTER, |
2743 StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, | 2743 StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER, |
2744 StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, | 2744 StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, |
2745 StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, | 2745 StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, |
| 2746 StaticTypeWarningCode.FOR_IN_OF_INVALID_TYPE, |
| 2747 StaticTypeWarningCode.FOR_IN_OF_INVALID_ELEMENT_TYPE, |
2746 StaticWarningCode.AMBIGUOUS_IMPORT, | 2748 StaticWarningCode.AMBIGUOUS_IMPORT, |
2747 StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, | 2749 StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE, |
2748 StaticWarningCode.ASSIGNMENT_TO_CONST, | 2750 StaticWarningCode.ASSIGNMENT_TO_CONST, |
2749 StaticWarningCode.ASSIGNMENT_TO_FINAL, | 2751 StaticWarningCode.ASSIGNMENT_TO_FINAL, |
2750 StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER, | 2752 StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER, |
2751 StaticWarningCode.ASSIGNMENT_TO_FUNCTION, | 2753 StaticWarningCode.ASSIGNMENT_TO_FUNCTION, |
2752 StaticWarningCode.ASSIGNMENT_TO_METHOD, | 2754 StaticWarningCode.ASSIGNMENT_TO_METHOD, |
2753 StaticWarningCode.ASSIGNMENT_TO_TYPE, | 2755 StaticWarningCode.ASSIGNMENT_TO_TYPE, |
2754 StaticWarningCode.CASE_BLOCK_NOT_TERMINATED, | 2756 StaticWarningCode.CASE_BLOCK_NOT_TERMINATED, |
2755 StaticWarningCode.CAST_TO_NON_TYPE, | 2757 StaticWarningCode.CAST_TO_NON_TYPE, |
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4389 * a static type warning if T may not be assigned to the declared return type | 4391 * a static type warning if T may not be assigned to the declared return type |
4390 * of f. If f is synchronous it is a static type warning if T may not be | 4392 * of f. If f is synchronous it is a static type warning if T may not be |
4391 * assigned to Iterable. If f is asynchronous it is a static type warning if | 4393 * assigned to Iterable. If f is asynchronous it is a static type warning if |
4392 * T may not be assigned to Stream. | 4394 * T may not be assigned to Stream. |
4393 */ | 4395 */ |
4394 static const StaticTypeWarningCode YIELD_OF_INVALID_TYPE = | 4396 static const StaticTypeWarningCode YIELD_OF_INVALID_TYPE = |
4395 const StaticTypeWarningCode('YIELD_OF_INVALID_TYPE', | 4397 const StaticTypeWarningCode('YIELD_OF_INVALID_TYPE', |
4396 "The type '{0}' implied by the 'yield' expression must be assignable t
o '{1}'"); | 4398 "The type '{0}' implied by the 'yield' expression must be assignable t
o '{1}'"); |
4397 | 4399 |
4398 /** | 4400 /** |
| 4401 * 17.6.2 For-in. If the iterable expression does not implement Iterable, |
| 4402 * this warning is reported. |
| 4403 * |
| 4404 * Parameters: |
| 4405 * 0: The type of the iterable expression. |
| 4406 * 1: The sequence type -- Iterable for `for` or Stream for `await for`. |
| 4407 */ |
| 4408 static const StaticTypeWarningCode FOR_IN_OF_INVALID_TYPE = |
| 4409 const StaticTypeWarningCode('FOR_IN_OF_INVALID_TYPE', |
| 4410 "The type '{0}' used in the 'for' loop must implement {1}"); |
| 4411 |
| 4412 /** |
| 4413 * 17.6.2 For-in. It the iterable expression does not implement Iterable with |
| 4414 * a type argument that can be assigned to the for-in variable's type, this |
| 4415 * warning is reported. |
| 4416 * |
| 4417 * Parameters: |
| 4418 * 0: The type of the iterable expression. |
| 4419 * 1: The sequence type -- Iterable for `for` or Stream for `await for`. |
| 4420 * 2: The loop variable type. |
| 4421 */ |
| 4422 static const StaticTypeWarningCode FOR_IN_OF_INVALID_ELEMENT_TYPE = |
| 4423 const StaticTypeWarningCode('FOR_IN_OF_INVALID_ELEMENT_TYPE', |
| 4424 "The type '{0}' used in the 'for' loop must implement {1} with a type
argument that can be assigned to '{2}'"); |
| 4425 |
| 4426 /** |
4399 * Initialize a newly created error code to have the given [name]. The message | 4427 * Initialize a newly created error code to have the given [name]. The message |
4400 * associated with the error will be created from the given [message] | 4428 * associated with the error will be created from the given [message] |
4401 * template. The correction associated with the error will be created from the | 4429 * template. The correction associated with the error will be created from the |
4402 * given [correction] template. | 4430 * given [correction] template. |
4403 */ | 4431 */ |
4404 const StaticTypeWarningCode(String name, String message, [String correction]) | 4432 const StaticTypeWarningCode(String name, String message, [String correction]) |
4405 : super(name, message, correction); | 4433 : super(name, message, correction); |
4406 | 4434 |
4407 @override | 4435 @override |
4408 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; | 4436 ErrorSeverity get errorSeverity => ErrorType.STATIC_TYPE_WARNING.severity; |
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5703 * Initialize a newly created error code to have the given [name]. | 5731 * Initialize a newly created error code to have the given [name]. |
5704 */ | 5732 */ |
5705 const TodoCode(String name) : super(name, "{0}"); | 5733 const TodoCode(String name) : super(name, "{0}"); |
5706 | 5734 |
5707 @override | 5735 @override |
5708 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; | 5736 ErrorSeverity get errorSeverity => ErrorSeverity.INFO; |
5709 | 5737 |
5710 @override | 5738 @override |
5711 ErrorType get type => ErrorType.TODO; | 5739 ErrorType get type => ErrorType.TODO; |
5712 } | 5740 } |
OLD | NEW |