|
|
Author: particle
Date: Tue Dec 18 13:26:21 2007
New Revision: 24051
Modified:
trunk/src/ops/object.ops
trunk/src/ops/pmc.ops
trunk/t/op/debuginfo.t
trunk/t/pmc/object-meths.t
trunk/t/pmc/pmc.t
Log:
#48294: [RFE] oo -- improve "Method '...' not found' error
improved error message to display invocant's class name
Modified: trunk/src/ops/object.ops
==============================================================================
--- trunk/src/ops/object.ops (original)
+++ trunk/src/ops/object.ops Tue Dec 18 13:26:21 2007
@@ -62,7 +62,8 @@
method_pmc = VTABLE_find_method(interp, object, meth);
if (PMC_IS_NULL(method_pmc)) {
real_exception(interp, next, METH_NOT_FOUND,
- "Method '%Ss' not found", meth);
+ "Method '%Ss' not found for invocant of class '%Ss'", meth,
+ VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
}
interp->current_object = object;
interp->current_cont = NEED_CONTINUATION;
@@ -98,7 +99,8 @@
method_pmc = VTABLE_find_method(interp, object, meth);
if (PMC_IS_NULL(method_pmc)) {
real_exception(interp, next, METH_NOT_FOUND,
- "Method '%Ss' not found", meth);
+ "Method '%Ss' not found for invocant of class '%Ss'", meth,
+ VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
}
interp->current_object = object;
interp->current_cont = $3;
@@ -132,7 +134,8 @@
method_pmc = VTABLE_find_method(interp, object, meth);
if (PMC_IS_NULL(method_pmc)) {
real_exception(interp, next, METH_NOT_FOUND,
- "Method '%Ss' not found", meth);
+ "Method '%Ss' not found for invocant of class '%Ss'", meth,
+ VTABLE_get_string(interp, VTABLE_get_class(interp, object)));
}
interp->current_cont = CONTEXT(interp->ctx)->current_cont;
PObj_get_FLAGS(interp->current_cont) |= SUB_FLAG_TAILCALL;
Modified: trunk/src/ops/pmc.ops
==============================================================================
--- trunk/src/ops/pmc.ops (original)
+++ trunk/src/ops/pmc.ops Tue Dec 18 13:26:21 2007
@@ -307,7 +307,8 @@
$1 = $2->vtable->find_method(interp, $2, $3);
if (PMC_IS_NULL($1) || !VTABLE_defined(interp, $1)) {
real_exception(interp, resume, METH_NOT_FOUND,
- "Method '%Ss' not found", $3);
+ "Method '%Ss' not found for invocant of class '%Ss'", $3,
+ VTABLE_get_string(interp, VTABLE_get_class(interp, $2)));
}
restart ADDRESS(resume);
}
Modified: trunk/t/op/debuginfo.t
==============================================================================
--- trunk/t/op/debuginfo.t (original)
+++ trunk/t/op/debuginfo.t Tue Dec 18 13:26:21 2007
@@ -96,7 +96,7 @@
/^ok 1
ok 2
ok 3
-Method 'nosuchmethod' not found
+Method 'nosuchmethod' not found for invocant of class 'Integer'
current instr.: 'parrot;Test1;foo' pc (\d+|-1) \(.*?:(\d+|-1)\)
called from Sub 'parrot;Test1;main' pc (\d+|-1) \(.*?:(\d+|-1)\)$/
OUTPUT
Modified: trunk/t/pmc/object-meths.t
==============================================================================
--- trunk/t/pmc/object-meths.t (original)
+++ trunk/t/pmc/object-meths.t Tue Dec 18 13:26:21 2007
@@ -29,7 +29,7 @@
print "should never reach here\n"
end
CODE
-/Method 'nada' not found/
+/Method 'nada' not found for invocant of class 'Foo'/
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "callmethod (STR) - unknown
method" );
@@ -39,7 +39,7 @@
print "should never reach here\n"
end
CODE
-/Method 'nada' not found/
+/Method 'nada' not found for invocant of class 'Foo'/
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "callmethodcc - unknown method"
);
@@ -49,7 +49,7 @@
print "should never reach here\n"
end
CODE
-/Method 'nada' not found/
+/Method 'nada' not found for invocant of class 'Foo'/
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "callmethodcc (STR) - unknown
method" );
@@ -59,7 +59,7 @@
print "should never reach here\n"
end
CODE
-/Method 'nada' not found/
+/Method 'nada' not found for invocant of class 'Foo'/
OUTPUT
pir_output_is( <<'CODE', <<'OUTPUT', "callmethod 1" );
@@ -440,7 +440,7 @@
print "nope\n"
end
CODE
-/Method 'nada' not found/
+/Method 'nada' not found for invocant of class 'Foo'/
OUTPUT
pasm_output_is( <<'CODE', <<'OUTPUT', "constructor - diamond parents" );
Modified: trunk/t/pmc/pmc.t
==============================================================================
--- trunk/t/pmc/pmc.t (original)
+++ trunk/t/pmc/pmc.t Tue Dec 18 13:26:21 2007
@@ -169,7 +169,7 @@
find_method P0, P1, "no_such_meth"
end
CODE
-/Method 'no_such_meth' not found/
+/Method 'no_such_meth' not found for invocant of class 'Integer'/
OUTPUT
pasm_error_output_like( <<'CODE', <<'OUTPUT', "new with a native type" );
|
|