[ 
https://issues.apache.org/jira/browse/GROOVY-11907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18074988#comment-18074988
 ] 

Eric Milles commented on GROOVY-11907:
--------------------------------------

When handling the dynamic call {{(... $self 
...).grails_plugin_geb_support_ContainerSupport__container$get()}} the class 
generator drops out of StaticTypesInvocationWriter and asks for the regular 
invocation writer.  It is returning a plain InvocationWriter (not 
InvokeDynamicWriter).  Down in {{makeCachedCall}} it runs the CallSiteWriter, 
which loads the call site array (index -1).  I think this is the extra local 
reference that it cannot find.

{code:java}
    public void makeCall(final Expression origin, final Expression receiver, 
final Expression message, final Expression arguments, final 
MethodCallerMultiAdapter adapter, final boolean safe, final boolean spreadSafe, 
final boolean implicitThis) {
        if (origin.getNodeMetaData(StaticTypesMarker.DYNAMIC_RESOLUTION) != 
null) {
            if (origin instanceof MethodCallExpression) ((MethodCallExpression) 
origin).setMethodTarget(null); // ensure dynamic resolve
            InvocationWriter dynamicInvocationWriter = 
((StaticTypesWriterController) controller).getRegularInvocationWriter();
            dynamicInvocationWriter.makeCall(origin, receiver, message, 
arguments, adapter, safe, spreadSafe, implicitThis);
            return;
{code}

> SC: trait static field helper generates invalid bytecode when method-level 
> DYNAMIC_RESOLUTION is present (GROOVY-11817 regression) 
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11907
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11907
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Paul King
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.6
>
>         Attachments: screenshot-1.png
>
>
> This is to track the *_grails-geb testFixtures_* error discussed here:
> [Canary] Grails 8 on Groovy 5 + Spring Boot 4 integration branch
> https://github.com/apache/grails-core/pull/15557



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to