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

Unified Diff: pkg/compiler/lib/src/diagnostics/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/compiler/lib/src/diagnostics/generated/shared_messages.dart ('k') | pkg/dart_messages/bin/publish.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/diagnostics/messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index 2679c7548f3e518a7aebc3af9d44125065ffd38d..85f8289856e239ed1f317e9b9f3c7385e47719a8 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -476,7 +476,7 @@ enum MessageKind {
// TODO(johnnniwinther): For Infos, consider adding a reference to the
// error/warning/hint that they belong to.
class MessageTemplate {
- final dynamic/*MessageKind | SharedMessageKind*/ kind;
+ final MessageKind kind;
/// Should describe what is wrong and why.
final String template;
@@ -2594,42 +2594,6 @@ main() {}
// Don't know how to fix since the underlying error is unknown.
howToFix: DONT_KNOW_HOW_TO_FIX),
- 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 get 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(){}"]),
-
- 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 [
- // "get foo; main(){}",
- "set foo; main(){}",
- "abstract foo; main(){}",
- "static foo; main(){}",
- "external foo; main(){}"]),
-
MessageKind.ABSTRACT_CLASS_INSTANTIATION:
const MessageTemplate(MessageKind.ABSTRACT_CLASS_INSTANTIATION,
"Can't instantiate abstract class.",
@@ -3706,7 +3670,7 @@ class Message {
assert(() { computeMessage(); return true; });
}
- dynamic/*MessageKind | SharedMessageKind*/ get kind => template.kind;
+ MessageKind get kind => template.kind;
String computeMessage() {
if (message == null) {
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart ('k') | pkg/dart_messages/bin/publish.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698