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

Unified Diff: runtime/vm/object.cc

Issue 13132002: Version 0.4.3.5 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 9 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/f_bounded_quantification2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 20601)
+++ runtime/vm/object.cc (working copy)
@@ -9179,7 +9179,13 @@
num_type_params = 0;
}
} else {
- first_type_param_index = num_args - num_type_params;
+ // The actual type argument vector can be longer than necessary, because
+ // of type optimizations.
+ if (IsFinalized() && cls.is_finalized()) {
+ first_type_param_index = cls.NumTypeArguments() - num_type_params;
+ } else {
+ first_type_param_index = num_args - num_type_params;
+ }
}
if (cls.IsSignatureClass()) {
// We may be reporting an error about a malformed function type. In that
@@ -9192,8 +9198,10 @@
if (cls.IsCanonicalSignatureClass()) {
const Function& signature_function = Function::Handle(
cls.signature_function());
- // Signature classes have no super type.
- ASSERT(first_type_param_index == 0);
+ // Signature classes have no super type, however, they take as many
+ // type arguments as the owner class of their signature function (if it
+ // is non static and generic, see Class::NumTypeArguments()). Therefore,
+ // first_type_param_index may be greater than 0 here.
return signature_function.InstantiatedSignatureFrom(args,
name_visibility);
}
@@ -9548,8 +9556,9 @@
AbstractTypeArguments::Handle(arguments());
type_arguments = type_arguments.InstantiateFrom(instantiator_type_arguments,
malformed_error);
+ // Note that the type class has to be resolved at this time, but not
+ // necessarily finalized yet. We may be checking bounds at compile time.
const Class& cls = Class::Handle(type_class());
- ASSERT(cls.is_finalized());
// This uninstantiated type is not modified, as it can be instantiated
// with different instantiators.
Type& instantiated_type = Type::Handle(
@@ -9734,7 +9743,6 @@
bool TypeParameter::Equals(const Instance& other) const {
- ASSERT(IsFinalized());
if (raw() == other.raw()) {
return true;
}
@@ -9746,6 +9754,9 @@
if (parameterized_class() != other_type_param.parameterized_class()) {
return false;
}
+ if (IsFinalized() != other_type_param.IsFinalized()) {
+ return false;
+ }
if (index() != other_type_param.index()) {
return false;
}
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | tests/language/f_bounded_quantification2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698