| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java
|
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java
|
| index 0609419200e92cf0b35da7c9306d929d57072fea..d0066ad58f094663aa8a9b5a2334ca636f859877 100644
|
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java
|
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/resolver/ElementResolver.java
|
| @@ -1326,30 +1326,28 @@ public class ElementResolver extends SimpleASTVisitor<Void> {
|
| // TODO(brianwilkerson) Report this error.
|
| return null;
|
| }
|
| - ClassElement superclass = getSuperclass(enclosingClass);
|
| - if (superclass == null) {
|
| + InterfaceType superType = enclosingClass.getSupertype();
|
| + if (superType == null) {
|
| // TODO(brianwilkerson) Report this error.
|
| return null;
|
| }
|
| SimpleIdentifier name = node.getConstructorName();
|
| - ConstructorElement element;
|
| - if (name == null) {
|
| - element = superclass.getUnnamedConstructor();
|
| - } else {
|
| - element = superclass.getNamedConstructor(name.getName());
|
| - }
|
| + String superName = name != null ? name.getName() : null;
|
| + ConstructorElement element = superType.lookUpConstructor(
|
| + superName,
|
| + resolver.getDefiningLibrary());
|
| if (element == null) {
|
| if (name != null) {
|
| resolver.reportError(
|
| CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
|
| node,
|
| - superclass.getName(),
|
| + superType.getDisplayName(),
|
| name);
|
| } else {
|
| resolver.reportError(
|
| CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
|
| node,
|
| - superclass.getName());
|
| + superType.getDisplayName());
|
| }
|
| return null;
|
| } else {
|
| @@ -1738,20 +1736,6 @@ public class ElementResolver extends SimpleASTVisitor<Void> {
|
| }
|
|
|
| /**
|
| - * Return the element representing the superclass of the given class.
|
| - *
|
| - * @param targetClass the class whose superclass is to be returned
|
| - * @return the element representing the superclass of the given class
|
| - */
|
| - private ClassElement getSuperclass(ClassElement targetClass) {
|
| - InterfaceType superType = targetClass.getSupertype();
|
| - if (superType == null) {
|
| - return null;
|
| - }
|
| - return superType.getElement();
|
| - }
|
| -
|
| - /**
|
| * Return {@code true} if the given type represents an object that could be invoked using the call
|
| * operator '()'.
|
| *
|
|
|