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

STC: callable (closure) property from super class

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

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.21, 5.0.0-alpha-8, 4.0.21
    • None
    • Static Type Checker
    • None

    Description

      GROOVY-5881, GROOVY-6324, GROOVY-9418

      Consider the following:

      abstract class A {
        Closure func = { x -> x }
      }
      class C extends A {
        Closure proc = { -> }
        @CompileStatic test() {
          func(123)
          proc()
        }
      }
      
      print(new C().test())
      

      STC is happy with "proc()" but errors on "func(123)". If a variable expression can be called without ".call" it should not matter the source of the variable. Both method call expressions work fine without STC.

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            emilles Eric Milles

            Dates

              Created:
              Updated:

              Slack

                Issue deployment