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

Regression in GString handling

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.1
    • 4.0.0-alpha-1, 3.0.2
    • parser-antlr4
    • None

    Description

      Seems like a regression in GString placeholder parsing:
      Groovy 2.5.9: executing String s in groovyConsole gives => null
      Groovy 3.0.1: executing String s in groovyConsole gives => null
      In both cases it is a declaration statement, type String, name s (all good so far)

      Trying a GString containing the same expression yields:
      Groovy 2.5.9: executing "${String s}" in groovyConsole gives => null
      Groovy 3.0.1: executing "${String s}" in groovyConsole gives => groovy.lang.MissingPropertyException: No such property: s for class

      In 2.5.9, we have a GString with value being a closure exp containing the decl exp as per previous example
      In 3.0.1, we have a GString with value being a method call exp with name 'java.lang.String' and arg 's'

      Attachments

        Activity

          People

            daniel_sun Daniel Sun
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: