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

polymorphic static methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 1.1-beta-1
    • None
    • None
    • any

    Description

      class MySuperClass{
      static void printSelf()

      { println this; }

      }

      class MyClass extends MySuperClass{
      }

      now... any class is an instance -> class methods are equals to instance methods -> if (not exist) find in superclass

      MyClass.printSelf() -> "class MySuperClass" (the message receiver)

      but,

      MyClass.printSelf() -> returns, an exception (the message receiver is "class MyClass")

      Attachments

        Activity

          People

            paulk Paul King
            joseaio joseaio
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: