public inline fun String.toInt():int在kotlin.text中定义
今天在我的kotlin项目中,我得到了下面的编译器错误:
Error:(101, 59) Kotlin: Overload resolution ambiguity: @InlineOnly public inline fun String.toInt(): Int defined in kotlin.text @InlineOnly public inline fun String.toInt(): Int defined in kotlin.text
我的代码(简体):
"3".toInt()
我知道这与不兼容的bundeled kotlin运行时间有关:
Warning:Kotlin: Library has Kotlin runtime bundled into it
但是,我不能通过排除bundeled运行时来解决它:
compile ('my.bad.dependency:with-kotlin:1.0') { exclude group: 'org.jetbrains.kotlin' }
我现在的.toInt()
是不使用.toInt()
函数。 有没有办法告诉编译器使用最新的运行时库?