Skip to content

fix: interpreter eval STRING variable attrs after RETRIEVE_BEGIN_* + SUPER stash#716

Merged
fglock merged 2 commits into
masterfrom
fix/eval-retrieve-begin-attrs
May 12, 2026
Merged

fix: interpreter eval STRING variable attrs after RETRIEVE_BEGIN_* + SUPER stash#716
fglock merged 2 commits into
masterfrom
fix/eval-retrieve-begin-attrs

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented May 12, 2026

Summary

  • Interpreter eval STRING: After RETRIEVE_BEGIN_SCALAR|ARRAY|HASH, emit DISPATCH_VAR_ATTRS when the declaration has non-builtin variable attributes, matching JVM EmitVariable (fixes Class::Std and similar my %h : ATTR(...) inside eval q{} without forcing JPERL_EVAL_NO_INTERPRETER=1).
  • CompileAssignment: Same dispatch after retrieve paths for my $x =, my @x =, and my %x =.
  • NextMethod: SUPER:: / next use stashInstallPackage / stashInstallSub when present so glob-assigned wrappers resolve the correct MRO (Class::Std access patterns).
  • Tests: New src/test/resources/unit/eval_string_retrieve_begin_attrs.t. Comment in CompileAssignment documents why my ($a,$b)= list slots do not emit per-slot variable-attr dispatch.

Verification

  • make (full unit parallel + shadowJar) passes.
  • eval_nested_lexicals.t passes.
  • Class::Std t/runtime.t with -Ilib: all executed assertions pass (upstream file still declares 45 tests but only contains 44).

fglock and others added 2 commits May 12, 2026 17:11
Emit DISPATCH_VAR_ATTRS after RETRIEVE_BEGIN_* for my/state declarations and
for my $x/@x/%x = ... assignment forms, matching JVM EmitVariable. Skipping
this left MODIFY_*_ATTRIBUTES uncalled when lexicals used the closure
pre-registration path (e.g. Class::Std t/runtime.t inside eval).

SUPER/next resolution uses RuntimeCode stash install metadata when present
so glob-assigned wrappers resolve the correct MRO package.

Add unit test eval_string_retrieve_begin_attrs.t.

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Document why my ($a,$b)=... slots do not call emitVarAttrsIfNeeded here.

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <noreply@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@fglock fglock merged commit 59b4dcd into master May 12, 2026
2 checks passed
@fglock fglock deleted the fix/eval-retrieve-begin-attrs branch May 12, 2026 15:46
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.

1 participant