Skip to content

Commit

Permalink
Fix MustCombineARecord error message for // (#1702)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sjakobi authored Mar 10, 2020
1 parent 05149e8 commit f56bb0e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dhall/src/Dhall/TypeCheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -900,13 +900,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'))

Expand Down

0 comments on commit f56bb0e

Please sign in to comment.