Subject: Compiled files ignore aliases
From: Sebastian Gniazdowski <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Fri, 5 Feb 2016 16:33:02 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Hello,
this is probably expected as aliases are applied on parsing time. But
maybe this wasn't yet recognized?

% cat 2test-script.zsh
#!/bin/zsh
alias autoload="echo Hello; autoload"
#autoload() { echo "Hello"; builtin autoload "$@" }
source "./test-script.zsh"
echo "|"${functions[abc]}"|"

% cat test-script.zsh
#!/bin/zsh
echo "Hello from script, will call a builtin"
autoload abc

Output when using alias in 2test-script.zsh and test-script.zsh is
compiled (there is .zwc file):
% ./2test-script.zsh
Hello from script, will call a builtin
|builtin autoload -X|

Output when using function in 2test-script.zsh:
% ./2test-script.zsh
Hello from script, will call a builtin
Hello
|builtin autoload -X|

Any way to have aliases working when sourcing .zwc file?

Best regards,
Sebastian Gniazdowski