Open mikeshulman opened 8 months ago
I've encountered the same issue only on OCaml 5.1.0 (didn't encounter on OCaml 5.0.0).
This also applies to
(* Cycle_in_def *)
type a = b
and b = a
as well, which is supposed to report a "The definition of %s contains a cycle", but instead results in a stack overflow shortly after freezing.
What I found odd however, is the following works just fine:
(* Recursive_abbrev *)
type ('a, 'b) t = ('b, 'a) t
resulting in:
Error: The type abbreviation t is cyclic: ('a, 'b) t = ('b, 'a) t
but
(* Recursive_abbrev *)
type ('a, 'b) t = ('a, 'b) t
causes a stack overflow.
Seems to work fine in the ocaml repl as well
Occurs with dune as well, but seems to work on 5.2.0.
In utop 2.13.1 for ocaml 5.1.0, entering
causes the program to freeze and become unresponsive, instead of giving the correct error message "The type abbreviation t is cyclic" (which the ordinary toplevel does). This appears to be a regression since 2.12.1 for ocaml 5.0.0.
(It's possible this problem is not confined to utop, as I have also experienced a similar issue with Merlin, but only in a more complicated situation that I haven't managed to minimize yet.)