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

Compiler should not allow 2 methods with same name and no argument to return different types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.0-beta-2
    • None

    Description

      This compiles fine, but it shouldn't be allowed :

      class A {
         int foo() { 1 }
         long foo() {2L }
      }
      new A().foo()
      

      (returns 1)

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: