You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2021/06/21 20:58:07 UTC

[GitHub] [groovy] eric-milles commented on pull request #1601: GROOVY-10099: Resolve ambiguous varargs behaviour in dynamic mode by recourse to compiler-stage information

eric-milles commented on pull request #1601:
URL: https://github.com/apache/groovy/pull/1601#issuecomment-865338972


   Would it be possible to summarize the different scenarios surrounding variadic method calling and show where dynamic, STC and SC are giving expected or unexpected results?  There is so much discussion under the issue and the previous pull request.  It is difficult to understand the scope of the problem and also the solution does not seem to fit the size of the problem IMO.
   
   We have been using compile-time type information as part of static compilation to resolve issues such as these.  With that in mind, it can be expected that dynamic runtime behavior will not always match static compilation behaviors.  I cite [GROOVY-5438](https://issues.apache.org/jira/browse/GROOVY-5438) as one example.  We would need to apply the static compilation methodology to the dynamic case to make them work the same; there simply are not enough facilities available at runtime to provide total consistency.
   
   Groovy adds one additional complication to variadic method calling.  It treats `foo(String[])` the same as `foo(String...)` in most cases.  This means we cannot count on the varargs modifier at runtime as a signal.  And I had to file a bug related to the unreliability of the varargs modifier: [GROOVY-10140](https://issues.apache.org/jira/browse/GROOVY-10140)


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org