# HG changeset patch # User paulson # Date 1290178729 0 # Node ID 4a1173d21ec41d8564b59057bb8c653ad71ee2e9 # Parent ab551d108feb96841e4f91758a3d2001c9e143b7 First-order pattern matching: catch a rogue exception (differing numbers of arguments) diff -r ab551d108feb -r 4a1173d21ec4 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)