Skip to content

Commit 7b66c13

Browse files
Add test for omitting parent type in constructor reference (#447)
Co-authored-by: Paul-Elliot <[email protected]> Signed-off-by: Paul-Elliot <[email protected]>
1 parent 99bcd17 commit 7b66c13

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

test/xref2/github_issue_447.t/a.mli

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
type u = Bar
2+
3+
(** {!constructor-Bar} {!u.constructor-Bar} *)
4+
5+
module M : sig
6+
type t = Foo
7+
end
8+
9+
(** {!M.constructor-Foo} and {!M.Foo}
10+
11+
{!M.t.constructor-Foo} and {!M.t.Foo} *)
12+
13+
class t : object end
14+
15+
(** {!t.constructor-A} *)

test/xref2/github_issue_447.t/run.t

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
This test tests the ability to reference constructors, omitting the type they
2+
are coming from.
3+
4+
$ ocamlc -c -bin-annot a.mli
5+
$ odoc compile --warn-error -I . a.cmti
6+
7+
Currently, it is only possible to omit the parent type of the constructor in the
8+
toplevel: only [{!M.constructor-Foo}] does not resolve, as it cannot find a type
9+
named [M].
10+
11+
$ odoc link a.odoc
12+
File "a.mli", line 15, characters 4-22:
13+
Warning: Failed to resolve reference unresolvedroot(t).A Couldn't find "t"
14+
File "a.mli", line 9, characters 4-24:
15+
Warning: Failed to resolve reference unresolvedroot(M).Foo Couldn't find "M"

0 commit comments

Comments
 (0)