Permalink
Browse files

Fix marshalling of exceptions with no parameters

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
  • Loading branch information...
1 parent eb9be87 commit e177763d4dccccf3e7031597a8261e2039186ee4 David Scott committed Oct 23, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/p4_idl.ml
View
@@ -354,8 +354,8 @@ struct
end >> in
let exnty_of_exn =
- let gen_mc (uid,ty) = <:match_case<
- $uid:uid$ x -> Exception.$uid:uid$ x >> in
+ let gen_mc = function | (uid,Some _) -> <:match_case< $uid:uid$ x -> Exception.$uid:uid$ x >>
+ | (uid,None) -> <:match_case< $uid:uid$ -> Exception.$uid:uid$ >> in
let generic = <:match_case<
e -> Exception.Internal_error (Printexc.to_string e) >> in
let ors = List.map gen_mc rev_exns in
@@ -364,8 +364,8 @@ struct
in
let exn_of_exnty =
- let gen_mc (uid,ty) = <:match_case<
- Exception.$uid:uid$ x -> $uid:uid$ x >> in
+ let gen_mc = function | (uid,Some _) -> <:match_case< Exception.$uid:uid$ x -> $uid:uid$ x >>
+ | (uid,None) -> <:match_case< Exception.$uid:uid$ -> $uid:uid$ >> in
let ors = List.map gen_mc rev_exns in
<:str_item<
value exn_of_exnty x = match x with [ $Ast.mcOr_of_list ors$ ] >>

0 comments on commit e177763

Please sign in to comment.