https://kotlinlang.org logo
i

ilya.gorbunov

05/25/2018, 5:57 PM
File class is a JVM implementation detail, and you can get it with the help of java reflection:
Copy code
@file:JvmName("SomeFileKt")
import kotlin.reflect.jvm.javaMethod

private fun dummy(){}

fun main(args: Array<String>) {
    println(::dummy.javaMethod!!.declaringClass)
}
☝️ 2