From 3ffba374ae343afb90e53acf72b691e79e28ece2 Mon Sep 17 00:00:00 2001 From: Georges Dubus Date: Fri, 26 Jan 2018 13:19:14 +0100 Subject: [PATCH] Fix recset evaluation logic Before, an evaluation of a recset would contain all the environment. Eg: ``` >>> let a = 4; in rec {x = 2;} {x = 2; a = 4;} ``` This commit changes it to only contain the values actually bound in the set: ``` >>> let a = 4; in rec {x = 2;} {x = 2;} ``` --- Nix/Eval.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nix/Eval.hs b/Nix/Eval.hs index 95ad13e..7335ac8 100644 --- a/Nix/Eval.hs +++ b/Nix/Eval.hs @@ -148,7 +148,7 @@ evalExpr = cata phi rec mergedEnv <- pure $ Fix $ NVSet $ evaledBinds `Map.union` env' evaledBinds <- evalBinds True mergedEnv binds - pure mergedEnv + pure . Fix . NVSet $ evaledBinds _ -> error "invalid evaluation environment" phi (NLet binds e) = \env -> case env of