Chromium Code Reviews| 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 fbf6d7000f9f3b41f800f69619d44113b44d6bf5..f7d8952145b1a345389ff01b5fdb6bed288945e4 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,15 +280,21 @@ abstract class SourceLibraryBuilder<T extends TypeBuilder, R> |
| builder.next = existing; |
| if (builder is PrefixBuilder && existing is PrefixBuilder) { |
| assert(existing.next == null); |
| + Builder deferred; |
| + Builder other; |
| if (builder.deferred) { |
| - addCompileTimeError(builder.charOffset, |
| - "Can't use the name '$name' for a deferred library, as the name is used elsewhere."); |
| - addCompileTimeError(existing.charOffset, "'$name' is used here."); |
| + deferred = builder; |
| + other = existing; |
| + } else if (existing.deferred) { |
| + deferred = existing; |
| + other = builder; |
| } |
| - if (existing.deferred) { |
| - 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."); |
| + if (deferred != null) { |
| + addCompileTimeError( |
| + deferred.charOffset, |
| + "Can't use the name '$name' for a deferred library, " |
| + "as the name is used elsewhere."); |
| + addCompileTimeError(other.charOffset, "'$name' is used here."); |
|
Paul Berry
2017/06/12 16:23:12
Not a blocking issue for this CL, but I believe th
ahe
2017/06/12 16:34:08
I'm aware of this problem, and I'm not sure what t
|
| } |
| return existing |
| ..exports.merge(builder.exports, |