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

Calling static method from subclass using super creates StackOverFlow

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.5
    • 2.0.6
    • Compiler
    • None
    • IDEA IC-122.519 EAP using Groovy 2.0.5

    Description

      Don't know whether calling super from a static method is supposed to compile. But it does in IDEA IC-122.519 EAP using Groovy 2.0.5 and runs into an endless loop.

      @CompileStatic
      class A {
          public static foo() {
              print("A")
          }
      }
      
      @CompileStatic
      class B extends A {
          public static foo() {
              A.foo() // compiles and prints "AB"
              super.foo() // compiles and creates StackOverFlow
              print("B")
          }
      
          def static main(args)
          {
              B.foo()
          }
      }
      

      Attachments

        Issue Links

          Activity

            oliver_plow Oliver Plow added a comment -

            At home with IntelliJ IDEA CE 122.694 EAP it does not compile. Not with Groovy 2.0.5 nor with 1.8.8. Sorry for any trouble caused if in the end it is caused by IDEA IC-122.519 EAP. The versions of IDEA 12 EAP can be downloaded from here: http://confluence.jetbrains.com/display/IDEADEV/IDEA+12+EAP

            oliver_plow Oliver Plow added a comment - At home with IntelliJ IDEA CE 122.694 EAP it does not compile. Not with Groovy 2.0.5 nor with 1.8.8. Sorry for any trouble caused if in the end it is caused by IDEA IC-122.519 EAP. The versions of IDEA 12 EAP can be downloaded from here: http://confluence.jetbrains.com/display/IDEADEV/IDEA+12+EAP

            As as sidenote, this problem is not specific to @CompileStatic. Dynamic Groovy has the very same problem.

            melix Cédric Champeau added a comment - As as sidenote, this problem is not specific to @CompileStatic . Dynamic Groovy has the very same problem.

            People

              melix Cédric Champeau
              oliver_plow Oliver Plow
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: