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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3120?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 `75.00000%` with `1 line` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.1037%. Comparing base 
([`cd944a5`](https://app.codecov.io/gh/apache/groovy/commit/cd944a5f0ee353126e6f6a484f574b4b53e555fd?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`0658c60`](https://app.codecov.io/gh/apache/groovy/commit/0658c60e30fbb7fca28514a435f788561eaec17c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3120?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...oovy/transform/trait/TraitReceiverTransformer.java](https://app.codecov.io/gh/apache/groovy/pull/3120?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Ftrait%2FTraitReceiverTransformer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS90cmFpdC9UcmFpdFJlY2VpdmVyVHJhbnNmb3JtZXIuamF2YQ==)
 | 75.0000% | [1 Missing :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3120?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/3120/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/3120?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3120        +/-   ##
   ==================================================
   + Coverage     74.1016%   74.1037%   +0.0020%     
   - Complexity      43596      43597         +1     
   ==================================================
     Files            1692       1692                
     Lines          149245     149245                
     Branches        28284      28283         -1     
   ==================================================
   + Hits           110593     110596         +3     
     Misses          28475      28475                
   + Partials        10177      10174         -3     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3120?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...oovy/transform/trait/TraitReceiverTransformer.java](https://app.codecov.io/gh/apache/groovy/pull/3120?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Ftrait%2FTraitReceiverTransformer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS90cmFpdC9UcmFpdFJlY2VpdmVyVHJhbnNmb3JtZXIuamF2YQ==)
 | `88.3249% <75.0000%> (-0.5076%)` | :arrow_down: |
   
   ... and [12 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3120/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>




> Assigning a static trait property named name, module, componentType or 
> packageName from a static trait method fails
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12593
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12593
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 4.0.33, 5.0.8, 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> trait T {
>     static String name = 'x'
>     static void w() { name = 'y' } // same with this.name = 'y', name += 'y', 
> or inside a closure or lambda
> }
> class C implements T {}
> C.w()
> assert C.name == 'y'
> {code}
> Actual (dynamic):
> {noformat}
> groovy.lang.MissingMethodException: No signature of static method: 
> java_lang_Object__name$set for class: C is applicable for argument types: 
> (String) values: [y]
> {noformat}
> Actual (@TypeChecked or @CompileStatic):
> {noformat}
> [Static type checking] - Cannot find matching method 
> java.lang.Class#java_lang_Object__name$set(java.lang.String) or static method 
> T#java_lang_Object__name$set(java.lang.String). Please check if the declared 
> type is correct and if the method exists.
> {noformat}
> Expected: the assignment sets the static property, as it does for any other 
> property name. The same happens for {{module}}, {{componentType}} and 
> {{packageName}}. Reads, and assignments from instance trait methods, work.
> Cause: in a static trait method the receiver is typed as Class of T, and 
> {{TraitReceiverTransformer.tryGetFieldNode}} looked the field up on that type 
> before the trait. It found the private field of {{java.lang.Class}} with that 
> name, so the transformer generated a call to a setter named after {{Object}}.
> Seen in 4.0.33, 5.0.8 and 6.0.0 (dynamic).
> PR: https://github.com/apache/groovy/pull/3120



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

Reply via email to