| Index: pkg/compiler/lib/src/resolution/send_resolver.dart
|
| diff --git a/pkg/compiler/lib/src/resolution/send_resolver.dart b/pkg/compiler/lib/src/resolution/send_resolver.dart
|
| index fc02a31b7fa24944e4e7c595afba73776a5c3087..0ddce75d817a96285e0a1ef6669f34e12234c57b 100644
|
| --- a/pkg/compiler/lib/src/resolution/send_resolver.dart
|
| +++ b/pkg/compiler/lib/src/resolution/send_resolver.dart
|
| @@ -400,5 +400,68 @@ abstract class SendResolverMixin {
|
| }
|
| }
|
| }
|
| +
|
| + ConstructorAccessSemantics computeConstructorAccessSemantics(
|
| + ConstructorElement constructor,
|
| + DartType type) {
|
| + if (constructor.isErroneous) {
|
| + return new ConstructorAccessSemantics(
|
| + ConstructorAccessKind.ERRONEOUS, constructor, type);
|
| + } else if (constructor.isRedirectingFactory) {
|
| + ConstructorElement effectiveTarget = constructor.effectiveTarget;
|
| + if (effectiveTarget == constructor ||
|
| + effectiveTarget.isErroneous) {
|
| + return new ConstructorAccessSemantics(
|
| + ConstructorAccessKind.ERRONEOUS_REDIRECTING_FACTORY,
|
| + constructor,
|
| + type);
|
| + }
|
| + ConstructorAccessSemantics effectiveTargetSemantics =
|
| + computeConstructorAccessSemantics(
|
| + effectiveTarget,
|
| + constructor.computeEffectiveTargetType(type));
|
| + if (effectiveTargetSemantics.isErroneous) {
|
| + return new RedirectingFactoryConstructorAccessSemantics(
|
| + ConstructorAccessKind.ERRONEOUS_REDIRECTING_FACTORY,
|
| + constructor,
|
| + type,
|
| + effectiveTargetSemantics);
|
| + }
|
| + return new RedirectingFactoryConstructorAccessSemantics(
|
| + ConstructorAccessKind.REDIRECTING_FACTORY,
|
| + constructor,
|
| + type,
|
| + effectiveTargetSemantics);
|
| + } else if (constructor.isFactoryConstructor) {
|
| + return new ConstructorAccessSemantics(
|
| + ConstructorAccessKind.FACTORY, constructor, type);
|
| + } else if (constructor.isRedirectingGenerative) {
|
| + if (constructor.enclosingClass.isAbstract) {
|
| + return new ConstructorAccessSemantics(
|
| + ConstructorAccessKind.ABSTRACT, constructor, type);
|
| + }
|
| + return new ConstructorAccessSemantics(
|
| + ConstructorAccessKind.REDIRECTING_GENERATIVE, constructor, type);
|
| + } else if (constructor.enclosingClass.isAbstract) {
|
| + return new ConstructorAccessSemantics(
|
| + ConstructorAccessKind.ABSTRACT, constructor, type);
|
| + } else {
|
| + return new ConstructorAccessSemantics(
|
| + ConstructorAccessKind.GENERATIVE, constructor, type);
|
| + }
|
| + }
|
| +
|
| + NewStructure computeNewStructure(NewExpression node) {
|
| + if (node.isConst) {
|
| + return new ConstInvokeStructure(elements.getConstant(node));
|
| + }
|
| + Element element = elements[node.send];
|
| + Selector selector = elements.getSelector(node.send);
|
| + DartType type = elements.getType(node);
|
| +
|
| + ConstructorAccessSemantics constructorAccessSemantics =
|
| + computeConstructorAccessSemantics(element, type);
|
| + return new NewInvokeStructure(constructorAccessSemantics, selector);
|
| + }
|
| }
|
|
|
|
|