[
https://issues.apache.org/jira/browse/GROOVY-12672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137496#comment-18137496
]
ASF GitHub Bot commented on GROOVY-12672:
-----------------------------------------
codecov-commenter commented on PR #3193:
URL: https://github.com/apache/groovy/pull/3193#issuecomment-6612188953
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/3193?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 `0%` with `1 line` in your changes missing coverage.
Please review.
:white_check_mark: Project coverage is 74.1519%. Comparing base
([`0941dba`](https://app.codecov.io/gh/apache/groovy/commit/0941dbacf496a1667c27681c6fe76deee59bfb57?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`b1bd8dc`](https://app.codecov.io/gh/apache/groovy/commit/b1bd8dcfcbcbb8f883b82b85a3f44112536c99a5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 11 commits behind head on master.
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3193?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Patch % | Lines |
|---|---|---|
|
[...ovy/classgen/asm/sc/StaticTypesLambdaAnalyzer.java](https://app.codecov.io/gh/apache/groovy/pull/3193?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesLambdaAnalyzer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0xhbWJkYUFuYWx5emVyLmphdmE=)
| 0.0000% | [0 Missing and 1 partial :warning:
](https://app.codecov.io/gh/apache/groovy/pull/3193?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>
[](https://app.codecov.io/gh/apache/groovy/pull/3193?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3193 +/- ##
==================================================
- Coverage 74.1533% 74.1519% -0.0013%
- Complexity 43751 43752 +1
==================================================
Files 1692 1692
Lines 149516 149516
Branches 28366 28366
==================================================
- Hits 110871 110869 -2
Misses 28448 28448
- Partials 10197 10199 +2
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/3193?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...ovy/classgen/asm/sc/StaticTypesLambdaAnalyzer.java](https://app.codecov.io/gh/apache/groovy/pull/3193?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2Fasm%2Fsc%2FStaticTypesLambdaAnalyzer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL2FzbS9zYy9TdGF0aWNUeXBlc0xhbWJkYUFuYWx5emVyLmphdmE=)
| `90.9639% <0.0000%> (ø)` | |
... and [15 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/3193/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: a lambda that reads delegate, owner, resolveStrategy or
> maximumNumberOfParameters throws ClassCastException
> ---------------------------------------------------------------------------------------------------------------
>
> Key: GROOVY-12672
> URL: https://issues.apache.org/jira/browse/GROOVY-12672
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 7.0.0-alpha-1, 6.0.0
> Reporter: Scott Murphy Heiberg
> Priority: Major
>
> {code:groovy}
> import groovy.transform.CompileStatic
> import java.util.function.Supplier
> @CompileStatic
> class C {
> def m() {
> Supplier<Object> s = () -> delegate
> s.get()
> }
> }
> assert new C().m() instanceof C
> {code}
> *Actual:* {{java.lang.ClassCastException: class java.lang.Class cannot be
> cast to class C$_m_lambda1}}. The same happens for {{owner}},
> {{maximumNumberOfParameters}}, {{resolveStrategy}}, {{parameterTypes}},
> {{directive}} and {{metaClass}}, in instance and static methods, in nested
> lambdas and in a lambda inside a closure. Assigning {{resolveStrategy}} fails
> with {{NoSuchMethodException: java.lang.Class.setProperty}}.
> *Expected:* the property is read from the lambda. {{delegate}} and {{owner}}
> are the enclosing object, as for {{thisObject}} and as the type checker
> infers; in a static method they are the class. 4.0.33 and 5.0.8 do not throw;
> they return the class for {{delegate}} and {{owner}}.
> Cause: since GROOVY-11905, a lambda that does not touch the enclosing
> instance gets a static {{doCall}}. Only {{this}}, {{super}} and
> {{thisObject}} counted as such access ({{StaticTypesLambdaAnalyzer}}), so a
> closure property is read from the enclosing Class instead of the lambda.
> Verified: 6.0.0 and master affected; 4.0.33 and 5.0.8 not affected.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)