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

Bug with GString property access

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.2
    • 1.5.3
    • None
    • None

    Description

      The following script produces a java.lang.ClassCastException: org.codehaus.groovy.runtime.GStringImpl with 1.5.2. With 1.5.0 it has printed 'peter'

      class Person {
          String name
      }
      Person person = new Person()
      String propertyName = 'name'
      person."$propertyName" = 'peter'
      println person.name
      

      Attachments

        Activity

          People

            ait Alex Tkachman
            hans_d Hans Dockter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: