| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 | 5 |
| 6 /** | 6 /** |
| 7 * The messages in this file should meet the following guide lines: | 7 * The messages in this file should meet the following guide lines: |
| 8 * | 8 * |
| 9 * 1. The message should be a complete sentence starting with an uppercase | 9 * 1. The message should be a complete sentence starting with an uppercase |
| 10 * letter, and ending with a period. | 10 * letter, and ending with a period. |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 "Only constructors can have initializers."), | 972 "Only constructors can have initializers."), |
| 973 | 973 |
| 974 MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE: | 974 MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE: |
| 975 const MessageTemplate(MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE, | 975 const MessageTemplate(MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE, |
| 976 "Cyclic constructor redirection."), | 976 "Cyclic constructor redirection."), |
| 977 | 977 |
| 978 MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY: | 978 MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY: |
| 979 const MessageTemplate(MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY, | 979 const MessageTemplate(MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY, |
| 980 "Redirecting constructor can't have a body."), | 980 "Redirecting constructor can't have a body."), |
| 981 | 981 |
| 982 MessageKind.CONST_CONSTRUCTOR_HAS_BODY: | |
| 983 const MessageTemplate(MessageKind.CONST_CONSTRUCTOR_HAS_BODY, | |
| 984 "Const constructor or factory can't have a body.", | |
| 985 howToFix: "Remove the 'const' keyword or the body", | |
| 986 examples: const [""" | |
| 987 class C { | |
| 988 const C() {} | |
| 989 } | |
| 990 | |
| 991 main() => new C();"""]), | |
| 992 | |
| 993 MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER: | 982 MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER: |
| 994 const MessageTemplate( | 983 const MessageTemplate( |
| 995 MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER, | 984 MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER, |
| 996 "Redirecting constructor cannot have other initializers."), | 985 "Redirecting constructor cannot have other initializers."), |
| 997 | 986 |
| 998 MessageKind.SUPER_INITIALIZER_IN_OBJECT: | 987 MessageKind.SUPER_INITIALIZER_IN_OBJECT: |
| 999 const MessageTemplate(MessageKind.SUPER_INITIALIZER_IN_OBJECT, | 988 const MessageTemplate(MessageKind.SUPER_INITIALIZER_IN_OBJECT, |
| 1000 "'Object' cannot have a super initializer."), | 989 "'Object' cannot have a super initializer."), |
| 1001 | 990 |
| 1002 MessageKind.DUPLICATE_SUPER_INITIALIZER: | 991 MessageKind.DUPLICATE_SUPER_INITIALIZER: |
| (...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3726 static String convertToString(value) { | 3715 static String convertToString(value) { |
| 3727 if (value is ErrorToken) { | 3716 if (value is ErrorToken) { |
| 3728 // Shouldn't happen. | 3717 // Shouldn't happen. |
| 3729 return value.assertionMessage; | 3718 return value.assertionMessage; |
| 3730 } else if (value is Token) { | 3719 } else if (value is Token) { |
| 3731 value = value.value; | 3720 value = value.value; |
| 3732 } | 3721 } |
| 3733 return '$value'; | 3722 return '$value'; |
| 3734 } | 3723 } |
| 3735 } | 3724 } |
| OLD | NEW |