Index: runtime/vm/class_finalizer.cc |
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc |
index 1db03051a164a076847afb7bb13c2a246216395d..1a7f6cf2fb3f07d134bbc0b5c43c512577f239d3 100644 |
--- a/runtime/vm/class_finalizer.cc |
+++ b/runtime/vm/class_finalizer.cc |
@@ -993,13 +993,16 @@ void ClassFinalizer::CheckTypeArgumentBounds(const Class& cls, |
!(type_arg.Equals(type_param) && |
instantiated_bound.Equals(declared_bound))) { |
// If type_arg is a type parameter, its declared bound may not be |
- // resolved yet. |
+ // finalized yet. |
if (type_arg.IsTypeParameter()) { |
const Class& type_arg_cls = Class::Handle( |
TypeParameter::Cast(type_arg).parameterized_class()); |
AbstractType& bound = AbstractType::Handle( |
TypeParameter::Cast(type_arg).bound()); |
- ResolveType(type_arg_cls, bound); |
+ if (!bound.IsFinalized() && !bound.IsBeingFinalized()) { |
+ bound = FinalizeType(type_arg_cls, bound, kCanonicalize); |
+ TypeParameter::Cast(type_arg).set_bound(bound); |
+ } |
} |
// This may be called only if type needs to be finalized, therefore |
// seems OK to allocate finalized types in old space. |