[ 
https://issues.apache.org/jira/browse/GROOVY-10355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18105787#comment-18105787
 ] 

ASF GitHub Bot commented on GROOVY-10355:
-----------------------------------------

testlens-app[bot] commented on PR #2817:
URL: https://github.com/apache/groovy/pull/2817#issuecomment-5337943673

   ## ✅ All tests passed ✅
   
   🏷️ Commit: 96b0192a3c0b197333f5e9fbd41ffbeb678fac2f
   ▶️ Tests:  110641 executed
   ⚪️ Checks: 31/31 completed
   
   ---
   _Learn more about TestLens at [testlens.app](https://testlens.app)._
   




> Compiler interpret variable name  as class name when in parentheses.
> --------------------------------------------------------------------
>
>                 Key: GROOVY-10355
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10355
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser-antlr4
>    Affects Versions: 3.0.0, 4.0.0, 5.0.0
>         Environment: JDK 11.0.12
>            Reporter: Olof Asbrink
>            Priority: Major
>         Attachments: GROOVY-10355-Assessment.pdf, screenshot-1.png, 
> screenshot-2.png
>
>
> This behavior seems unexpected:
> {code:java}
> String b = "B"
> System.out.println("A" + (b) + "C")
> {code}
> Throws this exception:
> {code:java}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> /tmp/repo1.gm: 2: unable to resolve class b
>  @ line 2, column 26.
>    System.out.println("A" + (b) + "C")
>                             ^{code}
> However these examples work:
> {code:java}
> String b = "B"
> System.out.println("A" + b + "C")
> {code}
> and
> {code:java}
> String b = "B"
> System.out.println("A" + (b))
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to