methodclosurewitharraybug.groovy

来自「大名鼎鼎的java动态脚本语言。已经通过了sun的认证」· GROOVY 代码 · 共 29 行

GROOVY
29
字号
package groovy.bugsimport org.codehaus.groovy.runtime.MethodClosureclass MethodClosureWithArrayBug extends GroovyTestCase {    def aa(x) {        println x    }    void testMetodClosure() {           Class[] c1 =  [ Exception.class, Throwable.class ]        Class[] c2 = [ IllegalStateException.class ]        println (c1)        println (c2)        def cl = this.&aa        println(cl.class)        assertTrue(cl instanceof Closure)        assertTrue(cl instanceof MethodClosure)        [c1, c2].each(cl)    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?