2016-12-08 2 views
2

Warum folgende groovy Code eine Ausnahme auslösen: groovy.lang.MissingMethodException: No signature of method.wie groovy.lang.MissingMethodException zu beheben: Keine Signatur der Methode

Ich bin der neue Typ für groovy, kann mir jeder Körper helfen?

def b = {-> 
    c() 
    } 

    def c={ -> 
    true 
    } 

    b() 

Stracktrace ist

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) 

Antwort

3

Es geht um Ordnung

def c = { -> 
    true 
} 

def b = { ->  
    c() 
} 

b()​​ 
+0

Danke, das das Problem. – Huabei

Verwandte Themen