-
Notifications
You must be signed in to change notification settings - Fork 19
Import compiler changes from PR 5398 #218
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
Merged
Merged
Conversation
This file contains hidden or 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
Contributor
dkalinichenko-js
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 4-way diff, courtesy of Claude:
⎿ ======================================================================
4-WAY DIFF: oxcaml/oxcaml#5398 vs oxcaml/merlin#218
======================================================================
Shared files (3):
- typing/printtyp.ml
- typing/typemode.ml
- typing/typemode.mli
oxcaml-only files (1):
- testsuite/tests/typing-jkind-bounds/verbosity/verbosity2.ml
merlin-only files (1):
- tests/test-dirs/kind-enclosing/verbosity.t
======================================================================
FILE: typing/printtyp.ml
DIFFERENCES FOUND:
--- oxcaml#typing/printtyp.ml
+++ merlin#typing/printtyp.ml
@@ -1,7 +1,7 @@
diff --git a/typing/printtyp.ml b/typing/printtyp.ml
---- a/typing/printtyp.ml
+--- b/typing/printtyp.ml
+++ b/typing/printtyp.ml
-@@ -1433,7 +1433,7 @@ let outcome_label : Types.arg_label -> Outcometree.arg_label = function
+@@ -1352,7 +1352,7 @@ let outcome_label : Types.arg_label -> Outcometree.arg_label = function
accordingly. *)
let tree_of_modalities mut t =
t
@@ -9,4 +9,4 @@
+ |> Typemode.least_modalities ~include_implied:false ~mut
|> Typemode.sort_dedup_modalities
|> List.map (fun (Atom (ax, m) : Modality.atom) ->
- Fmt.asprintf "%a" (Modality.Per_axis.print ax) m)
+ Format.asprintf "%a" (Modality.Per_axis.print ax) m)
======================================================================
FILE: typing/typemode.ml
DIFFERENCES FOUND:
--- oxcaml#typing/typemode.ml
+++ merlin#typing/typemode.ml
@@ -1,5 +1,5 @@
diff --git a/typing/typemode.ml b/typing/typemode.ml
---- a/typing/typemode.ml
+--- b/typing/typemode.ml
+++ b/typing/typemode.ml
@@ -520,7 +520,7 @@ let idx_expected_modalities ~(mut : bool) =
"Typemode.idx_expected_modalities: mismatch with mutable implied \
@@ -31,12 +31,12 @@
- |> List.map (fun (Atom (ax, m) : Modality.atom) ->
+ List.map
+ (fun (Atom (ax, m) : Modality.atom) ->
- let s = Format_doc.asprintf "%a" (Modality.Per_axis.print ax) m in
+ let s = Format.asprintf "%a" (Modality.Per_axis.print ax) m in
{ Location.txt = Parsetree.Mode s; loc = Location.none })
+ least_modalities
in
- let nonmodal_annots =
-+ (* These mod-bounds are top ones, which are redundant to print. But we include
++ (* These mod-bounds are top ones, which are redundant to print. But we include
+ them when printing verbosely. *)
+ let top_modality_annots () =
+ List.filter_map
@@ -52,7 +52,7 @@
+ | true -> None
+ | false ->
+ let s =
-+ Format_doc.asprintf "%a"
++ Format.asprintf "%a"
+ (Modality.Per_axis.print ax)
+ (Modality.Const.proj ax modality)
+ in
@@ -65,11 +65,11 @@
- if (not verbose) && value = default
- then None
- else
-- let s = Format_doc.asprintf "%a" print value in
+- let s = Format.asprintf "%a" print value in
- Some { Location.txt = Parsetree.Mode s; loc = Location.none }
-+ let mk_annot top print value =
++ let mk_annot top print value =
+ let only_when_verbose = value = top in
-+ let s = Format_doc.asprintf "%a" print value in
++ let s = Format.asprintf "%a" print value in
+ ( { Location.txt = Parsetree.Mode s; loc = Location.none },
+ only_when_verbose )
in
======================================================================
FILE: typing/typemode.mli
DIFFERENCES FOUND:
--- oxcaml#typing/typemode.mli
+++ merlin#typing/typemode.mli
@@ -1,5 +1,5 @@
diff --git a/typing/typemode.mli b/typing/typemode.mli
---- a/typing/typemode.mli
+--- b/typing/typemode.mli
+++ b/typing/typemode.mli
@@ -33,8 +33,14 @@ val transl_modalities :
Parsetree.modalities ->
dkalinichenko-js
approved these changes
Feb 9, 2026
Contributor
Author
|
Thanks for catching my sloppiness - fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR cherrypicks the compiler changes from PR oxcaml/oxcaml#5398. The reason for eagerly cherry-picking is to fix verbose kind hovers without waiting for the next compiler roll.