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

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

Issue 1700243002: Share const-error messages. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Use double-quotes Created 4 years, 10 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2aa258a9818f72ec2d68bd3ac920ca9333e505c4..e7ad53a4d070dc500a3cdd6e61267e8b111da00f 100644
--- a/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart
@@ -17,18 +17,52 @@ const Map<MessageKind, MessageTemplate> TEMPLATES = const <MessageKind, MessageT
"Const constructor or factory can't have a body.",
howToFix: "Remove the 'const' keyword or the body.",
examples: const [
- r'''
+ r"""
class C {
const C() {}
}
- main() => new C();''',
- r'''
+ main() => new C();""",
+ r"""
class C {
const factory C() {}
}
- main() => new C();''',
+ main() => new C();""",
+ ]
+ ), // Generated. Don't edit.
+ MessageKind.EXTRANEOUS_MODIFIER: const MessageTemplate(
+ MessageKind.EXTRANEOUS_MODIFIER,
+ "Can't have modifier '#{modifier}' here.",
+ howToFix: "Try removing '#{modifier}'.",
+ examples: const [
+ "var String foo; main(){}",
+ "var set foo; main(){}",
+ "var final foo; main(){}",
+ "var var foo; main(){}",
+ "var const foo; main(){}",
+ "var abstract foo; main(){}",
+ "var static foo; main(){}",
+ "var external foo; main(){}",
+ "get var foo; main(){}",
+ "set var foo; main(){}",
+ "final var foo; main(){}",
+ "var var foo; main(){}",
+ "const var foo; main(){}",
+ "abstract var foo; main(){}",
+ "static var foo; main(){}",
+ "external var foo; main(){}",
+ ]
+ ), // Generated. Don't edit.
+ MessageKind.EXTRANEOUS_MODIFIER_REPLACE: const MessageTemplate(
+ MessageKind.EXTRANEOUS_MODIFIER_REPLACE,
+ "Can't have modifier '#{modifier}' here.",
+ howToFix: "Try replacing modifier '#{modifier}' with 'var', 'final', or a type.",
+ examples: const [
+ "set foo; main(){}",
+ "abstract foo; main(){}",
+ "static foo; main(){}",
+ "external foo; main(){}",
]
), // Generated. Don't edit.
};
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698