Commits

camlspotter committed 3113832

added special cases of identity

Comments (0)

Files changed (1)

pa/pa_meta_conv.ml

     >>
   
   let rec gen_ctyp : ?top:(Loc.t * string) -> ctyp -> expr = fun ?top -> function
+    | TyId (loc, id) when same_idents target_type_path id ->
+        <:expr@loc< fun x -> x >>
+
     | TyId (loc, id) ->  (* int *)
         <:expr@loc< $id: change_id (fun s -> A.conv_name ^ "_of_" ^ s) id$ >>
           
      its position.
   *)
   let rec gen_ctyp : ?top: (Loc.t * string) -> ctyp -> expr = fun ?top -> function
+    | TyId (loc, id) when same_idents target_type_path id ->
+        <:expr@loc< fun ?trace:__t x -> `Ok x >>
+
     | TyId (loc, id) ->  (* int *)
         <:expr@loc< $id: change_id (fun s -> s ^ "_of_" ^ A.conv_name) id$ >>