Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] _modutils: fix the testing of -R/--resolve-alias options as it is now, it is always true due to how $+var works with the k subscript flag on associative arrays



On 5 Jul, Eric Cook wrote:
> % typeset -A foo=(bar baz); print -- ${foo[(k)-R]} - ${+foo[(k)-R]}; typeset -A foo=(bar bar -R qux); print -- ${foo[(k)-R]} - ${+foo[(k)-R]}

That change makes sense. Searching the wider code shows many cases where
we've done similar tests with opt_args[(i)...|...|...  but none with
(k). Subscript flags can be easy to make mistakes with.

Oliver




Messages sorted by: Reverse Date, Date, Thread, Author