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

Unified Diff: runtime/vm/object.cc

Issue 1270093004: Relax debug check to allow for type arguments of a canonical signature type to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | 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 1c8405ce407521ffe780844dfbceb29a6fa80713..83e45e9cb2ef0728c0bf1d08c1b85559c9724d77 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -15655,7 +15655,9 @@ RawAbstractType* Type::Canonicalize(GrowableObjectArray* trail) const {
if ((index == 0) && cls.IsCanonicalSignatureClass()) {
// Verify that the first canonical type is the signature type by checking
// that the type argument vector of the canonical type ends with the
- // uninstantiated type parameters of the signature class.
+ // uninstantiated type parameters of the signature class. Note that these
+ // type parameters may be bounded if the super class of the owner class
+ // declares bounds.
// The signature type is finalized during class finalization, before the
// optimizer may canonicalize instantiated function types of the same
// signature class.
@@ -15666,10 +15668,13 @@ RawAbstractType* Type::Canonicalize(GrowableObjectArray* trail) const {
TypeArguments::Handle(isolate, cls.type_parameters());
const intptr_t num_type_params = cls.NumTypeParameters();
const intptr_t num_type_args = cls.NumTypeArguments();
- TypeParameter& type_arg = TypeParameter::Handle(isolate);
+ AbstractType& type_arg = AbstractType::Handle(isolate);
TypeParameter& type_param = TypeParameter::Handle(isolate);
for (intptr_t i = 0; i < num_type_params; i++) {
- type_arg ^= type_args.TypeAt(num_type_args - num_type_params + i);
+ type_arg = type_args.TypeAt(num_type_args - num_type_params + i);
+ while (type_arg.IsBoundedType()) {
+ type_arg = BoundedType::Cast(type_arg).type();
+ }
type_param ^= type_params.TypeAt(i);
ASSERT(type_arg.Equals(type_param));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698