Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make "Odd number of elements" error a bit stronger, fix Hash.STORE
so that %a = %a works (RT #77586).  Probably need a spectest.
  • Loading branch information
pmichaud committed Jul 1, 2011
1 parent 7ea50ce commit 6cd9c42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/Hash.pm
Expand Up @@ -20,8 +20,8 @@ my class Hash {
}

method STORE(\$to_store) {
my $items = $to_store.flat.eager;
nqp::bindattr(self, EnumMap, '$!storage', pir::new__Ps('Hash'));
my $items = $to_store.flat;
while $items {
my Mu $x := $items.shift;
if Enum.ACCEPTS($x) { self.STORE_AT_KEY($x.key.Str, $x.value) }
Expand All @@ -30,7 +30,7 @@ my class Hash {
}
elsif $items { self.STORE_AT_KEY($x.Str, $items.shift) }
else {
fail 'Odd number of elements found where hash expected'
die 'Odd number of elements found where hash expected'
}
}
self
Expand Down

0 comments on commit 6cd9c42

Please sign in to comment.