Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
When I was trying to call constructor from anonymous class, I catch strange exception
Could not find matching constructor for: A$B(A$_foo_closure1)
Here is a reproduction
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()
When my inner class have fields, exception is slightly different
GroovyRuntimeException: Could not find matching constructor for: A$B(A$_foo_closure1, java.util.LinkedHashMap)
Enviroment : groovy 2.3.9