da18c7c9a7
In order to create a Future for the result of async closure, closure needs to instantiate a type argument of its result type. The result type may reference type arguments of enclosing function or class and scope builder should visit closure's result type in order to capture receiver or type arguments variable of parent factory. TEST=runtime/tests/vm/dart/regress_49424_test.dart Fixes https://github.com/dart-lang/sdk/issues/49424 Change-Id: I1cd131251717fca43f8ca95856d13718eb9aca68 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251320 Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>