Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ priorities and future plans.

## Work in progress

- Preserve named typeglob stringification when copying package stash entries (#1927).

- Reduce repeated eval STRING overhead with lazy state and caching for context-free integer-literal evals (#1911).

- Preserve arbitrary bytes in SQLite text columns across DBI fetches (#1923).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@ private static RuntimeScalar snapshotStashEntry(String key, RuntimeScalar value)
RuntimeGlob io = GlobalVariable.peekGlobalIO(sourceName);
RuntimeScalar code = GlobalVariable.globalCodeRefs.get(sourceName);
RuntimeGlob snapshot = RuntimeGlob.createDetachedWithSlots(scalar, array, hash, io, code);
// A detached glob has no live stash name for slot access, but a Perl
// typeglob copied out of a stash still stringifies with its source name.
snapshot.setStringificationName(sourceName);
return new RuntimeScalar(snapshot);
}

Expand Down
12 changes: 12 additions & 0 deletions src/test/resources/unit/stash_copied_glob_stringification.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use strict;
use warnings;
use Test::More tests => 1;

{
package StashCopiedGlobStringification;
sub exported { 1 }
}

my %stash = %StashCopiedGlobStringification::;
is("$stash{exported}", '*StashCopiedGlobStringification::exported',
'a glob copied from a package stash retains its name when stringified');
Loading