GROOVY-10355: restore binary reading of (name) +/- x and (name) in/as… - #2817
Open
paulk-asert wants to merge 1 commit into
Open
GROOVY-10355: restore binary reading of (name) +/- x and (name) in/as…#2817paulk-asert wants to merge 1 commit into
paulk-asert wants to merge 1 commit into
Conversation
paulk-asert
force-pushed
the
groovy10355
branch
3 times, most recently
from
August 18, 2026 23:50
5451ff0 to
af2b7b6
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2817 +/- ##
==================================================
+ Coverage 70.1846% 70.1908% +0.0062%
- Complexity 35846 35923 +77
==================================================
Files 1562 1563 +1
Lines 132542 132667 +125
Branches 24379 24424 +45
==================================================
+ Hits 93024 93120 +96
- Misses 31109 31123 +14
- Partials 8409 8424 +15
🚀 New features to boost your workflow:
|
blackdrag
reviewed
Aug 19, 2026
| * could equally be read as an operator continuation of a parenthesized value expression, | ||
| * so that later resolution failures can explain the ambiguity (GROOVY-10355). | ||
| */ | ||
| public static final String AMBIGUOUS_BARE_NAME_CAST = "_AMBIGUOUS_BARE_NAME_CAST"; |
Contributor
There was a problem hiding this comment.
could we move that constant to a different place? I think ResolveVisitor should not reference AstBuilder or any antlr4 class if we can avoid that.
Contributor
Author
There was a problem hiding this comment.
Inverted the relationship.
paulk-asert
force-pushed
the
groovy10355
branch
from
August 19, 2026 04:34
af2b7b6 to
96b0192
Compare
This comment has been minimized.
This comment has been minimized.
… x (design sketch) A parenthesized bare name whose final segment starts lowercase is by convention a value, not a class, so a cast mis-parse of the ambiguous shapes is rebuilt in AstBuilder as the binary expression the syntax visually suggests, preserving textual left-to-right grouping across precedence levels. The binary-only keywords in/as captured as cast operand identifiers are restored to their relational reading for any capitalization. Unresolvable bare-name cast types now carry a hint explaining the ambiguity and the ((name)) workaround. The grammar is unchanged: a predicate-gated castExprAlt is not viable because adaptive prediction under the me.sunlan antlr4 fork only consults semantic predicates when a decision conflict is registered, which this decision never produces, so the predicate would only fire as a parse-time FailedPredicateException.
paulk-asert
force-pushed
the
groovy10355
branch
from
August 19, 2026 07:16
96b0192 to
cd6fa5e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… x (design sketch)
A parenthesized bare name whose final segment starts lowercase is by convention a value, not a class, so a cast mis-parse of the ambiguous shapes is rebuilt in AstBuilder as the binary expression the syntax visually suggests, preserving textual left-to-right grouping across precedence levels. The binary-only keywords in/as captured as cast operand identifiers are restored to their relational reading for any capitalization. Unresolvable bare-name cast types now carry a hint explaining the ambiguity and the ((name)) workaround.
The grammar is unchanged: a predicate-gated castExprAlt is not viable because adaptive prediction under the me.sunlan antlr4 fork only consults semantic predicates when a decision conflict is registered, which this decision never produces, so the predicate would only fire as a parse-time FailedPredicateException.