You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2023/02/10 21:41:00 UTC

[jira] [Closed] (GROOVY-10700) STC cannot locate method specified by interface but supplied by AST transform

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

Paul King closed GROOVY-10700.
------------------------------

> STC cannot locate method specified by interface but supplied by AST transform
> -----------------------------------------------------------------------------
>
>                 Key: GROOVY-10700
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10700
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 4.0.5, 2.5.19, 3.0.14
>
>
> Consider the following:
> {code:groovy}
> package p
> interface A {
>   String decode(String s)
> }
> class B implements A {
>   String decode(String s) { s }
> }
> class C implements A {
>   @Delegate private final B b = new B()
> }
> {code}
> {code:groovy}
> package p
> class D extends C { // implements A
>   @groovy.transform.TypeChecked
>   void test() {
>     def x = decode('string')
>   }
> }
> {code}
> The class {{D}} implements {{A}} through its superclass {{C}}, which declares {{decode(String)}}.  However the type-checker says "Cannot find matching method D#decode(java.lang.String). Please check if the declared type is correct and if the method exists."



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