Completely rewrite reifiedIntTypeAnalysis, making it more streamline

and easy to understand and optimize if it would be a bottleneck.
Use LVT to get information of refined int type in one specific case

 #KT-38925 Fixed
This commit is contained in:
Ilmir Usmanov
2020-05-25 22:35:50 +02:00
parent 0e908b720d
commit 1ed4324613
20 changed files with 478 additions and 226 deletions
@@ -0,0 +1,49 @@
// FILE: test.kt
// COMMON_COROUTINES_TEST
// WITH_RUNTIME
// WITH_COROUTINES
// WITH_REFLECT
import COROUTINES_PACKAGE.*
import helpers.*
import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(thisRef: Any?, property: KProperty<*>): String {
return "OK"
}
}
interface SuspendRunnable {
suspend fun run(): String
}
suspend inline fun test(crossinline c: suspend (String) -> String): String {
val sr = object : SuspendRunnable {
val ok by Delegate()
override suspend fun run(): String {
return c(ok)
}
}
return sr.run()
}
// FILE: box.kt
// COMMON_COROUTINES_TEST
import COROUTINES_PACKAGE.*
import helpers.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
suspend fun dummy() {}
fun box(): String {
var res: String = "FAIL"
builder {
res = test { it }
}
return res
}