fix: interpreter eval STRING variable attrs after RETRIEVE_BEGIN_* + SUPER stash#716
Merged
Conversation
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>
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.
Summary
eval STRING: AfterRETRIEVE_BEGIN_SCALAR|ARRAY|HASH, emitDISPATCH_VAR_ATTRSwhen the declaration has non-builtin variable attributes, matching JVMEmitVariable(fixesClass::Stdand similarmy %h : ATTR(...)insideeval q{}without forcingJPERL_EVAL_NO_INTERPRETER=1).CompileAssignment: Same dispatch after retrieve paths formy $x =,my @x =, andmy %x =.NextMethod:SUPER::/nextusestashInstallPackage/stashInstallSubwhen present so glob-assigned wrappers resolve the correct MRO (Class::Std access patterns).src/test/resources/unit/eval_string_retrieve_begin_attrs.t. Comment inCompileAssignmentdocuments whymy ($a,$b)=list slots do not emit per-slot variable-attr dispatch.Verification
make(full unit parallel + shadowJar) passes.eval_nested_lexicals.tpasses.t/runtime.twith-Ilib: all executed assertions pass (upstream file still declares 45 tests but only contains 44).