File tree 2 files changed +10
-2
lines changed
testsuite/tests/typing-modal-kinds
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -897,6 +897,7 @@ Error: This type "int t" should be an instance of type
897
897
But the kind of int t must be a subkind of value mod contended
898
898
because of the definition of require_contended at line 1 , characters 0 -49.
899
899
| }]
900
+ (* CR layouts v2.8: fix principal mode *)
900
901
901
902
type t2 = int ref t require_contended
902
903
Original file line number Diff line number Diff line change @@ -399,8 +399,15 @@ let relevant_axes_of_modality ~relevant_for_nullability ~modality =
399
399
| Modal axis ->
400
400
let (P axis) = Mode.Const.Axis. alloc_as_value (P axis) in
401
401
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. *)
404
411
| Nonmodal Externality -> true
405
412
| Nonmodal Nullability -> (
406
413
match relevant_for_nullability with
You can’t perform that action at this time.
0 commit comments