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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart

Issue 77993002: Add substitutions even when type arguments are fixed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years 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_emitter/type_test_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
index 076240a311c115de4069d07fde1e22ac6293a403..bf66d9bd43f144ae4d01861d570ac0d82ab11ed2 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/type_test_emitter.dart
@@ -123,7 +123,7 @@ class TypeTestEmitter extends CodeEmitterHelper {
bool haveSameTypeVariables(ClassElement a, ClassElement b) {
if (a.isClosure()) return true;
- return a.typeVariables == b.typeVariables;
+ return backend.rti.isTrivialSubstitution(a, b);
}
if (superclass != null && superclass != compiler.objectClass &&
@@ -135,9 +135,12 @@ class TypeTestEmitter extends CodeEmitterHelper {
Set<ClassElement> emitted = new Set<ClassElement>();
// TODO(karlklose): move the computation of these checks to
// RuntimeTypeInformation.
- if (backend.classNeedsRti(cls)) {
- emitSubstitution(superclass, emitNull: true);
- emitted.add(superclass);
+ while (superclass != null) {
+ if (backend.classNeedsRti(superclass)) {
+ emitSubstitution(superclass, emitNull: true);
+ emitted.add(superclass);
+ }
+ superclass = superclass.superclass;
}
for (DartType supertype in cls.allSupertypes) {
ClassElement superclass = supertype.element;
« no previous file with comments | « no previous file | tests/language/fixed_type_variable2_test.dart » ('j') | tests/language/fixed_type_variable_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698