Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.12 injectivity annotations aren't (yet) supported #467

Closed
dra27 opened this issue Aug 4, 2020 · 1 comment · Fixed by #488
Closed

4.12 injectivity annotations aren't (yet) supported #467

dra27 opened this issue Aug 4, 2020 · 1 comment · Fixed by #488

Comments

@dra27
Copy link
Member

dra27 commented Aug 4, 2020

ocaml/ocaml#9500 adds support for injectivity annotations on abstract types - at present odoc can't build with trunk OCaml, therefore, since Asttypes.variance changed.

@dra27
Copy link
Member Author

dra27 commented Aug 4, 2020

A very small hack:

--- a/src/loader/cmti.ml
+++ b/src/loader/cmti.ml
@@ -178,9 +178,9 @@ let read_type_parameter (ctyp, var) =
   in
   let var =
     match var with
-    | Covariant -> Some Pos
-    | Contravariant -> Some Neg
-    | Invariant -> None
+    | Covariant, _ -> Some Pos
+    | Contravariant, _ -> Some Neg
+    | NoVariance, _ -> None

and a revert of ocaml/ocaml#9781 allows odoc master to compile trunk OCaml's documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant