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

Unified Diff: pkg/compiler/lib/src/warnings.dart

Issue 837473002: Improve message for import of part. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/elements/modelx.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/warnings.dart
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
index 020ead1306a4aa96c866305f6c7199fe1f49326e..e1bb353a97397b3a08f9355c181c0cfc3e3809e6 100644
--- a/pkg/compiler/lib/src/warnings.dart
+++ b/pkg/compiler/lib/src/warnings.dart
@@ -1126,9 +1126,26 @@ main() => new C();"""]);
static const MessageKind BEFORE_TOP_LEVEL = const MessageKind(
"Part header must come before top-level definitions.");
+ static const MessageKind IMPORT_PART_OF = const MessageKind(
+ "The imported library must not have a 'part-of' directive.",
+ howToFix: "Try removing the 'part-of' directive or replacing the "
+ "import of the library with a 'part' directive.",
+ examples: const [const {
+'main.dart': """
+library library;
+
+import 'part.dart';
+
+main() {}
+""",
+
+'part.dart': """
+part of library;
+"""}]);
+
static const MessageKind LIBRARY_NAME_MISMATCH = const MessageKind(
"Expected part of library name '#{libraryName}'.",
- howToFix: "Trying changing the directive to 'part of #{libraryName};'.",
+ howToFix: "Try changing the directive to 'part of #{libraryName};'.",
examples: const [const {
'main.dart': """
library lib.foo;
@@ -1145,7 +1162,7 @@ part of lib.bar;
static const MessageKind MISSING_LIBRARY_NAME = const MessageKind(
"Library has no name. Part directive expected library name "
"to be '#{libraryName}'.",
- howToFix: "Trying adding 'library #{libraryName};' to the library.",
+ howToFix: "Try adding 'library #{libraryName};' to the library.",
examples: const [const {
'main.dart': """
part 'part.dart';
@@ -1166,9 +1183,6 @@ part of lib.foo;
static const MessageKind DUPLICATED_PART_OF = const MessageKind(
"Duplicated part-of directive.");
- static const MessageKind ILLEGAL_DIRECTIVE = const MessageKind(
- "Directive not allowed here.");
-
static const MessageKind DUPLICATED_LIBRARY_NAME = const MessageKind(
"Duplicated library name '#{libraryName}'.");
« no previous file with comments | « pkg/compiler/lib/src/elements/modelx.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698