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

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

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

   ## 🚨 TestLens detected 3 failed tests 🚨
   
   ### Test Summary
   > [!TIP]
   > Inspect all details with the [TestLens 
CLI](https://testlens.app/docs/features/cli): `testlens pr 3050`
   
   #### [Build and test / lts \(17, 
macos-latest\)](https://github.com/apache/groovy/actions/runs/45052507805/job/137300549300?pr=3050)
 > :test
   
   | Test | Runs | Flakiness |
   |---|---|--:|
   | RegressionTest > testGroovy12510\(\) | ❌ | 0% 🟢 |
   | RegressionTest > testGroovy12523\(\) | ❌ | 0% 🟢 |
   | RegressionTest > testGroovy12637\(\) | ❌ | 0% 🟢 |
   
   🏷️ Commit: c51a496e9d4bb9a3f1226da9b204e54e1f24c57f
   ▶️ Tests:  22765 executed
   🟡 Checks: 6/24 completed
   
   ### Test Failures
   
   <details><summary><strong>RegressionTest > testGroovy12510()</strong> (:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/45052507805/job/137300549300?pr=3050";>Build
 and test / lts (17, macos-latest)</a>)</summary>
   
   ```
   java.lang.AssertionError: Method is marked with @NotYetImplemented but 
passes unexpectedly
        at bugs.RegressionTest.testGroovy12510(RegressionTest.groovy:4849)
   ```
   
   </details>
   <details><summary><strong>RegressionTest > testGroovy12523()</strong> (:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/45052507805/job/137300549300?pr=3050";>Build
 and test / lts (17, macos-latest)</a>)</summary>
   
   ```
   java.lang.AssertionError: Method is marked with @NotYetImplemented but 
passes unexpectedly
        at bugs.RegressionTest.testGroovy12523(RegressionTest.groovy:4934)
   ```
   
   </details>
   <details><summary><strong>RegressionTest > testGroovy12637()</strong> (:test 
in <a 
href="https://github.com/apache/groovy/actions/runs/45052507805/job/137300549300?pr=3050";>Build
 and test / lts (17, macos-latest)</a>)</summary>
   
   ```
   java.lang.AssertionError: Method is marked with @NotYetImplemented but 
passes unexpectedly
        at bugs.RegressionTest.testGroovy12637(RegressionTest.groovy:5176)
   ```
   
   </details>
   
   ### Rerun Controls
   > [!NOTE]
   > Checks are currently running using the configuration below.
   
   Select tests to mute in this pull request:
   
   🔲 RegressionTest > testGroovy12510\(\) <!

> STC: private members of another class of the same nest are not accessible
> -------------------------------------------------------------------------
>
>                 Key: GROOVY-12509
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12509
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 7.0.0-alpha-1, 6.0.1
>
>
> Under static type checking, a class nested in a top-level class cannot use 
> the private constructors, methods and accessors of another class nested in 
> the same top-level class:
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
>     static class Box {
>         private Box(String s) {}
>         private static String sm() { 'sm' }
>         private String im() { 'im' }
>         private String getX() { 'x' }
>     }
>     static class A { private static class Hidden { public static int x = 1 } }
>     static class Other {
>         static test(Box box) {
>             new Box('a')  // Cannot find matching constructor 
> C$Box(java.lang.String)
>             Box.sm()      // Cannot find matching method java.lang.Class#sm() 
> or static method C$Box#sm()
>             box.im()      // Cannot find matching method C$Box#im()
>             box.x         // No such property: x for class: C$Box
>             A.Hidden.x    // Cannot access field: x of class: C$A$Hidden from 
> class: C$Other
>         }
>     }
> }
> {code}
> Java allows all of these (JLS 6.6.1: a private member is accessible anywhere 
> within the body of the top-level class that encloses its declaration), and 
> the JVM does through nestmates. Groovy already writes the {{NestHost}} and 
> {{NestMembers}} attributes for these classes, the class generator already 
> calls private members of nestmates directly, and the type checker already 
> allows private fields of nestmates (GROOVY-12290). Method references such as 
> {{Box::new}} and {{Box::sm}} are rejected the same way.
> The modes also disagree. With a private {{Box(String)}} beside a public 
> {{Box(Object)}}, {{new Box('s')}} in {{Other}} calls the private constructor 
> in dynamic and {{@TypeChecked}} code, as javac does, but the public one under 
> {{@CompileStatic}}. The same happens for a private {{B.m(String)}} beside an 
> inherited {{A.m(Object)}}.
> A private getter or setter used through property syntax ({{box.x}}) is also 
> rejected from the outer class into a nested class.
> The last case, a public member reached through a private nested type 
> ({{A.Hidden.x}}, or a constant of a private nested enum), worked in 5.0.8 and 
> fails since 6.0.0 (GROOVY-12310), from a sibling and from the outer class. 
> The other cases fail in 4.0, 5.0 and 6.0.
> PR: https://github.com/apache/groovy/pull/3044 (the private nested types; the 
> other parts follow in separate pull requests)



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

Reply via email to