Skip to content

Commit 9cad1f3

Browse files
committed
Review
1 parent 79712c1 commit 9cad1f3

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

testsuite/tests/typing-modal-kinds/basics.ml

+1
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ Error: This type "int t" should be an instance of type
897897
But the kind of int t must be a subkind of value mod contended
898898
because of the definition of require_contended at line 1, characters 0-49.
899899
|}]
900+
(* CR layouts v2.8: fix principal mode *)
900901

901902
type t2 = int ref t require_contended
902903

typing/jkind.ml

+9-2
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,15 @@ let relevant_axes_of_modality ~relevant_for_nullability ~modality =
399399
| Modal axis ->
400400
let (P axis) = Mode.Const.Axis.alloc_as_value (P axis) in
401401
let modality = Mode.Modality.Value.Const.proj axis modality in
402-
let is_constant = Mode.Modality.is_constant modality in
403-
not is_constant
402+
not (Mode.Modality.is_constant modality)
403+
(* The kind-inference.md document (in the repo) discusses both constant
404+
modalities and identity modalities. Of course, reality has modalities
405+
(such as [shared]) that are neither constants nor identities. Here, we
406+
treat all non-constant modalities the way that the design treats identity
407+
modalities. This is safe, because it leads to a minimum of
408+
mode-crossing. In the future, we may want to complexify the modal-kinds
409+
setup to allow for more mode-crossing in the presence of non-constant
410+
non-identity modalities. *)
404411
| Nonmodal Externality -> true
405412
| Nonmodal Nullability -> (
406413
match relevant_for_nullability with

0 commit comments

Comments
 (0)