@@ -525,6 +525,19 @@ arg n tyhole = do ty <- unique_hole tyhole
525525 claim ty RType
526526 forall n (Var ty)
527527
528+-- try a tactic, if it adds any unification problem, return an error
529+no_errors :: Elab' aux () -> Elab' aux ()
530+no_errors tac
531+ = do ps <- get_probs
532+ tac
533+ ps' <- get_probs
534+ if (length ps' > length ps) then
535+ case reverse ps' of
536+ ((x,y,env,err) : _) ->
537+ let env' = map (\(x, b) -> (x, binderTy b)) env in
538+ lift $ tfail $ CantUnify False x y err env' 0
539+ else return ()
540+
528541-- Try a tactic, if it fails, try another
529542try :: Elab' aux a -> Elab' aux a -> Elab' aux a
530543try t1 t2 = try' t1 t2 False