Treat accessors to JvmStatic methods as having no dispatch receiver
#KT-21246 Fixed
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// WITH_RUNTIME
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
object Test {
|
||||
|
||||
@JvmStatic
|
||||
fun test() = action { createWildcard("OK") }.x
|
||||
|
||||
@JvmStatic
|
||||
private fun createWildcard(s: String): Type<*>? {
|
||||
return Type<Any>(s)
|
||||
}
|
||||
|
||||
inline fun action(crossinline f: () -> Type<*>?) = f()!!
|
||||
|
||||
class Type<T>(val x: String)
|
||||
|
||||
}
|
||||
|
||||
fun box() = Test.test()
|
||||
@@ -0,0 +1,15 @@
|
||||
// WITH_RUNTIME
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
object Test {
|
||||
|
||||
fun test() = { createWildcard("OK") }()
|
||||
|
||||
@JvmStatic
|
||||
private fun createWildcard(s: String) = Type<Any>(s).x
|
||||
|
||||
class Type<T>(val x: String)
|
||||
|
||||
}
|
||||
|
||||
fun box() = Test.test()
|
||||
Reference in New Issue
Block a user