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

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

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

   ## 🚨 All tests passed but jobs failed 🚨
   
   ### Failed Jobs without Test Failures
   
   ❌ [Build and test / lts \(21, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42470636053/job/128700318795?pr=3248)
   ❌ [Build and test for coverage / 
test](https://github.com/apache/groovy/actions/runs/42470636016/job/128700318328?pr=3248)
   ❌ [Check licenses / test 
\(ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42470636019/job/128700318287?pr=3248)
   ❌ [CodeQL / Analyze \(java, 
21\)](https://github.com/apache/groovy/actions/runs/42470636129/job/128700318533?pr=3248)
   ❌ [Generate SNAPSHOT artifacts / 
dist](https://github.com/apache/groovy/actions/runs/42470636064/job/128700318249?pr=3248)
   ❌ [Generate SNAPSHOT distributions / 
dist](https://github.com/apache/groovy/actions/runs/42470636118/job/128700318617?pr=3248)
   ❌ [Lint gate / 
lint](https://github.com/apache/groovy/actions/runs/42470636013/job/128700318242?pr=3248)
   ❌ [Performance check / 
test](https://github.com/apache/groovy/actions/runs/42470636095/job/128700318616?pr=3248)
   ❌ [jmh / 
summary](https://github.com/apache/groovy/actions/runs/42470636056/job/128700438703?pr=3248)
   ❌ [jmh / test \(bench, 
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42470636056/job/128700318623?pr=3248)
   ❌ [jmh / test \(core-ag, 
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42470636056/job/128700318705?pr=3248)
   ❌ [jmh / test \(core-hz, 
\\\\.perf\\\\.[H-Z]\)](https://github.com/apache/groovy/actions/runs/42470636056/job/128700318417?pr=3248)
   ❌ [jmh / test \(grails-ad, 
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42470636056/job/128700318631?pr=3248)
   ❌ [jmh / test \(grails-ez, 
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42470636056/job/128700318649?pr=3248)
   ❌ [jmh-classic / test \(bench, 
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42470636097/job/128700319110?pr=3248)
   ❌ [jmh-classic / test \(core-ag, 
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42470636097/job/128700319013?pr=3248)
   ❌ [jmh-classic / test \(grails-ad, 
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42470636097/job/128700319120?pr=3248)
   
   🏷️ Commit: 85443e913ca3547b1003a57d1a4df555f1b945fa
   ▶️ Tests:  0 executed
   🟡 Checks: 19/25 completed
   
   ### Rerun Controls
   
   Click the checkbox to trigger a rerun:
   
   🔲 **Rerun jobs**
   
   ---
   _Learn more about TestLens at 
[testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
   




> A cast applied to await or to an async closure is parsed as a call to a 
> method named await or async
> ---------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12715
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12715
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser-antlr4
>    Affects Versions: 6.0.0
>         Environment: Groovy 6.0.0 binary distribution and master 7379c5720d; 
> BellSoft JDK 21.0.12; macOS 15 arm64
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {{await}} and {{async}} are contextual keywords with their own alternatives 
> in the {{expression}} rule of the grammar ({{awaitExprAlt}}, 
> {{asyncClosureExprAlt}}), but the operand of a cast is parsed by 
> {{castOperandExpression}}, which lists only another cast, a 
> {{postfixExpression}} and the unary operators. So after a cast the two words 
> fall back to being identifiers, and {{(BigDecimal) await(price)}} is a call 
> to a method named {{await}} with one argument, {{(Awaitable<Integer>) async { 
> 7 }}} a call to a method named {{async}} with a closure. At script level that 
> is a {{MissingMethodException}}; inside an async task the exception is 
> swallowed by the task nobody awaits, and the code awaiting the task's result 
> hangs.
> On 6.0.0 and master (JDK 21):
> {code:groovy}
> def t = async { 7 }
> Integer a = (Integer) await t          // MissingMethodException: No 
> signature of method: await for class: Script1 ... 
> (groovy.concurrent.Awaitable)
> {code}
> {code:groovy}
> import groovy.concurrent.Awaitable
> Awaitable<Integer> t = (Awaitable<Integer>) async { 7 }   // 
> MissingMethodException: ... async ... (Script1$_run_closure1)
> {code}
> {code:groovy}
> import groovy.concurrent.DataflowVariable
> DataflowVariable<BigDecimal> price = new DataflowVariable<BigDecimal>()
> DataflowVariable<Integer> quantity = new DataflowVariable<Integer>()
> DataflowVariable<BigDecimal> total = new DataflowVariable<BigDecimal>()
> async {
>     BigDecimal unitPrice = (BigDecimal) await(price)   // parsed as 
> this.await(price): the task fails
>     Integer count = (Integer) await(quantity)
>     total << unitPrice * count
> }
> async { quantity << 4 }
> async { price << 2.50 }
> println await(total)                                  // hangs: total is 
> never bound
> {code}
> The parenthesised forms {{(int) (await t)}} and {{-(await t)}} work, as do 
> {{BigDecimal b = await(price)}} and {{await(price) as BigDecimal}}. Found 
> because Claude Opus 5.5 wrote the cast form in every answer of an eval task 
> under static typing; the script then timed out.
> Suggested fix: add the {{asyncClosureExprAlt}} and {{awaitExprAlt}} 
> alternatives to {{castOperandExpression}} (it uses {{options { baseContext = 
> expression; }}}, so the same labels reuse the same contexts and 
> {{AstBuilder.visitAwaitExprAlt}} and {{visitAsyncClosureExprAlt}} apply 
> unchanged). Pull request to follow.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to