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

[perl #66624] [BUG] Bogus unthrown exception when using 'index' on non-substring in Rakudo

0 views
Skip to first unread message

Carl Mäsak

unread,
Jun 16, 2009, 9:29:42 AM6/16/09
to bugs-bi...@netlabs.develooper.com
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #66624]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=66624 >


<szabgab> rakudo: say index "abcbd", "x"
<p6eval> rakudo ba09b2: OUTPUT«Attempt to index from negative position␤␤»
<szabgab> rakudo: index "abcbd", "x"
<p6eval> rakudo ba09b2: ( no output )
<moritz_> it returns a failure object
<moritz_> which throws an exception if used
<Matt-W> ooooh
<Matt-W> and when .Str is called on it, it tells you about the failure?
<masak> rakudo: 1+index("abcbd", "x")
<p6eval> rakudo ba09b2: OUTPUT«Attempt to index from negative position␤»
<moritz_> but that error message is bogus nonetheless
<Matt-W> it is a strange error message to be produced in that situation
* masak submits rakudobug

Patrick R. Michaud via RT

unread,
Jun 30, 2009, 12:03:23 PM6/30/09
to perl6-c...@perl.org
Rakudo 95a2c4f now gives a more useful error message when returning the
failure for not finding a given substring:

pmichaud@orange:~/rakudo$ ./perl6
> say index "abcd", "x"
Substring 'x' not found in 'abcd'

Closing ticket, thanks!

Pm

0 new messages