Do not spill nested coroutine method calls
Summary:
Nested suspend method calls like
```
coroutine function nested(MyTestClass $class) {
suspend $class->method(suspend $class->method(0));
}
```
were being incorrectly spilled:
```
function nested(
\InternalCoroutineContinuation<mixed> $coroutineContinuation_generated,
int $number,
): \CoroutineResult<mixed> {
...
state_label_0:
$__closure->coroutineResultData2 = $class->method;
$__closure->nextLabel = 1;
$__coroutineResult = $class->another_method($__closure, 0);
if ($__coroutineResult->isSuspended()) {
return \SuspendedCoroutineResult::create();
}
$__coroutineData = $__coroutineResult->getResult();
state_label_1:
$__closure->coroutineResultData1 = $__coroutineData;
if ($__exception_generated !== null) {
throw $__exception_generated;
}
$__closure->nextLabel = 2;
$__coroutineResult = $__closure->coroutineResultData2(
$__closure,
$__closure->coroutineResultData1,
);
...
}
```
in particular, this line failed lowered typechecking
```
$__closure->coroutineResultData2 = $class->method;
```
This diff changes `might_be_spilled` in `coroutine_suspend_rewriter.ml` such that nested calls such as these do not get inappropriately spilled.
Reviewed By: michaeltingley
Differential Revision:
D7114276
fbshipit-source-id:
6f96b66520b64895d6cb184e095cbc733277d54b