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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1066043002: Make sure declared upper bounds are resolved when finalizing a type containing a (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | « no previous file | tests/language/regress_23089_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 44955)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -510,6 +510,10 @@
void ClassFinalizer::FinalizeTypeParameters(
const Class& cls,
GrowableObjectArray* pending_types) {
+ if (FLAG_trace_type_finalization) {
+ OS::Print("Finalizing type parameters of '%s'\n",
+ String::Handle(cls.Name()).ToCString());
+ }
if (cls.IsMixinApplication()) {
// Setup the type parameters of the mixin application and finalize the
// mixin type.
@@ -817,6 +821,15 @@
if (error.IsNull() &&
!(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.
+ if (type_arg.IsTypeParameter()) {
+ const Class& type_arg_cls = Class::Handle(
+ TypeParameter::Cast(type_arg).parameterized_class());
+ const AbstractType& bound = AbstractType::Handle(
+ TypeParameter::Cast(type_arg).bound());
+ ResolveType(type_arg_cls, bound);
+ }
if (!type_param.CheckBound(type_arg, instantiated_bound, &error) &&
error.IsNull()) {
// The bound cannot be checked at compile time; postpone to run time.
« no previous file with comments | « no previous file | tests/language/regress_23089_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698