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

Groovy does not respect covariant return types when overriding methods from Object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5.1
    • None
    • None

    Description

      the compiler allows classes such as

       class X1 {
              Long toString() { 333L }  // Should not be allowed
              String hashCode() { "hash" } // Should also not be allowed
           }
      

      which it should not

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            blackdrag Jochen Theodorou
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: