Skip to content
Permalink
Browse files

Throw when splicing lazy Seq into native array

  • Loading branch information...
jstuder-gh committed Aug 28, 2018
1 parent fc8c7f8 commit bb963a25044757e9680b348436572cc40fdcbe1a
Showing with 4 additions and 12 deletions.
  1. +3 −9 src/core/native_array.pm6
  2. +1 −3 tools/build/makeNATIVE_ARRAY.p6
@@ -293,9 +293,7 @@ my class array does Iterable {
multi method splice(strarray:D: Int:D $offset, Int:D $size, Seq:D \seq) {
nqp::if(
seq.is-lazy,
Failure.new(X::Cannot::Lazy.new(
:action<splice>, :what(self.^name)
)),
X::Cannot::Lazy.new(:action<splice>, :what(self.^name)).throw,
nqp::stmts(
nqp::unless(
nqp::istype(
@@ -778,9 +776,7 @@ my class array does Iterable {
multi method splice(intarray:D: Int:D $offset, Int:D $size, Seq:D \seq) {
nqp::if(
seq.is-lazy,
Failure.new(X::Cannot::Lazy.new(
:action<splice>, :what(self.^name)
)),
X::Cannot::Lazy.new(:action<splice>, :what(self.^name)).throw,
nqp::stmts(
nqp::unless(
nqp::istype(
@@ -1315,9 +1311,7 @@ my class array does Iterable {
multi method splice(numarray:D: Int:D $offset, Int:D $size, Seq:D \seq) {
nqp::if(
seq.is-lazy,
Failure.new(X::Cannot::Lazy.new(
:action<splice>, :what(self.^name)
)),
X::Cannot::Lazy.new(:action<splice>, :what(self.^name)).throw,
nqp::stmts(
nqp::unless(
nqp::istype(
@@ -250,9 +250,7 @@ for $*IN.lines -> $line {
multi method splice(#type#array:D: Int:D $offset, Int:D $size, Seq:D \seq) {
nqp::if(
seq.is-lazy,
Failure.new(X::Cannot::Lazy.new(
:action<splice>, :what(self.^name)
)),
X::Cannot::Lazy.new(:action<splice>, :what(self.^name)).throw,
nqp::stmts(
nqp::unless(
nqp::istype(

0 comments on commit bb963a2

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