Skip to content

Commit

Permalink
Add test for omitting parent type in constructor reference (ocaml#447)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul-Elliot <peada@free.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
  • Loading branch information
EmileTrotignon and panglesd committed Mar 30, 2023
1 parent 3d2e555 commit dc92e12
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/xref2/github_issue_447.t/a.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type u = Bar

(** {!constructor-Bar} {!u.constructor-Bar} *)

module M : sig
type t = Foo
end

(** {!M.constructor-Foo} and {!M.Foo}
{!M.t.constructor-Foo} and {!M.t.Foo} *)
13 changes: 13 additions & 0 deletions test/xref2/github_issue_447.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This test tests the ability to reference constructors, omitting the type they
are coming from.

$ ocamlc -c -bin-annot a.mli
$ odoc compile --warn-error -I . a.cmti

Currently, it is only possible to omit the parent type of the constructor in the
toplevel: only [{!M.constructor-Foo}] does not resolve, as it cannot find a type
named [M].

$ odoc link a.odoc
File "a.mli", line 9, characters 4-24:
Warning: Failed to resolve reference unresolvedroot(M).Foo Couldn't find "M"

0 comments on commit dc92e12

Please sign in to comment.