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

Nested categories doesn't obey the rule of the inner category taking precedence over outer in case of toString method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 1.7.1
    • None
    • syntax
    • None
    • Windows Vista

    Description

      I am learning MOP in groovy. I am using Groovy 1.7.1.
      As per the Programming Groovy book,when we work with nested categories, the inner categories takes precedence over the outer.
      But when i try the below code , it is the reverse .is this correct?
      groovy> class one {
      groovy> def static toString(String self)

      { groovy> println "one" groovy> }


      groovy> }
      groovy> class two {
      groovy> def static toSring(String self)

      { groovy> println "two" groovy> }


      groovy> }
      groovy> use(one){use(two) {"hello".toString()}}
      one

      I have also opened a thread at http://groups.google.co.in/group/groovy-user/browse_thread/thread/da5149edf2ce7c24#

      Attachments

        Activity

          People

            Unassigned Unassigned
            santoshgokak santosh gokak
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: