While testing this I discovered that the same (silent no-op) behavior
applies to "typeset -gn" for specials, and for autoloads we get e.g.
this:
% typeset -gn SRANDOM
zsh: invalid variable name: zsh/random
I'll see if I can track that down.
I have code that fixes this -> changes the error to "SRANDOM: can't change type of autoloaded parameter".
I was reviewing the code of typeset_single in order to understand how special parameters get localized. I still haven't figured this out but I noticed that this condition is most likely missing a PM_NAMEREF. After much more digging I finally ended up with changes that also fix the issue above. More work is needed before I can send patch(es) but what is already clear is that I need the same ability to tell assignsparam and assignaparam to not dereference the assigned parameter as in workers/55026. It would be great if you could commit that one, or at least the changes in zsh.h and params.c.
Philippe