[
https://issues.apache.org/jira/browse/GROOVY-12841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18152308#comment-18152308
]
ASF GitHub Bot commented on GROOVY-12841:
-----------------------------------------
testlens-app[bot] commented on PR #3369:
URL: https://github.com/apache/groovy/pull/3369#issuecomment-7233910561
## 🚨 TestLens detected 2 failed tests 🚨
### Test Summary
> [!TIP]
> Inspect all details with the [TestLens
CLI](https://testlens.app/docs/features/cli): `testlens pr 3369`
#### [Build and test / lts \(25,
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/46105237031/job/140856389525?pr=3369)
> :test
| Test | Runs | Flakiness |
|---|---|--:|
| GrabResolverTest > testResolverDefinitionResolvesDependency\(\) | ❌ |
0% 🟢 |
| GrabResolverTest >
testResolverDefinitionResolvesDependencyWithShorthand\(\) | ❌ | 0% 🟢 |
🏷️ Commit: d7544ee25d9a8e31b6bd0e661690ae97bcbc154e
▶️ Tests: 58697 executed
🟡 Checks: 8/24 completed
### Test Failures
<details><summary><strong>GrabResolverTest >
testResolverDefinitionResolvesDependency()</strong> (:test in <a
href="https://github.com/apache/groovy/actions/runs/46105237031/job/140856389525?pr=3369">Build
and test / lts (25, ubuntu-latest)</a>)</summary>
```
java.lang.AssertionError: Forked JVM for
groovy.grape.GrabResolverTest#testResolverDefinitionResolvesDependency failed:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed:
General error during conversion: Error grabbing Grapes
> Javadoc of CompilerConfiguration.CLOSURE_PACKING and @PackedClosures says the
> flag packs only @CompileStatic closures
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12841
> URL: https://issues.apache.org/jira/browse/GROOVY-12841
> Project: Groovy
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 6.0.0, 6.0.1
> Reporter: Scott Murphy Heiberg
> Priority: Blocker
>
> CompilerConfiguration.CLOSURE_PACKING is documented as
> {quote}
> System-property name for the GEP-27 incubating option that automatically
> packs provably-safe @CompileStatic closures (hoisting their bodies to a
> shared adapter instead of a class).
> {quote}
> and the Javadoc of groovy.transform.PackedClosures says "Automatic packing of
> provably-safe @CompileStatic closures — without this annotation — is
> available behind the groovy.target.closure.pack flag".
> With the property set, dynamically compiled closures are packed too when
> their body has no free name:
> {code:groovy}
> class Dyn {
> static void main(String[] args) {
> Closure c = { String s -> s.length() }
> println c.getClass().name
> }
> }
> {code}
> {noformat}
> $ java -Dgroovy.target.closure.pack=true -cp groovy-6.0.1.jar
> groovy.ui.GroovyMain Dyn.groovy
> org.codehaus.groovy.runtime.PackedClosure$Fixed1
> {noformat}
> The behaviour is intended: ClosureWriter#isPackTriggered packs a dynamic
> closure that isSyntacticallyDelegateIndependent ("GROOVY-12151 dynamic
> syntactic path"), and
> ClosurePackCapabilityTest#dynamicDelegateIndependentClosuresAutoPackBySyntax
> asserts it. The documentation is what is out of date. The first sentence of
> the Javadoc of ClosureWriter#isPackTriggered ("the only trigger is the
> @PackedClosures trust assertion") and the class comment of
> ClosurePackCapabilityTest ("dynamic closures (no static resolution) are never
> auto-packed") say the same outdated thing.
> Proposed fix (pull request to follow)
> State both subsets in the two public Javadocs: under @CompileStatic, closures
> the type checker resolved without a delegate; under dynamic compilation,
> closures whose body has no free name (no implicit-this call and no name other
> than a parameter or local variable).
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)