forked from ocaml/odoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for omitting parent type in constructor reference (ocaml#447)
Co-authored-by: Paul-Elliot <peada@free.fr> Signed-off-by: Paul-Elliot <peada@free.fr>
- Loading branch information
1 parent
3d2e555
commit dc92e12
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |