Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make (1,2,3)[2] = 4 and (1,2,3)[3] give same error
  • Loading branch information
lizmat committed Dec 13, 2015
1 parent e160c98 commit 782f4b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Nil.pm
@@ -1,3 +1,5 @@
class X::Assignment::RO { ... }

my class Nil is Cool { # declared in BOOTSTRAP
method new(*@) { Nil }
multi method gist(Nil:) { 'Nil' }
Expand All @@ -13,7 +15,7 @@ my class Nil is Cool { # declared in BOOTSTRAP
method BIND-KEY(*@) { fail X::Bind.new(target => '{self.gist}') }
method ASSIGN-POS(*@) { die "Attempted to ASSIGN-POS to {self.gist}." }
method ASSIGN-KEY(*@) { die "Attempted to ASSIGN-KEY to {self.gist}." }
method STORE(*@) { die "Attempted to STORE to {self.gist}." }
method STORE(*@) { X::Assignment::RO.new(:typename<Nil>).throw }
method push(*@) is nodal { die "Attempted to push to {self.gist}." }
method append(*@) is nodal { die "Attempted to append to {self.gist}." }
method unshift(*@) is nodal { die "Attempted to unshift to {self.gist}." }
Expand Down

0 comments on commit 782f4b6

Please sign in to comment.