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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart b/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
index 50dc24afc069ef6cfd09299fb2513f09f9ec4209..a18ce662d17b370c7f49669490cbaba25b24af51 100644
--- a/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
@@ -12,10 +12,10 @@ of the json, dart2js and analyzer representations.
import '../messages.dart' show MessageKind, MessageTemplate;
const Map<MessageKind, MessageTemplate> TEMPLATES = const <MessageKind, MessageTemplate>{
- MessageKind.CONST_CONSTRUCTOR_OR_FACTORY_WITH_BODY: const MessageTemplate(
- MessageKind.CONST_CONSTRUCTOR_OR_FACTORY_WITH_BODY,
- "Const constructor or factory can't have a body.",
- howToFix: "Remove the 'const' keyword or the body.",
+ MessageKind.CONST_CONSTRUCTOR_WITH_BODY: const MessageTemplate(
+ MessageKind.CONST_CONSTRUCTOR_WITH_BODY,
+ "Const constructor can't have a body.",
+ howToFix: "Try removing the 'const' keyword or the body.",
examples: const [
r"""
class C {
@@ -23,6 +23,13 @@ const Map<MessageKind, MessageTemplate> TEMPLATES = const <MessageKind, MessageT
}
main() => new C();""",
+ ]
+ ), // Generated. Don't edit.
+ MessageKind.CONST_FACTORY: const MessageTemplate(
+ MessageKind.CONST_FACTORY,
+ "Only redirecting factory constructors can be declared to be 'const'.",
+ howToFix: "Try removing the 'const' keyword or replacing the body with '=' followed by a valid target.",
+ examples: const [
r"""
class C {
const factory C() {}
« 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