[
https://issues.apache.org/jira/browse/GROOVY-10682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610278#comment-17610278
]
Paul King commented on GROOVY-10682:
------------------------------------
Some general comments:
* I wouldn't assume we need all of the methods brought over in one go, so long
as it is clear on the status.
* Some methods won't need STC checks, e.g. {{shuffle}} has no variant
involving a Closure. Currently, {{average}} exists for int[] but doesn't
involve a Closure variant, though one could conceivably add a Closure variant
like exists for T[]. So we might not need all "480" tests depending on what is
tackled for now.
* We have ways to automate testing to reduce the volume of tests when the
tests are all very similar.
> 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)