Fix compatibility of suspend functions with strict bytecode analyzers
In short, some of the bytecode analyzers assume that there could be no stores instructions into parameter vars with value of different types (even when the value type is a subtype) See the issue for details #KT-19713 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
import helpers.*
|
||||
// TREAT_AS_ONE_FILE
|
||||
import kotlin.coroutines.experimental.*
|
||||
import kotlin.coroutines.experimental.intrinsics.*
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
x.resume("OK")
|
||||
}
|
||||
|
||||
suspend fun suspendThere(param: Int, param2: String, param3: Long): String {
|
||||
val a = suspendHere()
|
||||
val b = suspendHere()
|
||||
return a + b
|
||||
}
|
||||
|
||||
/* 2 stores happen because the continuation parameter is visible in debug and should be spilled */
|
||||
// 2 ASTORE 4
|
||||
Reference in New Issue
Block a user