Skip to content
Permalink
Browse files

Make sure we containerize arrays in @A <<+>> 0

Arrays were created, but without containers.  Fixes R#2840.  This **also**
fixes the case where the original array was typed: the type *and* its
associated descriptor are cloned.
  • Loading branch information...
lizmat committed Nov 10, 2018
1 parent c50cf82 commit 1a2b39dc1a9bef6c8aba8ca647d8b2cbc8ed2ad9
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/core/Hyper.pm6
@@ -92,11 +92,11 @@ class Hyper {
);

my \result := nqp::p6bindattrinvres(
nqp::create(
nqp::istype(left,List) ?? left.WHAT !! List # keep subtype
),
List, '$!reified', values
nqp::create(List), List, '$!reified', values
);
nqp::bind(result,nqp::clone(left).STORE(result))
if nqp::istype(left.WHAT,List) # a subtype of List
&& nqp::not_i(nqp::eqaddr(left.WHAT,List));
nqp::iscont(left) ?? result.item !! result
}

@@ -122,11 +122,11 @@ class Hyper {
);

my \result := nqp::p6bindattrinvres(
nqp::create(
nqp::istype(right,List) ?? right.WHAT !! List # keep subtype
),
List, '$!reified', values
nqp::create(List), List, '$!reified', values
);
nqp::bind(result,nqp::clone(right).STORE(result))
if nqp::istype(right.WHAT,List) # a subtype of List
&& nqp::not_i(nqp::eqaddr(right.WHAT,List));
nqp::iscont(right) ?? result.item !! result
}

0 comments on commit 1a2b39d

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