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

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

Issue 2933723002: Complain about duplicated defer. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | tests/language/language_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 24b8c29c606c86215731918157a930752e40147a..fbf6d7000f9f3b41f800f69619d44113b44d6bf5 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
@@ -280,6 +280,16 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R>
builder.next = existing;
if (builder is PrefixBuilder && existing is PrefixBuilder) {
assert(existing.next == null);
+ if (builder.deferred) {
+ addCompileTimeError(builder.charOffset,
+ "Can't use the name '$name' for a deferred library, as the name is used elsewhere.");
Johnni Winther 2017/06/12 08:09:13 Long line + below
ahe 2017/06/12 08:33:28 Acknowledged.
+ addCompileTimeError(existing.charOffset, "'$name' is used here.");
+ }
+ if (existing.deferred) {
Johnni Winther 2017/06/12 08:09:13 Make this an `else if` to avoid to errors when bot
ahe 2017/06/12 08:33:28 Acknowledged.
+ addCompileTimeError(existing.charOffset,
+ "Can't use the name '$name' for a deferred library, as the name is used elsewhere.");
+ addCompileTimeError(builder.charOffset, "'$name' is used here.");
+ }
return existing
..exports.merge(builder.exports,
(String name, Builder existing, Builder member) {
« no previous file with comments | « no previous file | tests/language/language_kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698