Fix DeepRecursiveFunction in worker on Native

Add `@SharedImmutable` to `UNDEFINED_RESULT` top-level property.
This commit is contained in:
Svyatoslav Scherbina
2020-12-09 18:13:47 +03:00
parent b3d8c4a0fc
commit c094d77794
@@ -7,6 +7,7 @@ package kotlin
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
import kotlin.native.concurrent.SharedImmutable
/**
* Defines deep recursive function that keeps its stack on the heap,
@@ -124,6 +125,7 @@ public sealed class DeepRecursiveScope<T, R> {
@ExperimentalStdlibApi
private typealias DeepRecursiveFunctionBlock = suspend DeepRecursiveScope<*, *>.(Any?) -> Any?
@SharedImmutable
private val UNDEFINED_RESULT = Result.success(COROUTINE_SUSPENDED)
@Suppress("UNCHECKED_CAST")