To figure out the relevant types for HOFs like For and RunState we used to query the binders on their lambda parameters. That sometimes involved some awkward partiality due to assumed-successful hoisting. But more importantly it will become harder to do once we have type blocks. Querying the type of a lambda binder will give us some decls that we have to emit or go under. And hoisting a type that we expect to not dependent on a binder might fail because of spurious decls rather than true dependence. With this change, the HOFs just take extra type parameters for their relevant types, just as they would if they were regular library-level Dex functions, and there's never a need to query the lambda binders.
To figure out the relevant types for HOFs like
For
andRunState
we used to query the binders on their lambda parameters. That sometimes involved some awkward partiality due to assumed-successful hoisting. But more importantly it will become harder to do once we have type blocks. Querying the type of a lambda binder will give us some decls that we have to emit or go under. And hoisting a type that we expect to not dependent on a binder might fail because of spurious decls rather than true dependence. With this change, the HOFs just take extra type parameters for their relevant types, just as they would if they were regular library-level Dex functions, and there's never a need to query the lambda binders.