[
https://issues.apache.org/jira/browse/GROOVY-11803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18039472#comment-18039472
]
ASF GitHub Bot commented on GROOVY-11803:
-----------------------------------------
codecov-commenter commented on PR #2338:
URL: https://github.com/apache/groovy/pull/2338#issuecomment-3554673440
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2338?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 66.9900%. Comparing base
([`fd43443`](https://app.codecov.io/gh/apache/groovy/commit/fd43443ca9c64d1e83769f76f646362584aec411?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`a8d8956`](https://app.codecov.io/gh/apache/groovy/commit/a8d8956787f27a726ed496524823da0780bcd36f?dropdown=coverage&el=desc&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/2338?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2338 +/- ##
==================================================
- Coverage 66.9908% 66.9900% -0.0008%
+ Complexity 29333 29330 -3
==================================================
Files 1382 1382
Lines 116607 116604 -3
Branches 20429 20430 +1
==================================================
- Hits 78116 78113 -3
Misses 32058 32058
Partials 6433 6433
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2338?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[src/main/java/groovy/lang/MetaClassImpl.java](https://app.codecov.io/gh/apache/groovy/pull/2338?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fgroovy%2Flang%2FMetaClassImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9ncm9vdnkvbGFuZy9NZXRhQ2xhc3NJbXBsLmphdmE=)
| `78.2369% <100.0000%> (-0.0359%)` | :arrow_down: |
... and [2 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2338/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>
> Property shorthand not working for default methods in interfaces without
> @CompileStatic
> ---------------------------------------------------------------------------------------
>
> Key: GROOVY-11803
> URL: https://issues.apache.org/jira/browse/GROOVY-11803
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
> Assignee: Eric Milles
> Priority: Major
>
> The following script fails:
> {code:groovy}
> interface Foo {
> default int barSize() { bar.size() }
> String getBar()
> }
> class Baz implements Foo {
> String getBar() { 'BAR' }
> }
> assert new Baz().barSize() == 3
> {code}
> With this error:
> {noformat}
> groovy.lang.MissingPropertyException: No such property: bar for class: Baz
> {noformat}
> Workaround 1: Use getter:
> {code:groovy}
> interface Foo {
> default int barSize() { getBar().size() }
> String getBar()
> }
> class Baz implements Foo {
> String getBar() { 'BAR' }
> }
> assert new Baz().barSize() == 3
> {code}
> Workaround 2: use @CompileStatic:
> {code:groovy}
> @groovy.transform.CompileStatic
> interface Foo {
> default int barSize() { bar.size() }
> String getBar()
> }
> class Baz implements Foo {
> String getBar() { 'BAR' }
> }
> assert new Baz().barSize() == 3
> {code}
> I think this is a bug but if we can't get this to work for dynamic Groovy, I
> think we need to improve the documentation.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)