You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/02/29 02:27:00 UTC

[jira] [Created] (GROOVY-9427) Regression in GString handling

Paul King created GROOVY-9427:
---------------------------------

             Summary: Regression in GString handling
                 Key: GROOVY-9427
                 URL: https://issues.apache.org/jira/browse/GROOVY-9427
             Project: Groovy
          Issue Type: Task
          Components: parser-antlr4
    Affects Versions: 3.0.1
            Reporter: Paul King


Seems like a regression in GString placeholder parsing:
 Groovy 2.5.9: executing {color:#4c9aff}{{String s}}{color} in groovyConsole gives => null
 Groovy 3.0.1: executing {color:#4c9aff}{{String s}}{color} 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 {color:#4c9aff}{{"${String s}"}}{color} in groovyConsole gives => null
 Groovy 3.0.1: executing {color:#4c9aff}{{"${String s}"}}{color} in groovyConsole gives => {color:#de350b}groovy.lang.MissingPropertyException: No such property: s for class{color}

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'



--
This message was sent by Atlassian Jira
(v8.3.4#803005)