summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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...