mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 21:40:07 +00:00
Move the check for 'locals hides exports' to DillLibraryBuilder.buildAmbiguousBuilder().
R=ahe@google.com BUG= Review-Url: https://codereview.chromium.org/2893383002 .
This commit is contained in:
parent
79b4382784
commit
5139a1f85c
|
@ -98,11 +98,6 @@ abstract class LibraryBuilder<T extends TypeBuilder, R> extends Builder {
|
|||
Builder existing = map[name];
|
||||
if (existing == member) return false;
|
||||
if (existing != null) {
|
||||
// For each entry mapping key `k` to declaration `d` in `NS` an entry
|
||||
// mapping `k` to `d` is added to the exported namespace of `L` unless a
|
||||
// top-level declaration with the name `k` exists in `L`.
|
||||
if (existing.parent == this) return false;
|
||||
|
||||
Builder result =
|
||||
buildAmbiguousBuilder(name, existing, member, -1, isExport: true);
|
||||
map[name] = result;
|
||||
|
|
|
@ -24,6 +24,7 @@ import '../errors.dart' show internalError;
|
|||
import '../kernel/kernel_builder.dart'
|
||||
show
|
||||
Builder,
|
||||
InvalidTypeBuilder,
|
||||
KernelInvalidTypeBuilder,
|
||||
KernelTypeBuilder,
|
||||
LibraryBuilder,
|
||||
|
@ -120,6 +121,13 @@ class DillLibraryBuilder extends LibraryBuilder<KernelTypeBuilder, Library> {
|
|||
Builder buildAmbiguousBuilder(
|
||||
String name, Builder builder, Builder other, int charOffset,
|
||||
{bool isExport: false, bool isImport: false}) {
|
||||
if (builder == other) return builder;
|
||||
if (builder is InvalidTypeBuilder) return builder;
|
||||
if (other is InvalidTypeBuilder) return other;
|
||||
// For each entry mapping key `k` to declaration `d` in `NS` an entry
|
||||
// mapping `k` to `d` is added to the exported namespace of `L` unless a
|
||||
// top-level declaration with the name `k` exists in `L`.
|
||||
if (builder.parent == this) return builder;
|
||||
return new KernelInvalidTypeBuilder(name, charOffset, fileUri);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue