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

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

testlens-app[bot] commented on PR #3098:
URL: https://github.com/apache/groovy/pull/3098#issuecomment-6539713194

   ## 🚨 All tests passed but jobs failed 🚨
   
   ### Failed Jobs without Test Failures
   
   ❌ [Build and test / lts \(17, 
macos-latest\)](https://github.com/apache/groovy/actions/runs/41169510933/job/124444213619?pr=3098)
   ❌ [Build and test / lts \(17, windows-latest, 
1\)](https://github.com/apache/groovy/actions/runs/41169510933/job/124444213742?pr=3098)
   ❌ [Build and test / lts \(21, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41169510933/job/124444213764?pr=3098)
   ❌ [Build and test / lts \(25, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/41169510933/job/124444213506?pr=3098)
   
   🏷️ Commit: 99cb0ad0f0cd7c23e0f830c10976c920af85135f
   ▶️ Tests:  44305 executed
   ⚪️ Checks: 27/27 completed
   
   ### Rerun Controls
   
   Click the checkbox to trigger a rerun:
   
   - [ ] **Rerun jobs**
   
   ---
   _Learn more about TestLens at 
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
   




> SC: a package-private class of another GroovyClassLoader compilation fails 
> with IllegalAccessError where dynamic code works
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12569
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12569
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> A class that is not public is accessible only within its run-time package 
> (JVMS 5.4.4), and the JVM checks that wherever an instruction names the 
> class. Dynamic code uses a package-private class of an earlier 
> {{GroovyShell}} parse, or of a library used by a script, without naming it. 
> Statically compiled code names it and fails:
> {code:groovy}
> def shell = new GroovyShell()
> shell.evaluate '''package p
>     @groovy.transform.PackageScope class Hidden implements Runnable {
>         static String sm() { 'sm' }
>         String name
>         String own() { 'own' }
>         void run() { }
>     }
>     true
> '''
> shell.evaluate '''package p
>     @groovy.transform.CompileStatic
>     def test() {
>         def h = new Hidden(name: 'x')
>         h.run()
>         Runnable r = h
>         [Hidden.sm(), h.own(), h.name]
>     }
>     test()
> ''' // each line fails with IllegalAccessError; without @CompileStatic it 
> works
> {code}
> Expected: as in dynamic code, {{new}} and static members go through the 
> meta-class, a method is called through a public superclass or interface that 
> declares it (else the meta-class), and a value of the class is held as its 
> nearest public superclass. A variable declared with the class, a cast to it 
> and {{instanceof}} still fail, as in dynamic code. Classes compiled to class 
> files are used directly.
> PR: https://github.com/apache/groovy/pull/3098



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to