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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_types.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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/dart_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart
index 5f14cc2ccd40144b62d26137bc1495141d9f6ecc..a4603f0f6cbc10415db4b88911a20e4c907ac5f3 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -60,11 +60,6 @@ abstract class DartType {
*/
DartType subst(Link<DartType> arguments, Link<DartType> parameters);
- /// Performs the substitution of the type arguments of [type] for their
- /// corresponding type variables in this type.
- DartType substByContext(GenericType type) =>
- subst(type.typeArguments, type.element.typeVariables);
-
/**
* Returns the unaliased type of this type.
*
@@ -802,7 +797,8 @@ class TypedefType extends GenericType {
compiler.resolveTypedef(element);
element.checkCyclicReference(compiler);
DartType definition = element.alias.unalias(compiler);
- return definition.substByContext(this);
+ TypedefType declaration = element.computeType(compiler);
+ return definition.subst(typeArguments, declaration.typeArguments);
}
int get hashCode => super.hashCode;
@@ -893,8 +889,10 @@ class Member {
type = element.computeType(compiler);
}
if (!declarer.element.typeVariables.isEmpty) {
- type = type.substByContext(declarer);
- type = type.substByContext(receiver);
+ type = type.subst(declarer.typeArguments,
+ declarer.element.typeVariables);
+ type = type.subst(receiver.typeArguments,
+ receiver.element.typeVariables);
}
cachedType = type;
}
@@ -1307,7 +1305,8 @@ class Types {
Link<DartType> typeVariables = element.typeVariables;
while (!typeVariables.isEmpty && !typeArguments.isEmpty) {
TypeVariableType typeVariable = typeVariables.head;
- DartType bound = typeVariable.element.bound.substByContext(type);
+ DartType bound = typeVariable.element.bound.subst(
+ type.typeArguments, element.typeVariables);
DartType typeArgument = typeArguments.head;
checkTypeVariableBound(type, typeArgument, typeVariable, bound);
typeVariables = typeVariables.tail;
@@ -1502,10 +1501,13 @@ class Types {
/// Returns the set of supertypes of [type] at depth [depth].
Set<DartType> getSupertypesAtDepth(InterfaceType type, int depth) {
- OrderedTypeSet types = type.element.allSupertypesAndSelf;
+ ClassElement cls = type.element;
+ OrderedTypeSet types = cls.allSupertypesAndSelf;
+ Link<DartType> typeVariables = cls.typeVariables;
+ Link<DartType> typeArguments = type.typeArguments;
Set<DartType> set = new Set<DartType>();
- types.forEach(depth, (DartType supertype) {
- set.add(supertype.substByContext(type));
+ types.forEach(depth, (DartType type) {
+ set.add(type.subst(typeArguments, typeVariables));
});
return set;
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698