ks.zealot created GROOVY-8104:
---------------------------------

             Summary: Could not call constructor of inner class from anonimous 
class inside closure
                 Key: GROOVY-8104
                 URL: https://issues.apache.org/jira/browse/GROOVY-8104
             Project: Groovy
          Issue Type: Bug
            Reporter: ks.zealot
            Priority: Minor


When I was trying to call constructor from anonymous class, I  catch strange 
exception
{code}
Could not find matching constructor for: A$B(A$_foo_closure1)
{code}
Here is a reproduction
{code}
interface I {
    void bar(Object o)
}
class A {
    void foo(){
        C c = new C()
        ['1','2','3'].each {
            obj ->
                c.baz(obj, new I() {
                    @Override
                    void bar(Object o) {
                        B b = new B(  )

                    }
                })
        }
    }
    class B {

    }
}
class C {
    void baz(Object o, I i) {
        i.bar(o)
    }
}
A a = new A()
a.foo()
{code}

When my inner class have fields, exception is slightly different

{code}
GroovyRuntimeException: Could not find matching constructor for: 
A$B(A$_foo_closure1, java.util.LinkedHashMap)
{code}
Enviroment : groovy 2.3.9




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to