Skip to content

Instantly share code, notes, and snippets.

@xerial
Last active December 16, 2015 13:19
Show Gist options
  • Save xerial/5440968 to your computer and use it in GitHub Desktop.
Save xerial/5440968 to your computer and use it in GitHub Desktop.
Extract return type of Function3
def f(a:Int, b:String, c:Int) : Unit = {}
val f3 = f(_, _, _)
for(m <- f3.getClass.getDeclaredMethods.find(m => m.getName == "apply" && !m.isSynthetic)) {
val retType = m.getReturnType
info(s"f3 class: ${f3.getClass.getName}")
info(s"return type of f3: $retType")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment