OxCaml: Support for kind annotations#1410
Conversation
| ("recent.mli", Min "5.4"); | ||
| ("labels.mli", Min "4.09"); | ||
| ("recent_impl.ml", Min "4.09"); | ||
| ("recent_impl.ml", MinNotOxCaml "4.09"); |
There was a problem hiding this comment.
recent_impl.ml is the only .ml file currently tested, and it uses simple type t = A which in OxCaml now renders as type t : immediate = A (which is correct, but not compatible with the OCaml output). I tried to "complexify" the type definition, but then you either get immutable_data or mutable_data instead so that doesn't help! :P
(This doesn't seem to be an issue for .mli testing, because OxCaml doesn't try to infer more precise kinds than the ones specified)
There was a problem hiding this comment.
That seems fine to me. OxCaml not being run on this specific test seems fine. Adding the variant MinNotOxCaml is fine.
Just to confirm I understand correctly:
type t = Awill be loaded as different values in odoc, depending on whether they are in an ml or mli file:
- In an ml file, some layout is inferred for
t, from the definition, and stored in thecmt - In an mli file, nothing is inferred and the
Defaultannotation is loaded from thecmi.
This seems strange, and will discourage the use of ml without mli, since it will be impossible to have a type without an annotation!
But if it comes from the cmti, I'm not sure we should do anything about that.
50e0a0b to
d0a2d4e
Compare
There was a problem hiding this comment.
Looks good to me!
The only improvements I see is to have test the kind products (eg, bit32 & float64). In particular, do we need to use parentheses for thing like (bit32 mod portable) & (float64 mod contended)?
I am also not sure what Pjk_kind_of represents, and whether it is tested or not...
91731c7 to
d23585b
Compare
|
Thanks everyone! I've rebased and updated for OxCaml minus31, with some new tests and fixes following the reviews :) @panglesd > The |
|
mdx tests failed. I'm very doubtful they provide any value any more - they're very old and have largely been superseded by newer tests. I'd be happy for them to be removed. |
panglesd
left a comment
There was a problem hiding this comment.
Looks good to me!
I'm happy to have the kind abbrev in another PR.
Kinds do not have any "format breaks", but this can also be fixed in another PR (especially, I don't know if it is a big deal, how often are there so many kinds it's better to break, but I hope not too often)
I left a nitpick on an unimplemented feature.
|
And I agree with the removal of mdx tests. I've never had a bug found by an mdx test not covered by a cram test. It could be in this PR or another. |
|
I've fixed the mdx tests here, and submitted #1437 to get rid of them in the future :) |
|
Thanks! |
Builds on top of #1404 (which adds the oxcaml test file)
This PR adds support for OxCaml kind annotations :)