File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ let ser_str_of_record ~loc varname labels =
321321 | None ->
322322 [% expr [% e result] :: fields]
323323 | Some default ->
324- [% expr if Pervasives. ( = ) [% e field] [% e default] then fields else [% e result] :: fields])
324+ [% expr if [% e field] = [% e default] then fields else [% e result] :: fields])
325325 in
326326 let assoc =
327327 List. fold_left
Original file line number Diff line number Diff line change 1- include module type of Ppx_deriving_runtime
2-
31type 'a error_or = ('a , string ) Result .result
42
53val ( >> = ) : 'a error_or -> ('a -> 'b error_or) -> 'b error_or
@@ -10,3 +8,17 @@ val map_bind : ('a -> 'b error_or) -> 'b list -> 'a list -> 'b list error_or
108 computes it tail-recursively so that large list lengths don't
119 cause a stack overflow *)
1210val safe_map : ('a -> 'b ) -> 'a list -> 'b list
11+
12+ val ( = ) : 'a -> 'a -> bool (* NOTE: Used for [@default ...] *)
13+ module List : (module type of List )
14+ module String : (module type of String )
15+ module Bytes : (module type of Bytes )
16+ module Int32 : (module type of Int32 )
17+ module Int64 : (module type of Int64 )
18+ module Nativeint : (module type of Nativeint )
19+ module Array : (module type of Array )
20+ module Result : sig
21+ type ('a, 'b) result = ('a , 'b ) Result .result =
22+ | Ok of 'a
23+ | Error of 'b
24+ end
Original file line number Diff line number Diff line change @@ -510,11 +510,13 @@ let test_equality_redefined ctxt =
510510 module Pervasives = struct
511511 let (=) : int -> int -> bool = fun a b -> a = b
512512 let _ = 1 = 1 (* just dummy usage of `=` to suppress compiler warning *)
513+
514+ let never_gonna_be_in_pervasives = None
513515 end
514516 let (=) : int -> int -> bool = fun a b -> a = b
515517 let _ = 1 = 1 (* just dummy usage of `=` to suppress compiler warning *)
516518
517- type t = {field : int option [@ default None ]} [@@ deriving to_yojson ]
519+ type t = {field : int option [@ default Pervasives .never_gonna_be_in_pervasives ]} [@@ deriving to_yojson ]
518520 let x = {field = Some 42 }
519521 end
520522 in
You can’t perform that action at this time.
0 commit comments