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

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

daniellansun commented on PR #3071:
URL: https://github.com/apache/groovy/pull/3071#issuecomment-6512633103

   Friendly ping: CI is green and this is ready for review. If there are no 
objections, I plan to merge it this weekend. Thanks!




> 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)

Reply via email to