You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2026/02/04 15:16:00 UTC
[jira] [Created] (GROOVY-11854) Enclosing method not set for AIC in script statements
Eric Milles created GROOVY-11854:
------------------------------------
Summary: Enclosing method not set for AIC in script statements
Key: GROOVY-11854
URL: https://issues.apache.org/jira/browse/GROOVY-11854
Project: Groovy
Issue Type: Bug
Components: class generator
Affects Versions: 5.0.4
Reporter: Eric Milles
Assignee: Eric Milles
Consider the following:
{code:groovy}
def fun = { -> }
println fun.getClass().getEnclosingClass() // the script
println fun.getClass().getEnclosingMethod() // the run() method
{code}
{code:groovy}
def obj = new Object() {}
println obj.getClass().getEnclosingClass() // the script
println obj.getClass().getEnclosingMethod() // null
{code}
At the time the AIC is created, the script class and run method are not available, so the metadata is incomplete.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)