Can you get an instance of `Class` object for top-...
# announcements
a
Can you get an instance of
Class
object for top-level declaration, e.g.:
Copy code
val x = ???::class.java.getResourceAsStream(...)
?
🚫 1
k
I don't think so, I've been looking for this too. I usually end up with my own function similar to
Copy code
fun resourceAsString(path: String) = ::resourceAsString.class.java.getResourceAsString(path)
You get back a class that's also defined in the same package IIRC.