[
https://issues.apache.org/jira/browse/GROOVY-12717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18140666#comment-18140666
]
ASF GitHub Bot commented on GROOVY-12717:
-----------------------------------------
testlens-app[bot] commented on PR #3251:
URL: https://github.com/apache/groovy/pull/3251#issuecomment-6720135744
## 🚨 Jobs failed without executing tests 🚨
### Failed Jobs without Test Failures
❌ [Build and test / lts \(17,
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42469660230/job/128697232766?pr=3251)
❌ [Check licenses / test
\(ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42469660206/job/128697232704?pr=3251)
❌ [CodeQL / Analyze \(java,
21\)](https://github.com/apache/groovy/actions/runs/42469660343/job/128697233693?pr=3251)
❌ [Generate SNAPSHOT distributions /
dist](https://github.com/apache/groovy/actions/runs/42469660565/job/128697234820?pr=3251)
❌ [Lint gate /
lint](https://github.com/apache/groovy/actions/runs/42469660285/job/128697233048?pr=3251)
❌ [Performance check /
test](https://github.com/apache/groovy/actions/runs/42469660314/job/128697233308?pr=3251)
❌ [jmh /
summary](https://github.com/apache/groovy/actions/runs/42469660351/job/128697301600?pr=3251)
❌ [jmh / test \(bench,
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42469660351/job/128697233422?pr=3251)
❌ [jmh / test \(core-ag,
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42469660351/job/128697233395?pr=3251)
❌ [jmh / test \(core-hz,
\\\\.perf\\\\.[H-Z]\)](https://github.com/apache/groovy/actions/runs/42469660351/job/128697233232?pr=3251)
❌ [jmh / test \(grails-ad,
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42469660351/job/128697233392?pr=3251)
❌ [jmh / test \(grails-ez,
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42469660351/job/128697233402?pr=3251)
❌ [jmh-classic /
summary](https://github.com/apache/groovy/actions/runs/42469660322/job/128697312589?pr=3251)
❌ [jmh-classic / test \(bench,
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42469660322/job/128697233483?pr=3251)
❌ [jmh-classic / test \(core-ag,
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42469660322/job/128697233284?pr=3251)
❌ [jmh-classic / test \(core-hz,
\\\\.perf\\\\.[H-Z]\)](https://github.com/apache/groovy/actions/runs/42469660322/job/128697233451?pr=3251)
❌ [jmh-classic / test \(grails-ad,
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42469660322/job/128697233460?pr=3251)
❌ [jmh-classic / test \(grails-ez,
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42469660322/job/128697233437?pr=3251)
🏷️ Commit: ea228d96b9cecb73420403ebb0b375e112d63aae
▶️ Tests: 0 executed
🟡 Checks: 20/26 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: new of a protected constructor of another package, or a protected method
> through a superclass receiver, fails verification instead of being reported
> --------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12717
> URL: https://issues.apache.org/jira/browse/GROOVY-12717
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 4.0.32, 5.0.8, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> // package p
> class A {
> protected A(String s) { }
> protected String im() { 'im' }
> protected String getQp() { 'qp' }
> }
> // package q
> @groovy.transform.CompileStatic
> class B extends p.A {
> B() { super('b') }
> static test(p.A a) {
> new p.A('x') // or new p.A([:]) with a protected no-argument
> constructor
> a.im()
> a.qp
> java.util.function.Supplier<String> s = a::im
> java.util.function.Function<p.A, String> f = p.A::im
> }
> }
> {code}
> *Actual:* {{VerifyError: Bad access to protected <init> method}} and
> {{VerifyError: Bad access to protected data in invokevirtual}} when {{B}} is
> loaded, and {{BootstrapMethodError}} for the method references.
> *Expected:* a compile error, as javac gives. Outside its package, a protected
> constructor can only be called by {{super(...)}} or an anonymous class (JLS
> 6.6.2.2), and a protected instance method only through a receiver of the
> subclass (JLS 6.6.2.1, JVMS 4.10.1.8).
> Cause: {{StaticInvocationWriter}} writes {{new}} of such a constructor
> directly. Its GROOVY-7325 check for a method compares the types the wrong way
> round: it tests whether the current class is a subtype of the receiver type,
> not the reverse.
> Verified on 5.0.8, 6.0.0 and master. 4.0.32 fails the same way for the
> constructors and method references, and rejects {{a.im()}} and {{a.qp}} at
> compile time.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)