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 626d8fda1e62625240e0c6a8299ab2e77c720d92..834cda536044011ea6458ac9a0a30c170deafc38 100644 |
--- a/pkg/compiler/lib/src/diagnostics/messages.dart |
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart |
@@ -244,6 +244,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, |
@@ -2029,6 +2030,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 'not-main.dart'; |
+""" |
+ } |
+ ]), |
+ |
MessageKind.MISSING_LIBRARY_NAME: const MessageTemplate( |
MessageKind.MISSING_LIBRARY_NAME, |
"Library has no name. Part directive expected library name " |