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

STC: callable (closure) property from super class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.21, 5.0.0-alpha-8, 4.0.21
    • 5.0.0-alpha-11
    • Static Type Checker
    • None

    Description

      GROOVY-5705, GROOVY-5807, 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

          People

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

            Dates

              Created:
              Updated:
              Resolved: