You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat main.ml
type t
= A of int * int [@equal fun (_, a) (_, b) -> Int.(a = b)]
[@@deriving eq]
let a1 = A (1, 2)
let a2 = A (2, 2)
let () =
Printf.printf "a1 and a2 are %s" (if equal a1 a2 then "equal" else "not equal")
$ ocamlfind ocamlopt -ppx '`ocamlfind query ppx_deriving`/ppx_deriving `ocamlfind query ppx_deriving`/eq/ppx_deriving_eq.cma' -dsource -c main.ml
type t =
| A of int * int [@equal fun (_, a) -> fun (_, b) -> let open Int in a = b]
[@@deriving eq]
let rec (equal : t -> t -> Ppx_deriving_runtime.bool) =
((let open! ((Ppx_deriving_runtime)[@ocaml.warning "-A"]) in
fun lhs ->
fun rhs ->
match (lhs, rhs) with
| (A (lhs0, lhs1), A (rhs0, rhs1)) ->
((fun (a : int) -> fun b -> a = b) lhs0 rhs0) &&
(((fun (a : int) -> fun b -> a = b)) lhs1 rhs1)
| _ -> false)
[@ocaml.warning "-A"])[@@ocaml.warning "-39"]
let a1 = A (1, 2)
let a2 = A (2, 2)
let () =
Printf.printf "a1 and a2 are %s"
(if equal a1 a2 then "equal" else "not equal")
File "main.ml", line 1, characters 0-85:
1 | type t
2 | = A of int * int [@equal fun (_, a) (_, b) -> Int.(a = b)]
3 | [@@deriving eq]
Error: Unbound module Ppx_deriving_runtime
I think the [@Equal] annotation is not taken care of inside the variant.
(I also find it difficult to debug the situation - I ran into the issue #150 when trying to get the AST)
The text was updated successfully, but these errors were encountered:
I think the [@Equal] annotation is not taken care of inside the variant.
(I also find it difficult to debug the situation - I ran into the issue #150 when trying to get the AST)
The text was updated successfully, but these errors were encountered: