unsettled class and object methods
Closed / Fixed2120903fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-09-20 19:25:43
Linux debsam 2.6.18-6-k7 #1 SMP Mon Aug 18 09:20:26 UTC 2008 i686 GNU/Linux
Tcl: 8.6a3
### source ###
oo::class create MyClass {
method toString {} {
return "str"
}
method isa {o} {
return [MyClass toString $o]
}
self {
method toString {obj} {
return [$obj toString]
}
}
}
MyClass create o1
MyClass create o2
puts [MyClass toString o1]
puts [o1 toString]
puts [o1 isa o2]
### output ###
str
str
wrong # args: should be "MyClass toString"
while executing
"MyClass toString $o"
(class "::MyClass" method "isa" line 2)
invoked from within
"o1 isa o2"
invoked from within
"puts [o1 isa o2]"
dkfplain2008-09-21 13:37:48
I can't duplicate this exactly; things go wrong differently in my sandbox. Very bad nonetheless!
dkf Ticket [2120903fff]: 1 change
[History diff]2008-09-21 13:37:49
dkfplain2008-09-24 21:08:05
Appears to be due to shared literals. Which means that there's a mixup in the cache/intRep invalidation. Confirmed critical bug.
dkfplain2008-09-25 19:09:33
Turned out that an important bit was not being saved or compared in the cache management. All fixed now. (Thanks very much for the example; helped me write a reliable test for this problem.)
Log in (anonymous is fine) to add a comment.