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

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

Issue 111283006: Revert "Compute correct constructor type for synthesized mixin constructors." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 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/typechecker.dart
diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart
index ff499fc4548274054087a5d8e703feb0980490af..5dd026aa6ed882f957bd4466555d31f034784265 100644
--- a/sdk/lib/_internal/compiler/implementation/typechecker.dart
+++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart
@@ -1334,19 +1334,10 @@ class TypeCheckerVisitor extends Visitor<DartType> {
if (Elements.isUnresolved(constructor)) return types.dynamicType;
DartType constructorType = constructor.computeType(compiler);
if (identical(type.kind, TypeKind.INTERFACE)) {
- 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);
- }
+ InterfaceType interfaceType = type;
+ constructorType = constructorType.subst(
+ interfaceType.typeArguments,
+ interfaceType.element.typeVariables);
}
return constructorType;
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/compiler/dart2js/mixin_language_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698