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

ASF GitHub Bot commented on GROOVY-10683:
-----------------------------------------

codecov-commenter commented on PR #2169:
URL: https://github.com/apache/groovy/pull/2169#issuecomment-2778979938

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2169?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   Attention: Patch coverage is `73.75887%` with `37 lines` in your changes 
missing coverage. Please review.
   > Project coverage is 69.0619%. Comparing base 
[(`6ce967f`)](https://app.codecov.io/gh/apache/groovy/commit/6ce967f8019f175e589e71873f025b0a16bb0a13?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 to head 
[(`b83cab1`)](https://app.codecov.io/gh/apache/groovy/commit/b83cab100ed796d4488ab278311c7e640219554f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 9 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2169?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...ehaus/groovy/classgen/ClassCompletionVerifier.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FClassCompletionVerifier.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL0NsYXNzQ29tcGxldGlvblZlcmlmaWVyLmphdmE=)
 | 68.1818% | [5 Missing and 9 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...va/org/apache/groovy/parser/antlr4/AstBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fparser%2Fantlr4%2FAstBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9wYXJzZXIvYW50bHI0L0FzdEJ1aWxkZXIuamF2YQ==)
 | 69.2308% | [6 Missing and 2 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...vy/classgen/asm/sc/StaticTypesStatementWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesStatementWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc1N0YXRlbWVudFdyaXRlci5qYXZh)
 | 62.5000% | [4 Missing and 2 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[.../codehaus/groovy/classgen/asm/StatementWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FStatementWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9TdGF0ZW1lbnRXcml0ZXIuamF2YQ==)
 | 55.5556% | [3 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...vy/groovy/console/ui/AstNodeToScriptAdapter.groovy](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=subprojects%2Fgroovy-console%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Fconsole%2Fui%2FAstNodeToScriptAdapter.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWNvbnNvbGUvc3JjL21haW4vZ3Jvb3Z5L2dyb292eS9jb25zb2xlL3VpL0FzdE5vZGVUb1NjcmlwdEFkYXB0ZXIuZ3Jvb3Z5)
 | 57.1429% | [2 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...us/groovy/transform/CategoryASTTransformation.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2FCategoryASTTransformation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9DYXRlZ29yeUFTVFRyYW5zZm9ybWF0aW9uLmphdmE=)
 | 50.0000% | [1 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2169/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2169        +/-   ##
   ==================================================
   + Coverage     68.8443%   69.0619%   +0.2176%     
   - Complexity      29533      30527       +994     
   ==================================================
     Files            1421       1421                
     Lines          113424     116090      +2666     
     Branches        19644      20186       +542     
   ==================================================
   + Hits            78086      80174      +2088     
   - Misses          28754      29209       +455     
   - Partials         6584       6707       +123     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2169?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...ava/org/codehaus/groovy/ast/stmt/ForStatement.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fstmt%2FForStatement.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9zdG10L0ZvclN0YXRlbWVudC5qYXZh)
 | `100.0000% <100.0000%> (ø)` | |
   | 
[...codehaus/groovy/classgen/VariableScopeVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FVariableScopeVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL1ZhcmlhYmxlU2NvcGVWaXNpdG9yLmphdmE=)
 | `94.4351% <100.0000%> (+0.7435%)` | :arrow_up: |
   | 
[.../codehaus/groovy/classgen/VerifierCodeVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FVerifierCodeVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL1ZlcmlmaWVyQ29kZVZpc2l0b3IuamF2YQ==)
 | `89.7436% <100.0000%> (+0.8547%)` | :arrow_up: |
   | 
[.../groovy/transform/sc/StaticCompilationVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fsc%2FStaticCompilationVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zYy9TdGF0aWNDb21waWxhdGlvblZpc2l0b3IuamF2YQ==)
 | `73.2143% <100.0000%> (+0.0960%)` | :arrow_up: |
   | 
[...us/groovy/transform/CategoryASTTransformation.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2FCategoryASTTransformation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9DYXRlZ29yeUFTVFRyYW5zZm9ybWF0aW9uLmphdmE=)
 | `85.7143% <50.0000%> (-0.4926%)` | :arrow_down: |
   | 
[...vy/groovy/console/ui/AstNodeToScriptAdapter.groovy](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=subprojects%2Fgroovy-console%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Fconsole%2Fui%2FAstNodeToScriptAdapter.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LWNvbnNvbGUvc3JjL21haW4vZ3Jvb3Z5L2dyb292eS9jb25zb2xlL3VpL0FzdE5vZGVUb1NjcmlwdEFkYXB0ZXIuZ3Jvb3Z5)
 | `71.4729% <57.1429%> (+0.3549%)` | :arrow_up: |
   | 
[.../codehaus/groovy/classgen/asm/StatementWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2FStatementWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9TdGF0ZW1lbnRXcml0ZXIuamF2YQ==)
 | `96.0563% <55.5556%> (-1.0783%)` | :arrow_down: |
   | 
[...vy/classgen/asm/sc/StaticTypesStatementWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesStatementWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc1N0YXRlbWVudFdyaXRlci5qYXZh)
 | `93.7984% <62.5000%> (-4.5349%)` | :arrow_down: |
   | 
[...va/org/apache/groovy/parser/antlr4/AstBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fparser%2Fantlr4%2FAstBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9wYXJzZXIvYW50bHI0L0FzdEJ1aWxkZXIuamF2YQ==)
 | `86.3233% <69.2308%> (-0.3018%)` | :arrow_down: |
   | 
[...ehaus/groovy/classgen/ClassCompletionVerifier.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FClassCompletionVerifier.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL0NsYXNzQ29tcGxldGlvblZlcmlmaWVyLmphdmE=)
 | `84.2402% <68.1818%> (-0.9377%)` | :arrow_down: |
   
   ... and [7 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2169/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> Consider enhancing for loop to provide access to loop index or iterator
> -----------------------------------------------------------------------
>
>                 Key: GROOVY-10683
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10683
>             Project: Groovy
>          Issue Type: New Feature
>          Components: parser-antlr4
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>
> When iterating over an array or iterable, there is choice between traditional 
> counting loop for index access, declaring/managing an external variable to 
> leverage for-each loop, or switching to {{eachWithIndex}} which requires 
> quite a bit more runtime investment.
> {code:groovy}
> for (int i = 0, n = array.length; i < n; i += 1) {
>   def val = array[i]
> }
> int idx = 0; for (val in array) {
>   idx += 1;
> }
> // idiomatic and takes care of all the management, but lacks STC support for 
> primitive arrays and adds the cost of method invocation for each iteration
> array.eachWithIndex { val, idx ->
> }
> {code}
> Please consider the possibility of {{for}} loop enhancements of 
> [Gosu|https://gosu-lang.github.io/docs.html], which provides a direct syntax 
> for index or iterator:
> {code}
> for (val in array index idx) {
>   println "$idx: $val"
> }
> for (value in iterable iterator iter) { // could be ListIterator for List 
> types, which increases options
>   iter.remove() // for example
> }
> {code}



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

Reply via email to