GROOVY-11967: VerifyError in @CompileStatic constructor with default-…#2493
Open
paulk-asert wants to merge 1 commit intoapache:masterfrom
Open
GROOVY-11967: VerifyError in @CompileStatic constructor with default-…#2493paulk-asert wants to merge 1 commit intoapache:masterfrom
paulk-asert wants to merge 1 commit intoapache:masterfrom
Conversation
ff217d5 to
a1be2cb
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2493 +/- ##
==================================================
+ Coverage 67.1394% 67.1663% +0.0269%
- Complexity 31627 31641 +14
==================================================
Files 1451 1451
Lines 122560 122563 +3
Branches 22007 22008 +1
==================================================
+ Hits 82286 82321 +35
+ Misses 33194 33158 -36
- Partials 7080 7084 +4
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds regression coverage and a bytecode-generation fix for GROOVY-11967, addressing a JVM verifier failure triggered by @CompileStatic constructors with default-valued list parameters when bridge constructors are generated.
Changes:
- Add a new JUnit regression test suite covering several default-list constructor parameter shapes (class, string, integer, nested, empty, and mid-parameter defaults).
- Adjust static compilation list-literal bytecode emission to insert a
CHECKCASTbeforeArrayList.addin indy scenarios to satisfy the verifier.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/test/groovy/bugs/Groovy11967.groovy | New regression tests reproducing and guarding the VerifyError scenario across multiple default-list cases. |
| src/main/java/org/codehaus/groovy/transform/sc/transformers/ListExpressionTransformer.java | Bytecode emission tweak to cast the list instance before invoking ArrayList.add when constructor calls leave Object on stack in indy mode. |
…valued list parameter
a1be2cb to
c40387e
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.
…valued list parameter
https://issues.apache.org/jira/browse/GROOVY-11967