You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2022/09/22 16:34:00 UTC

[jira] [Updated] (GROOVY-7930) @SelfType in hierarchy with an interface in the middle

     [ https://issues.apache.org/jira/browse/GROOVY-7930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-7930:
--------------------------------
    Labels: traits  (was: )

> @SelfType in hierarchy with an interface in the middle
> ------------------------------------------------------
>
>                 Key: GROOVY-7930
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7930
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.7
>            Reporter: Daniil Ovchinnikov
>            Assignee: Paul King
>            Priority: Major
>              Labels: traits
>             Fix For: 2.4.8
>
>
> {code}
> interface Self {
>     def bar()
> }
> @SelfType(Self)
> trait T {
>     def foo() {
>         println "foo called"
>         bar()
>     }
> }
> interface Middle extends T {}
> class C implements Middle {}
> new C().foo()
> {code}
> Above code compiles fine but fails at run time with:
> {noformat}
> groovy.lang.MissingMethodException: No signature of method: selftype.baseinterface.C.bar() is applicable for argument types: () values: []
> {noformat}
> The compilation should fail like if {{Middle}} was a trait.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)