In Itcl 3.4 working as expected, throws an error in Itcl 4.0:
puts tcl[info patchlevel] puts itcl[package require Itcl] proc foo {body} { uplevel $body } itcl::class A { method do {body} {foo $body} method do2 {} {puts done} } [A #auto] do { puts "I'm $this" do2 }
Output:
tcl8.6.0 itcl4.0.0 I'm ::a0 ItclObjectCmd cannot get context object (NULL) while executing "do2" ("uplevel" body line 3) invoked from within "uplevel $body" (procedure "foo" line 2) invoked from within "foo $body" (object "::a0" method "::A::do" body line 1) invoked from within "[A #auto] do { puts "I'm $this" do2 }" (file "./test8.6" line 19)
Regards Michael
fixed in trunk, will go into version 4.0.1