From 0a765fba7e9d1b8fc9901084144c8f17afff382d 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 --- 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 6a8c7771d2..3f1f516f0a 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'))