Skip to content

Commit 523b6f5

Browse files
committed
Add a test for #587
Signed-off-by: Jon Ludlam <[email protected]>
1 parent 3d40f62 commit 523b6f5

File tree

9 files changed

+87
-0
lines changed

9 files changed

+87
-0
lines changed

test/xref2/dune

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@
1313

1414
(cram
1515
(deps %{bin:odoc} %{bin:odoc_print} %{bin:compile}))
16+
17+
(subdir
18+
v408_and_above
19+
(cram
20+
(enabled_if
21+
(>= %{ocaml_version} 4.08.0))))
22+

test/xref2/v408_and_above/dune

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(cram
2+
(deps %{bin:odoc} %{bin:odoc_print} %{bin:compile}))
3+
4+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module type S = sig
2+
module Foo : sig end
3+
end
4+
5+
module type A = sig
6+
module type S = S
7+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include B_intf.B
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module Bar = struct end
2+
3+
module type S = sig
4+
include A_intf.S
5+
6+
module Foo : sig end
7+
end
8+
9+
module type B = sig
10+
module type S = S
11+
12+
include S
13+
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
OCAMLC=ocamlc
4+
ODOC=odoc
5+
6+
$OCAMLC -w -49 -no-alias-deps -c odoc_bug__.ml -bin-annot
7+
8+
for f in a_intf b_intf; do
9+
$OCAMLC -c $f.ml -bin-annot -g -no-alias-deps -open Odoc_bug__ -o odoc_bug__$f
10+
done
11+
12+
for f in b c; do
13+
$OCAMLC -c -intf $f.mli -bin-annot -no-alias-deps -open Odoc_bug__ -o odoc_bug__$f
14+
done
15+
16+
for f in .cmt a_intf.cmt b_intf.cmt b.cmti c.cmti; do
17+
odoc compile odoc_bug__$f -I . --pkg odoc_bug
18+
done
19+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include B.S
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module A_intf = Odoc_bug__a_intf
2+
module B = Odoc_bug__b
3+
module B_intf = Odoc_bug__b_intf
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
A quick test to repro the issue found in #587
2+
3+
$ ./build.sh
4+
odoc: internal error, uncaught exception:
5+
Failure("Error")
6+
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
7+
Called from Odoc_xref2__Subst.rename_bound_idents.new_module_id in file "src/xref2/subst.ml", line 771, characters 13-29
8+
Called from Odoc_xref2__Subst.rename_bound_idents.(fun) in file "src/xref2/subst.ml", line 809, characters 16-32
9+
Called from Odoc_xref2__Subst.rename_bound_idents.(fun) in file "src/xref2/subst.ml", line 868, characters 8-69
10+
Called from Odoc_xref2__Subst.signature in file "src/xref2/subst.ml", line 907, characters 17-50
11+
Called from Odoc_xref2__Subst.simple_expansion in file "src/xref2/subst.ml", line 503, characters 30-46
12+
Called from Odoc_xref2__Subst.option_ in file "src/xref2/subst.ml", line 412, characters 51-61
13+
Called from Odoc_xref2__Subst.module_type_expr in file "src/xref2/subst.ml", line 599, characters 24-62
14+
Called from Odoc_xref2__Subst.module_type in file "src/xref2/subst.ml", line 509, characters 37-59
15+
Called from Odoc_xref2__Tools.handle_module_type_lookup.(fun) in file "src/xref2/tools.ml", line 415, characters 13-37
16+
Called from Odoc_xref2__Tools.resolve_module_type.(fun) in file "src/xref2/tools.ml", line 708, characters 8-68
17+
Called from Odoc_xref2__Expand_tools.aux_expansion_of_u_module_type_expr in file "src/xref2/expand_tools.ml", line 111, characters 6-61
18+
Called from Odoc_xref2__Compile.include_.get_expansion in file "src/xref2/compile.ml", line 325, characters 10-66
19+
Called from Odoc_xref2__Compile.signature_items.(fun) in file "src/xref2/compile.ml", line 240, characters 21-35
20+
Called from Stdlib__list.fold_left in file "list.ml", line 121, characters 24-34
21+
Called from Odoc_xref2__Compile.signature_items in file "src/xref2/compile.ml", line 204, characters 4-1023
22+
Called from Odoc_xref2__Compile.signature in file "src/xref2/compile.ml", line 273, characters 16-46
23+
Called from Odoc_xref2__Compile.content.(fun) in file "src/xref2/compile.ml", line 66, characters 13-54
24+
Called from Odoc_xref2__Compile.unit in file "src/xref2/compile.ml", line 59, characters 21-47
25+
Called from Odoc_xref2__Lookup_failures.catch_failures in file "src/xref2/lookup_failures.ml", line 18, characters 10-14
26+
Called from Odoc_odoc__Compile.resolve_and_substitute.(fun) in file "src/odoc/compile.ml", line 74, characters 2-37
27+
Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 25, characters 19-24
28+
Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 23, characters 12-19
29+
Called from Cmdliner.Term.run in file "cmdliner.ml", line 117, characters 32-39
30+
[2]
31+
32+

0 commit comments

Comments
 (0)