aboutsummaryrefslogtreecommitdiff
path: root/tests/tailcall.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2013-12-20 08:34:28 +1000
committerSteve Bennett <steveb@workware.net.au>2013-12-21 01:04:39 +1000
commitdd766b8642398684da5bf70f4f346301bc9da01c (patch)
tree090a30d0d6f4649a98531b9e378a46cc41d5d33d /tests/tailcall.test
parent32fc07012bd8f734e3f7c05fe2a17123c6be2baf (diff)
downloadjimtcl-dd766b8642398684da5bf70f4f346301bc9da01c.zip
jimtcl-dd766b8642398684da5bf70f4f346301bc9da01c.tar.gz
jimtcl-dd766b8642398684da5bf70f4f346301bc9da01c.tar.bz2
tailcall should resolve command in current namespace
Currently tailcall resolves the command in the parent namespace. This also fixes the deletion of [local] commands such that they are always correctly deleted. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/tailcall.test')
-rw-r--r--tests/tailcall.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tailcall.test b/tests/tailcall.test
index 35ae91c..4657947 100644
--- a/tests/tailcall.test
+++ b/tests/tailcall.test
@@ -58,4 +58,16 @@ test tailcall-1.6 {tailcall pass through return} {
b
} {ok}
+test tailcall-1.7 {tailcall with namespaces} {
+ proc a::b {} {
+ proc c {} {
+ return 1
+ }
+ set d [local lambda {} { c }]
+ # $d should resolve in namespace 'a', not ""
+ tailcall $d
+ }
+ a::b
+} 1
+
testreport