1 diff -r dd611ab202a8 -r e7e647949c95 src/HOL/Tools/Function/fun.ML
2 --- a/src/HOL/Tools/Function/fun.ML Wed Jun 06 10:35:05 2012 +0200
3 +++ b/src/HOL/Tools/Function/fun.ML Wed Jun 06 21:36:21 2012 +0200
5 spec @ mk_catchall fixes arity_of
8 -fun warnings ctxt origs tss =
9 +fun further_checks ctxt origs tss =
11 - fun warn_redundant t =
12 - warning ("Ignoring redundant equation: " ^ quote (Syntax.string_of_term ctxt t))
13 + fun fail_redundant t =
14 + error (cat_lines ["Equation is redundant (covered by preceding clauses):", Syntax.string_of_term ctxt t])
15 fun warn_missing strs =
16 warning (cat_lines ("Missing patterns in function definition:" :: strs))
19 @ ["(" ^ string_of_int (length rest) ^ " more)"])
21 val _ = (origs ~~ tss')
22 - |> map (fn (t, ts) => if null ts then warn_redundant t else ())
23 + |> map (fn (t, ts) => if null ts then fail_redundant t else ())
28 val compleqs = add_catchall ctxt fixes feqs (* Completion *)
30 val spliteqs = Function_Split.split_all_equations ctxt compleqs
31 - |> tap (warnings ctxt feqs)
32 + |> tap (further_checks ctxt feqs)
34 fun restore_spec thms =
35 bnds ~~ take (length bnds) (unflat spliteqs thms)