| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT, | 129 CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT, |
| 130 CANNOT_RESOLVE, | 130 CANNOT_RESOLVE, |
| 131 CANNOT_RESOLVE_AWAIT, | 131 CANNOT_RESOLVE_AWAIT, |
| 132 CANNOT_RESOLVE_AWAIT_IN_CLOSURE, | 132 CANNOT_RESOLVE_AWAIT_IN_CLOSURE, |
| 133 CANNOT_RESOLVE_CONSTRUCTOR, | 133 CANNOT_RESOLVE_CONSTRUCTOR, |
| 134 CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT, | 134 CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT, |
| 135 CANNOT_RESOLVE_GETTER, | 135 CANNOT_RESOLVE_GETTER, |
| 136 CANNOT_RESOLVE_IN_INITIALIZER, | 136 CANNOT_RESOLVE_IN_INITIALIZER, |
| 137 CANNOT_RESOLVE_SETTER, | 137 CANNOT_RESOLVE_SETTER, |
| 138 CANNOT_RESOLVE_TYPE, | 138 CANNOT_RESOLVE_TYPE, |
| 139 CANNOT_RETURN_FROM_CONSTRUCTOR, | 139 RETURN_IN_GENERATIVE_CONSTRUCTOR, |
| 140 CLASS_NAME_EXPECTED, | 140 CLASS_NAME_EXPECTED, |
| 141 COMPILER_CRASHED, | 141 COMPILER_CRASHED, |
| 142 COMPLEX_RETURNING_NSM, | 142 COMPLEX_RETURNING_NSM, |
| 143 COMPLEX_THROWING_NSM, | 143 COMPLEX_THROWING_NSM, |
| 144 CONSIDER_ANALYZE_ALL, | 144 CONSIDER_ANALYZE_ALL, |
| 145 CONST_CALLS_NON_CONST, | 145 CONST_CALLS_NON_CONST, |
| 146 CONST_CALLS_NON_CONST_FOR_IMPLICIT, | 146 CONST_CALLS_NON_CONST_FOR_IMPLICIT, |
| 147 CONST_CONSTRUCTOR_OR_FACTORY_WITH_BODY, | 147 CONST_CONSTRUCTOR_OR_FACTORY_WITH_BODY, |
| 148 CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS, | 148 CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS, |
| 149 CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR, | 149 CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR, |
| (...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1840 "Operator '#{operatorName}' must have exactly 2 parameters."), | 1840 "Operator '#{operatorName}' must have exactly 2 parameters."), |
| 1841 | 1841 |
| 1842 MessageKind.OPERATOR_OPTIONAL_PARAMETERS: | 1842 MessageKind.OPERATOR_OPTIONAL_PARAMETERS: |
| 1843 const MessageTemplate(MessageKind.OPERATOR_OPTIONAL_PARAMETERS, | 1843 const MessageTemplate(MessageKind.OPERATOR_OPTIONAL_PARAMETERS, |
| 1844 "Operator '#{operatorName}' cannot have optional parameters."), | 1844 "Operator '#{operatorName}' cannot have optional parameters."), |
| 1845 | 1845 |
| 1846 MessageKind.OPERATOR_NAMED_PARAMETERS: | 1846 MessageKind.OPERATOR_NAMED_PARAMETERS: |
| 1847 const MessageTemplate(MessageKind.OPERATOR_NAMED_PARAMETERS, | 1847 const MessageTemplate(MessageKind.OPERATOR_NAMED_PARAMETERS, |
| 1848 "Operator '#{operatorName}' cannot have named parameters."), | 1848 "Operator '#{operatorName}' cannot have named parameters."), |
| 1849 | 1849 |
| 1850 MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR: | |
| 1851 const MessageTemplate(MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR, | |
| 1852 "Constructors can't return values.", | |
| 1853 howToFix: "Remove the return statement or use a factory constructor.", | |
| 1854 examples: const [""" | |
| 1855 class C { | |
| 1856 C() { | |
| 1857 return 1; | |
| 1858 } | |
| 1859 } | |
| 1860 | |
| 1861 main() => new C();"""]), | |
| 1862 | |
| 1863 MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER: | 1850 MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER: |
| 1864 const MessageTemplate(MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER, | 1851 const MessageTemplate(MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER, |
| 1865 "Cannot have final modifier on method."), | 1852 "Cannot have final modifier on method."), |
| 1866 | 1853 |
| 1867 MessageKind.ILLEGAL_CONST_FIELD_MODIFIER: | 1854 MessageKind.ILLEGAL_CONST_FIELD_MODIFIER: |
| 1868 const MessageTemplate(MessageKind.ILLEGAL_CONST_FIELD_MODIFIER, | 1855 const MessageTemplate(MessageKind.ILLEGAL_CONST_FIELD_MODIFIER, |
| 1869 "Cannot have const modifier on non-static field.", | 1856 "Cannot have const modifier on non-static field.", |
| 1870 howToFix: | 1857 howToFix: |
| 1871 "Try adding a static modifier, or removing the const modifier.", | 1858 "Try adding a static modifier, or removing the const modifier.", |
| 1872 examples: const [""" | 1859 examples: const [""" |
| (...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3307 }""", | 3294 }""", |
| 3308 """ | 3295 """ |
| 3309 main() async* { | 3296 main() async* { |
| 3310 var yield; | 3297 var yield; |
| 3311 }""", | 3298 }""", |
| 3312 """ | 3299 """ |
| 3313 main() sync* { | 3300 main() sync* { |
| 3314 var yield; | 3301 var yield; |
| 3315 }"""]), | 3302 }"""]), |
| 3316 | 3303 |
| 3317 MessageKind.RETURN_IN_GENERATOR: | |
| 3318 const MessageTemplate(MessageKind.RETURN_IN_GENERATOR, | |
| 3319 "'return' with a value is not allowed in a method body using the " | |
| 3320 "'#{modifier}' modifier.", | |
| 3321 howToFix: "Try removing the value, replacing 'return' with 'yield' " | |
| 3322 "or changing the method body modifier.", | |
| 3323 examples: const [ | |
| 3324 """ | |
| 3325 foo() async* { return 0; } | |
| 3326 main() => foo(); | |
| 3327 """, | |
| 3328 | |
| 3329 """ | |
| 3330 foo() sync* { return 0; } | |
| 3331 main() => foo(); | |
| 3332 """]), | |
| 3333 | |
| 3334 MessageKind.NATIVE_NOT_SUPPORTED: | 3304 MessageKind.NATIVE_NOT_SUPPORTED: |
| 3335 const MessageTemplate(MessageKind.NATIVE_NOT_SUPPORTED, | 3305 const MessageTemplate(MessageKind.NATIVE_NOT_SUPPORTED, |
| 3336 "'native' modifier is not supported.", | 3306 "'native' modifier is not supported.", |
| 3337 howToFix: "Try removing the 'native' implementation or analyzing the " | 3307 howToFix: "Try removing the 'native' implementation or analyzing the " |
| 3338 "code with the --allow-native-extensions option.", | 3308 "code with the --allow-native-extensions option.", |
| 3339 examples: const [""" | 3309 examples: const [""" |
| 3340 main() native "Main"; | 3310 main() native "Main"; |
| 3341 """]), | 3311 """]), |
| 3342 | 3312 |
| 3343 MessageKind.DART_EXT_NOT_SUPPORTED: | 3313 MessageKind.DART_EXT_NOT_SUPPORTED: |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3704 static String convertToString(value) { | 3674 static String convertToString(value) { |
| 3705 if (value is ErrorToken) { | 3675 if (value is ErrorToken) { |
| 3706 // Shouldn't happen. | 3676 // Shouldn't happen. |
| 3707 return value.assertionMessage; | 3677 return value.assertionMessage; |
| 3708 } else if (value is Token) { | 3678 } else if (value is Token) { |
| 3709 value = value.value; | 3679 value = value.value; |
| 3710 } | 3680 } |
| 3711 return '$value'; | 3681 return '$value'; |
| 3712 } | 3682 } |
| 3713 } | 3683 } |
| OLD | NEW |