Commits

Hiroki MIZUNO committed 75925cf

fix tuple conversion

Comments (0)

Files changed (1)

pa/pa_meta_conv.ml

         let ids = mk_idents "__x" len in
         let pat = create_patt_list (List.map patt_of_id ids) in 
         let tup = create_tuple (List.map expr_of_id ids) in
-        let exps = List.map2 (fun id ctyp -> <:expr< $gen_ctyp ctyp$ $id:id$>> ) ids ctyps in
+        let exps = List.map2 (fun id ctyp -> <:expr< $gen_ctyp ctyp$ ~adrs:(snd $id:id$) (fst $id:id$)>> ) ids ctyps in
         let binds = binds ids exps tup in
-        <:expr< fun ?(adrs:__adrs=Meta_conv.Types.Address.top) __value -> 
-          match $id:module_path$.Decode.tuple (__value,_adrs) with
+        <:expr< fun ?adrs:(__adrs=Meta_conv.Types.Address.top) __value -> 
+          match $id:module_path$.Decode.tuple (__value,__adrs) with
           | $pat$ -> $binds$
-          | l -> Meta_conv.Internal.tuple_arity_error len (List.length l) __value __adrs
+          | l -> Meta_conv.Internal.tuple_arity_error $int:string_of_int len$ (List.length l) __value __adrs
         >>
     | _ -> assert false