Skip to content

Instantly share code, notes, and snippets.

@abreslav
Created October 16, 2012 14:23
Show Gist options
  • Save abreslav/3899575 to your computer and use it in GitHub Desktop.
Save abreslav/3899575 to your computer and use it in GitHub Desktop.
fun main(args: Array<String>) {
val array = Class.forName("java.util.Collection")?.getInterfaces()!!
for (c in array) {
println(c)
c!!.accept(ClassVisitor())
}
}
class ClassVisitor
fun <T:Any?>java.lang.Class<out T>.accept(visitor: ClassVisitor) {
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment