Fix for KT-12106: import static of reified companion object method throws IllegalAccessError
#KT-12106 Fixed
This commit is contained in:
committed by
Mikhael Bogdanov
parent
5df52e08cc
commit
abc7d5101d
@@ -0,0 +1,19 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
object Host {
|
||||
// private final foo()V
|
||||
inline fun <reified T> foo(): String {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.Host.foo
|
||||
|
||||
fun box(): String {
|
||||
return foo<Any>()
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// WITH_RUNTIME
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
object Host {
|
||||
|
||||
inline val <reified T : Any> T.foo: String
|
||||
get() = T::class.java.simpleName
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
import test.Host.foo
|
||||
|
||||
class OK
|
||||
|
||||
fun box(): String {
|
||||
return OK().foo
|
||||
}
|
||||
Reference in New Issue
Block a user