Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart

Issue 1768143003: Use specific messages for const constructor with body. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 = const <MessageKind, MessageT emplate>{
15 MessageKind.CONST_CONSTRUCTOR_OR_FACTORY_WITH_BODY: const MessageTemplate( 15 MessageKind.CONST_CONSTRUCTOR_WITH_BODY: const MessageTemplate(
16 MessageKind.CONST_CONSTRUCTOR_OR_FACTORY_WITH_BODY, 16 MessageKind.CONST_CONSTRUCTOR_WITH_BODY,
17 "Const constructor or factory can't have a body.", 17 "Const constructor can't have a body.",
18 howToFix: "Remove the 'const' keyword or the body.", 18 howToFix: "Try removing the 'const' keyword or the body.",
19 examples: const [ 19 examples: const [
20 r""" 20 r"""
21 class C { 21 class C {
22 const C() {} 22 const C() {}
23 } 23 }
24 24
25 main() => new C();""", 25 main() => new C();""",
26 ]
27 ), // Generated. Don't edit.
28 MessageKind.CONST_FACTORY: const MessageTemplate(
29 MessageKind.CONST_FACTORY,
30 "Only redirecting factory constructors can be declared to be 'const'.",
31 howToFix: "Try removing the 'const' keyword or replacing the body with '=' f ollowed by a valid target.",
32 examples: const [
26 r""" 33 r"""
27 class C { 34 class C {
28 const factory C() {} 35 const factory C() {}
29 } 36 }
30 37
31 main() => new C();""", 38 main() => new C();""",
32 ] 39 ]
33 ), // Generated. Don't edit. 40 ), // Generated. Don't edit.
34 MessageKind.EXTRANEOUS_MODIFIER: const MessageTemplate( 41 MessageKind.EXTRANEOUS_MODIFIER: const MessageTemplate(
35 MessageKind.EXTRANEOUS_MODIFIER, 42 MessageKind.EXTRANEOUS_MODIFIER,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 """, 230 """,
224 r""" 231 r"""
225 const x = 1; 232 const x = 1;
226 main() { x = 3; } 233 main() { x = 3; }
227 """, 234 """,
228 "get foo => null main() { foo = 5; }", 235 "get foo => null main() { foo = 5; }",
229 "const foo = 0 main() { foo = 5; }", 236 "const foo = 0 main() { foo = 5; }",
230 ] 237 ]
231 ), // Generated. Don't edit. 238 ), // Generated. Don't edit.
232 }; 239 };
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698