Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10700

STC cannot locate method specified by interface but supplied by AST transform

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      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()
      }
      
      package p
      class D extends C { // implements A
        @groovy.transform.TypeChecked
        void test() {
          def x = decode('string')
        }
      }
      

      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."

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment