From b276a20756a2443a518353180e361c9c37040e78 Mon Sep 17 00:00:00 2001 From: Simon Jakobi Date: Tue, 10 Mar 2020 15:49:21 +0100 Subject: [PATCH] Fix MustCombineARecord error message for `//` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For `{=} // 1`, we would previously report: You tried to combine the following value: ↳ {=} ... which is not a record, but is actually a: ↳ 1 Now we report: You tried to combine the following value: ↳ 1 ... which is not a record, but is actually a: ↳ Natural Fixes #1701. --- dhall/src/Dhall/TypeCheck.hs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dhall/src/Dhall/TypeCheck.hs b/dhall/src/Dhall/TypeCheck.hs index 6a8c7771d..3f1f516f0 100644 --- a/dhall/src/Dhall/TypeCheck.hs +++ b/dhall/src/Dhall/TypeCheck.hs @@ -902,13 +902,21 @@ infer typer = loop xLs' <- case _L' of VRecord xLs' -> return xLs' - _ -> die (MustCombineARecord '⫽' l r) + + _ -> do + let _L'' = quote names _L' + + die (MustCombineARecord '⫽' l _L'') _R' <- loop ctx r xRs' <- case _R' of VRecord xRs' -> return xRs' - _ -> die (MustCombineARecord '⫽' l r) + + _ -> do + let _R'' = quote names _R' + + die (MustCombineARecord '⫽' r _R'') return (VRecord (Dhall.Map.union xRs' xLs'))