is there any way to find out if whatever is callin...
# announcements
t
is there any way to find out if whatever is calling a function is kotlin or java?
i need something like
Copy code
myFun() {
    if (env == kotlin) {
    }
    if (env == java) {
    }
}
o
With reflection you can try inspecting the stack trace and finding calling class, and look if it has Kotlin’s metadata. But it will be damn slow.
t
speed is irrelevant for my use-case, is there any example of this anywhere?