Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-05-11
23:23 • Closed ticket [1960703fff]: Chaining mixins fails plus 3 other changes artifact: b480d37a5f user: dkf
23:23 • Ticket [1960703fff]: 4 changes artifact: 15084a77e1 user: dkf
17:36 • Ticket [1960703fff]: 1 change artifact: f8232d7cf5 user: dkf
17:36 • Ticket [1960703fff]: 4 changes artifact: 705405f41e user: dkf
2008-05-09
03:50 • New ticket [1960703fff]. artifact: 0df63a1635 user: pertronic

Chaining mixins fails

Closed / Fixed1960703fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-05-09 03:50:50
In the following testcase I expect A's method egg to be called.  However it fails with error 
"unknown method "egg": must be bar, destroy, egg, eval, ..."
while executing
"my egg"
    (class "::B" method "bar" line 3)
    invoked from within
"my bar"
    (class "::C" method "foo" line 3)
    invoked from within
"$o foo"
    (file "oo_bug2.tcl" line 27)

Note: the method name egg is displayed as being a known method.

package require TclOO
namespace import oo::*

# using TclOO 0.2 with Tcl 8.5.2

class create A {
method egg {} {
}
}

class create B {
method bar {} {
# mixin from A: fails
my egg
}
}

class create C {
method foo {} {
# mixin from B
my bar
}
}

define B mixin A
define C mixin B

set o [C new]
$o foo
dkfplain2008-05-11 17:36:38
Logged In: YES 
user_id=79902
Originator: NO

Confirmed with HEAD. Doubly serious because it is inconsistent with the error message!
dkf Ticket [1960703fff]: 1 change [History diff]2008-05-11 17:36:39
dkfplain2008-05-11 23:23:36
Logged In: YES 
user_id=79902
Originator: NO

Now fixed
dkf Closed ticket [1960703fff]. [History diff]2008-05-11 23:23:37
Log in (anonymous is fine) to add a comment.