Hiroki MIZUNO avatar 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
   
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.