groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: Unexpected behavior with Arrays.asList and an array of primitives even under CompileStatic
Date Thu, 01 Oct 2015 05:34:43 GMT
frankly I am not sure this is a bug. Since vargs are involved things are 
more difficult. What I can say is, that the int[] is cast to an 
Object[]. Either dynamically by the runtime in normal Groovy, or through 
static code using ScriptBytecodeAdapter.castToType with Object[]. Since 
@CompileStatic only mimics the dynamic code I am unsure as of if to 
classify this as a static compilation bug.

bye blackdrag

Am 01.10.2015 03:08, schrieb Edinson E. Padrón Urdaneta:
> Should I open a jira issue? I'm not familiar with the procedure.
>
> On Mon, Sep 28, 2015 at 3:06 AM, Edinson E. Padrón Urdaneta
> <edinson.padron.urdaneta@gmail.com
> <mailto:edinson.padron.urdaneta@gmail.com>> wrote:
>
>     I think (and I can be very wrong) what happens is that
>     `Arrays.toString(myIntArray)`is transformed
>     to`Arrays.toString(myIntArray as Integer[])`explaining why the
>     original array and the list that should be backed by it are not
>     bound at all. It's just an hypotheses, of course.
>
>


-- 
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/


Mime
View raw message