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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 2643523002: Implement generic function type syntax in the VM (fixes #27966). (Closed)
Patch Set: refactor parsing of formal parameter per review request Created 3 years, 11 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.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index c319f1f18c42b75239ae97e4b544a5692e6e2d02..a43da72d43f8358fd50547c77ac50cb90ddf63b4 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -565,6 +565,16 @@ void ClassFinalizer::ResolveType(const Class& cls, const AbstractType& type) {
ResolveSignature(scope_class, signature);
} else {
ResolveSignature(cls, signature);
+ if ((type.arguments() != TypeArguments::null()) &&
+ signature.HasInstantiatedSignature()) {
+ ASSERT(scope_class.IsGeneric());
+ // Although the scope class of this function type is generic,
+ // the signature of this function type does not refer to any
+ // of its type parameters. Reset its scope class to _Closure.
+ Type::Cast(type).set_type_class(Class::Handle(
+ Isolate::Current()->object_store()->closure_class()));
+ type.set_arguments(Object::null_type_arguments());
+ }
}
if (signature.IsSignatureFunction()) {
// Drop fields that are not necessary anymore after resolution.
@@ -706,7 +716,7 @@ intptr_t ClassFinalizer::ExpandAndFinalizeTypeArguments(
// If we are not reifying types, drop type arguments.
if (!FLAG_reify) {
- type.set_arguments(TypeArguments::Handle(zone, TypeArguments::null()));
+ type.set_arguments(Object::null_type_arguments());
}
// Initialize the type argument vector.
« no previous file with comments | « runtime/vm/class_finalizer.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698