[Native] Move isRestrictedSuspendFunction from IrUtils2

This function is also helpful for JVM backend.
This commit is contained in:
Ivan Kylchik
2023-08-16 11:17:03 +02:00
committed by Space Team
parent 2657adc6dc
commit 5cd96831dc
4 changed files with 11 additions and 9 deletions
@@ -144,6 +144,9 @@ fun KotlinType.isRestrictsSuspensionReceiver() = (listOf(this) + this.supertypes
) == true
}
fun FunctionDescriptor.isRestrictedSuspendFunction(): Boolean =
extensionReceiverParameter?.type?.isRestrictsSuspensionReceiver() == true
private fun checkRestrictsSuspension(
enclosingSuspendCallableDescriptor: CallableDescriptor,
resolvedCall: ResolvedCall<*>,