| Index: runtime/vm/object.cc
|
| diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
|
| index cd65cdca8158940c0080f129c163cdc6c9cc16f1..465b8fca72c9c08ba87f9fa5b392a0a1bd98037a 100644
|
| --- a/runtime/vm/object.cc
|
| +++ b/runtime/vm/object.cc
|
| @@ -5615,6 +5615,11 @@ void Function::set_parent_function(const Function& value) const {
|
|
|
|
|
| bool Function::HasGenericParent() const {
|
| + if (IsImplicitClosureFunction()) {
|
| + // The parent function of an implicit closure function is not the enclosing
|
| + // function we are asking about here.
|
| + return false;
|
| + }
|
| Function& parent = Function::Handle(parent_function());
|
| while (!parent.IsNull()) {
|
| if (parent.IsGeneric()) {
|
| @@ -6013,6 +6018,9 @@ intptr_t Function::NumTypeParameters(Thread* thread) const {
|
|
|
|
|
| intptr_t Function::NumParentTypeParameters() const {
|
| + if (IsImplicitClosureFunction()) {
|
| + return 0;
|
| + }
|
| Thread* thread = Thread::Current();
|
| Function& parent = Function::Handle(parent_function());
|
| intptr_t num_parent_type_params = 0;
|
| @@ -6051,6 +6059,11 @@ RawTypeParameter* Function::LookupTypeParameter(
|
| }
|
| }
|
| }
|
| + if (function.IsImplicitClosureFunction()) {
|
| + // The parent function is not the enclosing function, but the closurized
|
| + // function with identical type parameters.
|
| + break;
|
| + }
|
| function ^= function.parent_function();
|
| if (function_level != NULL) {
|
| (*function_level)--;
|
|
|