daniellansun opened a new pull request, #3342:
URL: https://github.com/apache/groovy/pull/3342

   https://issues.apache.org/jira/browse/GROOVY-2994
   
   `"${1}" + "2"` and `"${1}".plus("2")` now return a String, as `"1" + "${2}"` 
already did. `GString.plus(String)` renders the receiver and appends the 
argument, so the two orders agree on the result type. The text is unchanged.
   
   This is a Groovy 7 behavioral change and should not be backported to 6.0.x. 
Before, a GString on the left produced another GString, so values stayed 
unrendered until `toString`, `writeTo` or `build`, and `groovy.sql.Sql` could 
still bind parameters from a query built by appending a plain String. A class 
compiled against the previous `plus(String)` descriptor will throw 
`NoSuchMethodError` until it is recompiled. Code that needs the result to 
remain a GString should keep both sides as GString (`GString.plus(GString)` is 
unchanged).
   
   `testGroovy2994` now runs as a regular test; its assertions are unchanged. 
Additional coverage is in `Groovy2994`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to