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

Unified Diff: runtime/vm/parser.cc

Issue 8872037: Adjust index of type parameters at finalization time (fix issue 718). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 2282)
+++ runtime/vm/parser.cc (working copy)
@@ -880,8 +880,9 @@
Type& signature_type = Type::ZoneHandle(signature_class.SignatureType());
if (!is_top_level_ && !signature_type.IsFinalized()) {
String& errmsg = String::Handle();
- signature_type =
- ClassFinalizer::FinalizeAndCanonicalizeType(signature_type,
+ signature_type ^=
+ ClassFinalizer::FinalizeAndCanonicalizeType(signature_class,
+ signature_type,
&errmsg);
if (!errmsg.IsNull()) {
ErrorMsg(errmsg.ToCString());
@@ -3754,8 +3755,10 @@
// been finalized already.
if (!signature_type.IsFinalized()) {
String& errmsg = String::Handle();
- signature_type =
- ClassFinalizer::FinalizeAndCanonicalizeType(signature_type, &errmsg);
+ signature_type ^=
+ ClassFinalizer::FinalizeAndCanonicalizeType(signature_class,
+ signature_type,
+ &errmsg);
if (!errmsg.IsNull()) {
ErrorMsg(errmsg.ToCString());
}
@@ -6555,6 +6558,7 @@
ErrorMsg(type_pos, "using '%s' in this context is invalid",
type_name.ident->ToCString());
}
+ Class& scope_class = Class::Handle();
Object& type_class = Object::Handle();
if (type_resolution == kDoNotResolve) {
String& qualifier = String::Handle();
@@ -6563,7 +6567,7 @@
}
type_class = UnresolvedClass::New(type_pos, qualifier, *(type_name.ident));
} else {
- const Class& scope_class = Class::Handle(TypeParametersScopeClass());
+ scope_class = TypeParametersScopeClass();
if (!scope_class.IsNull()) {
TypeParameter& type_parameter = TypeParameter::Handle();
// Check if qualifier is a type parameter in scope.
@@ -6582,6 +6586,16 @@
ErrorMsg(type_pos, "type parameter '%s' cannot be parameterized",
String::Handle(type_parameter.Name()).ToCString());
}
+ if (type_resolution == kMustResolve) {
+ String& errmsg = String::Handle();
+ type_parameter ^=
+ ClassFinalizer::FinalizeAndCanonicalizeType(scope_class,
+ type_parameter,
+ &errmsg);
+ if (!errmsg.IsNull()) {
+ ErrorMsg(errmsg.ToCString());
+ }
+ }
return type_parameter.raw();
}
}
@@ -6596,7 +6610,9 @@
if (type_resolution == kMustResolve) {
ASSERT(type_class.IsClass()); // Must be resolved.
String& errmsg = String::Handle();
- type = ClassFinalizer::FinalizeAndCanonicalizeType(type, &errmsg);
+ type ^= ClassFinalizer::FinalizeAndCanonicalizeType(scope_class,
+ type,
+ &errmsg);
if (!errmsg.IsNull()) {
ErrorMsg(errmsg.ToCString());
}
@@ -7147,7 +7163,9 @@
Type& type = Type::Handle(
Type::NewParameterizedType(signature_class, type_arguments));
String& errmsg = String::Handle();
- type = ClassFinalizer::FinalizeAndCanonicalizeType(type, &errmsg);
+ type ^= ClassFinalizer::FinalizeAndCanonicalizeType(signature_class,
+ type,
+ &errmsg);
if (!errmsg.IsNull()) {
ErrorMsg(errmsg.ToCString());
}
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698