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) { |