-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Description
In ppx_deriving 2.2., it was possible to apply @@deriving on a module that happens to have the same name as a standard library module, e.g.:
module List = struct
type 'a t = [`Cons of 'a | `Nil] [@@deriving show]
end
type 'a t = 'a List.t option [@@deriving show]
However, this results in an error in ppx_deriving 3.0:
ocamlfind ocamlc -c -package 'ppx_deriving.std' test.ml
File "test.ml", line 4, characters 0-46:
Error: Unbound value List.pp
Looking at the output of ppx_tools/rewriter
, it appears that Ppx_deriving_runtime.List is shadowing the user-defined List module:
module List = struct ... end
let rec pp : ... =
((let open! Ppx_deriving_runtime in
fun poly_a ->
fun fmt ->
function
| None -> Format.pp_print_string fmt "None"
| Some x ->
(Format.pp_print_string fmt "(Some ";
(List.pp (fun fmt -> poly_a fmt) fmt) x;
Format.pp_print_string fmt ")"))[@ocaml.warning "-A"])
and ...
Metadata
Metadata
Assignees
Labels
No labels