Treat accessors to JvmStatic methods as having no dispatch receiver

#KT-21246 Fixed
This commit is contained in:
Dmitry Petrov
2017-11-13 15:29:14 +03:00
parent db2aad1857
commit 15ac471626
7 changed files with 77 additions and 3 deletions
+20
View File
@@ -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()
+15
View File
@@ -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()