Skip to content

GROOVY-12694: keep closed-paren fixtures pointed at a real syntax error - #3247

Merged
daniellansun merged 1 commit into
apache:masterfrom
daniellansun:GROOVY-12694-parser-fixtures
Nov 6, 2026
Merged

daniellansun merged 1 commit into
apache:masterfrom
daniellansun:GROOVY-12694-parser-fixtures

Conversation

@daniellansun

Copy link
Copy Markdown
Contributor

Summary

GROOVY-12641 (GEP-19) accepts case Type name -> as a type pattern. Two ParserNegativeSyntaxTest fixtures that used that form as their later syntax error therefore began to parse, so expectParseError failed with "expected parse to fail" — the only reds on Build-and-test across the CI matrix.

Those scripts exist to prove that a paren group the parser has already closed is not reported as a missing ). The type-pattern case labels stay; each script now ends in def y = 1 +, the same dangling operator already used by the method-parameter and parenthesised-call cases. That is still a recognition failure, so a closed record header or for header ahead of it must not move the caret.

Change

  • Single file: ParserNegativeSyntaxTest.groovy
  • Keep type-pattern cases; point the deliberate trailing error at def y = 1 +

Related

GROOVY-12641 accepts `case Type name ->` as a type pattern, so the two
ParserNegativeSyntaxTest scripts that used that form as their later
syntax error now parse. expectParseError then fails with "expected
parse to fail", which is the only red on Build-and-test.

Those scripts are the check that a paren group the parser has already
closed is not reported as a missing ')'. The type-pattern labels stay,
and each script now ends in `def y = 1 +`, the same dangling operator
the method-parameter and parenthesised-call cases already use. That
is still a recognition failure, so a closed record header or for
header ahead of it must not move the caret.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.3409%. Comparing base (d1710f8) to head (7f6ca55).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #3247        +/-   ##
==================================================
+ Coverage     74.2207%   74.3409%   +0.1202%     
- Complexity      43914      44304       +390     
==================================================
  Files            1692       1699         +7     
  Lines          149911     150855       +944     
  Branches        28466      28754       +288     
==================================================
+ Hits           111265     112147       +882     
+ Misses          28444      28435         -9     
- Partials        10202      10273        +71     

see 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants