# New Ticket Created by chromatic
# Please include the string: [perl #28134]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=28134 >
Hi,
Here's a patch to improve the string exception thrown when subclassing
goes awry. I've also added a newline to the end of the message to
prettify the output.
This leaves one otherwise-identical error message untouched, in the
subclass op that doesn't take a string name.
-- c
Index: ops/object.ops
===================================================================
RCS file: /cvs/public/parrot/ops/object.ops,v
retrieving revision 1.38
diff -u -u -r1.38 object.ops
--- ops/object.ops 26 Mar 2004 15:01:38 -0000 1.38
+++ ops/object.ops 1 Apr 2004 06:49:29 -0000
@@ -191,7 +191,8 @@
PMC *class = VTABLE_get_pmc_keyed_str(interpreter,
interpreter->class_hash, $2);
if (!class || !PObj_is_class_TEST(class)) {
- internal_exception(NO_CLASS, "Class doesn't exist");
+ internal_exception(NO_CLASS, "Class '%s' doesn't exist\n",
+ string_to_cstring( interpreter, $3 ));
}
$1 = Parrot_single_subclass(interpreter, class, $3);
goto NEXT();
@@ -201,7 +202,8 @@
PMC *class = VTABLE_get_pmc_keyed_str(interpreter,
interpreter->class_hash, $2);
if (!class || !PObj_is_class_TEST(class)) {
- internal_exception(NO_CLASS, "Class doesn't exist");
+ internal_exception(NO_CLASS, "Class '%s' doesn't exist\n",
+ string_to_cstring( interpreter, $2 ));
}
$1 = Parrot_single_subclass(interpreter, class, NULL);
goto NEXT();
@@ -232,7 +234,8 @@
if (VTABLE_exists_keyed_str(interpreter, interpreter->class_hash, $2)) {
$1 = VTABLE_get_pmc_keyed_str(interpreter, interpreter->class_hash, $2);
} else {
- internal_exception(NO_CLASS, "Class doesn't exist");
+ internal_exception(NO_CLASS, "Class '%s' doesn't exist\n",
+ string_to_cstring( interpreter, $2 ));
}
goto NEXT();
}