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

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

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

   ## 🚨 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/42470821662/job/128700915309?pr=3254)
   ❌ [Build and test / lts \(25, 
ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42470821662/job/128700915488?pr=3254)
   ❌ [Build and test for coverage / 
test](https://github.com/apache/groovy/actions/runs/42470821637/job/128700915213?pr=3254)
   ❌ [Check licenses / test 
\(ubuntu-latest\)](https://github.com/apache/groovy/actions/runs/42470821606/job/128700915053?pr=3254)
   ❌ [CodeQL / Analyze \(java, 
21\)](https://github.com/apache/groovy/actions/runs/42470821632/job/128700915134?pr=3254)
   ❌ [Generate SNAPSHOT distributions / 
dist](https://github.com/apache/groovy/actions/runs/42470821639/job/128700914973?pr=3254)
   ❌ [Lint gate / 
lint](https://github.com/apache/groovy/actions/runs/42470821640/job/128700915144?pr=3254)
   ❌ [Performance check / 
test](https://github.com/apache/groovy/actions/runs/42470821616/job/128700914913?pr=3254)
   ❌ [jmh / test \(core-ag, 
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42470821627/job/128700915210?pr=3254)
   ❌ [jmh / test \(core-hz, 
\\\\.perf\\\\.[H-Z]\)](https://github.com/apache/groovy/actions/runs/42470821627/job/128700915278?pr=3254)
   ❌ [jmh / test \(grails-ad, 
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42470821627/job/128700915286?pr=3254)
   ❌ [jmh / test \(grails-ez, 
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42470821627/job/128700915133?pr=3254)
   ❌ [jmh-classic / 
summary](https://github.com/apache/groovy/actions/runs/42470821728/job/128700984941?pr=3254)
   ❌ [jmh-classic / test \(bench, 
\\\\.bench\\\\.\)](https://github.com/apache/groovy/actions/runs/42470821728/job/128700915561?pr=3254)
   ❌ [jmh-classic / test \(core-ag, 
\\\\.perf\\\\.[A-G]\)](https://github.com/apache/groovy/actions/runs/42470821728/job/128700915541?pr=3254)
   ❌ [jmh-classic / test \(core-hz, 
\\\\.perf\\\\.[H-Z]\)](https://github.com/apache/groovy/actions/runs/42470821728/job/128700915608?pr=3254)
   ❌ [jmh-classic / test \(grails-ad, 
\\\\.perf\\\\.grails\\\\.[A-D]\)](https://github.com/apache/groovy/actions/runs/42470821728/job/128700915637?pr=3254)
   ❌ [jmh-classic / test \(grails-ez, 
\\\\.perf\\\\.grails\\\\.[E-Z]\)](https://github.com/apache/groovy/actions/runs/42470821728/job/128700915622?pr=3254)
   
   🏷️ Commit: e52f9b715b04b8e3d430be773ac99cf450753dc4
   ▶️ Tests:  818 executed
   🟡 Checks: 20/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/)._
   




> Script: @Override on a script's own run() method is copied to the script 
> class and rejected ("not allowed on element TYPE")
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12720
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12720
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> A script may declare its own no-argument {{run()}}: 
> {{ModuleNode.createStatementsClass}} keeps it instead of generating one, and 
> copies its annotations to the script class so that, for example, 
> {{@CompileStatic}} on {{run()}} applies to the whole class. Every annotation 
> is copied, including {{@Override}}, whose only target is METHOD:
> {code:groovy}
> class PriceRules { int quotes = 0 }
> @Override
> Object run() {
>     println new PriceRules().quotes
>     null
> }
> {code}
> Expected: compiles and runs; the method does override 
> {{groovy.lang.Script#run()}}. Actual, on 6.0.0 and master:
> {noformat}
> script.groovy: 5: Annotation @java.lang.Override is not allowed on element 
> TYPE
> {noformat}
> The same script with {{@Deprecated}} compiles, and {{@Override}} on any other 
> script method is checked as usual ("does not override method from its 
> superclass").
> Proposed fix: when the method's annotations are copied to the class, leave 
> {{@Override}} out; it stays on the method, where it is correct. The other 
> annotations keep moving to the class as before.
> Found while scoring Groovy 6.0.0 code written by a language model: told that 
> the file is compiled with static type checking, it declared the script's 
> {{run()}} with {{@Override}} and {{@TypeChecked}}, and was given an error 
> about an element it had not annotated.



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

Reply via email to