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

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

Issue 19811002: Do not emit substitutions for unnamed mixin applications. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/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 4c72122f90c2c362031030285533b6a9ac0e5144..29e1ecba526e5e4e8c4f79a4438fdf5e2cb4ab2f 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
@@ -463,15 +463,13 @@ class RuntimeTypes {
{ bool alwaysGenerateFunction: false }) {
if (isTrivialSubstitution(cls, check)) return null;
+ // Unnamed mixin application classes do not need substitutions, because they
+ // are never instantiated and their checks are overwritten by the class that
+ // they are mixed into.
+ if (cls.isUnnamedMixinApplication) return null;
InterfaceType type = cls.computeType(compiler);
InterfaceType target = type.asInstanceOf(check);
- Link<DartType> typeVariables;
- if (cls.isMixinApplication) {
- MixinApplicationElement mixinApplication = cls;
- typeVariables = mixinApplication.mixin.typeVariables;
- } else {
- typeVariables = cls.typeVariables;
- }
+ Link<DartType> typeVariables = cls.typeVariables;
if (typeVariables.isEmpty && !alwaysGenerateFunction) {
return new Substitution.list(target.typeArguments);
} else {
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart ('k') | tests/language/mixin_type_parameter4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698