| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| index bacfc870e48d7f783d8d02bf309efa96ca01d1d6..fda82a7406b554fd4bb58c354a211b9125d355f5 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| @@ -674,15 +674,31 @@ class LibraryElementX extends ElementX implements LibraryElement {
|
| importers[element] =
|
| importers.putIfAbsent(element, () => const Link<Import>())
|
| .prepend(import);
|
| - Element existing = importScope[element.name];
|
| - if (existing != null) {
|
| - // TODO(johnniwinther): Provide access to the import tags from which
|
| - // the elements came.
|
| - importScope[element.name] = new AmbiguousElementX(
|
| - MessageKind.DUPLICATE_IMPORT, {'name': element.name},
|
| - this, existing, element);
|
| - } else {
|
| - importScope[element.name] = element;
|
| + SourceString name = element.name;
|
| + Element existing = importScope.putIfAbsent(name, () => element);
|
| + if (existing != element) {
|
| + if (existing.getLibrary().isPlatformLibrary &&
|
| + !element.getLibrary().isPlatformLibrary) {
|
| + // [existing] is implicitly hidden.
|
| + importScope[name] = element;
|
| + listener.reportWarningCode(import, MessageKind.HIDDEN_IMPORT,
|
| + {'name': name,
|
| + 'hiddenUri': existing.getLibrary().canonicalUri,
|
| + 'hidingUri': element.getLibrary().canonicalUri});
|
| + } else if (!existing.getLibrary().isPlatformLibrary &&
|
| + element.getLibrary().isPlatformLibrary) {
|
| + // [element] is implicitly hidden.
|
| + listener.reportWarningCode(import, MessageKind.HIDDEN_IMPORT,
|
| + {'name': name,
|
| + 'hiddenUri': element.getLibrary().canonicalUri,
|
| + 'hidingUri': existing.getLibrary().canonicalUri});
|
| + } else {
|
| + // TODO(johnniwinther): Provide access to the import tags from which
|
| + // the elements came.
|
| + importScope[name] = new AmbiguousElementX(
|
| + MessageKind.DUPLICATE_IMPORT, {'name': name},
|
| + this, existing, element);
|
| + }
|
| }
|
| }
|
|
|
|
|