You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "paulk-asert (via GitHub)" <gi...@apache.org> on 2026/07/12 13:22:07 UTC

[PR] GROOVY-12154: box primitive lambda param when the target SAM param is… [groovy]

paulk-asert opened a new pull request, #2697:
URL: https://github.com/apache/groovy/pull/2697

   … a reference type
   
   A @CompileStatic lambda declaring a primitive parameter (e.g. (int a) -> ...) against a generic functional interface (e.g. Function<Integer,Integer>) compiled cleanly but threw at runtime:
   
     java.lang.invoke.LambdaConversionException:
       int is not a subtype of class java.lang.Object
   
   AbstractFunctionalInterfaceWriter.convertParameterType always emitted a primitive implementation-method parameter when the lambda declared a primitive, ignoring the target (functional-interface) parameter type. But LambdaMetafactory links against the erased SAM signature (Object) and will not unbox to a primitive, so the implementation method must accept the boxed type when the SAM parameter is a reference type. It stays primitive only when the SAM parameter is itself primitive (e.g. IntUnaryOperator), preserving GROOVY-9790.


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

To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GROOVY-12154: box primitive lambda param when the target SAM param is… [groovy]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #2697:
URL: https://github.com/apache/groovy/pull/2697#issuecomment-4951429166

   ## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2697?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 69.1047%. Comparing base ([`c9363db`](https://app.codecov.io/gh/apache/groovy/commit/c9363dba83711e0b680546e275294a5ac1836485?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e27f3d3`](https://app.codecov.io/gh/apache/groovy/commit/e27f3d357d01fc902cd9526b93b92b4bb54eca89?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 3 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree graph](https://app.codecov.io/gh/apache/groovy/pull/2697/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2697?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2697        +/-   ##
   ==================================================
   - Coverage     69.1083%   69.1047%   -0.0036%     
   - Complexity      34235      34236         +1     
   ==================================================
     Files            1537       1537                
     Lines          129310     129311         +1     
     Branches        23478      23479         +1     
   ==================================================
   - Hits            89364      89360         -4     
   - Misses          31936      31941         +5     
     Partials         8010       8010                
   ```
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2697?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [...sgen/asm/sc/AbstractFunctionalInterfaceWriter.java](https://app.codecov.io/gh/apache/groovy/pull/2697?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FAbstractFunctionalInterfaceWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9BYnN0cmFjdEZ1bmN0aW9uYWxJbnRlcmZhY2VXcml0ZXIuamF2YQ==) | `94.1606% <100.0000%> (+1.5135%)` | :arrow_up: |
   
   ... and [7 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2697/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>


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

To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GROOVY-12154: box primitive lambda param when the target SAM param is… [groovy]

Posted by "paulk-asert (via GitHub)" <gi...@apache.org>.
paulk-asert merged PR #2697:
URL: https://github.com/apache/groovy/pull/2697


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

To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GROOVY-12154: box primitive lambda param when the target SAM param is… [groovy]

Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #2697:
URL: https://github.com/apache/groovy/pull/2697#issuecomment-4951487136

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


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

To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org