Skip to content
Permalink
Browse files

Alternate way to fix R#2447

Always use the .WHICH of objects in the map to create the value type .WHICH.
Since the .WHICH is supposed to be immutable for an object even if it is not
a value type, this can create a stable .WHICH for a Map, even though it still
be mutable at a deeper level.
  • Loading branch information...
lizmat committed Oct 30, 2018
1 parent b8176dc commit 052067fd13876b629d69cdd0552834f09cccb3c7
Showing with 1 addition and 6 deletions.
  1. +1 −6 src/core/Map.pm6
@@ -31,12 +31,7 @@ my class Map does Iterable does Associative { # declared in BOOTSTRAP
nqp::stmts(
(my \key := nqp::atpos_s(sorted,$i)),
nqp::push_s(strings,key),
(my \value := nqp::atkey($!storage,key).WHICH),
nqp::if(
nqp::istype(value,ValueObjAt),
nqp::push_s(strings,value),
(return self.Mu::WHICH)
)
nqp::push_s(strings,nqp::atkey($!storage,key).WHICH)
)
),
strings

0 comments on commit 052067f

Please sign in to comment.
You can’t perform that action at this time.