danielsun1106 commented on a change in pull request #1455:
URL: https://github.com/apache/groovy/pull/1455#discussion_r557436347
##########
File path:
src/test/org/codehaus/groovy/classgen/asm/sc/bugs/Groovy9892Bug.groovy
##########
@@ -0,0 +1,21 @@
+package org.codehaus.groovy.classgen.asm.sc.bugs
+
+import groovy.transform.stc.StaticTypeCheckingTestCase
+import org.codehaus.groovy.classgen.asm.sc.StaticCompilationTestSupport
+
+class Groovy9892Bug extends StaticTypeCheckingTestCase implements
StaticCompilationTestSupport {
+ void testUnaryOperationInGString() {
+ assertScript '''
+ class OuterClass {
+ int counter
+
+ def call() {
+ { ->
+ "Hello${++counter}World"
+ }.call()
+ }
+ }
+ assert new OuterClass().call() == 'Hello1World'
Review comment:
Could you add a test case to cover `counter++` ?
----------------------------------------------------------------
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]