Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1045)

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 13642002: Make sure required type arguments are given when using factories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index e6fd47862ac1280627bedfdbbf339ae86f10a11c..d8a42cff3c64461817d1ea8719e6a74762e2f89a 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -2538,9 +2538,11 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
// and only declaration elements may be registered.
world.registerStaticUse(constructor.declaration);
ClassElement cls = constructor.getEnclosingClass();
- // [cls] might be the implementation element and only declaration elements
- // may be registered.
- world.registerInstantiatedType(mapping.getType(node), mapping);
+ InterfaceType type = mapping.getType(node);
+ world.registerInstantiatedType(type, mapping);
+ if (constructor.isFactoryConstructor() && !type.typeArguments.isEmpty) {
+ world.registerFactoryWithTypeArguments(mapping);
+ }
if (cls.isAbstract(compiler)) {
compiler.backend.registerAbstractClassInstantiation(mapping);
}

Powered by Google App Engine
This is Rietveld 408576698