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

Cannot initialize object hashes with coercive types #6176

Closed
p6rt opened this issue Apr 5, 2017 · 3 comments
Closed

Cannot initialize object hashes with coercive types #6176

p6rt opened this issue Apr 5, 2017 · 3 comments

Comments

@p6rt
Copy link

p6rt commented Apr 5, 2017

Migrated from rt.perl.org#131103 (status was 'new')

Searchable as RT131103$

@p6rt
Copy link
Author

p6rt commented Apr 5, 2017

From @lizmat

<lizmat> m​: my %h{Str(Cool)} = a => 42 # we actually don't appear to support coercive typed object hashes
<+camelia> rakudo-moar 4facf1​: OUTPUT​: «Type check failed in binding to parameter 'key'; expected Str(Cool) but got Str ("a")␤ in block <unit> at <tmp> line 1␤␤»
<timotimo> oh, huh
<timotimo> that is certainly strange
<lizmat> I'll rakudobug it so it won't fall through the cracks

https://irclog.perlgeek.de/perl6-dev/2017-04-05#i_14378922

@usev6
Copy link

usev6 commented Apr 4, 2021

This seems to work now.

$ ./rakudo-m -e 'my %h{Str(Cool)} = a => 42; say %h<a>'
42
$ ./rakudo-m -e 'my %h{Int(Str)} = "10" => 42; say %h.keys[0].^name'
Int

Tagging as testneeded.

@usev6
Copy link

usev6 commented Oct 21, 2023

According to bisectable6 (https://colabti.org/irclogger/irclogger_log/raku-dev?date=2023-10-21#l50) this seems to work since rakudo/rakudo@f2d73287f9.

Test added with Raku/roast@1f824745f2.

Closing as "resolved".

@usev6 usev6 closed this as completed Oct 21, 2023
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

2 participants