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

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

Issue 1564803002: Specialize message for parts as entry point (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comment Created 4 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/diagnostics/messages.dart ('k') | tests/compiler/dart2js/diagnostic_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 0c585aca42b7e2ab05f5a703fed4793ca0410e54..238d3939add61e474728c1155b0113d32f14ade2 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -649,16 +649,24 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
libraryCanonicalUriMap.remove(resolvedUri);
return null;
}
- DiagnosticMessage error = reporter.withCurrentElement(
- compilationUnit,
- () => reporter.createMessage(
- compilationUnit.partTag, MessageKind.IMPORT_PART_OF));
- DiagnosticMessage info = reporter.withCurrentElement(
- importingLibrary,
- () => reporter.createMessage(
- node,
- MessageKind.IMPORT_PART_OF_HERE));
- reporter.reportError(error, <DiagnosticMessage>[info]);
+ if (importingLibrary == null) {
+ DiagnosticMessage error = reporter.withCurrentElement(
+ compilationUnit,
+ () => reporter.createMessage(
+ compilationUnit.partTag, MessageKind.MAIN_HAS_PART_OF));
+ reporter.reportError(error);
+ } else {
+ DiagnosticMessage error = reporter.withCurrentElement(
+ compilationUnit,
+ () => reporter.createMessage(
+ compilationUnit.partTag, MessageKind.IMPORT_PART_OF));
+ DiagnosticMessage info = reporter.withCurrentElement(
+ importingLibrary,
+ () => reporter.createMessage(
+ node,
+ MessageKind.IMPORT_PART_OF_HERE));
+ reporter.reportError(error, [info]);
+ }
}
return processLibraryTags(handler, element).then((_) {
reporter.withCurrentElement(element, () {
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/messages.dart ('k') | tests/compiler/dart2js/diagnostic_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698