[
https://issues.apache.org/jira/browse/GROOVY-12446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18126047#comment-18126047
]
ASF GitHub Bot commented on GROOVY-12446:
-----------------------------------------
codecov-commenter commented on PR #2974:
URL: https://github.com/apache/groovy/pull/2974#issuecomment-6108635963
##
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2974?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 `39.13043%` with `14 lines` in your changes missing
coverage. Please review.
:white_check_mark: Project coverage is 71.5961%. Comparing base
([`5d37b46`](https://app.codecov.io/gh/apache/groovy/commit/5d37b46bbec1750910a9959bc155345f2e91d515?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
to head
([`ba8b534`](https://app.codecov.io/gh/apache/groovy/commit/ba8b53422d38fff29d09e3b824bcf7f256efe54b?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/2974?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Patch % | Lines |
|---|---|---|
|
[...s/groovy/transform/stc/SignatureCodecVersion1.java](https://app.codecov.io/gh/apache/groovy/pull/2974?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FSignatureCodecVersion1.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU2lnbmF0dXJlQ29kZWNWZXJzaW9uMS5qYXZh)
| 39.1304% | [8 Missing and 6 partials :warning:
](https://app.codecov.io/gh/apache/groovy/pull/2974?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/2974?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #2974 +/- ##
==================================================
- Coverage 71.6089% 71.5961% -0.0127%
+ Complexity 38063 38058 -5
==================================================
Files 1588 1588
Lines 137078 137094 +16
Branches 25507 25511 +4
==================================================
- Hits 98160 98154 -6
- Misses 30014 30026 +12
- Partials 8904 8914 +10
```
| [Files with missing
lines](https://app.codecov.io/gh/apache/groovy/pull/2974?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
| Coverage Δ | |
|---|---|---|
|
[...s/groovy/transform/stc/SignatureCodecVersion1.java](https://app.codecov.io/gh/apache/groovy/pull/2974?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Ftransform%2Fstc%2FSignatureCodecVersion1.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L3RyYW5zZm9ybS9zdGMvU2lnbmF0dXJlQ29kZWNWZXJzaW9uMS5qYXZh)
| `61.9718% <39.1304%> (-5.4885%)` | :arrow_down: |
... and [12 files with indirect coverage
changes](https://app.codecov.io/gh/apache/groovy/pull/2974/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>
> STC: stop writing UnionTypeClassNode into inferred-return signatures
> --------------------------------------------------------------------
>
> Key: GROOVY-12446
> URL: https://issues.apache.org/jira/browse/GROOVY-12446
> Project: Groovy
> Issue Type: Improvement
> Reporter: Daniel Sun
> Priority: Major
>
> h2. Context
> {{UnionTypeClassNode}} is a checker-only {{ClassNode}}. It represents a flow
> type such as {{x instanceof A}} or {{x instanceof B}}. Its Javadoc says it
> must not leak outside the type checker.
> {{SignatureCodecVersion1}} encodes an inferred return type as a Base64
> {{DataOutputStream}} payload for {{@TypeChecked.TypeCheckingInfo}}. The first
> UTF string in that payload is the simple name of the stored {{ClassNode}}
> subclass.
> GROOVY-12445 locked the unknown-version rule and left union payload layout as
> separate work. The compiler has not written {{@TypeCheckingInfo}}
> inferred-return annotations since GROOVY-6401. There is no production reader
> today. The codec still has to define what that payload may contain.
> h2. Problem
> {{doEncode}} wrote the tag {{UnionTypeClassNode}}, then the arm count, then
> each arm. {{doDecode}} rebuilt a {{UnionTypeClassNode}}. That round-trips a
> checker-only node through a class-file annotation.
> A union name is synthetic and is not a binary name. A later reader that
> treated the decoded node as a loadable type would see a name
> {{Class.forName}} cannot resolve.
> h2. Contract
> Version {{1}} stays version {{1}}. Newly encoded signatures never start with
> the {{UnionTypeClassNode}} tag.
> On encode, a union is replaced with a type that has a stable binary name,
> then that type is encoded:
> * the lowest upper bound of the arms, unwrapped until a real class or
> interface remains
> * {{Object}} if there is no such type: empty arms, a
> {{LowestUpperBoundClassNode}} whose superclass is {{Object}}, or a name that
> is empty or starts with '<'
> A {{LowestUpperBoundClassNode}} supplied directly still round-trips,
> including its interfaces. The primitive encoding tail (array flag, type
> descriptor, generics) is unchanged.
> On decode, a historical payload whose first tag is {{UnionTypeClassNode}} is
> still consumed. The arms are decoded, then widened by the same rule. An arm
> count of {{0}} or less decodes as {{Object}}.
> ||Input||Encode writes||Decode returns||
> |disjoint types, e.g. {{String}} and {{List}}|{{Object}}; first tag is not
> {{UnionTypeClassNode}}|{{Object}}|
> |{{RuntimeException}} and {{Exception}}|{{Exception}}|{{Exception}}|
> |two types that share one interface|that interface|that interface|
> |historical {{UnionTypeClassNode}} tag|(read path only)|same widening|
> |direct {{LowestUpperBoundClassNode}}|LUB tag, as today|same LUB node|
> Callers of {{SignatureCodecVersion1.decode}} that expected a union node now
> receive the shared supertype. Method descriptors are unchanged, so
> {{japicmp}} does not report this.
> h2. Touch points
> * {{org.codehaus.groovy.transform.stc.SignatureCodecVersion1}} — encode and
> historical decode
> *
> {{src/test/groovy/org/codehaus/groovy/transform/stc/SignatureCodecTest.groovy}}
> — stable-bound and historical-payload tests
> * {{COMPATIBILITY.md}} — behavioural-change note
> h2. Scope
> This issue covers union payload layout only. The unknown-version rule is
> GROOVY-12445. Rewiring {{addTypeCheckingInfoAnnotation}} onto
> {{startMethodInference}}, and a new compiler diagnostic, remain separate work.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)