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

ExpandoMetaClass doesn't handle no arg borrowing of methods in current form

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.1-beta-2
    • Fix Version/s: 1.5
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      No arg method borrowing stopped working for EMC in recent builds. In particular, the example on the website no longer works.

      class Person {
          String name
      } 
      class MortgageLender {
         def borrowMoney() {
            "buy house"
         }
      }
      
      def lender = new MortgageLender()
      
      Person.metaClass.buyHouse = lender.&borrowMoney
      
      
      def p = new Person()
      
      assert "buy house" == p.buyHouse()
      

        Attachments

          Activity

            People

            • Assignee:
              ait Alex Tkachman
              Reporter:
              paulk Paul King
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: