Paul King created GROOVY-7944:

             Summary: Bad class generation when trying to instantiate an inner 
class within a static method
                 Key: GROOVY-7944
             Project: Groovy
          Issue Type: Bug
            Reporter: Paul King

The first constructor call is OK. The second constructor call is thought to be 
in a static context and the argument is replaced with it's class.
class Foo {
  class Bar { }
  static void main(args) {
    new Bar(new Foo()) // OK, matches Foo$Bar(Foo)
    new Foo().with {
      new Bar(this) // GRE: trying to match Foo$Bar(java.lang.Class)
It isn't specific to {{with}}. You could use {{any}}, {{every}}, etc.

This message was sent by Atlassian JIRA

Reply via email to