Adjust type inference for record literals (#1309)

… to changes from
https://github.com/dhall-lang/dhall-lang/pull/740.
This commit is contained in:
Simon Jakobi 2019-09-15 22:03:58 +02:00 committed by mergify[bot]
parent ca86ed612c
commit 17c28d4b6c
2 changed files with 3 additions and 3 deletions

@ -1 +1 @@
Subproject commit 084ec169695c09e8ac92c4c0dfeb4f9b8188b593
Subproject commit bdb27504913770a85b308a9d893fdded219c0fa4

View File

@ -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)