Skip to content

Commit

Permalink
Resolved issue with compiler release 4.11
Browse files Browse the repository at this point in the history
- Resolved issue with compiler release 4.11 going into an
  infinite loop compiling lib/utilities.ml
  • Loading branch information
stevebleazard committed Jun 2, 2021
1 parent 283b30f commit b842d14
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.0.1 (2021-06-02)
- Resolved issue with compiler release 4.11 going into an
infinite loop compiling lib/utilities.ml

## v1.0.0 (2021-02-21)

- Initial release
18 changes: 17 additions & 1 deletion lib/utilities.ml
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,28 @@ let rec equal json1 json2 =
| `Variant (n1, v1), `Variant (n2, v2) -> begin
match String.compare n1 n2 with
| 0 -> begin
(* match (v1:'a Json_internal.constrained option), (v2:'a option) with *)
match v1, v2 with
| Some v1, Some v2 -> equal v1 v2
| None, None -> true
| _ -> false
end
| _ -> false
end
(*
The following causes some compiler versions, especially 4.11, to go into an
infinite loop. Expanding the left hand side appears to resolve this.
| (_:'a Json_internal.constrained), (_:'a Json_internal.constrained) -> false
*)
| `Null, (_:'a Json_internal.constrained)
| `Bool _, (_:'a Json_internal.constrained)
| `Int _, (_:'a Json_internal.constrained)
| `Intlit _, (_:'a Json_internal.constrained)
| `Float _, (_:'a Json_internal.constrained)
| `Floatlit _, (_:'a Json_internal.constrained)
| `String _, (_:'a Json_internal.constrained)
| `Stringlit _, (_:'a Json_internal.constrained)
| `Assoc _, (_:'a Json_internal.constrained)
| `Tuple _, (_:'a Json_internal.constrained)
| `List _, (_:'a Json_internal.constrained)
| `Variant _, (_:'a Json_internal.constrained) -> false

0 comments on commit b842d14

Please sign in to comment.