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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 * object results in an uncaught exception being thrown. | 44 * object results in an uncaught exception being thrown. |
45 */ | 45 */ |
46 static const CheckedModeCompileTimeErrorCode | 46 static const CheckedModeCompileTimeErrorCode |
47 CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH = | 47 CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH = |
48 const CheckedModeCompileTimeErrorCode( | 48 const CheckedModeCompileTimeErrorCode( |
49 'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH', | 49 'CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH', |
50 "A value of type '{0}' can't be assigned to a parameter of type " | 50 "A value of type '{0}' can't be assigned to a parameter of type " |
51 "'{1}'."); | 51 "'{1}'."); |
52 | 52 |
53 /** | 53 /** |
| 54 * 16.12.2 Const: It is a compile-time error if evaluation of a constant |
| 55 * object results in an uncaught exception being thrown. |
| 56 */ |
| 57 static const CheckedModeCompileTimeErrorCode CONST_EVAL_THROWS_EXCEPTION = |
| 58 const CheckedModeCompileTimeErrorCode('CONST_EVAL_THROWS_EXCEPTION', |
| 59 "Evaluation of this constant expression throws an exception."); |
| 60 |
| 61 /** |
54 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error | 62 * 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error |
55 * if o is not <b>null</b> and the interface of the class of <i>o</i> is not a | 63 * if o is not <b>null</b> and the interface of the class of <i>o</i> is not a |
56 * subtype of the static type of the field <i>v</i>. | 64 * subtype of the static type of the field <i>v</i>. |
57 * | 65 * |
58 * 16.12.2 Const: It is a compile-time error if evaluation of a constant | 66 * 16.12.2 Const: It is a compile-time error if evaluation of a constant |
59 * object results in an uncaught exception being thrown. | 67 * object results in an uncaught exception being thrown. |
60 * | 68 * |
61 * Parameters: | 69 * Parameters: |
62 * 0: the name of the type of the initializer expression | 70 * 0: the name of the type of the initializer expression |
63 * 1: the name of the type of the field | 71 * 1: the name of the type of the field |
(...skipping 4990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5054 * created from the optional [correction] template. | 5062 * created from the optional [correction] template. |
5055 */ | 5063 */ |
5056 const StrongModeCode(ErrorType type, String name, String message, | 5064 const StrongModeCode(ErrorType type, String name, String message, |
5057 [String correction]) | 5065 [String correction]) |
5058 : type = type, | 5066 : type = type, |
5059 super('STRONG_MODE_$name', message, correction); | 5067 super('STRONG_MODE_$name', message, correction); |
5060 | 5068 |
5061 @override | 5069 @override |
5062 ErrorSeverity get errorSeverity => type.severity; | 5070 ErrorSeverity get errorSeverity => type.severity; |
5063 } | 5071 } |
OLD | NEW |