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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0-beta-2
    • Component/s: None
    • Labels:

      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

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              melix C├ędric Champeau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: