You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/07/19 05:39:50 UTC

[GitHub] [groovy] danielsun1106 commented on pull request #1309: GROOVY-9637: Improve the performance of GString

danielsun1106 commented on pull request #1309:
URL: https://github.com/apache/groovy/pull/1309#issuecomment-660591379


   STC supports mutability of `GString` too, so it would be a breaking change anyway. If some user changes the strings/values via the bad practice and is impacted by the change, creating a new `GString` instance could be a workaround.
   
   ```
   @groovy.transform.CompileStatic
   def x() {
       def s = "a${1}b"
       s.strings[0] = 'c'
       s.values[0] = 2
       s
   }
   
   x()  // yields c2b
   ```


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org