From 92543e196ce40d5619b6b7225b170ddaa9003e2d Mon Sep 17 00:00:00 2001 From: usev6 Date: Mon, 11 Apr 2016 23:04:13 +0200 Subject: [PATCH] Add test for RT #111498 --- S09-hashes/objecthash.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/S09-hashes/objecthash.t b/S09-hashes/objecthash.t index e9089112a4..3e850bb366 100644 --- a/S09-hashes/objecthash.t +++ b/S09-hashes/objecthash.t @@ -1,7 +1,7 @@ use v6; use Test; -plan 36; +plan 37; { class A { method Str() { 'foo' } }; @@ -97,4 +97,15 @@ plan 36; is %h.WHAT, %j.WHAT, "Clone of an object hash instance is an object hash"; } +# RT #111498 +{ + my $r1 = role { method foo() { 5 } }; + my $r2 = role { method foo() { 7 } }; + my %hash{Any}; + %hash{"quux" but $r1} = 9; + %hash{"quux" but $r2} = 11; + + is %hash.keys>>.foo.sort, (5, 7), 'Can use mixin objects as keys'; +} + #vim: ft=perl6