Index: pkg/compiler/lib/src/resolution/members.dart |
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart |
index 5a80a1089dbce729924aae5d33567fac29808a3a..656c12c5c8a9822236da79a2d7b7968456d0b69d 100644 |
--- a/pkg/compiler/lib/src/resolution/members.dart |
+++ b/pkg/compiler/lib/src/resolution/members.dart |
@@ -50,7 +50,8 @@ import 'operators.dart'; |
import 'send_structure.dart'; |
import 'constructors.dart' show |
- ConstructorResolver; |
+ ConstructorResolver, |
+ ConstructorResult; |
import 'label_scope.dart' show |
StatementScope; |
import 'registry.dart' show |
@@ -3637,7 +3638,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
bool isConstConstructor = constructor.isConst; |
bool isValidAsConstant = isConstConstructor; |
ConstructorElement redirectionTarget = resolveRedirectingFactory( |
- node, inConstContext: isConstConstructor); |
+ node, inConstContext: isConstConstructor).element; |
constructor.immediateRedirectionTarget = redirectionTarget; |
Node constructorReference = node.constructorReference; |
@@ -3815,7 +3816,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
ResolutionResult visitNewExpression(NewExpression node) { |
bool isValidAsConstant = true; |
- FunctionElement constructor = resolveConstructor(node); |
+ ConstructorElement constructor = resolveConstructor(node).element; |
final bool isSymbolConstructor = constructor == compiler.symbolConstructor; |
final bool isMirrorsUsedConstant = |
node.isConst && (constructor == compiler.mirrorsUsedConstructor); |
@@ -3857,8 +3858,6 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
// factory constructors. |
registry.registerInstantiatedType(type); |
if (constructor.isGenerativeConstructor && cls.isAbstract) { |
- warning(node, MessageKind.ABSTRACT_CLASS_INSTANTIATION); |
- registry.registerAbstractClassInstantiation(); |
isValidAsConstant = false; |
} |
@@ -3994,14 +3993,15 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> { |
* Note: this function may return an ErroneousFunctionElement instead of |
* [:null:], if there is no corresponding constructor, class or library. |
*/ |
- ConstructorElement resolveConstructor(NewExpression node) { |
- return node.accept(new ConstructorResolver(compiler, this)); |
+ ConstructorResult resolveConstructor(NewExpression node) { |
+ return node.accept(new ConstructorResolver( |
+ compiler, this, inConstContext: node.isConst)); |
} |
- ConstructorElement resolveRedirectingFactory(RedirectingFactoryBody node, |
+ ConstructorResult resolveRedirectingFactory(RedirectingFactoryBody node, |
{bool inConstContext: false}) { |
- return node.accept(new ConstructorResolver(compiler, this, |
- inConstContext: inConstContext)); |
+ return node.accept(new ConstructorResolver( |
+ compiler, this, inConstContext: inConstContext)); |
} |
DartType resolveTypeAnnotation(TypeAnnotation node, |