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

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

Issue 2640853005: Make Analyzer, VM and dart2js accept URI strings as part-of library identifier. (Closed)
Patch Set: Add tests, enable flag by default in analyzer. Created 3 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
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 7563ceac1c1fd1c790c441aad6e229d9886e3799..ce11250eebb8d1b521fd1cd370fd926c8d2558d6 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -291,6 +291,7 @@ enum MessageKind {
LIBRARY_NOT_FOUND,
LIBRARY_NOT_SUPPORTED,
LIBRARY_TAG_MUST_BE_FIRST,
+ LIBRARY_URI_MISMATCH,
MAIN_HAS_PART_OF,
MAIN_NOT_A_FUNCTION,
MAIN_WITH_EXTRA_PARAMETER,
@@ -2076,6 +2077,26 @@ part of lib.bar;
}
]),
+ MessageKind.LIBRARY_URI_MISMATCH: const MessageTemplate(
+ MessageKind.LIBRARY_URI_MISMATCH,
+ "Expected URI of library '#{libraryUri}'.",
+ howToFix: "Try changing the directive to 'part of "
+ "\"#{libraryUri}\";'.",
+ examples: const [
+ const {
+ 'main.dart': """
+library lib.foo;
+
+part 'part.dart';
+
+main() {}
+""",
+ 'part.dart': """
+part of "main.dart";
+"""
+ }
+ ]),
+
MessageKind.MISSING_LIBRARY_NAME: const MessageTemplate(
MessageKind.MISSING_LIBRARY_NAME,
"Library has no name. Part directive expected library name "

Powered by Google App Engine
This is Rietveld 408576698