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

Unified Diff: pkg/compiler/lib/src/diagnostics/messages.dart

Issue 1346133002: Report hint on unmatched show and hide combinators. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove line-ending changes. Created 5 years, 3 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/deferred_load.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.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 8fabdf8e91de92285ee11fdaf233fa78b8fb7efa..eefc26bcda797633f67a94e471081f3bcbb9b2c6 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -184,7 +184,9 @@ enum MessageKind {
DUPLICATED_RESOURCE,
EMPTY_CATCH_DECLARATION,
EMPTY_ENUM_DECLARATION,
+ EMPTY_HIDE,
EQUAL_MAP_ENTRY_KEY,
+ EMPTY_SHOW,
EXISTING_DEFINITION,
EXISTING_LABEL,
EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
@@ -822,7 +824,7 @@ main() {
MessageKind.DUPLICATE_EXPORT:
const MessageTemplate(MessageKind.DUPLICATE_EXPORT,
"Duplicate export of '#{name}'.",
- howToFix: "Trying adding 'hide #{name}' to one of the exports.",
+ howToFix: "Try adding 'hide #{name}' to one of the exports.",
examples: const [const {
'main.dart': """
export 'decl1.dart';
@@ -840,6 +842,40 @@ main() {}""",
const MessageTemplate(MessageKind.DUPLICATE_EXPORT_DECL,
"The exported '#{name}' from export #{uriString} is defined here."),
+ MessageKind.EMPTY_HIDE:
+ const MessageTemplate(MessageKind.EMPTY_HIDE,
+ "Library '#{uri}' doesn't export a '#{name}' declaration.",
+ howToFix: "Try removing '#{name}' the 'hide' clause.",
+ examples: const [
+ const {
+ 'main.dart': """
+import 'dart:core' hide Foo;
+
+main() {}"""},
+ const {
+'main.dart': """
+export 'dart:core' hide Foo;
+
+main() {}"""},
+]),
+
+ MessageKind.EMPTY_SHOW:
+ const MessageTemplate(MessageKind.EMPTY_SHOW,
+ "Library '#{uri}' doesn't export a '#{name}' declaration.",
+ howToFix: "Try removing '#{name}' from the 'show' clause.",
+ examples: const [
+ const {
+ 'main.dart': """
+import 'dart:core' show Foo;
+
+main() {}"""},
+ const {
+'main.dart': """
+export 'dart:core' show Foo;
+
+main() {}"""},
+]),
+
MessageKind.NOT_A_TYPE:
const MessageTemplate(MessageKind.NOT_A_TYPE,
"'#{node}' is not a type."),
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698