Eric Milles created GROOVY-10700:
------------------------------------

             Summary: 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
            Reporter: Eric Milles


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)

Reply via email to