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. |