Is it possible to prevent the compiler from inlining methods defined in a specific package or module (even if they’re marked
inline
)?
The compiler option
-Xno-inline
prevents inlining also of stdlib functions which causes plenty of errors:
Copy code
java.lang.IllegalAccessError: tried to access method kotlin.collections.MapsKt__MapsKt.mutableMapOf()Ljava/util/Map; from class tests.TestData$Companion
at tests.TestData$Companion.ofEncodable(TestData.kt:74)
at tests.NumberDataKt.<clinit>(numberData.kt:61)
…
i
ilya.gorbunov
10/21/2017, 9:06 PM
No there is no such option, however you can call an inline method from Java and it won't be inlined.
ilya.gorbunov
10/21/2017, 9:07 PM
Also I'm not sure how this question relates to Gradle Kotlin DSL which is being discussed in this channel.
m
Marc Knaup
10/21/2017, 9:13 PM
argh, wrong channel, sorry 😮
Marc Knaup
10/21/2017, 9:14 PM
Thanks for the info.
Would have to write my tests in Java in order to get full coverage then 😕