Skip to content

GROOVY-11959: multi-assignment failure for singleton primitives#2488

Open
paulk-asert wants to merge 1 commit intoapache:masterfrom
paulk-asert:groovy11959
Open

GROOVY-11959: multi-assignment failure for singleton primitives#2488
paulk-asert wants to merge 1 commit intoapache:masterfrom
paulk-asert:groovy11959

Conversation

@paulk-asert
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes GROOVY-11959 by ensuring multi-assignment/destructuring from primitive RHS values fails consistently (with a runtime MissingMethodException) rather than triggering bytecode verifier issues, aligning primitive behavior with boxed types.

Changes:

  • Add regression tests covering multi-assignment from boxed Integer and primitive int/long/double.
  • Box primitive RHS values in the multi-assignment path before storing into the temporary $rhs local, so later bytecode that assumes an object reference remains valid.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/test/groovy/gls/statements/MultipleAssignmentDeclarationTest.groovy Adds GROOVY-11959 regression coverage for multi-assignment from singleton numeric values (boxed and primitive).
src/main/java/org/codehaus/groovy/classgen/asm/BinaryExpressionHelper.java Boxes primitive RHS for tuple/multi-assignment before saving to $rhs, preventing invalid ALOAD/IF_ACMPEQ usage on primitive locals.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.0897%. Comparing base (815e756) to head (84be989).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #2488        +/-   ##
==================================================
+ Coverage     67.0889%   67.0897%   +0.0008%     
- Complexity      31588      31589         +1     
==================================================
  Files            1451       1451                
  Lines          122530     122533         +3     
  Branches        21996      21997         +1     
==================================================
+ Hits            82204      82207         +3     
+ Misses          33245      33243         -2     
- Partials         7081       7083         +2     
Files with missing lines Coverage Δ
...us/groovy/classgen/asm/BinaryExpressionHelper.java 89.7004% <100.0000%> (+0.0582%) ⬆️

... and 3 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.

3 participants