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

Unified Diff: runtime/vm/object.cc

Issue 1886633002: Properly handle unfinalized type parameters of generic mixins (fixes #26230). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | « runtime/vm/class_finalizer.cc ('k') | tests/language/regress_26230_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 2ce486b3f00f509a8eec81bd2414fcf498e7bfe0..7e1ebb59c873d6f7854e60e0ec9a8f63ec636f63 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -17236,7 +17236,9 @@ bool BoundedType::IsRecursive() const {
void BoundedType::set_type(const AbstractType& value) const {
- ASSERT(value.IsFinalized() || value.IsBeingFinalized());
+ ASSERT(value.IsFinalized() ||
+ value.IsBeingFinalized() ||
+ value.IsTypeParameter());
ASSERT(!value.IsMalformed());
StorePointer(&raw_ptr()->type_, value.raw());
}
@@ -17305,8 +17307,8 @@ RawAbstractType* BoundedType::InstantiateFrom(
return bounded_type.raw();
}
const TypeParameter& type_param = TypeParameter::Handle(type_parameter());
- if (instantiated_bounded_type.IsBeingFinalized() ||
- instantiated_upper_bound.IsBeingFinalized() ||
+ if (!instantiated_bounded_type.IsFinalized() ||
+ !instantiated_upper_bound.IsFinalized() ||
(!type_param.CheckBound(instantiated_bounded_type,
instantiated_upper_bound,
bound_error,
@@ -17315,7 +17317,8 @@ RawAbstractType* BoundedType::InstantiateFrom(
bound_error->IsNull())) {
// We cannot determine yet whether the bounded_type is below the
// upper_bound, because one or both of them is still being finalized or
- // uninstantiated.
+ // uninstantiated. For example, instantiated_bounded_type may be the
+ // still unfinalized cloned type parameter of a mixin application class.
ASSERT(instantiated_bounded_type.IsBeingFinalized() ||
instantiated_upper_bound.IsBeingFinalized() ||
!instantiated_bounded_type.IsInstantiated() ||
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | tests/language/regress_26230_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698