package require -exact Itcl 4.0.1
proc do_uplevel { body } {
uplevel 1 $body
}
itcl::class TestClass {
constructor {} {}
public method api-call {} private method internal-helper {} public variable property "value"
}
proc ::testclass { pathName args } {
uplevel TestClass $pathName $args
}
itcl::body TestClass::internal-helper {} {
puts "TestClass::internal-helper"
puts "this won't work:"
do_uplevel {
puts [cget -property]
}
}
itcl::body TestClass::api-call {} {
puts "TestClass::api-call"
internal-helper
}
set tc [::testclass .]
$tc api-call
Fixed in fossil respository trunk. Will go into next version. I hope this fix works for any number of uplevels. :)