eric-milles opened a new pull request, #2357: URL: https://github.com/apache/groovy/pull/2357
A gap exists between the invocation writer and call site writer selection for a statically-compiled method that includes `makeDynamic` usage and binary operations that map to methods, that are implemented at the end of the chain by [`StaticTypesCallSiteWriter#makeSingleArgumentCall`](https://github.com/apache/groovy/blob/c46a124e6bfd64ff511f85411c1a7dd751a6fd22/src/main/java/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java#L552). 1) Drop setting and checking `DYNAMIC_RESOLUTION` on closure and method. 2) Re-implement `CallSiteWriter` selection within `AsmClassGenerate#visitArrtibuteOrProperty`. - I opted to introduce `WriterController#getCallSiteWriterFor(Expression)` to check for `DYNAMIC_RESOLUTION` node metadata. - An alternative would be to have ACG perform direct check, like: ```java CallSiteWriter callSiteWriter = controller.getCallSiteWriter(); if (pexp.getNodeMetaData(DYNAMIC_RESOLUTION) != null && controller instanceof StaticTypesWriterController scController) { callSiteWriter = scController.getRegularCallSiteWriter(); // GROOVY-6232, GROOVY-11817 } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
