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

[perl #38432] Exception thrown from constructor leads to oddness

1 view
Skip to first unread message

Jonathan Worthington

unread,
Feb 4, 2006, 8:00:58 PM2/4/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Jonathan Worthington
# Please include the string: [perl #38432]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38432 >


Hi,

Here's an example of what I'm pretty sure is a bug.

.sub main :main
newclass $P0, "Parent"
push_eh handler
$P2 = new "Parent"
print "not "
handler:
print "ok\n"
end
.end

.namespace ["Parent"]
.sub __init :method
$P0 = class self
$S0 = classname $P0
if $S0 != "Parent" goto INIT_OK
$P1 = new .Exception
$P1["_message"] = "Can not instantiate an interface!"
throw $P1
INIT_OK:
.end

I would expect this code to have the output:

ok

However, it actually outputs:

ok
not ok

Thanks,

Jonathan

0 new messages