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. |
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 = |
Jacob
2017/03/16 03:14:39
This file is generated. Does it make sense to keep
sra1
2017/03/16 03:25:29
It says DON'T EDIT.
The way to make this file comp
| |
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 [ |
98 ] | 94 "main() { rethrow; }", |
99 ), // Generated. Don't edit. | 95 ]), // Generated. Don't edit. |
100 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR: const MessageTemplate( | 96 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR: const MessageTemplate( |
101 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR, | 97 MessageKind.RETURN_IN_GENERATIVE_CONSTRUCTOR, |
102 "Constructors can't return values.", | 98 "Constructors can't return values.", |
103 howToFix: "Try removing the return statement or using a factory constructor. ", | 99 howToFix: |
104 examples: const [ | 100 "Try removing the return statement or using a factory constructor.", |
105 r""" | 101 examples: const [ |
102 r""" | |
106 class C { | 103 class C { |
107 C() { | 104 C() { |
108 return 1; | 105 return 1; |
109 } | 106 } |
110 } | 107 } |
111 | 108 |
112 main() => new C();""", | 109 main() => new C();""", |
113 ] | 110 ]), // Generated. Don't edit. |
114 ), // Generated. Don't edit. | |
115 MessageKind.RETURN_IN_GENERATOR: const MessageTemplate( | 111 MessageKind.RETURN_IN_GENERATOR: const MessageTemplate( |
116 MessageKind.RETURN_IN_GENERATOR, | 112 MessageKind.RETURN_IN_GENERATOR, |
117 "Can't return a value from a generator function (using the '#{modifier}' mod ifier).", | 113 "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.", | 114 howToFix: |
119 examples: const [ | 115 "Try removing the value, replacing 'return' with 'yield' or changing t he method body modifier.", |
120 r""" | 116 examples: const [ |
117 r""" | |
121 foo() async* { return 0; } | 118 foo() async* { return 0; } |
122 main() => foo(); | 119 main() => foo(); |
123 """, | 120 """, |
124 r""" | 121 r""" |
125 foo() sync* { return 0; } | 122 foo() sync* { return 0; } |
126 main() => foo(); | 123 main() => foo(); |
127 """, | 124 """, |
128 ] | 125 ]), // Generated. Don't edit. |
129 ), // Generated. Don't edit. | 126 MessageKind.NOT_ASSIGNABLE: const MessageTemplate(MessageKind.NOT_ASSIGNABLE, |
130 MessageKind.NOT_ASSIGNABLE: const MessageTemplate( | 127 "'#{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( | 128 MessageKind.FORIN_NOT_ASSIGNABLE: const MessageTemplate( |
134 MessageKind.FORIN_NOT_ASSIGNABLE, | 129 MessageKind.FORIN_NOT_ASSIGNABLE, |
135 "The element type '#{currentType}' of '#{expressionType}' is not assignable to '#{elementType}'.", | 130 "The element type '#{currentType}' of '#{expressionType}' is not assignabl e to '#{elementType}'.", |
136 examples: const [ | 131 examples: const [ |
137 r""" | 132 r""" |
138 main() { | 133 main() { |
139 List<int> list = <int>[1, 2]; | 134 List<int> list = <int>[1, 2]; |
140 for (String x in list) x; | 135 for (String x in list) x; |
141 } | 136 } |
142 """, | 137 """, |
143 ] | 138 ]), // Generated. Don't edit. |
144 ), // Generated. Don't edit. | 139 MessageKind.CANNOT_RESOLVE: const MessageTemplate(MessageKind.CANNOT_RESOLVE, |
145 MessageKind.CANNOT_RESOLVE: const MessageTemplate( | 140 "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( | 141 MessageKind.UNDEFINED_METHOD: const MessageTemplate( |
149 MessageKind.UNDEFINED_METHOD, | 142 MessageKind.UNDEFINED_METHOD, |
150 "The method '#{memberName}' is not defined for the class '#{className}'.", | 143 "The method '#{memberName}' is not defined for the class '#{className}'.", |
151 examples: const [ | 144 examples: const [ |
152 r""" | 145 r""" |
153 class A { | 146 class A { |
154 foo() { bar(); } | 147 foo() { bar(); } |
155 } | 148 } |
156 main() { new A().foo(); } | 149 main() { new A().foo(); } |
157 """, | 150 """, |
158 ] | 151 ]), // Generated. Don't edit. |
159 ), // Generated. Don't edit. | |
160 MessageKind.UNDEFINED_GETTER: const MessageTemplate( | 152 MessageKind.UNDEFINED_GETTER: const MessageTemplate( |
161 MessageKind.UNDEFINED_GETTER, | 153 MessageKind.UNDEFINED_GETTER, |
162 "The getter '#{memberName}' is not defined for the class '#{className}'.", | 154 "The getter '#{memberName}' is not defined for the class '#{className}'.", |
163 examples: const [ | 155 examples: const [ |
164 "class A {} main() { new A().x; }", | 156 "class A {} main() { new A().x; }", |
165 "class A {} main() { A.x; }", | 157 "class A {} main() { A.x; }", |
166 ] | 158 ]), // Generated. Don't edit. |
167 ), // Generated. Don't edit. | |
168 MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER: const MessageTemplate( | 159 MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER: const MessageTemplate( |
169 MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER, | 160 MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER, |
170 "The setter '#{memberName}' in class '#{className}' can not be used as a get ter.", | 161 "The setter '#{memberName}' in class '#{className}' can not be used as a g etter.", |
171 examples: const [ | 162 examples: const [ |
172 "class A { set x(y) {} } main() { new A().x; }", | 163 "class A { set x(y) {} } main() { new A().x; }", |
173 ] | 164 ]), // Generated. Don't edit. |
174 ), // Generated. Don't edit. | |
175 MessageKind.UNDEFINED_OPERATOR: const MessageTemplate( | 165 MessageKind.UNDEFINED_OPERATOR: const MessageTemplate( |
176 MessageKind.UNDEFINED_OPERATOR, | 166 MessageKind.UNDEFINED_OPERATOR, |
177 "The operator '#{memberName}' is not defined for the class '#{className}'.", | 167 "The operator '#{memberName}' is not defined for the class '#{className}'. ", |
178 examples: const [ | 168 examples: const [ |
179 "class A {} main() { new A() + 3; }", | 169 "class A {} main() { new A() + 3; }", |
180 ] | 170 ]), // Generated. Don't edit. |
181 ), // Generated. Don't edit. | |
182 MessageKind.UNDEFINED_SETTER: const MessageTemplate( | 171 MessageKind.UNDEFINED_SETTER: const MessageTemplate( |
183 MessageKind.UNDEFINED_SETTER, | 172 MessageKind.UNDEFINED_SETTER, |
184 "The setter '#{memberName}' is not defined for the class '#{className}'.", | 173 "The setter '#{memberName}' is not defined for the class '#{className}'.", |
185 examples: const [ | 174 examples: const [ |
186 "class A {} main() { new A().x = 499; }", | 175 "class A {} main() { new A().x = 499; }", |
187 ] | 176 ]), // Generated. Don't edit. |
188 ), // Generated. Don't edit. | |
189 MessageKind.NO_SUCH_SUPER_MEMBER: const MessageTemplate( | 177 MessageKind.NO_SUCH_SUPER_MEMBER: const MessageTemplate( |
190 MessageKind.NO_SUCH_SUPER_MEMBER, | 178 MessageKind.NO_SUCH_SUPER_MEMBER, |
191 "Can't resolve '#{memberName}' in a superclass of '#{className}'." ), // G enerated. Don't edit. | 179 "Can't resolve '#{memberName}' in a superclass of '#{className}'."), // Ge nerated. Don't edit. |
192 MessageKind.UNDEFINED_SUPER_SETTER: const MessageTemplate( | 180 MessageKind.UNDEFINED_SUPER_SETTER: const MessageTemplate( |
193 MessageKind.UNDEFINED_SUPER_SETTER, | 181 MessageKind.UNDEFINED_SUPER_SETTER, |
194 "The setter '#{memberName}' is not defined in a superclass of '#{className}' .", | 182 "The setter '#{memberName}' is not defined in a superclass of '#{className }'.", |
195 examples: const [ | 183 examples: const [ |
196 r""" | 184 r""" |
197 class A {} | 185 class A {} |
198 class B extends A { | 186 class B extends A { |
199 foo() { super.x = 499; } | 187 foo() { super.x = 499; } |
200 } | 188 } |
201 main() { new B().foo(); } | 189 main() { new B().foo(); } |
202 """, | 190 """, |
203 ] | 191 ]), // Generated. Don't edit. |
204 ), // Generated. Don't edit. | |
205 MessageKind.UNDEFINED_STATIC_GETTER_BUT_SETTER: const MessageTemplate( | 192 MessageKind.UNDEFINED_STATIC_GETTER_BUT_SETTER: const MessageTemplate( |
206 MessageKind.UNDEFINED_STATIC_GETTER_BUT_SETTER, | 193 MessageKind.UNDEFINED_STATIC_GETTER_BUT_SETTER, |
207 "Cannot resolve getter '#{name}'.", | 194 "Cannot resolve getter '#{name}'.", |
208 examples: const [ | 195 examples: const [ |
209 "set foo(x) {} main() { foo; }", | 196 "set foo(x) {} main() { foo; }", |
210 ] | 197 ]), // Generated. Don't edit. |
211 ), // Generated. Don't edit. | |
212 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER: const MessageTemplate( | 198 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER: const MessageTemplate( |
213 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, | 199 MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER, |
214 "Cannot resolve setter '#{name}'.", | 200 "Cannot resolve setter '#{name}'.", |
215 examples: const [ | 201 examples: const [ |
216 r""" | 202 r""" |
217 main() { | 203 main() { |
218 final x = 1; | 204 final x = 1; |
219 x = 2; | 205 x = 2; |
220 }""", | 206 }""", |
221 r""" | 207 r""" |
222 main() { | 208 main() { |
223 const x = 1; | 209 const x = 1; |
224 x = 2; | 210 x = 2; |
225 } | 211 } |
226 """, | 212 """, |
227 r""" | 213 r""" |
228 final x = 1; | 214 final x = 1; |
229 main() { x = 3; } | 215 main() { x = 3; } |
230 """, | 216 """, |
231 r""" | 217 r""" |
232 const x = 1; | 218 const x = 1; |
233 main() { x = 3; } | 219 main() { x = 3; } |
234 """, | 220 """, |
235 "get foo => null main() { foo = 5; }", | 221 "get foo => null main() { foo = 5; }", |
236 "const foo = 0 main() { foo = 5; }", | 222 "const foo = 0 main() { foo = 5; }", |
237 ] | 223 ]), // Generated. Don't edit. |
238 ), // Generated. Don't edit. | |
239 }; | 224 }; |
OLD | NEW |