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

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

codecov-commenter commented on PR #3022:
URL: https://github.com/apache/groovy/pull/3022#issuecomment-6390389764

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3022?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `87.50000%` with `2 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 72.5251%. Comparing base 
([`98c2f9f`](https://app.codecov.io/gh/apache/groovy/commit/98c2f9f106d2ee368278ca33d105e540bf23baf0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`d5395be`](https://app.codecov.io/gh/apache/groovy/commit/d5395be5255da3cbbad8d99ce654e42f732fa8a0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 4 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3022?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...sc/StaticTypesMethodReferenceExpressionWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3022?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesMethodReferenceExpressionWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc01ldGhvZFJlZmVyZW5jZUV4cHJlc3Npb25Xcml0ZXIuamF2YQ==)
 | 87.5000% | [0 Missing and 2 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3022?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>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/3022/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/3022?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3022        +/-   ##
   ==================================================
   + Coverage     72.5157%   72.5251%   +0.0094%     
   - Complexity      40761      40790        +29     
   ==================================================
     Files            1644       1644                
     Lines          143027     143054        +27     
     Branches        26899      26906         +7     
   ==================================================
   + Hits           103717     103750        +33     
   + Misses          29759      29750         -9     
   - Partials         9551       9554         +3     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3022?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...sc/StaticTypesMethodReferenceExpressionWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3022?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesMethodReferenceExpressionWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc01ldGhvZFJlZmVyZW5jZUV4cHJlc3Npb25Xcml0ZXIuamF2YQ==)
 | `89.2265% <87.5000%> (-0.1107%)` | :arrow_down: |
   
   ... and [18 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3022/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>




> SC: constructor reference calls the constructor through the meta-class 
> instead of directly
> ------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12488
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12488
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static compilation
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> Under {{@CompileStatic}}, a constructor reference such as {{Made::new}} is 
> implemented by a synthetic method {{ctorRef$<method>$<n>}} on the enclosing 
> class, which the LambdaMetafactory call site targets. That method is not 
> statically compiled:
> {noformat}
> private static final Made ctorRef$ctorRef$0();
>    0: ldc           class Made
>    2: invokedynamic init:(Ljava/lang/Class;)Ljava/lang/Object;
>    7: invokedynamic cast:(Ljava/lang/Object;)LMade;
>   12: areturn
> {noformat}
> So every call selects the constructor through the meta-class at run time, 
> while other method references ({{String::length}}, {{Math::abs}}) link their 
> target directly. In a GraalVM native image the constructor also needs 
> reflection metadata although the code is statically compiled.
> The cause is 
> {{StaticTypesMethodReferenceExpressionWriter.addSyntheticMethodForConstructorReference}}:
>  it builds the constructor call without a target constructor and sets 
> {{STATIC_COMPILE_NODE}} to false (there is a TODO for it).
> Proposed fix: select the constructor at compile time from the functional 
> interface's parameter types, as for a constructor call expression, and call 
> it directly. Keep the run-time selection when no single constructor matches 
> (GROOVY-10971) and for a protected constructor in another package. As with 
> other method references and with Java, the constructor is then chosen from 
> the declared parameter types rather than the run-time argument types.
> PR: https://github.com/apache/groovy/pull/3022



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

Reply via email to