on master help sign in
Check the type of a proof matches the type of the goal!
commita162bd4494b8e2e154063dc85c83997a43e1b2e1 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateMon 11 Mar 2013, 11:32 (14 years ago) parent69d3216
1 file changed+5
src/Idris/Prover.hs+5
src/Idris/Prover.hs+5
@@ -59,6 +59,11 @@ prove ctxt lit n ty
5959 let tree = simpleCase False True CompileTime (FC "proof" 0) [([], P Ref n ty, tm)]
6060 logLvl 3 (show tree)
6161 (ptm, pty) <- recheckC (FC "proof" 0) [] tm
62+ logLvl 5 ("Proof type: " ++ show pty ++ "\n" ++
63+ "Expected type:" ++ show ty)
64+ case converts ctxt [] ty pty of
65+ OK _ -> return ()
66+ Error e -> ierror (CantUnify False ty pty e [] 0)
6267 ptm' <- applyOpts ptm
6368 updateContext (addCasedef n True False True False
6469 [Right (P Ref n ty, ptm)]