On Wed, Jan 26, 2022 at 5:44 AM gqqnb2005 wrote: > $ cat a.sh > a=$argv[ > $ zsh -n a.sh > $ zsh a.sh > a.sh:1: invalid subscript > This seems specifically to be a problem with assignments: % zsh -n =(echo ': $argv[') /tmp/zsh8ZwYOj:1: invalid subscript % zsh -n =(echo 'a=$argv[') % zsh -n =(echo ': a=$argv[') /tmp/zshDn6nSf:1: invalid subscript % zsh -n =(echo 'typeset a=$argv[') % There is no syntax check applied to the right-hand-side of an assignment at parse time unless it appears to include a process substitution or similar, that's instead left to happen at run time (which never occurs when noexec is in effect, obviously). Outside of an assignment, prefork substitutions etc. are performed even when noexec is in effect, so the error is caught. It's not clear what to do in the assignment case, because we don't have a separate code path that only checks syntax of parameter substitutions without actually substituting them, and it's probably not appropriate to invoke substitution in the middle of a parse. We could do some simple hacks like looking for unmatched brackets, but even that requires taking quoting into account, etc.