Skip to content

Commit

Permalink
Fix MustCombineARecord error message for //
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 committed Mar 10, 2020
1 parent 195c440 commit b276a20
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 @@ -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'))

Expand Down

0 comments on commit b276a20

Please sign in to comment.