develooper Front page | perl.perl6.compiler | Postings from March 2012

[perl #111924] [BUG] Negative-index Failure over-eagerly triggers even for Whatever-y indexings in Rakudo

From:
Carl Mäsak
Date:
March 21, 2012 14:15
Subject:
[perl #111924] [BUG] Negative-index Failure over-eagerly triggers even for Whatever-y indexings in Rakudo
Message ID:
rt-3.6.HEAD-4610-1332364500-265.111924-82-0@perl.org
# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #111924]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=111924 >


<felher> nom: my @array; say @array[4];
<p6eval> rakudo 1a468d: OUTPUT�Any()␤�
<felher> nom: my @array; say @array[*-1];
<p6eval> rakudo 1a468d: OUTPUT�Failure.new(exception =>
X::AdHoc.new(payload => "Cannot use negative index -1 on Array"))␤�
* felher hoped for 'Any', too
<masak> probably it's * getting expanded as 0, and then the failure
triggers (wrongly)
<masak> it could be argued that it should never trigger for whatever-y
expressions.
* masak submits rakudobug
<felher> \o/



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About