[
https://issues.apache.org/jira/browse/GROOVY-12712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139965#comment-18139965
]
ASF GitHub Bot commented on GROOVY-12712:
-----------------------------------------
codecov-commenter commented on PR #3243:
URL: https://github.com/apache/groovy/pull/3243#issuecomment-6697415346
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3243?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 74.3370%. Comparing base
([`5170b46`](https://app.codecov.io/gh/apache/groovy/commit/5170b4661350aed26bab4407fa66c68eecb86fc5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`3f8e070`](https://app.codecov.io/gh/apache/groovy/commit/3f8e07083d7e21d3bfa228b50845dc43364cae4d?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
[](https://app.codecov.io/gh/apache/groovy/pull/3243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3243 +/- ##
==================================================
- Coverage 74.3428% 74.3370% -0.0058%
+ Complexity 44310 44306 -4
==================================================
Files 1699 1699
Lines 150862 150863 +1
Branches 28756 28756
==================================================
- Hits 112155 112147 -8
- Misses 28435 28440 +5
- Partials 10272 10276 +4
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3243?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...va/org/apache/groovy/parser/antlr4/AstBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/3243?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==)
| `87.3391% <100.0000%> (ø)` | |
|
[...odehaus/groovy/transform/AsyncTransformHelper.java](https://app.codecov.io/gh/apache/groovy/pull/3243?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2FAsyncTransformHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9Bc3luY1RyYW5zZm9ybUhlbHBlci5qYXZh)
| `85.5072% <100.0000%> (+0.2131%)` | :arrow_up: |
... and [10 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3243/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>
> for await names its source variable with a JVM-wide counter, so class files
> depend on compile order
> ---------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12712
> URL: https://issues.apache.org/jira/browse/GROOVY-12712
> Project: Groovy
> Issue Type: Bug
> Components: parser-antlr4
> Affects Versions: 6.0.0
> Environment: Groovy 6.0.0 binary distribution and master 7379c5720d;
> BellSoft JDK 21.0.12; macOS 15 arm64
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> Since 6.0.0 the parser desugars a {{for await}} loop into a block that
> declares the iterable in a variable named {{$__forAwaitSource_<n>}}
> ({{AsyncTransformHelper.wrapForAwaitLoop}}, called from
> {{AstBuilder.visitForStmtAlt}}). The number comes from a {{static
> AtomicLong}} shared by every compilation in the JVM, not from the source
> unit, so the same file compiles to different class bytes depending on what
> was compiled before it in the same {{groovyc}}, build daemon or IDE session
> (the name reaches the local variable table), and two parses of one file in
> one JVM give two different ASTs.
> Reproducer (6.0.0, JDK 21):
> {code:groovy}
> // Beta.groovy
> class Beta {
> static List<String> names() {
> def gen = async { for (String s in ['a', 'b']) { yield return s } }
> List<String> seen = []
> for await (n in gen) { seen << (n as String) }
> seen
> }
> }
> {code}
> {{Alpha.groovy}} is any other class with one {{for await}} loop.
> {noformat}
> $ groovyc -d one Beta.groovy && javap -p -l -cp one Beta | grep -o
> '\$__forAwaitSource_[0-9]*' | sort -u
> $__forAwaitSource_1
> $ groovyc -d two Alpha.groovy Beta.groovy && javap -p -l -cp two Beta | grep
> -o '\$__forAwaitSource_[0-9]*' | sort -u
> $__forAwaitSource_2
> $ cmp one/Beta.class two/Beta.class
> one/Beta.class two/Beta.class differ: char 1743, line 9
> {noformat}
> Consequences: non-reproducible builds; build caches and incremental compilers
> keyed on outputs see a change that is not in the source; and tools that
> compare the CONVERSION-phase AST of a file with a re-parse of it (a formatter
> checking that it preserved the AST) report a difference for every file with a
> {{for await}} loop. The other names generated for {{async}} and {{yield
> return}} were stable across parses.
> Suggested fix: number the loops per source unit in {{AstBuilder}} and pass
> the number to {{wrapForAwaitLoop}}, so the name depends on the source alone.
> Pull request to follow.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)