Fiouz commented on a change in pull request #1455:
URL: https://github.com/apache/groovy/pull/1455#discussion_r557568194



##########
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:
       Test modified to verify both prefix and postfix increment




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