First-order pattern matching: catch a rogue exception (differing numbers of arguments)
--- a/src/Pure/pattern.ML Fri Nov 19 11:44:46 2010 +0100
+++ b/src/Pure/pattern.ML Fri Nov 19 14:58:49 2010 +0000
@@ -365,6 +365,7 @@
and cases(binders,env as (iTs,itms),pat,obj) =
let val (ph,pargs) = strip_comb pat
fun rigrig1(iTs,oargs) = fold (mtch binders) (pargs~~oargs) (iTs,itms)
+ handle UnequalLengths => raise MATCH
fun rigrig2((a:string,Ta),(b,Tb),oargs) =
if a <> b then raise MATCH
else rigrig1(typ_match thy (Ta,Tb) iTs, oargs)