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

Incorrect "Possible solutions" when calling a method on super in a non-derived class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.10, 1.8.1, 2.4.0-rc-1
    • 4.0.0-alpha-1, 3.0.5, 2.5.13
    • groovy-runtime
    • None

    Description

      Calling an instance method on super in a non-derived class.

      class T { void m() { super.m() } }
      new T().m() 
      

      This results in the below exception.

      ERROR groovy.lang.MissingMethodException:
      No signature of method: T.m() is applicable for argument types: () values: []
      Possible solutions: m(), is(java.lang.Object), dump(), any(), any(groovy.lang.Closure), use([Ljava.lang.Object;)
      

      This can be quite confusion as the called method on super is also listed in the possible solutions. The error message should be a different one.

      Calling a static method on super in a non-derived class.

      class T { static void m() { super.m() } }
      T.m() 
      

      This results in the below stack overflow.

      ERROR java.lang.StackOverflowError:
      null
              at T.$getCallSiteArray (groovysh_evaluate)
              at T.m (groovysh_evaluate)
              at T.m (groovysh_evaluate:2)
              at T.m (groovysh_evaluate:2)
              ...
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              rene.scheibe Rene Scheibe
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h