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

Unified Diff: pkg/front_end/lib/src/fasta/source/source_library_builder.dart

Issue 2736263002: Report compile-time error instead of crashing when encountering bad parts. (Closed)
Patch Set: Created 3 years, 9 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/front_end/lib/src/fasta/export.dart ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/source/source_library_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index 5c2115375e9ad5dc509ab715173f111565e506b0..6c992f6654fd75c32bbefd244316ff96d96e3095 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -8,7 +8,9 @@ import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind;
import '../combinator.dart' show Combinator;
-import '../errors.dart' show internalError;
+import '../errors.dart' show inputError, internalError;
+
+import '../export.dart' show Export;
import '../messages.dart' show warning;
@@ -320,11 +322,13 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
void validatePart() {
if (parts.isNotEmpty) {
- internalError("Part with parts: $uri");
+ inputError(fileUri, -1,
+ "A file that's a part of a library can't have parts itself.");
}
if (exporters.isNotEmpty) {
- internalError(
- "${exporters.first.exporter.uri} attempts to export the part $uri.");
+ Export export = exporters.first;
+ inputError(
+ export.fileUri, export.charOffset, "A part can't be exported.");
}
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/export.dart ('k') | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698