You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/03/08 12:17:00 UTC
[jira] [Closed] (GROOVY-7944) Bad class generation when trying to instantiate an inner class within a static method
[ https://issues.apache.org/jira/browse/GROOVY-7944?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-7944.
-----------------------------
> Bad class generation when trying to instantiate an inner class within a static method
> -------------------------------------------------------------------------------------
>
> Key: GROOVY-7944
> URL: https://issues.apache.org/jira/browse/GROOVY-7944
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
> Assignee: Eric Milles
> Priority: Major
>
> 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.
> {code}
> 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)
> }
> }
> }
> {code}
> It isn't specific to {{with}}. You could use {{any}}, {{every}}, etc.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)