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.dart.error.hint_codes; | 5 library analyzer.src.dart.error.hint_codes; |
6 | 6 |
7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
8 import 'package:analyzer/src/dart/element/element.dart'; | 8 import 'package:analyzer/src/dart/element/element.dart'; |
9 | 9 |
10 /** | 10 /** |
(...skipping 20 matching lines...) Expand all Loading... |
31 * | 31 * |
32 * Parameters: | 32 * Parameters: |
33 * 0: the name of the actual argument type | 33 * 0: the name of the actual argument type |
34 * 1: the name of the expected type | 34 * 1: the name of the expected type |
35 */ | 35 */ |
36 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode( | 36 static const HintCode ARGUMENT_TYPE_NOT_ASSIGNABLE = const HintCode( |
37 'ARGUMENT_TYPE_NOT_ASSIGNABLE', | 37 'ARGUMENT_TYPE_NOT_ASSIGNABLE', |
38 "The argument type '{0}' can't be assigned to the parameter type '{1}'."); | 38 "The argument type '{0}' can't be assigned to the parameter type '{1}'."); |
39 | 39 |
40 /** | 40 /** |
| 41 * This hint is generated when a function type is assigned to a function |
| 42 * typed location, and the assignment will be invalid after fuzzy arrows |
| 43 * (the treatment of dynamic as bottom in certain locations) is removed. |
| 44 * |
| 45 */ |
| 46 static const HintCode USES_DYNAMIC_AS_BOTTOM = const HintCode( |
| 47 'USES_DYNAMIC_AS_BOTTOM', |
| 48 "A function of type '{0}' can't be assigned to a variable of type '{1}'.", |
| 49 "Try changing the type of the function, or " |
| 50 "casting the right-hand type to '{1}'."); |
| 51 |
| 52 /** |
41 * When the target expression uses '?.' operator, it can be `null`, so all the | 53 * When the target expression uses '?.' operator, it can be `null`, so all the |
42 * subsequent invocations should also use '?.' operator. | 54 * subsequent invocations should also use '?.' operator. |
43 */ | 55 */ |
44 static const HintCode CAN_BE_NULL_AFTER_NULL_AWARE = const HintCode( | 56 static const HintCode CAN_BE_NULL_AFTER_NULL_AWARE = const HintCode( |
45 'CAN_BE_NULL_AFTER_NULL_AWARE', | 57 'CAN_BE_NULL_AFTER_NULL_AWARE', |
46 "The target expression uses '?.', so its value can be null.", | 58 "The target expression uses '?.', so its value can be null.", |
47 "Replace the '.' with a '?.' in the invocation."); | 59 "Replace the '.' with a '?.' in the invocation."); |
48 | 60 |
49 /** | 61 /** |
50 * Dead code is code that is never reached, this can happen for instance if a | 62 * Dead code is code that is never reached, this can happen for instance if a |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 */ | 685 */ |
674 const HintCode(String name, String message, [String correction]) | 686 const HintCode(String name, String message, [String correction]) |
675 : super(name, message, correction); | 687 : super(name, message, correction); |
676 | 688 |
677 @override | 689 @override |
678 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; | 690 ErrorSeverity get errorSeverity => ErrorType.HINT.severity; |
679 | 691 |
680 @override | 692 @override |
681 ErrorType get type => ErrorType.HINT; | 693 ErrorType get type => ErrorType.HINT; |
682 } | 694 } |
OLD | NEW |