Small tweak to record updates

A bit more constraing solving in case it helps find the record type
This commit is contained in:
Edwin Brady 2020-02-01 13:32:39 +00:00
parent 6f4fa7ade9
commit cf27bbed66

View File

@ -184,14 +184,19 @@ checkUpdate rig elabinfo nest env fc upds rec expected
_ => do (_, ty) <- checkImp rig elabinfo
nest env rec Nothing
pure ty
let solvemode = case elabMode elabinfo of
InLHS c => InLHS
_ => InTerm
delayOnFailure fc rig env recty needType $
\delayed =>
do exp <- getTerm recty
do solveConstraints solvemode Normal
exp <- getTerm recty
-- We can't just use the old NF on the second attempt,
-- because we might know more now, so recalculate it
let recty' = if delayed
then gnf env exp
else recty
logGlueNF 5 (show delayed ++ " record type " ++ show rec) env recty'
rcase <- recUpdate rig elabinfo fc nest env upds rec recty'
log 5 $ "Record update: " ++ show rcase
check rig elabinfo nest env rcase expected