Skip to content

Commit

Permalink
Add test case from JS
Browse files Browse the repository at this point in the history
  • Loading branch information
jonludlam committed May 21, 2024
1 parent 1989b5e commit c9d234c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/xref2/js_stack_overflow.t/a.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
open! Import
include S
module Thing : sig end

13 changes: 13 additions & 0 deletions test/xref2/js_stack_overflow.t/import.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module type S0 = sig
module Thing : sig
module Config : sig end
end
end

module type S = sig
include S0

module Thing : sig
module Config = Thing.Config
end
end
31 changes: 31 additions & 0 deletions test/xref2/js_stack_overflow.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
A bug report from JS. This code was causing a loop / stack overflow. Success is
simply finishing!

$ ocamlc -c import.mli -bin-annot
$ ocamlc -c a.mli -bin-annot

$ odoc compile import.cmti -I .
$ odoc compile a.cmti -I .

$ odoc link import.odoc -I .
$ odoc link a.odoc -I .

$ odoc_print --short a.odocl --show-expansions --show-include-expansions
open [ ]
include Import.S
(sig :
include Import.S0
(sig :
module {Thing}1/shadowed/(74ad8508d0ec544850c6ab547111f52a) :
sig module Config : sig end end
end)
module {Thing}1/shadowed/(1a743df82e4f1cc649e915544d526dea) :
sig
module Config =
{Thing}1/shadowed/(74ad8508d0ec544850c6ab547111f52a).Config
(sig : end)
end
end)
module Thing : sig end


0 comments on commit c9d234c

Please sign in to comment.