Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #118037] .exists returns false on a %h{Any} in a TypedHash

3 views
Skip to first unread message

Elizabeth Mattijsen

unread,
May 17, 2013, 6:05:16 PM5/17/13
to bugs-bi...@rt.perl.org
# New Ticket Created by Elizabeth Mattijsen
# Please include the string: [perl #118037]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118037 >


[23:54:47] <lizmat> r: my %h{Any}; %h{Any}=1; say (%h{Any}:p).perl; my @a=Any; say @a.perl; say (%h{@a}:p).perl
[23:54:49] <+camelia> rakudo 9c5650: OUTPUT«Any => 1␤Array.new(Any)␤use of uninitialized value of type Any in string context in block at /tmp/2ouUnJ18av:1␤␤((),)␤»
[23:55:32] <lizmat> it looks like doing a slice out of an object hash with Any as a key, is not returning the right thing :-(
[23:55:57] <lizmat> it works with a scalar:
[23:56:05] <lizmat> r: my %h{Any}; %h{Any}=1; say (%h{Any}:p).perl; my @a=Any; say @a.perl; say (%h{@a[0]}:p).perl
[23:56:07] <+camelia> rakudo 9c5650: OUTPUT«Any => 1␤Array.new(Any)␤Any => 1␤»
[23:56:26] <lizmat> masak: rakudobug ?
[23:56:50] <lizmat> (if you agree, I will make it a rakudobug)
[00:00:34] <masak> lizmat: looking, trying to understand with my feeble $work-addled mind.
[00:01:08] <masak> lizmat: yes, that looks buggy.
[00:01:17] <lizmat> still golfing down
[00:01:47] <lizmat> r: my %h{Any}; %h{Any}=1; say %h{Any}:exists
[00:01:49] <+camelia> rakudo 9c5650: OUTPUT«use of uninitialized value of type Any in string context in block at /tmp/6PK2DrIS7m:1␤␤False␤»
[00:02:06] <lizmat> masak: I think that's the problem
[00:02:18] <masak> lizmat: agreed.
[00:02:29] <lizmat> r: my %h{Any}; %h{Any}=1; say %h{Any}; say %h{Any}:exists
[00:02:30] <+camelia> rakudo 9c5650: OUTPUT«1␤use of uninitialized value of type Any in string context in block at /tmp/30nteXxcOh:1␤␤False␤»
[00:02:47] lizmat submits rakudobug
[00:02:51] <masak> yeah, that's self-contradictory.
[00:02:54] <masak> lizmat++

Christian Bartolomaeus via RT

unread,
Oct 15, 2014, 10:09:05 AM10/15/14
to perl6-c...@perl.org
I added a test to S09-hashes/objecthash.t with the following commit: https://github.com/perl6/roast/commit/85396dd33e
0 new messages