File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,11 @@ and desu_expr_of_only_typ ~path typ =
300300 raise_errorf ~loc: ptyp_loc " %s cannot be derived for %s"
301301 deriver (Ppx_deriving. string_of_core_type typ)
302302
303+ (* TODO: Do not wrap runtime around [@default ...].
304+ We do currently and for instance the following doesn't currently work:
305+ module List = struct let x = [1; 2] end
306+ type t = {field : int list [@default List.x]} [@@deriving to_yojson]
307+ *)
303308let wrap_runtime decls =
304309 Ppx_deriving. sanitize ~module_: (Lident " Ppx_deriving_yojson_runtime" ) decls
305310
Original file line number Diff line number Diff line change @@ -505,6 +505,22 @@ let test_int_redefined ctxt =
505505 let expected = `Int 1 in
506506 assert_equal ~ctxt ~printer: show_json expected M. x
507507
508+ (* TODO: Make this work *)
509+ (*
510+ let test_list_redefined ctxt =
511+ let module M = struct
512+ type redef_list =
513+ | []
514+ | (::) of int * int
515+
516+ type t = {field : int list} [@@deriving to_yojson]
517+ let x = {field = List.([1;2])}
518+ end
519+ in
520+ let expected = `List [`Int 1; `Int 2] in
521+ assert_equal ~ctxt ~printer:show_json expected M.x
522+ *)
523+
508524let test_equality_redefined ctxt =
509525 let module M = struct
510526 module Pervasives = struct
You can’t perform that action at this time.
0 commit comments