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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart

Issue 18844002: Use type variables of mixin when computing the substitution. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: update status file. Created 7 years, 5 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 | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
index 0ae4696c703bac3a2df63802ae9081e3c5458e0a..73e31a177081ae4a574b6334b2f2f0442b08ceb4 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
@@ -469,10 +469,17 @@ class RuntimeTypes {
};
InterfaceType type = cls.computeType(compiler);
InterfaceType target = type.asInstanceOf(check);
- if (cls.typeVariables.isEmpty && !alwaysGenerateFunction) {
+ Link<DartType> typeVariables;
+ if (cls.isMixinApplication) {
+ MixinApplicationElement mixinApplication = cls;
+ typeVariables = mixinApplication.mixin.typeVariables;
+ } else {
+ typeVariables = cls.typeVariables;
+ }
+ if (typeVariables.isEmpty && !alwaysGenerateFunction) {
return new Substitution.list(target.typeArguments);
} else {
- return new Substitution.function(target.typeArguments, cls.typeVariables);
+ return new Substitution.function(target.typeArguments, typeVariables);
}
}
@@ -798,11 +805,11 @@ class FunctionArgumentCollector extends DartTypeVisitor {
class Substitution {
final bool isFunction;
final Link<DartType> arguments;
- final Link<TypeVariableType> parameters;
+ final Link<DartType> parameters;
Substitution.list(this.arguments)
: isFunction = false,
- parameters = const Link<TypeVariableType>();
+ parameters = const Link<DartType>();
Substitution.function(this.arguments, this.parameters)
: isFunction = true;
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698