[JVM] Never treat arguments to methods as locals that can be removed.

Fixes KT-44347
This commit is contained in:
Mads Ager
2021-01-14 13:38:19 +01:00
committed by Dmitry Petrov
parent ada51509c4
commit 250cc1dc92
10 changed files with 79 additions and 0 deletions
@@ -0,0 +1,22 @@
// WITH_RUNTIME
import kotlin.coroutines.*
fun launch(block: suspend (Long) -> String): String {
var result = ""
block.startCoroutine(0L, Continuation(EmptyCoroutineContext) { result = it.getOrThrow() })
return result
}
suspend fun g() {}
class C {
suspend fun f(i: Long): String {
var x = 0
listOf<Int>().map { x }
g()
return "OK"
}
}
fun box(): String = launch(C()::f)