You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "paulk-asert (via GitHub)" <gi...@apache.org> on 2026/10/24 03:02:50 UTC
[PR] GROOVY-12486: MonadicChecker types the DO generator variable from the… [groovy]
paulk-asert opened a new pull request, #3020:
URL: https://github.com/apache/groovy/pull/3020
… carrier's first type argument
The bound variable is now typed from the input of the carrier's bind function, resolved against the receiver's type arguments, so Either<L, R> and Validation<E, A> bind R and A instead of L and E.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12486: MonadicChecker types the DO generator variable from the… [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #3020:
URL: https://github.com/apache/groovy/pull/3020#issuecomment-6379629541
## ✅ All tests passed ✅
🏷️ Commit: e40295c190b6bae0f5bffbf18e82dd57e875d51d
▶️ Tests: 123068 executed
⚪️ Checks: 32/32 completed
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12486: MonadicChecker types the DO generator variable from the… [groovy]
Posted by "testlens-app[bot] (via GitHub)" <gi...@apache.org>.
testlens-app[bot] commented on PR #3020:
URL: https://github.com/apache/groovy/pull/3020#issuecomment-6408193551
## 🚨 All tests passed but jobs failed 🚨
### Failed Jobs without Test Failures
❌ [Build and test / lts \(17, macos-latest\)](https://github.com/apache/groovy/actions/runs/40263698611/job/121381326907?pr=3020)
🏷️ Commit: 832f03b384fdc860a57f2d63a965705e07106cfd
▶️ Tests: 110724 executed
🟡 Checks: 30/31 completed
### Rerun Controls
Click the checkbox to trigger a rerun:
🔲 **Rerun jobs**
---
_Learn more about TestLens at [testlens.app/docs](https://testlens.app/docs/features/pr-comment/)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12486: MonadicChecker types the DO generator variable from the… [groovy]
Posted by "paulk-asert (via GitHub)" <gi...@apache.org>.
paulk-asert commented on PR #3020:
URL: https://github.com/apache/groovy/pull/3020#issuecomment-6407704164
Thanks Daniel, and good question on point 4. Looking at it again turned up a regression, now fixed in the latest push.
On ordering: the checker's bindName follows the runtime dispatcher exactly (Comprehensions.resolveMethodName): registry entries (Class-keyed, then name-keyed), then a structural single-arg flatMap, then @Monadic(bind=...). So a class with both a flatMap and @Monadic(bind='chain') binds via flatMap in both places.
On point 3 and point 4: the bound type's position doesn't matter when the bind signature is readable. It's resolved from the bind function's input (`? super A`) whatever slot A occupies, which the @Monadic Tri<E, A, X> test shows. Position only matters in the fallback, used when the bind parameter names no input: a Closure, or a raw Function or fj.F. In that case, falling back to the last type argument regressed carriers like `Box<A, M>` with an untyped `flatMap(Closure)`, which compiled before this PR. The fallback is now the first type argument, as before, so this PR only changes typing when the bind signature gives the answer.
New tests:
- the fallback for a Closure bind and for a raw Function bind, with the bound type first (both fail with the last-argument fallback)
- a bind declared as an interface default method, on a receiver whose type parameters are reordered
- a wildcard receiver, Result<String, ? extends Integer>
- a name-keyed fj.data.Validation<E, T> stub, as suggested on the JIRA
The bind-input tests all fail against the checker before this PR. groovy-macro-library 62/0, groovy-typecheckers 376/0, lintGate clean.
A Closure-typed bind with the bound type last, such as GRes<E, A>, still uses the fallback, as it did before. Static type checking already reads @ClosureParams for a direct call to such a bind, so DO should too. That's GROOVY-12531 for Groovy 7. It needs a decision on how @ClosureParams ranks against the bound-type information that GEP-23's carrier registration may add, so I've kept it out of this PR.
This affects the 6.0.0 allow-list rows (Vavr Either/Validation, Functional Java Validation) and cherry-picks cleanly onto GROOVY_6_0_X, so I plan to backport it to 6.0.1. GROOVY-12485 (the Zazr rows) builds on it: Zazr Either and Validation bind on their last type parameter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12486: MonadicChecker types the DO generator variable from the… [groovy]
Posted by "paulk-asert (via GitHub)" <gi...@apache.org>.
paulk-asert merged PR #3020:
URL: https://github.com/apache/groovy/pull/3020
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GROOVY-12486: MonadicChecker types the DO generator variable from the… [groovy]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #3020:
URL: https://github.com/apache/groovy/pull/3020#issuecomment-6379379192
## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/3020?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 `38.23529%` with `21 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 72.5059%. Comparing base ([`98c2f9f`](https://app.codecov.io/gh/apache/groovy/commit/98c2f9f106d2ee368278ca33d105e540bf23baf0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`e40295c`](https://app.codecov.io/gh/apache/groovy/commit/e40295c190b6bae0f5bffbf18e82dd57e875d51d?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/3020?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...n/groovy/groovy/typecheckers/MonadicChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/3020?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FMonadicChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9Nb25hZGljQ2hlY2tlci5ncm9vdnk=) | 38.2353% | [4 Missing and 17 partials :warning: ](https://app.codecov.io/gh/apache/groovy/pull/3020?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/3020?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
```diff
@@ Coverage Diff @@
## master #3020 +/- ##
==================================================
- Coverage 72.5157% 72.5059% -0.0097%
- Complexity 40761 40772 +11
==================================================
Files 1644 1644
Lines 143027 143060 +33
Branches 26899 26921 +22
==================================================
+ Hits 103717 103727 +10
- Misses 29759 29766 +7
- Partials 9551 9567 +16
```
| [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/3020?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...n/groovy/groovy/typecheckers/MonadicChecker.groovy](https://app.codecov.io/gh/apache/groovy/pull/3020?src=pr&el=tree&filepath=subprojects%2Fgroovy-typecheckers%2Fsrc%2Fmain%2Fgroovy%2Fgroovy%2Ftypecheckers%2FMonadicChecker.groovy&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXR5cGVjaGVja2Vycy9zcmMvbWFpbi9ncm9vdnkvZ3Jvb3Z5L3R5cGVjaGVja2Vycy9Nb25hZGljQ2hlY2tlci5ncm9vdnk=) | `52.4194% <38.2353%> (-4.7235%)` | :arrow_down: |
... and [9 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/3020/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>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org