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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/typechecker.dart

Issue 136753002: Version 1.1.0-dev.5.9 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 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: dart/sdk/lib/_internal/compiler/implementation/typechecker.dart
===================================================================
--- dart/sdk/lib/_internal/compiler/implementation/typechecker.dart (revision 31731)
+++ dart/sdk/lib/_internal/compiler/implementation/typechecker.dart (working copy)
@@ -1334,10 +1334,19 @@
if (Elements.isUnresolved(constructor)) return types.dynamicType;
DartType constructorType = constructor.computeType(compiler);
if (identical(type.kind, TypeKind.INTERFACE)) {
- InterfaceType interfaceType = type;
- constructorType = constructorType.subst(
- interfaceType.typeArguments,
- interfaceType.element.typeVariables);
+ if (constructor.isSynthesized) {
+ // TODO(johnniwinther): Remove this when synthesized constructors handle
+ // type variables correctly.
+ InterfaceType interfaceType = type;
+ ClassElement receiverElement = interfaceType.element;
+ while (receiverElement.isMixinApplication) {
+ receiverElement = receiverElement.supertype.element;
+ }
+ constructorType = constructorType.substByContext(
+ interfaceType.asInstanceOf(receiverElement));
+ } else {
+ constructorType = constructorType.substByContext(type);
+ }
}
return constructorType;
}

Powered by Google App Engine
This is Rietveld 408576698