Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-05-16
15:14 • Closed ticket [1965063fff]: unknown method chaining plus 3 other changes artifact: da0f7ae336 user: dkf
15:14 • Ticket [1965063fff]: 4 changes artifact: 73eb8362b7 user: dkf
05:18 • New ticket [1965063fff]. artifact: 5f31f442cd user: dkf

unknown method chaining

Closed / Fixed1965063fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-05-16 05:18:34
Consider the script:
  oo::class create foo {
     method dummy {} {}
     method unknown args {next {*}$args}
  }
  foo create bar
  catch {bar boo} -> opts
  puts [dict get $opts -errorinfo]

This produces bizarre output, like this:

unknown method "next": must be destroy, dummy or unknown
    while executing
"next {*}$args"
    (class "::foo" method "unknown" line 1)
    invoked from within
"bar boo"

Something's not right; that should be 'unknown method "boo"'. Need a test for this too...
dkfplain2008-05-16 15:14:29
Logged In: YES 
user_id=79902
Originator: YES

Fixed by consolidating the special argument handling for unknown methods into one place (the dispatcher) from the method implementations (where it was trickier to get right, and indeed was wrong). This means that a C-implemented 'unknown' method will now Just Work right (i.e. have an extra argument for the method name) without doing anything special, unlike before.
dkf Closed ticket [1965063fff]. [History diff]2008-05-16 15:14:30
Log in (anonymous is fine) to add a comment.