From 17c28d4b6c7af557109e9286bd09369030334214 Mon Sep 17 00:00:00 2001 From: Simon Jakobi Date: Sun, 15 Sep 2019 22:03:58 +0200 Subject: [PATCH] Adjust type inference for record literals (#1309) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … to changes from https://github.com/dhall-lang/dhall-lang/pull/740. --- dhall/dhall-lang | 2 +- dhall/src/Dhall/TypeCheck.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dhall/dhall-lang b/dhall/dhall-lang index 084ec16..bdb2750 160000 --- a/dhall/dhall-lang +++ b/dhall/dhall-lang @@ -1 +1 @@ -Subproject commit 084ec169695c09e8ac92c4c0dfeb4f9b8188b593 +Subproject commit bdb27504913770a85b308a9d893fdded219c0fa4 diff --git a/dhall/src/Dhall/TypeCheck.hs b/dhall/src/Dhall/TypeCheck.hs index 2c2dc0c..2ec352a 100644 --- a/dhall/src/Dhall/TypeCheck.hs +++ b/dhall/src/Dhall/TypeCheck.hs @@ -463,13 +463,13 @@ typeWithA tpa = loop return (Const c) loop ctx e@(RecordLit kvs ) = do let process k v = do - t <- loop ctx v + t <- fmap Dhall.Core.normalize (loop ctx v) s <- fmap Dhall.Core.normalize (loop ctx t) case s of Const _ -> return t _ -> Left (TypeError ctx e (InvalidFieldType k t)) - Record <$> Dhall.Map.unorderedTraverseWithKey process kvs + Record <$> Dhall.Map.unorderedTraverseWithKey process (Dhall.Map.sort kvs) loop ctx e@(Union kts ) = do let nonEmpty k mt = First (fmap (\t -> (k, t)) mt)