First-order pattern matching: catch a rogue exception (differing numbers of arguments)
authorpaulson
Fri, 19 Nov 2010 14:58:49 +0000
changeset 40617 4a1173d21ec4
parent 40615 ab551d108feb
child 40618 7202d63bfffe
First-order pattern matching: catch a rogue exception (differing numbers of arguments)
src/Pure/pattern.ML
--- 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)