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

Felix Schnabel commented on GROOVY-10682:
-----------------------------------------

I squashed the commits and force pushed the new version that only has primitive 
types in the new {{ArrayGroovyMethods}} class (I think I misunderstood you 
before, sorry for that). 
I also added the class to {{DGM_LIKE_CLASSES}} and now the STC test works 
locally as intended.
Should I now start with adding more variants for all the different primitive 
types for {{each}} and {{eachWithIndex}} or is there something else that needs 
to be changed beforehand?
p.s. if you think T[] should also be in the new class because it would improve 
the structure, I can still add it.

> Provide eachWithIndex for primitive arrays
> ------------------------------------------
>
>                 Key: GROOVY-10682
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10682
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-jdk
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test(int[] ints) {
>   ints.eachWithIndex { value, index ->
>     println "$index: ${value.doubleValue()}"
>   }
> }
> test(0,1,2,3,4,5)
> {code}
> Compiler reports "[Static type checking] - Cannot find matching method 
> java.lang.Object#doubleValue()"
> {{eachWithIndex}} is only provided for reference types, so "value" is seen as 
> Object by the type checker.



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

Reply via email to