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

Accessing map contents as properties fails for subclasses of HashMap

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-RC-1
    • 1.1-rc-3
    • None
    • None
    • Windows XP, Java 1.5

    Description

      class SubclassOfMap extends HashMap
      {
      }

      def sub = new SubclassOfMap()
      sub.xyz = 'xyz'

      This fails with a MissingPropertyException. Changing sub to be a HashMap works.

      Why is the property -> indexer overload not applied to subclasses of HashMap?

      Attachments

        1. Groovy1593.groovy
          0.4 kB
          Andres Almiray

        Activity

          People

            Unassigned Unassigned
            jskeet Jon Skeet
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: