[ https://issues.apache.org/jira/browse/GROOVY-11681?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18004512#comment-18004512 ]
ASF GitHub Bot commented on GROOVY-11681: ----------------------------------------- codecov-commenter commented on PR #2262: URL: https://github.com/apache/groovy/pull/2262#issuecomment-3058431321 ## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2262?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report Attention: Patch coverage is `75.00000%` with `2 lines` in your changes missing coverage. Please review. > Project coverage is 69.0809%. Comparing base [(`c7cc2a0`)](https://app.codecov.io/gh/apache/groovy/commit/c7cc2a069a7e41762b4c7c00bb7b1b676af7a5e6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`f93c8e0`)](https://app.codecov.io/gh/apache/groovy/commit/f93c8e07b7204df25adfda7fca965a632bcd226c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache). > Report is 1 commits behind head on master. | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2262?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines | |---|---|---| | [...a/org/codehaus/groovy/runtime/MetaClassHelper.java](https://app.codecov.io/gh/apache/groovy/pull/2262?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FMetaClassHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvTWV0YUNsYXNzSGVscGVyLmphdmE=) | 71.4286% | [0 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2262?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | <details><summary>Additional details and impacted files</summary> [](https://app.codecov.io/gh/apache/groovy/pull/2262?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## master #2262 +/- ## ================================================== + Coverage 69.0468% 69.0809% +0.0341% - Complexity 29770 29827 +57 ================================================== Files 1423 1423 Lines 114431 114541 +110 Branches 19834 19893 +59 ================================================== + Hits 79011 79126 +115 + Misses 28777 28776 -1 + Partials 6643 6639 -4 ``` | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2262?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [.../codehaus/groovy/runtime/DefaultGroovyMethods.java](https://app.codecov.io/gh/apache/groovy/pull/2262?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FDefaultGroovyMethods.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvRGVmYXVsdEdyb292eU1ldGhvZHMuamF2YQ==) | `74.7433% <100.0000%> (+0.0074%)` | :arrow_up: | | [...a/org/codehaus/groovy/runtime/MetaClassHelper.java](https://app.codecov.io/gh/apache/groovy/pull/2262?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fruntime%2FMetaClassHelper.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3J1bnRpbWUvTWV0YUNsYXNzSGVscGVyLmphdmE=) | `39.1685% <71.4286%> (-0.1328%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2262/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) </details> <details><summary> :rocket: New features to boost your workflow: </summary> - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems. - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges. </details> > Return statement throws a compile error inside a closure > -------------------------------------------------------- > > Key: GROOVY-11681 > URL: https://issues.apache.org/jira/browse/GROOVY-11681 > Project: Groovy > Issue Type: Bug > Components: Static compilation > Affects Versions: 5.0.0-beta-1 > Reporter: Saravanan > Assignee: Eric Milles > Priority: Major > > > I am not sure what's going on here, the first call to myOther() succeeds > during compilation, but the call to the submit method shows this error (after > static compile was applied, during class gen) > {code:java} > import java.util.concurrent.Callable; > import java.util.concurrent.Executors; > public class RecordTesting { > public <T> T myOther(Callable<T> callable) { > } > public void myFunction() { > myOther(() -> { > return "blah"; > }) > Executors.newSingleThreadExecutor().submit(() -> { > return "blah"; > }); > } > } > {code} > > {noformat} > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > General error during instruction selection: Cannot use return statement with > an expression on a method that returns void > . At [17:13] > testdata/plugins/records/RecordTesting.javaorg.codehaus.groovy.syntax.RuntimeParserException: > Cannot use return statement with an expression on a method that returns void > . At [17:13] testdata/plugins/records/RecordTesting.java > at > org.codehaus.groovy.classgen.AsmClassGenerator.throwException(AsmClassGenerator.java:2450) > at > org.codehaus.groovy.classgen.asm.StatementWriter.writeReturn(StatementWriter.java:603) > at > org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmClassGenerator.java:885) > at > org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:73) > at > org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:91) > at > org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter.writeBlockStatement(StaticTypesStatementWriter.java:79) > at > org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:815) > at > org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:72){noformat} > The error goes away if I cast the lambda to a callable like this > {code:java} > Executors.newSingleThreadExecutor().submit((Callable<String>) () -> { return > "blah"; }); > {code} > -- This message was sent by Atlassian Jira (v8.20.10#820010)