Created
January 11, 2013 18:38
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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