Created
January 29, 2015 08:24
-
-
Save nobeans/fa4f910f31109429b65f to your computer and use it in GitHub Desktop.
クロージャの引数の数はどうなってるのか
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
def cd = { println("cd") } | |
def c0 = { -> println("c0") } | |
def c1 = { a -> println("c1:$a") } | |
def c2 = { a, b -> println("c2:$a:$b") } | |
assert cd.parameterTypes.size() == 1 | |
assert c0.parameterTypes.size() == 0 | |
assert c1.parameterTypes.size() == 1 | |
assert c2.parameterTypes.size() == 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment