File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -826,6 +826,11 @@ TclOO_Object_VarName(
826
826
return TCL_ERROR ;
827
827
}
828
828
829
+ /*
830
+ * The variable reference must not disappear too soon. [Bug 74b6110204]
831
+ */
832
+ TclSetVarNamespaceVar (varPtr );
833
+
829
834
/*
830
835
* Now that we've pinned down what variable we're really talking about
831
836
* (including traversing variable links), convert back to a name.
Original file line number Diff line number Diff line change @@ -3055,6 +3055,20 @@ test oo-19.3 {OO: varname method and variable decl: Bug 3603695} -setup {
3055
3055
} -cleanup {
3056
3056
testClass destroy
3057
3057
} -result 0
3058
+ test oo-19.4 {OO: varname ghosts [Bug 74b6110204]} -setup {
3059
+ oo::class create testClass {
3060
+ export varname
3061
+ self export createWithNamespace
3062
+ }
3063
+ set obj [testClass createWithNamespace testoo19_4 testoo19_4]
3064
+ set ns [info object namespace $obj]
3065
+ } -body {
3066
+ set v [$obj varname foo]
3067
+ list [namespace which -variable $v] \
3068
+ [info exists $v] [namespace which -variable $v]
3069
+ } -cleanup {
3070
+ testClass destroy
3071
+ } -result {::testoo19_4::foo 0 ::testoo19_4::foo}
3058
3072
3059
3073
test oo-20.1 {OO: variable method} -body {
3060
3074
oo::class create testClass {
You can’t perform that action at this time.
0 commit comments