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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 2643523002: Implement generic function type syntax in the VM (fixes #27966). (Closed)
Patch Set: work in progress 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
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index c319f1f18c42b75239ae97e4b544a5692e6e2d02..c2d096917249f067afb505c8db985f5fc210266c 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -582,6 +582,16 @@ void ClassFinalizer::ResolveType(const Class& cls, const AbstractType& type) {
if (!scope_class.IsTypedefClass()) {
signature.set_owner(Object::Handle());
signature.set_token_pos(TokenPosition::kNoSource);
+ 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());
+ }
}
}
}
@@ -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') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698