| Index: pkg/compiler/lib/src/elements/modelx.dart
|
| diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
|
| index 0531a73146c188b08eaa188d423d28b1fa93db1f..631ed38c0388d5fec92b2d4af9a50a868a86a1db 100644
|
| --- a/pkg/compiler/lib/src/elements/modelx.dart
|
| +++ b/pkg/compiler/lib/src/elements/modelx.dart
|
| @@ -2400,24 +2400,22 @@ abstract class BaseClassElementX extends ElementX
|
| return false;
|
| }
|
|
|
| - Element validateConstructorLookupResults(Selector selector,
|
| - Element result,
|
| - Element noMatch(Element)) {
|
| - if (result == null
|
| - || !result.isConstructor
|
| - || (isPrivateName(selector.name)
|
| - && result.library != selector.library)) {
|
| - result = noMatch != null ? noMatch(result) : null;
|
| + ConstructorElement lookupDefaultConstructor() {
|
| + ConstructorElement constructor = lookupConstructor("");
|
| + // This method might be called on constructors that have not been
|
| + // resolved. As we query the live world, we return `null` in such cases
|
| + // as no default constructor exists in the live world.
|
| + if (constructor != null &&
|
| + constructor.hasFunctionSignature &&
|
| + constructor.functionSignature.requiredParameterCount == 0) {
|
| + return constructor;
|
| }
|
| - return result;
|
| + return null;
|
| }
|
|
|
| - // TODO(aprelev@gmail.com): Peter believes that it would be great to
|
| - // make noMatch a required argument. Peter's suspicion is that most
|
| - // callers of this method would benefit from using the noMatch method.
|
| - Element lookupConstructor(Selector selector, [Element noMatch(Element)]) {
|
| - Element result = localLookup(selector.name);
|
| - return validateConstructorLookupResults(selector, result, noMatch);
|
| + ConstructorElement lookupConstructor(String name) {
|
| + Element result = localLookup(name);
|
| + return result != null && result.isConstructor ? result : null;
|
| }
|
|
|
| Link<Element> get constructors {
|
|
|