blackdrag commented on PR #3097:
URL: https://github.com/apache/groovy/pull/3097#issuecomment-6550521468

   @codeconsole I think the dynamic path does not make sense here for static 
compilation because:
   * compile time and runtime may see different classes
   * meta class can influence constructor invocation
   * runtime may still fail
   
   I see a few paths forward here:
   
   1. do nothing and close the issue as won´t fix
   2. check at compile time and fail.
   3. check at compile time and implement a reflective path, for example via 
its own invokedynamic
   
   For (2) I would use the compiler configuration to set if want to check this, 
since this is a very specific scenario and GroovyShell could then for example 
set it by default. Unchecked means path (1)
   For (3) I would also use a compiler configuration option to control if we 
want to do this. (2) could be a fallback, I would still make (1) the default.
   
   path 3 makes this of course a much bigger implementation since we do not 
have that so far. Well maybe the LambdaFactory utilities can help here, since 
we really actually want a constant call site for this. And path (1) is pretty 
much a "won´t fix"
   
   I would not use ScriptByteCodeAdapter#invokeNew for this. What variant makes 
most sense for you?


-- 
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]

Reply via email to