diff options
author | sterni <sternenseemann@systemli.org> | 2022-09-07T13·37+0200 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-09-11T12·26+0000 |
commit | 4d8f35353b41080c57f7a65093c29060877f646c (patch) | |
tree | b56bc4830f13d80d894eba45f1284c2b7bb65e46 /tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp | |
parent | b4309f5b8a3a51dd8851d71a4d25d7695f04c8e7 (diff) |
fix(tvix/eval): declare let inherit (from) locals before compiling r/4805
The recent change that split declaration of let based locals and the compilation of their values did not touch locals bound by inherit in let. These were previously declared and compiled immediately before starting to work on the other locals introduced in a let. In the case of plain inherits, this behavior is kept in this change, because there's nothing wrong with it: The value of a plain inherit will always resolve to a higher scope, either statically or dynamically. Since inherit (from) expression might refer to other locals bound in the same let, we need to handle them in the same three steps as ordinary let based locals: 1. We need to declare the (uninitialised) locals. 2. We need to compile the expression that obtains their value. For this, we create a new thunk, since the from expression may very well return a thunk which we need to force before selecting the value we are interested in. 3. Thunks need to be finalised. For 1., we create an extra pass over the inherits that already declares and initialises plain inherits and notes inherit (from) expressions in the entries vector after declaring them. 2. only needs a bit of adapting to create the thunks for selecting if appropriate, the rest of the existing code can be reused. Change-Id: Ie4ac1c0f9ffcbf7c07c452036aa8e577443af773 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6490 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp')
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp index d00491fd7e5b..0cfbf08886fc 100644 --- a/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp @@ -1 +1 @@ -1 +2 |