[
https://issues.apache.org/jira/browse/GROOVY-12526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18133829#comment-18133829
]
ASF GitHub Bot commented on GROOVY-12526:
-----------------------------------------
testlens-app[bot] commented on PR #3071:
URL: https://github.com/apache/groovy/pull/3071#issuecomment-6480037934
## ✅ All tests passed ✅
🏷️ Commit: 45a73f440f67a0031691b40872f7dc00ac24181d
▶️ Tests: 124050 executed
⚪️ Checks: 32/32 completed
---
_Learn more about TestLens at
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
> I.super.m() is not rejected when I is not a direct superinterface
> -----------------------------------------------------------------
>
> Key: GROOVY-12526
> URL: https://issues.apache.org/jira/browse/GROOVY-12526
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 6.0.0
> Reporter: Scott Murphy Heiberg
> Assignee: Daniel Sun
> Priority: Major
>
> javac rejects {{I.super.m()}} unless {{I}} is a direct superinterface of the
> current class or interface ("not an enclosing class: I"). Groovy does not
> reject it, and dynamic Groovy runs something else:
> {code:groovy}
> interface J { default String m() { 'J' } }
> interface I extends J {
> default String m() { 'I' }
> default String n() { I.super.m() }
> }
> class C implements I { }
> assert new C().n() == 'I' // I's own m(), not J.m()
> {code}
> {code:groovy}
> interface Outer {
> default String m() { 'outer' }
> class Inner {
> String test() { Outer.super.m() } // Inner does not implement Outer
> }
> }
> new Outer.Inner().test() // GroovyBugError: BUG! UNCAUGHT EXCEPTION: caller
> class must be a subclass below the method: Outer.m()String/invokeSpecial,
> from class Outer$Inner
> {code}
> Under {{@TypeChecked}} and {{@CompileStatic}} both are rejected, but with "No
> such property: super for Class or static property for class: I" (and "...:
> Outer"). Seen in 5.0.8, 6.0.0 and master. In 4.0.33 the first example
> returned 'I' in every mode, and the second failed with
> {{MissingPropertyException}}.
> Expected: a compile error in every mode, as javac gives.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)