Loosen tail call check

Check that any source of ARETURN is inside a suspension point, not all
of them.
 #KT-27190 Fixed
This commit is contained in:
Ilmir Usmanov
2019-02-13 16:27:30 +03:00
parent cc62c971e7
commit 440cccae73
5 changed files with 40 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
import COROUTINES_PACKAGE.intrinsics.*
fun check() = true
suspend fun f(i: Int): Unit {
return f_2()
}
private inline suspend fun f_2(): Unit {
if (check()) return
return suspendCoroutineUninterceptedOrReturn {
COROUTINE_SUSPENDED
}
}

View File

@@ -0,0 +1,6 @@
@kotlin.Metadata
public final class TailCallIfReturnUnitKt {
public final static method check(): boolean
public final static @org.jetbrains.annotations.Nullable method f(p0: int, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.experimental.Continuation): java.lang.Object
private synthetic final static method f_2(p0: kotlin.coroutines.experimental.Continuation): java.lang.Object
}

View File

@@ -0,0 +1,6 @@
@kotlin.Metadata
public final class TailCallIfReturnUnitKt {
public final static method check(): boolean
public final static @org.jetbrains.annotations.Nullable method f(p0: int, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object
private synthetic final static method f_2(p0: kotlin.coroutines.Continuation): java.lang.Object
}