Ayfri
01/02/2022, 5:11 AMprivate inline fun execute(block: () -> Unit) = block()
fun main() {
execute { println("test") }
}
But when I see the Bytecode, it creates an execute
static method on the MainKt class but never use it, is there a way to say to the compiler to not generate this method and just inline ?ephemient
01/02/2022, 5:15 AMAyfri
01/02/2022, 5:16 AMephemient
01/02/2022, 5:17 AMAyfri
01/02/2022, 5:19 AMephemient
01/02/2022, 5:19 AMAyfri
01/02/2022, 5:57 AMError: Missing class android.annotation.SuppressLint (referenced from: kotlinx.coroutines.debug.AgentPremain)
ephemient
01/02/2022, 6:52 AMkotlinx-coroutines-debug
from your production dependencies, otherwise you'll have to fill in some implementation for that annotation class to satisfy r8Ayfri
01/02/2022, 7:00 AMimplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
ephemient
01/02/2022, 7:08 AMkotlinx-coroutines-test
or -debug
from somewherehfhbd
01/02/2022, 10:48 AMcrossinline
do not work?
private inline fun execute(crossinline block: () -> Unit) = block()
fun main() {
execute { println("test") }
}
ephemient
01/02/2022, 12:31 PMhfhbd
01/02/2022, 1:08 PMYoussef Shoaib [MOD]
01/02/2022, 4:16 PMJames Hamilton
01/03/2022, 9:29 AM