Index: tests/alias.test =================================================================== diff -u -r9a0b8bb0992be0561d8187c275fc1d9b7e0bbcd0 -r8c4e49a8486b47ce8caa35e9e48343accc7f2764 --- tests/alias.test (.../alias.test) (revision 9a0b8bb0992be0561d8187c275fc1d9b7e0bbcd0) +++ tests/alias.test (.../alias.test) (revision 8c4e49a8486b47ce8caa35e9e48343accc7f2764) @@ -763,4 +763,23 @@ # Recreation of the alias, must free refcount to the old object ? {::o alias X ::baff::child} "::o::X" -} \ No newline at end of file +} + +# +# Testing cylcic alias +# +nx::Test case cyclic-alias { + nx::Object create o { + set handle [:public method foo {} {return 1}] + # we can define currently the recursive definition + ? [list [:] public alias foo $handle] "::o::foo" + } + # at runtime, we get an exception + ? {o foo} {target "::o::foo" of alias foo apparently disappeared} + + # test indirect case + set handle1 [o public method foo {} {return 1}] + set handle2 [o public alias bar $handle1] + set handle3 [o public alias foo $handle2] + ? {o foo} {target "::o::bar" of alias foo apparently disappeared} +}