From 1313716b78f59aa1fdf75ec28910060c3e1c44e3 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 19 Jun 2022 06:17:48 +0200 Subject: [PATCH] dhall-to-nix: Quote field selection symbols Another one I missed, when you have a field selector, you want to quote it, in case it has some symbols nix does not know how to handle. `x.Foo/bar` will now be `x."Foo/bar"`, which is valid nix. --- dhall-nix/src/Dhall/Nix.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dhall-nix/src/Dhall/Nix.hs b/dhall-nix/src/Dhall/Nix.hs index 39103ddf0..2b74462b0 100644 --- a/dhall-nix/src/Dhall/Nix.hs +++ b/dhall-nix/src/Dhall/Nix.hs @@ -696,7 +696,7 @@ dhallToNix e = _ -> return (unionChoice k Nothing) loop (Field a (Dhall.Core.fieldSelectionLabel -> b)) = do a' <- loop a - return (a' @. b) + return (Fix (Nix.NSelect a' (mkDoubleQuoted b :| []) Nothing)) loop (Project a (Left b)) = do a' <- loop a let b' = fmap StaticKey (toList b)