summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2016-07-05 22:05:16 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2016-07-05 22:05:16 (GMT)
commit4b6e8293285a111598e5dc2d37921ca6ff732c45 (patch)
treef6bd79017948ef950e10c868b459ee768dd015e7
parentdb45aa4434d4a7af38b8c14072648bf9965d462b (diff)
downloadtcl-4b6e8293285a111598e5dc2d37921ca6ff732c45.zip
tcl-4b6e8293285a111598e5dc2d37921ca6ff732c45.tar.gz
tcl-4b6e8293285a111598e5dc2d37921ca6ff732c45.tar.bz2
Demonstrate that there is a problem.
-rw-r--r--tests/oo.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 48e093a..88e1124 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -3424,6 +3424,36 @@ test oo-27.22 {variables declaration uniqueifies: Bug 3396896} -setup {
} -cleanup {
foo destroy
} -result {v t}
+test oo-27.23 {variable resolver leakage: Bug 1493a43044} -setup {
+ oo::class create Super
+ oo::class create Master {
+ superclass Super
+ variable member1 member2
+ constructor {} {
+ set member1 master1
+ set member2 master2
+ }
+ method getChild {} {
+ Child new [self]
+ }
+ }
+ oo::class create Child {
+ superclass Super
+ variable member1 result
+ constructor {m} {
+ set [namespace current]::member1 child1
+ namespace upvar [info object namespace $m] \
+ member1 local1 member2 local2
+ upvar 1 member1 local3 member2 local4
+ set result [list $local1 $local2 $local3 $local4]
+ }
+ method result {} {return $result}
+ }
+} -body {
+ [[Master new] getChild] result
+} -cleanup {
+ Super destroy
+} -result {master1 master2 master1 master2}
# A feature that's not supported because the mechanism may change without
# warning, but is supposed to work...