小编Mat*_*sov的帖子

groovysh找不到方法

我将以下脚本加载到groovysh中:

def a() {
    println "a()"
}

def b() {
    println "b()"
    a()
}
Run Code Online (Sandbox Code Playgroud)

通过使用:load 'test.groovy'和调用方法b():

b()
Run Code Online (Sandbox Code Playgroud)

我明白了:

groovy:000> b()
b()
No signature of method: groovysh_evaluate.a() is applicable for argument types: () values: []
Possible solutions: b(), any(), is(java.lang.Object), any(groovy.lang.Closure), wait(), run()
        at groovysh_evaluate.b (groovysh_evaluate:5)
Run Code Online (Sandbox Code Playgroud)

为什么groovysh找不到方法a()?

groovy groovyshell

5
推荐指数
1
解决办法
230
查看次数

标签 统计

groovy ×1

groovyshell ×1