From a64bbe049e19618c33a878154f2e69029d45ecd7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 15 May 2009 13:46:13 +0000 Subject: * Change the scoping of "inherit (e) ..." in recs so that the attributes of the rec are in scope of `e'. This is useful in expressions such as rec { lib = import ./lib; inherit (lib) concatStrings; } It does change the semantics of expressions such as let x = {y = 1;}; in rec { x = {y = 2;}; inherit (x) y; }.y This now returns 2 instead of 1. However, no code in Nixpkgs or NixOS seems to rely on the old behaviour. --- tests/lang/eval-okay-scope-7.nix | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/lang/eval-okay-scope-7.nix (limited to 'tests/lang/eval-okay-scope-7.nix') diff --git a/tests/lang/eval-okay-scope-7.nix b/tests/lang/eval-okay-scope-7.nix new file mode 100644 index 000000000..4da02968f --- /dev/null +++ b/tests/lang/eval-okay-scope-7.nix @@ -0,0 +1,6 @@ +rec { + inherit (x) y; + x = { + y = 1; + }; +}.y -- cgit v1.2.3