[
https://issues.apache.org/jira/browse/GROOVY-12150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18095642#comment-18095642
]
ASF GitHub Bot commented on GROOVY-12150:
-----------------------------------------
paulk-asert opened a new pull request, #2691:
URL: https://github.com/apache/groovy/pull/2691
…ompiled view
Stamp each ClosureExpression, at closure-class creation, with the name of
the synthetic class it compiles to (a new GENERATED_CLOSURE_CLASS node-
metadata key on ClosureWriter), and have the console's AstNodeToScriptVisitor
render that name as a trailing block comment on the closure/lambda literal.
Previously the decompiled source showed the closure literal but never the
`new <ClosureClass>(...)` construction the writer emits, so a closure's
generated class was visible only in bytecode. The mark rides the existing
class-creation path (one putNodeMetaData per closure, alongside the
WriterControllerFactory one already there) and is only populated after the
class-generation phase, so it is free for normal compilation and simply absent
at earlier phases. The compiler itself never reads it.
> Decompiled AST view should show a closure's generated class name
> ----------------------------------------------------------------
>
> Key: GROOVY-12150
> URL: https://issues.apache.org/jira/browse/GROOVY-12150
> Project: Groovy
> Issue Type: Improvement
> Components: groovy-console
> Reporter: Paul King
> Assignee: Paul King
> Priority: Major
>
> The Script->InspectAST view in the Groovy Console doesn't make it obvious
> which generated closure was used (class gen phase)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)