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:
[email protected]


Reply via email to