Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 DON'T EDIT. GENERATED. DON'T EDIT. | 5 DON'T EDIT. GENERATED. DON'T EDIT. |
|
Siggi Cherem (dart-lang)
2016/04/07 16:15:24
revert this file :)
Harry Terkelsen
2016/04/07 16:52:29
Done.
| |
| 6 This file has been generated by 'publish.dart' in the dart_messages package. | 6 This file has been generated by 'publish.dart' in the dart_messages package. |
| 7 | 7 |
| 8 Messages are maintained in `lib/shared_messages.dart` of that same package. | 8 Messages are maintained in `lib/shared_messages.dart` of that same package. |
| 9 After any change to that file, run `bin/publish.dart` to generate a new version | 9 After any change to that file, run `bin/publish.dart` to generate a new version |
| 10 of the json, dart2js and analyzer representations. | 10 of the json, dart2js and analyzer representations. |
| 11 */ | 11 */ |
| 12 import '../messages.dart' show MessageKind, MessageTemplate; | 12 import '../messages.dart' show MessageKind, MessageTemplate; |
| 13 | 13 |
| 14 const Map<MessageKind, MessageTemplate> TEMPLATES = const <MessageKind, MessageT emplate>{ | 14 const Map<MessageKind, MessageTemplate> TEMPLATES = |
| 15 const <MessageKind, MessageTemplate>{ | |
| 15 MessageKind.CONST_CONSTRUCTOR_WITH_BODY: const MessageTemplate( | 16 MessageKind.CONST_CONSTRUCTOR_WITH_BODY: const MessageTemplate( |
| 16 MessageKind.CONST_CONSTRUCTOR_WITH_BODY, | 17 MessageKind.CONST_CONSTRUCTOR_WITH_BODY, |
| 17 "Const constructor can't have a body.", | 18 "Const constructor can't have a body.", |
| 18 howToFix: "Try removing the 'const' keyword or the body.", | 19 howToFix: "Try removing the 'const' keyword or the body.", |
| 19 examples: const [ | 20 examples: const [ |
| 20 r""" | 21 r""" |
| 21 class C { | 22 class C { |
| 22 const C() {} | 23 const C() {} |
| 23 } | 24 } |
| 24 | 25 |
| 25 main() => new C();""", | 26 main() => new C();""", |
| 26 ] | 27 ]), // Generated. Don't edit. |
| 27 ), // Generated. Don't edit. | 28 MessageKind.CONST_FACTORY: const MessageTemplate(MessageKind.CONST_FACTORY, |
| 28 MessageKind.CONST_FACTORY: const MessageTemplate( | 29 "Only redirecting factory constructors can be declared to be 'const'.", |
| 29 MessageKind.CONST_FACTORY, | 30 howToFix: |
| 30 "Only redirecting factory constructors can be declared to be 'const'.", | 31 "Try removing the 'const' keyword or replacing the body with '=' follo wed by a valid target.", |
| 31 howToFix: "Try removing the 'const' keyword or replacing the body with '=' f ollowed by a valid target.", | 32 examples: const [ |
| 32 examples: const [ | 33 r""" |
| 33 r""" | |
| 34 class C { | 34 class C { |
| 35 const factory C() {} | 35 const factory C() {} |
| 36 } | 36 } |
| 37 | 37 |
| 38 main() => new C();""", | 38 main() => new C();""", |
| 39 ] | 39 ]), // Generated. Don't edit. |
| 40 ), // Generated. Don't edit. | |
| 41 MessageKind.EXTRANEOUS_MODIFIER: const MessageTemplate( | 40 MessageKind.EXTRANEOUS_MODIFIER: const MessageTemplate( |
| 42 MessageKind.EXTRANEOUS_MODIFIER, | 41 MessageKind.EXTRANEOUS_MODIFIER, |
| 43 "Can't have modifier '#{modifier}' here.", | 42 "Can't have modifier '#{modifier}' here.", |
| 44 howToFix: "Try removing '#{modifier}'.", | 43 howToFix: "Try removing '#{modifier}'.", |
| 45 examples: const [ | 44 examples: const [ |
| 46 "var String foo; main(){}", | 45 "var String foo; main(){}", |
| 47 "var set foo; main(){}", | 46 "var set foo; main(){}", |
| 48 "var final foo; main(){}", | 47 "var final foo; main(){}", |
| 49 "var var foo; main(){}", | 48 "var var foo; main(){}", |
| 50 "var const foo; main(){}", | 49 "var const foo; main(){}", |
| 51 "var abstract foo; main(){}", | 50 "var abstract foo; main(){}", |
| 52 "var static foo; main(){}", | 51 "var static foo; main(){}", |
| 53 "var external foo; main(){}", | 52 "var external foo; main(){}", |
| 54 "get var foo; main(){}", | 53 "get var foo; main(){}", |
| 55 "set var foo; main(){}", | 54 "set var foo; main(){}", |
| 56 "final var foo; main(){}", | 55 "final var foo; main(){}", |
| 57 "var var foo; main(){}", | 56 "var var foo; main(){}", |
| 58 "const var foo; main(){}", | 57 "const var foo; main(){}", |
| 59 "abstract var foo; main(){}", | 58 "abstract var foo; main(){}", |
| 60 "static var foo; main(){}", | 59 "static var foo; main(){}", |
| 61 "external var foo; main(){}", | 60 "external var foo; main(){}", |
| 62 ] | 61 ]), // Generated. Don't edit. |
| 63 ), // Generated. Don't edit. | |
| 64 MessageKind.EXTRANEOUS_MODIFIER_REPLACE: const MessageTemplate( | 62 MessageKind.EXTRANEOUS_MODIFIER_REPLACE: const MessageTemplate( |
| 65 MessageKind.EXTRANEOUS_MODIFIER_REPLACE, | 63 MessageKind.EXTRANEOUS_MODIFIER_REPLACE, |
| 66 "Can't have modifier '#{modifier}' here.", | 64 "Can't have modifier '#{modifier}' here.", |
| 67 howToFix: "Try replacing modifier '#{modifier}' with 'var', 'final', or a ty pe.", | 65 howToFix: |
| 68 examples: const [ | 66 "Try replacing modifier '#{modifier}' with 'var', 'final', or a type." , |
| 69 "set foo; main(){}", | 67 examples: const [ |
| 70 "abstract foo; main(){}", | 68 "set foo; main(){}", |
| 71 "static foo; main(){}", | 69 "abstract foo; main(){}", |
| 72 "external foo; main(){}", | 70 "static foo; main(){}", |
| 73 ] | 71 "external foo; main(){}", |
| 74 ), // Generated. Don't edit. | 72 ]), // Generated. Don't edit. |
| 75 MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE: const MessageTemplate( | 73 MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE: const MessageTemplate( |
| 76 MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE, | 74 MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE, |
| 77 "Constructors can't have a return type.", | 75 "Constructors can't have a return type.", |
| 78 howToFix: "Try removing the return type.", | 76 howToFix: "Try removing the return type.", |
| 79 examples: const [ | 77 examples: const [ |
| 80 "class A { int A() {} } main() { new A(); }", | 78 "class A { int A() {} } main() { new A(); }", |
| 81 ] | 79 ]), // Generated. Don't edit. |
| 82 ), // Generated. Don't edit. | |
| 83 MessageKind.MISSING_EXPRESSION_IN_THROW: const MessageTemplate( | 80 MessageKind.MISSING_EXPRESSION_IN_THROW: const MessageTemplate( |
| 84 MessageKind.MISSING_EXPRESSION_IN_THROW, | 81 MessageKind.MISSING_EXPRESSION_IN_THROW, |
| 85 "Missing expression after 'throw'.", | 82 "Missing expression after 'throw'.", |
| 86 howToFix: "Did you mean 'rethrow'?", | 83 howToFix: "Did you mean 'rethrow'?", |
| 87 examples: const [ | 84 examples: const [ |
| 88 "main() { throw; }", | 85 "main() { throw; }", |
| 89 "main() { try { throw 0; } catch(e) { throw; } }", | 86 "main() { try { throw 0; } catch(e) { throw; } }", |
| 90 ] | 87 ]), // Generated. Don't edit. |
| 91 ), // Generated. Don't edit. | |
| 92 MessageKind.RETHROW_OUTSIDE_CATCH: const MessageTemplate( | 88 MessageKind.RETHROW_OUTSIDE_CATCH: const MessageTemplate( |
| 93 MessageKind.RETHROW_OUTSIDE_CATCH, | 89 MessageKind.RETHROW_OUTSIDE_CATCH, |
| 94 "Rethrow must be inside of catch clause.", | 90 "Rethrow must be inside of catch clause.", |
| 95 howToFix: "Try moving the expression into a catch clause, or using a 'throw' expression.", | 91 howToFix: |
| 96 examples: const [ | 92 "Try moving the expression into a catch clause, or using a 'throw' exp ression.", |
| 97 "main() { rethrow; }", | 93 examples: const ["main() { rethrow; }",]), // Generated. Don't edit. |
| 98 ] | |
| 99 ), // Generated. Don't edit. | |
| 100 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR: const MessageTemplate( | 94 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR: const MessageTemplate( |
| 101 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR, | 95 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR, |
| 102 "Constructors can't return values.", | 96 "Constructors can't return values.", |
| 103 howToFix: "Try removing the return statement or using a factory constructor. ", | 97 howToFix: |
| 104 examples: const [ | 98 "Try removing the return statement or using a factory constructor.", |
| 105 r""" | 99 examples: const [ |
| 100 r""" | |
| 106 class C { | 101 class C { |
| 107 C() { | 102 C() { |
| 108 return 1; | 103 return 1; |
| 109 } | 104 } |
| 110 } | 105 } |
| 111 | 106 |
| 112 main() => new C();""", | 107 main() => new C();""", |
| 113 ] | 108 ]), // Generated. Don't edit. |
| 114 ), // Generated. Don't edit. | |
| 115 MessageKind.RETURN_IN_GENERATOR: const MessageTemplate( | 109 MessageKind.RETURN_IN_GENERATOR: const MessageTemplate( |
| 116 MessageKind.RETURN_IN_GENERATOR, | 110 MessageKind.RETURN_IN_GENERATOR, |
| 117 "Can't return a value from a generator function (using the '#{modifier}' mod ifier).", | 111 "Can't return a value from a generator function (using the '#{modifier}' m odifier).", |
| 118 howToFix: "Try removing the value, replacing 'return' with 'yield' or changi ng the method body modifier.", | 112 howToFix: |
| 119 examples: const [ | 113 "Try removing the value, replacing 'return' with 'yield' or changing t he method body modifier.", |
| 120 r""" | 114 examples: const [ |
| 115 r""" | |
| 121 foo() async* { return 0; } | 116 foo() async* { return 0; } |
| 122 main() => foo(); | 117 main() => foo(); |
| 123 """, | 118 """, |
| 124 r""" | 119 r""" |
| 125 foo() sync* { return 0; } | 120 foo() sync* { return 0; } |
| 126 main() => foo(); | 121 main() => foo(); |
| 127 """, | 122 """, |
| 128 ] | 123 ]), // Generated. Don't edit. |
| 129 ), // Generated. Don't edit. | 124 MessageKind.NOT_ASSIGNABLE: const MessageTemplate(MessageKind.NOT_ASSIGNABLE, |
| 130 MessageKind.NOT_ASSIGNABLE: const MessageTemplate( | 125 "'#{fromType}' is not assignable to '#{toType}'."), // Generated. Don't ed it. |
| 131 MessageKind.NOT_ASSIGNABLE, | |
| 132 "'#{fromType}' is not assignable to '#{toType}'." ), // Generated. Don't e dit. | |
| 133 MessageKind.FORIN_NOT_ASSIGNABLE: const MessageTemplate( | 126 MessageKind.FORIN_NOT_ASSIGNABLE: const MessageTemplate( |
| 134 MessageKind.FORIN_NOT_ASSIGNABLE, | 127 MessageKind.FORIN_NOT_ASSIGNABLE, |
| 135 "The element type '#{currentType}' of '#{expressionType}' is not assignable to '#{elementType}'.", | 128 "The element type '#{currentType}' of '#{expressionType}' is not assignabl e to '#{elementType}'.", |
| 136 examples: const [ | 129 examples: const [ |
| 137 r""" | 130 r""" |
| 138 main() { | 131 main() { |
| 139 List<int> list = <int>[1, 2]; | 132 List<int> list = <int>[1, 2]; |
| 140 for (String x in list) x; | 133 for (String x in list) x; |
| 141 } | 134 } |
| 142 """, | 135 """, |
| 143 ] | 136 ]), // Generated. Don't edit. |
| 144 ), // Generated. Don't edit. | 137 MessageKind.CANNOT_RESOLVE: const MessageTemplate(MessageKind.CANNOT_RESOLVE, |
| 145 MessageKind.CANNOT_RESOLVE: const MessageTemplate( | 138 "Can't resolve '#{name}'."), // Generated. Don't edit. |
| 146 MessageKind.CANNOT_RESOLVE, | |
| 147 "Can't resolve '#{name}'." ), // Generated. Don't edit. | |
| 148 MessageKind.UNDEFINED_METHOD: const MessageTemplate( | 139 MessageKind.UNDEFINED_METHOD: const MessageTemplate( |
| 149 MessageKind.UNDEFINED_METHOD, | 140 MessageKind.UNDEFINED_METHOD, |
| 150 "The method '#{memberName}' is not defined for the class '#{className}'.", | 141 "The method '#{memberName}' is not defined for the class '#{className}'.", |
| 151 examples: const [ | 142 examples: const [ |
| 152 r""" | 143 r""" |
| 153 class A { | 144 class A { |
| 154 foo() { bar(); } | 145 foo() { bar(); } |
| 155 } | 146 } |
| 156 main() { new A().foo(); } | 147 main() { new A().foo(); } |
| 157 """, | 148 """, |
| 158 ] | 149 ]), // Generated. Don't edit. |
| 159 ), // Generated. Don't edit. | |
| 160 MessageKind.UNDEFINED_GETTER: const MessageTemplate( | 150 MessageKind.UNDEFINED_GETTER: const MessageTemplate( |
| 161 MessageKind.UNDEFINED_GETTER, | 151 MessageKind.UNDEFINED_GETTER, |
| 162 "The getter '#{memberName}' is not defined for the class '#{className}'.", | 152 "The getter '#{memberName}' is not defined for the class '#{className}'.", |
| 163 examples: const [ | 153 examples: const [ |
| 164 "class A {} main() { new A().x; }", | 154 "class A {} main() { new A().x; }", |
| 165 "class A {} main() { A.x; }", | 155 "class A {} main() { A.x; }", |
| 166 ] | 156 ]), // Generated. Don't edit. |
| 167 ), // Generated. Don't edit. | |
| 168 MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER: const MessageTemplate( | 157 MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER: const MessageTemplate( |
| 169 MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER, | 158 MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER, |
| 170 "The setter '#{memberName}' in class '#{className}' can not be used as a get ter.", | 159 "The setter '#{memberName}' in class '#{className}' can not be used as a g etter.", |
| 171 examples: const [ | 160 examples: const [ |
| 172 "class A { set x(y) {} } main() { new A().x; }", | 161 "class A { set x(y) {} } main() { new A().x; }", |
| 173 ] | 162 ]), // Generated. Don't edit. |
| 174 ), // Generated. Don't edit. | |
| 175 MessageKind.UNDEFINED_OPERATOR: const MessageTemplate( | 163 MessageKind.UNDEFINED_OPERATOR: const MessageTemplate( |
| 176 MessageKind.UNDEFINED_OPERATOR, | 164 MessageKind.UNDEFINED_OPERATOR, |
| 177 "The operator '#{memberName}' is not defined for the class '#{className}'.", | 165 "The operator '#{memberName}' is not defined for the class '#{className}'. ", |
| 178 examples: const [ | 166 examples: const [ |
| 179 "class A {} main() { new A() + 3; }", | 167 "class A {} main() { new A() + 3; }", |
| 180 ] | 168 ]), // Generated. Don't edit. |
| 181 ), // Generated. Don't edit. | |
| 182 MessageKind.UNDEFINED_SETTER: const MessageTemplate( | 169 MessageKind.UNDEFINED_SETTER: const MessageTemplate( |
| 183 MessageKind.UNDEFINED_SETTER, | 170 MessageKind.UNDEFINED_SETTER, |
| 184 "The setter '#{memberName}' is not defined for the class '#{className}'.", | 171 "The setter '#{memberName}' is not defined for the class '#{className}'.", |
| 185 examples: const [ | 172 examples: const [ |
| 186 "class A {} main() { new A().x = 499; }", | 173 "class A {} main() { new A().x = 499; }", |
| 187 ] | 174 ]), // Generated. Don't edit. |
| 188 ), // Generated. Don't edit. | |
| 189 MessageKind.NO_SUCH_SUPER_MEMBER: const MessageTemplate( | 175 MessageKind.NO_SUCH_SUPER_MEMBER: const MessageTemplate( |
| 190 MessageKind.NO_SUCH_SUPER_MEMBER, | 176 MessageKind.NO_SUCH_SUPER_MEMBER, |
| 191 "Can't resolve '#{memberName}' in a superclass of '#{className}'." ), // G enerated. Don't edit. | 177 "Can't resolve '#{memberName}' in a superclass of '#{className}'."), // Ge nerated. Don't edit. |
| 192 MessageKind.UNDEFINED_SUPER_SETTER: const MessageTemplate( | 178 MessageKind.UNDEFINED_SUPER_SETTER: const MessageTemplate( |
| 193 MessageKind.UNDEFINED_SUPER_SETTER, | 179 MessageKind.UNDEFINED_SUPER_SETTER, |
| 194 "The setter '#{memberName}' is not defined in a superclass of '#{className}' .", | 180 "The setter '#{memberName}' is not defined in a superclass of '#{className }'.", |
| 195 examples: const [ | 181 examples: const [ |
| 196 r""" | 182 r""" |
| 197 class A {} | 183 class A {} |
| 198 class B extends A { | 184 class B extends A { |
| 199 foo() { super.x = 499; } | 185 foo() { super.x = 499; } |
| 200 } | 186 } |
| 201 main() { new B().foo(); } | 187 main() { new B().foo(); } |
| 202 """, | 188 """, |
| 203 ] | 189 ]), // Generated. Don't edit. |
| 204 ), // Generated. Don't edit. | |
| 205 MessageKind.UNDEFINED_STATIC_GETTER_BUT_SETTER: const MessageTemplate( | 190 MessageKind.UNDEFINED_STATIC_GETTER_BUT_SETTER: const MessageTemplate( |
| 206 MessageKind.UNDEFINED_STATIC_GETTER_BUT_SETTER, | 191 MessageKind.UNDEFINED_STATIC_GETTER_BUT_SETTER, |
| 207 "Cannot resolve getter '#{name}'.", | 192 "Cannot resolve getter '#{name}'.", |
| 208 examples: const [ | 193 examples: const [ |
| 209 "set foo(x) {} main() { foo; }", | 194 "set foo(x) {} main() { foo; }", |
| 210 ] | 195 ]), // Generated. Don't edit. |
| 211 ), // Generated. Don't edit. | |
| 212 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER: const MessageTemplate( | 196 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER: const MessageTemplate( |
| 213 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, | 197 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, |
| 214 "Cannot resolve setter '#{name}'.", | 198 "Cannot resolve setter '#{name}'.", |
| 215 examples: const [ | 199 examples: const [ |
| 216 r""" | 200 r""" |
| 217 main() { | 201 main() { |
| 218 final x = 1; | 202 final x = 1; |
| 219 x = 2; | 203 x = 2; |
| 220 }""", | 204 }""", |
| 221 r""" | 205 r""" |
| 222 main() { | 206 main() { |
| 223 const x = 1; | 207 const x = 1; |
| 224 x = 2; | 208 x = 2; |
| 225 } | 209 } |
| 226 """, | 210 """, |
| 227 r""" | 211 r""" |
| 228 final x = 1; | 212 final x = 1; |
| 229 main() { x = 3; } | 213 main() { x = 3; } |
| 230 """, | 214 """, |
| 231 r""" | 215 r""" |
| 232 const x = 1; | 216 const x = 1; |
| 233 main() { x = 3; } | 217 main() { x = 3; } |
| 234 """, | 218 """, |
| 235 "get foo => null main() { foo = 5; }", | 219 "get foo => null main() { foo = 5; }", |
| 236 "const foo = 0 main() { foo = 5; }", | 220 "const foo = 0 main() { foo = 5; }", |
| 237 ] | 221 ]), // Generated. Don't edit. |
| 238 ), // Generated. Don't edit. | |
| 239 }; | 222 }; |
| OLD | NEW |