Menu

#269 Missing method error is incorrect

4.0*
closed-fixed
None
5
2015-12-19
2015-11-26
No

The error message for a missing method is incorrect. For example:

package require Itcl

itcl::class C {}
set c [C #auto]
$c

In Itcl 3.4, this correctly displays:

wrong # args: should be one of...
  c0 cget -option
  c0 configure ?-option? ?value -option value...?
  c0 isa className
    while executing
"$c"

In Itcl 4.0.3, this incorrectly displays:

wrong # args: should be "::itcl::builtin::objectunknown object method ?arg...?"
    while executing
"::itcl::builtin::objectunknown c0"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 ::itcl::builtin::objectunknown c0 $args"
    invoked from within
"$c"

The error message is correct when an incorrect method is called, but it fails when a method name is omitted entirely. It looks like the function ItclBiObjectUnknownCmd() in itclBuiltin.c should allow a missing method name instead of throwing an error.

Discussion

  • Don Porter

    Don Porter - 2015-11-30

    Confirmed on branch tips.

    This is at least an improvement over Itcl 4.0.0, which segfaults
    on the same demo script.

     
  • Don Porter

    Don Porter - 2015-11-30

    Proper fix likely a variation on the checkin that
    stopped the segfault:

    http://core2.tclers.tk/itcl/info/ee50a890cc70f5cd

     
  • Don Porter

    Don Porter - 2015-12-19
    • status: open --> closed-fixed
    • assigned_to: Don Porter
     

Log in to post a comment.