| 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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 * 16.12.2 Const: It is a compile-time error if evaluation of a constant | 973 * 16.12.2 Const: It is a compile-time error if evaluation of a constant |
| 974 * object results in an uncaught exception being thrown. | 974 * object results in an uncaught exception being thrown. |
| 975 * | 975 * |
| 976 * Parameters: | 976 * Parameters: |
| 977 * 0: the maximum number of positional arguments | 977 * 0: the maximum number of positional arguments |
| 978 * 1: the actual number of positional arguments given | 978 * 1: the actual number of positional arguments given |
| 979 */ | 979 */ |
| 980 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = | 980 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS = |
| 981 const CompileTimeErrorCode( | 981 const CompileTimeErrorCode( |
| 982 'EXTRA_POSITIONAL_ARGUMENTS', | 982 'EXTRA_POSITIONAL_ARGUMENTS', |
| 983 "{0} positional arguments expected, but {1} found.", | 983 "Too many positional arguments: {0} expected, but {1} found.", |
| 984 "Try removing the extra arguments."); | 984 "Try removing the extra arguments."); |
| 985 | 985 |
| 986 /** | 986 /** |
| 987 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < |
| 988 * h</i> or if <i>m > n</i>. |
| 989 * |
| 990 * 16.12.2 Const: It is a compile-time error if evaluation of a constant |
| 991 * object results in an uncaught exception being thrown. |
| 992 * |
| 993 * Parameters: |
| 994 * 0: the maximum number of positional arguments |
| 995 * 1: the actual number of positional arguments given |
| 996 * |
| 997 * See [NOT_ENOUGH_REQUIRED_ARGUMENTS]. |
| 998 */ |
| 999 static const CompileTimeErrorCode EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED = |
| 1000 const CompileTimeErrorCode( |
| 1001 'EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED', |
| 1002 "Too many positional arguments: {0} expected, but {1} found.", |
| 1003 "Try removing the extra positional arguments, " |
| 1004 "or specifying the name for named arguments."); |
| 1005 |
| 1006 /** |
| 987 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It | 1007 * 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. It |
| 988 * is a compile time error if more than one initializer corresponding to a | 1008 * is a compile time error if more than one initializer corresponding to a |
| 989 * given instance variable appears in <i>k</i>'s list. | 1009 * given instance variable appears in <i>k</i>'s list. |
| 990 * | 1010 * |
| 991 * Parameters: | 1011 * Parameters: |
| 992 * 0: the name of the field being initialized multiple times | 1012 * 0: the name of the field being initialized multiple times |
| 993 */ | 1013 */ |
| 994 static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = | 1014 static const CompileTimeErrorCode FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS = |
| 995 const CompileTimeErrorCode( | 1015 const CompileTimeErrorCode( |
| 996 'FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', | 1016 'FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS', |
| (...skipping 2503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3500 * | 3520 * |
| 3501 * Parameters: | 3521 * Parameters: |
| 3502 * 0: the maximum number of positional arguments | 3522 * 0: the maximum number of positional arguments |
| 3503 * 1: the actual number of positional arguments given | 3523 * 1: the actual number of positional arguments given |
| 3504 * | 3524 * |
| 3505 * See [NOT_ENOUGH_REQUIRED_ARGUMENTS]. | 3525 * See [NOT_ENOUGH_REQUIRED_ARGUMENTS]. |
| 3506 */ | 3526 */ |
| 3507 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = | 3527 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS = |
| 3508 const StaticWarningCode( | 3528 const StaticWarningCode( |
| 3509 'EXTRA_POSITIONAL_ARGUMENTS', | 3529 'EXTRA_POSITIONAL_ARGUMENTS', |
| 3510 "{0} positional arguments expected, but {1} found.", | 3530 "Too many positional arguments: {0} expected, but {1} found.", |
| 3511 "Try removing the extra positional arguments."); | 3531 "Try removing the extra positional arguments."); |
| 3512 | 3532 |
| 3513 /** | 3533 /** |
| 3534 * 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < |
| 3535 * h</i> or if <i>m > n</i>. |
| 3536 * |
| 3537 * Parameters: |
| 3538 * 0: the maximum number of positional arguments |
| 3539 * 1: the actual number of positional arguments given |
| 3540 * |
| 3541 * See [NOT_ENOUGH_REQUIRED_ARGUMENTS]. |
| 3542 */ |
| 3543 static const StaticWarningCode EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED = |
| 3544 const StaticWarningCode( |
| 3545 'EXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMED', |
| 3546 "Too many positional arguments: {0} expected, but {1} found.", |
| 3547 "Try removing the extra positional arguments, " |
| 3548 "or specifying the name for named arguments."); |
| 3549 |
| 3550 /** |
| 3514 * 5. Variables: It is a static warning if a final instance variable that has | 3551 * 5. Variables: It is a static warning if a final instance variable that has |
| 3515 * been initialized at its point of declaration is also initialized in a | 3552 * been initialized at its point of declaration is also initialized in a |
| 3516 * constructor. | 3553 * constructor. |
| 3517 */ | 3554 */ |
| 3518 static const StaticWarningCode | 3555 static const StaticWarningCode |
| 3519 FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = | 3556 FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION = |
| 3520 const StaticWarningCode( | 3557 const StaticWarningCode( |
| 3521 'FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', | 3558 'FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION', |
| 3522 "Fields can't be initialized in the constructor if they are final " | 3559 "Fields can't be initialized in the constructor if they are final " |
| 3523 "and have already been initialized at their declaration.", | 3560 "and have already been initialized at their declaration.", |
| (...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5017 * created from the optional [correction] template. | 5054 * created from the optional [correction] template. |
| 5018 */ | 5055 */ |
| 5019 const StrongModeCode(ErrorType type, String name, String message, | 5056 const StrongModeCode(ErrorType type, String name, String message, |
| 5020 [String correction]) | 5057 [String correction]) |
| 5021 : type = type, | 5058 : type = type, |
| 5022 super('STRONG_MODE_$name', message, correction); | 5059 super('STRONG_MODE_$name', message, correction); |
| 5023 | 5060 |
| 5024 @override | 5061 @override |
| 5025 ErrorSeverity get errorSeverity => type.severity; | 5062 ErrorSeverity get errorSeverity => type.severity; |
| 5026 } | 5063 } |
| OLD | NEW |