Join Slack
Powered by
is there any way to find out if whatever is callin...
# announcements
t
tipsy
02/18/2018, 1:40 AM
is there any way to find out if whatever is calling a function is kotlin or java?
tipsy
02/18/2018, 1:41 AM
i need something like
Copy code
myFun() { if (env == kotlin) { } if (env == java) { } }
o
orangy
02/18/2018, 5:40 PM
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
tipsy
02/18/2018, 8:33 PM
speed is irrelevant for my use-case, is there any example of this anywhere?
3
Views
Open in Slack
Previous
Next