This patch covers a bunch of odds and ends referenced or revealed by Jun T.'s commentary over the last few days. 1) Document the behavior of "typeset -n existing_var", (via Jun T. comment) 2) Prohibit "typeset -nm pattern" because, well, it's insane. Add test. 3) Improve doc for ${(!)ref} including ${{t!)ref} (Jun T.) 4) Fix doc for how-to unset of a named ref (Jun T.) 5) Allow "typeset +r -n ref" and "typeset +r +n ref" (Jun T.) 6) Fix "typeset -r -n ref=param" to create readonly references 7) Avoid accidental removal of PM_UNSET flag (Jun T.) and update test 8) Fix "typeset -gn ref=value" and add a test for it 9) Add tests for read-only reference behavior 10) Fix infinite recursion when resolving scope of an unset local named reference, add test. RE #5: Not explicitly called out anywhere yet (suggestions?) but notice that parameter type conversions occur before parameter assignments when using "typeset [options] var=val". See K01 test. RE #6: There is an explicit exception to the above for "typeset -r var=val". I'm not entirely happy with the way this had to be fixed for -n, but it's necessary to prevent following the reference. RE #10: Previously if a local named reference was unset and an assignment was made to the name, resolve_nameref() could find a reference of the same name in the enclosing scope and end up in an infinite loop. Aside from the loop, looking up-scope is wrong just from expected behavior of locals. The fix results in assigning a new referent to the (thereafter not unset) reference.