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

groovyConsole resolves static methods incorrectly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None

      Description

      class A {
         static void dangerous() { println "I'm an A" }
      }
      class B extends A  {
         static void dangerous() { println "I'm a B" }
      }
      A object1 = new A()
      object1.dangerous()  // outputs "I'm an A"
      B object2 = new B()
      object2.dangerous()  // outputs "I'm an A" OOOPS
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              marc@anyware.co.uk Marc Palmer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: