From 18a48d80a0686ba81959057e8becc6272acd6c46 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 16 May 2013 19:08:02 +0200 Subject: Show function names in error messages Functions in Nix are anonymous, but if they're assigned to a variable/attribute, we can use the variable/attribute name in error messages, e.g. while evaluating `concatMapStrings' at `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/pkgs/lib/strings.nix:18:25': ... --- src/libexpr/parser.y | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libexpr/parser.y') diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y index f78780b1d486..964527be6763 100644 --- a/src/libexpr/parser.y +++ b/src/libexpr/parser.y @@ -104,6 +104,7 @@ static void addAttr(ExprAttrs * attrs, AttrPath & attrPath, } } } + e->setName(attrPath.back()); } -- cgit 1.4.1