From 97020cb3428d4d1da3b00c31e08a3eadb09db9ee Mon Sep 17 00:00:00 2001 From: usev6 Date: Sat, 19 Dec 2015 20:12:49 +0100 Subject: [PATCH] Avoid NullPointerException in S02-types/baghash.t the following code resulted in a NPE on JVM my $b = BagHash.new( (a=>"b") ); $b.keys[0] ~~ ("a" => "b") --- src/core/Pair.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Pair.pm b/src/core/Pair.pm index d2afd450a16..0d5e78295f2 100644 --- a/src/core/Pair.pm +++ b/src/core/Pair.pm @@ -25,7 +25,7 @@ my class Pair does Associative { $!value.ACCEPTS(%h.AT-KEY($!key)); } multi method ACCEPTS(Pair:D: Pair:D $p) { - $!value.ACCEPTS(nqp::getattr($p,Pair,'$!value')); + $!value.ACCEPTS(nqp::getattr(nqp::decont($p),Pair,'$!value')); } multi method ACCEPTS(Pair:D: Mu $other) { $other."$!key"().Bool === $!value.Bool