Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

something weird is going on with object hashes and mixed-in objects in Rakudo #2660

Closed
p6rt opened this issue Mar 2, 2012 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Mar 2, 2012

Migrated from rt.perl.org#111498 (status was 'resolved')

Searchable as RT111498$

@p6rt
Copy link
Author

p6rt commented Mar 2, 2012

From @masak

<sorear> rakudo​: 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; say %hash.keys>>.foo
<p6eval> rakudo d4dc7d​: OUTPUT«5␤»
<moritz> ouch
<masak> huh.
< moritz> rakudo​: my $r1 = role { method foo() { 5 } }; my $r2 = role
{ method foo() { 7 } }; say ("quux" but $r1).WHICH; say ("quux" but
$r2).WHICH
<p6eval> rakudo d4dc7d​: OUTPUT«Str+{<anon>}|quux␤Str+{<anon>}|quux␤»
<moritz> seems we are insufficiently paranoid in ClassHOW.gist, or we
should be using something else in .WHICH
<masak> those look more like .WHAT than .WHICH to me.
<moritz> masak​: feel free to rakudobug
* masak submits rakudobug
<jnthn> Er, we shoudln't be using the typename. :)
<jnthn> Just use nqp​::where($the_type.HOW) to get a unique identifier
for the type.
<moritz> ok

@p6rt
Copy link
Author

p6rt commented Nov 28, 2015

From @usev6

Current behaviour​:

$ perl6-m -e '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; say %hash.keys>>.foo'
(5 7)

Is that the expected answer?

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 28, 2015

From @usev6

Current behaviour​:

$ perl6-m -e '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; say %hash.keys>>.foo'
(5 7)

Is that the expected answer?

@p6rt
Copy link
Author

p6rt commented Nov 28, 2015

@usev6 - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Apr 7, 2016
@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

@diakopter - Status changed from 'open' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Apr 11, 2016

From @usev6

I added a test to S09-hashes/objecthash.t with commit Raku/roast@92543e196c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant