Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:from:date:message-id:subject:to:content-type;
        bh=aqS6bbCN8mRnOl+GUp1QZ5W5pD3SgB5VnLUkA/et+8I=;
        b=Sy/59jMIBMsmDucW8aFr9NLuUztwwOf6ROVxfTUPmlUGhLOwsqYWjTtbrkUJW5XG/N
         rqZl/RPntbZMvylNKcsxHrC9QAzC4V8g8gUo1aNPQgXqYagorLfIryoH9reB2Rii2eO/
         jT618Kt9H2KAlurskJzJdRofQyn4JvLfTZH/QhFn61X7TJDKO2R1fCg4Jtgf0ARyDWFE
         wdxCMO2sQbHAxfdGsOEPqE6AhnZjSk3YDWVFIGssf1ixt1vcCueNUN5fYGcJ3Fp8NIte
         X65if59lteRMPyrDb95z1q86XXjxckxDCYJc6tuaVR4nCLnNOxkJp0mQg3nWs9UkcgII
         KK/g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:from:date:message-id:subject:to
         :content-type;
        bh=aqS6bbCN8mRnOl+GUp1QZ5W5pD3SgB5VnLUkA/et+8I=;
        b=a1TBRAizFJ2Ksh1P/7LGGTwvkHVNkf4BGs3juecaOL6j6sgXc7fg8olUxRmNFR/e4b
         hwsmLvf6uiQ9jUkt9Nb7sAazhtxE3fqjl9ush2rAGqYOpyCUc0epcdfTGjpigvjHYp0f
         iouhUmRfWJgVxiYajRqC+LiM699d4Uv9rqBnMZHdUWxSpjr4i1d8ICkImRo2y2Y4OQLD
         S7h3rsyiPQgIP2niUDcEbmAF36g9GEJEFhHCGFtji7tFAdLc9ddmuZIcZd4bvMRbuPUT
         R1sLmG8E510xEi2VCeg9Sx8B3sOGOlLEloa+4Lzuoc+vqZp23L1edt/T6tVytMFm29Zj
         xIzw==
X-Gm-Message-State: AG10YORKpYijGLpy86kovXzffiOVbqvoeqM4EqLNWRQQyg5WNvROLk2gRNoYbpRC306+j2G8WKI8VDVfmRQWjQ==
X-Received: by 10.25.80.200 with SMTP id e191mr6326604lfb.150.1454686401503;
 Fri, 05 Feb 2016 07:33:21 -0800 (PST)
MIME-Version: 1.0
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date: Fri, 5 Feb 2016 16:33:02 +0100
Message-ID: <CAKc7PVDKxBdZ+9teFDS+Zd3VCvr_JYTpiGtYNuyRicAUfPa4KA@mail.gmail.com>
Subject: Compiled files ignore aliases
To: Zsh hackers list <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 37887

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

