Skip to content

Instantly share code, notes, and snippets.

@samueltardieu
Created January 11, 2013 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samueltardieu/4512923 to your computer and use it in GitHub Desktop.
Save samueltardieu/4512923 to your computer and use it in GitHub Desktop.
scala> ((x: Int, y: Int) => x+y).getClass.getMethods.find(_.getName == "apply").get.getParameterTypes.size res49: Int = 2
scala> ((x: Int, y: Int) => x+y).getClass.getMethods.find(_.getName == "apply").get.getParameterTypes.size
res0: Int = 2
// Le getMethods.find(_.getName == "apply") est dû au fait qu'il y a deux apply possible,
// un avec des "int", et un avec des "Object" (à cause de la possibilité de passer des
// "Integer") -- vive l'interaction avec la JVM. Mais ces deux apply auront obligatoirement
// la même arité.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment