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

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

Issue 2933813002: Follow-up to CLs 2933723002 and 2932973003. (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 | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | tests/language/constants_test.dart » ('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 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,
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | tests/language/constants_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698