| 1 |
open Ppx_compare_lib.Builtin |
| 2 |
|
| 3 |
type t = |
| 4 |
{ x : int [@compare.ignore] |
| 5 |
; y : int |
| 6 |
} |
| 7 |
[@@deriving equal] |
| 8 |
|
| 9 |
[%%expect |
| 10 |
{| |
| 11 |
Line _, characters _-_: |
| 12 |
Error: Cannot use [@compare.ignore] with [@@deriving equal] |
| 13 |
|}] |
| 14 |
|
| 15 |
type t = |
| 16 |
{ x : int [@equal.ignore] |
| 17 |
; y : int |
| 18 |
} |
| 19 |
[@@deriving compare, equal] |
| 20 |
|
| 21 |
[%%expect |
| 22 |
{| |
| 23 |
Line _, characters _-_: |
| 24 |
Error: Cannot use [@equal.ignore] with [@@deriving compare]. |
| 25 |
|}] |
| 26 |
|
| 27 |
(* The following ones are OK: *) |
| 28 |
|
| 29 |
type t = |
| 30 |
{ x : int [@compare.ignore] [@equal.ignore] |
| 31 |
; y : int |
| 32 |
} |
| 33 |
[@@deriving compare, equal] |
| 34 |
|
| 35 |
[%%expect {| |}] |
| 36 |
|
| 37 |
type t = |
| 38 |
{ x : int [@ignore] |
| 39 |
; y : int |
| 40 |
} |
| 41 |
[@@deriving compare, equal] |
| 42 |
|
| 43 |
[%%expect {| |}] |