| 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 9612da5970829345c2e6a6633f98fdc8c81b8f42..042e5c828608d2a7e55545fa0d626479c53560a0 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart
|
| @@ -1904,25 +1904,25 @@ abstract class BaseClassElementX extends ElementX implements ClassElement {
|
| }
|
|
|
| /**
|
| - * Returns true if the [fieldMember] is shadowed by another field. The given
|
| - * [fieldMember] must be a member of this class.
|
| + * Returns true if the [fieldMember] shadows another field. The given
|
| + * [fieldMember] must be a member of this class, i.e. if there is a field of
|
| + * the same name in the superclass chain.
|
| *
|
| * This method also works if the [fieldMember] is private.
|
| */
|
| - bool isShadowedByField(Element fieldMember) {
|
| + bool hasFieldShadowedBy(Element fieldMember) {
|
| assert(fieldMember.isField());
|
| String fieldName = fieldMember.name;
|
| bool isPrivate = isPrivateName(fieldName);
|
| LibraryElement memberLibrary = fieldMember.getLibrary();
|
| - ClassElement lookupClass = this;
|
| + ClassElement lookupClass = this.superclass;
|
| while (lookupClass != null) {
|
| Element foundMember = lookupClass.lookupLocalMember(fieldName);
|
| if (foundMember != null) {
|
| - if (foundMember == fieldMember) return false;
|
| if (foundMember.isField()) {
|
| if (!isPrivate || memberLibrary == foundMember.getLibrary()) {
|
| - // Private fields can only be shadowed by a field declared
|
| - // in the same library.
|
| + // Private fields can only be shadowed by a field declared in the
|
| + // same library.
|
| return true;
|
| }
|
| }
|
|
|