Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix LTA error on List.push/pop/unshift/shift
pippo++ for pointing this out
  • Loading branch information
lizmat committed Sep 14, 2015
1 parent e11a341 commit 86ddca2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/core/List.pm
Expand Up @@ -3,6 +3,7 @@ my class X::TypeCheck { ... }
my class X::TypeCheck::Splice { ... }
my class X::Cannot::Lazy { ... }
my class X::Cannot::Empty { ... }
my class X::Immutable { ... }
my role Supply { ... }

my sub combinations($n, $k) {
Expand Down Expand Up @@ -836,6 +837,19 @@ my class List does Iterable does Positional { # declared in BOOTSTRAP
nqp::push_s($rsa, '...') if $infinite;
nqp::p6box_s(nqp::join(nqp::unbox_s($separator.Str), $rsa))
}

method push(|) {
X::Immutable.new( method => 'push', typename => 'List' ).throw;
}
method pop(|) {
X::Immutable.new( method => 'pop', typename => 'List' ).throw;
}
method shift(|) {
X::Immutable.new( method => 'shift', typename => 'List' ).throw;
}
method unshift(|) {
X::Immutable.new( method => 'unshift', typename => 'List' ).throw;
}
}

# The , operator produces a List.
Expand Down

0 comments on commit 86ddca2

Please sign in to comment.