如何修复groovy.lang.MissingMethodException:没有方法的签名

时间:2016-12-08 02:04:00

标签: java groovy

为什么跟随groovy代码抛出异常:groovy.lang.MissingMethodException: No signature of method

我是groovy的新人,任何人都可以帮助我吗?

def b = {->
    c()
  }

  def c={ ->
  true
  } 

  b()

Stracktrace是

groovy.lang.MissingMethodException: No signature of method: Script1.c() is applicable for argument types: () values: []
Possible solutions: a(), is(java.lang.Object), run(), run(), any(), any(groovy.lang.Closure)<i>
    at Script1$_run_closure1.doCall(Script1.groovy:7)
    at Script1.run(Script1.groovy:14)

1 个答案:

答案 0 :(得分:3)

关于订单

def c = { ->
    true
} 

def b = { ->    
    c()
}

b()​​