Skip to content

Instantly share code, notes, and snippets.

@itang
Created February 23, 2021 11:34
Show Gist options
  • Select an option

  • Save itang/e33f2722732f92d2465ff1d7e8bed240 to your computer and use it in GitHub Desktop.

Select an option

Save itang/e33f2722732f92d2465ff1d7e8bed240 to your computer and use it in GitHub Desktop.

Revisions

  1. itang created this gist Feb 23, 2021.
    6 changes: 6 additions & 0 deletions PrintTypeTree.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    private def print_type_tree(clazz: Class[?], level: Int = 0): Unit =
    if clazz != null then
    println((" " * level) + clazz)
    val nextLevel = level + 2
    clazz.getInterfaces.foreach(it => print_type_tree(it, nextLevel))
    print_type_tree(clazz.getSuperclass, nextLevel)