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

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

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

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3297?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 `85.42857%` with `51 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 74.5208%. Comparing base 
([`0b455da`](https://app.codecov.io/gh/apache/groovy/commit/0b455da1f570a2ecdf51620215396ba6f6460672?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`8c291d4`](https://app.codecov.io/gh/apache/groovy/commit/8c291d45f0522cd82f49aca81b3574c1a7885357?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3297?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/3297?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==)
 | 83.4356% | [4 Missing and 23 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nVmlzaXRvci5qYXZh)
 | 78.9474% | [0 Missing and 8 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...oovy/transform/stc/TraitTypeCheckingExtension.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FTraitTypeCheckingExtension.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvVHJhaXRUeXBlQ2hlY2tpbmdFeHRlbnNpb24uamF2YQ==)
 | 85.7143% | [1 Missing and 7 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...groovy/classgen/asm/sc/StaticInvocationWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticInvocationWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNJbnZvY2F0aW9uV3JpdGVyLmphdmE=)
 | 88.3721% | [1 Missing and 4 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...groovy/transform/trait/TraitASTTransformation.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Ftrait%2FTraitASTTransformation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS90cmFpdC9UcmFpdEFTVFRyYW5zZm9ybWF0aW9uLmphdmE=)
 | 93.3333% | [0 Missing and 2 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[...ovy/classgen/asm/sc/StaticTypesCallSiteWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesCallSiteWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0NhbGxTaXRlV3JpdGVyLmphdmE=)
 | 66.6667% | [0 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/3297?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/3297/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/3297?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #3297        +/-   ##
   ==================================================
   + Coverage     74.4894%   74.5208%   +0.0314%     
   - Complexity      44906      45094       +188     
   ==================================================
     Files            1703       1703                
     Lines          152180     152493       +313     
     Branches        29166      29290       +124     
   ==================================================
   + Hits           113358     113639       +281     
     Misses          28408      28408                
   - Partials        10414      10446        +32     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/3297?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/classgen/VariableScopeVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FVariableScopeVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL1ZhcmlhYmxlU2NvcGVWaXNpdG9yLmphdmE=)
 | `92.4051% <100.0000%> (+0.1097%)` | :arrow_up: |
   | 
[...ovy/classgen/asm/sc/StaticTypesCallSiteWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesCallSiteWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0NhbGxTaXRlV3JpdGVyLmphdmE=)
 | `78.0992% <66.6667%> (+0.0453%)` | :arrow_up: |
   | 
[...groovy/transform/trait/TraitASTTransformation.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Ftrait%2FTraitASTTransformation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS90cmFpdC9UcmFpdEFTVFRyYW5zZm9ybWF0aW9uLmphdmE=)
 | `92.5065% <93.3333%> (-0.0143%)` | :arrow_down: |
   | 
[...groovy/classgen/asm/sc/StaticInvocationWriter.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticInvocationWriter.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNJbnZvY2F0aW9uV3JpdGVyLmphdmE=)
 | `78.3362% <88.3721%> (+0.8081%)` | :arrow_up: |
   | 
[...roovy/transform/stc/StaticTypeCheckingVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FStaticTypeCheckingVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU3RhdGljVHlwZUNoZWNraW5nVmlzaXRvci5qYXZh)
 | `88.0151% <78.9474%> (+0.0462%)` | :arrow_up: |
   | 
[...oovy/transform/stc/TraitTypeCheckingExtension.java](https://app.codecov.io/gh/apache/groovy/pull/3297?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FTraitTypeCheckingExtension.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvVHJhaXRUeXBlQ2hlY2tpbmdFeHRlbnNpb24uamF2YQ==)
 | `83.4646% <85.7143%> (+2.4519%)` | :arrow_up: |
   | 
[...oovy/transform/trait/TraitReceiverTransformer.java](https://app.codecov.io/gh/apache/groovy/pull/3297?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==)
 | `86.1272% <83.4356%> (-2.6483%)` | :arrow_down: |
   
   ... and [20 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/3297/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>




> Trait code reads a plain static accessor as a property through the 
> implementing class in dynamic and @TypeChecked code, but declarer-bound under 
> @CompileStatic and in the method form
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-12614
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12614
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 6.0.0
>            Reporter: Scott Murphy Heiberg
>            Priority: Major
>
> {code:groovy}
> trait T {
>     static String getLabel() { 'trait' }
>     static String sm() { label }        // property form
>     static String sm2() { getLabel() }  // method form
> }
> class C implements T { static String getLabel() { 'impl' } }
> class D implements T {}
> println([C.sm(), D.sm(), C.sm2(), D.sm2()])
> {code}
> Dynamic and @TypeChecked: [impl, trait, trait, trait]
> @CompileStatic: [trait, trait, trait, trait]
> The property form of a plain (non-@Virtual) static accessor, read from trait 
> code, dispatches through the implementing class in dynamic and type-checked 
> code, but is declarer-bound under static compilation, and the method form is 
> declarer-bound in every mode. The same holds for this.label, for an instance 
> trait method, inside closures, and for an accessor of a super trait. A 
> field-backed static property is declarer-bound in all modes.
> The traits guide says public statics are declarer-bound by default for calls 
> from other trait code and that @Virtual opts into implementing-class dispatch 
> ("For overridable static data rather than behaviour, use a @Virtual 
> accessor"). VirtualAnnotationTest/TraitStaticDispatchMatrix row09vget adds 
> @Virtual to get exactly the override-visible property read. But 
> TraitStaticDispatchMatrix.row09acc_accessorPattern_overrideVisibleToTraitBody 
> asserts the dynamic behaviour ("origin is class" for a plain accessor), with 
> a comment pointing at row 1's dispatch path, which since "GROOVY-12093 
> adjusted: out with @Anchored in with @Virtual" requires @Virtual. row09acc 
> looks like it predates that change.
> Question: which is intended? If declarer-bound is the rule, 
> TraitReceiverTransformer should call the helper for a property read or write 
> of a plain static accessor, as it does for the method form, and row09acc 
> should expect "origin is trait" (or move to @Virtual). If row09acc is the 
> rule, static compilation and the method form disagree with it. I can provide 
> the PR either way.
> Seen in 6.0.0 and on master.



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

Reply via email to