Skip to content

Commit b6b4e58

Browse files
committed
clean up modality printing
1 parent 15b36a8 commit b6b4e58

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

testsuite/tests/typing-jkind-bounds/subsumption/modalities.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,17 @@ end
370370
Line 4, characters 40-48:
371371
4 | type 'a t : immutable_data with 'a @@ portable contended portable
372372
^^^^^^^^
373-
Warning 213: This portability is overriden by meet_with(portable) later.
373+
Warning 213: This portability is overriden by portable later.
374374

375375
Line 4, characters 40-48:
376376
4 | type 'a t : immutable_data with 'a @@ portable contended portable
377377
^^^^^^^^
378-
Warning 213: This portability is overriden by meet_with(portable) later.
378+
Warning 213: This portability is overriden by portable later.
379379

380380
Line 4, characters 40-48:
381381
4 | type 'a t : immutable_data with 'a @@ portable contended portable
382382
^^^^^^^^
383-
Warning 213: This portability is overriden by meet_with(portable) later.
383+
Warning 213: This portability is overriden by portable later.
384384

385385
module M : sig type 'a t : immutable_data with 'a @@ portable end
386386
|}]

testsuite/tests/typing-modes/modes.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ type t = Foo of global_ string @@ global
325325
Line 1, characters 16-23:
326326
1 | type t = Foo of global_ string @@ global
327327
^^^^^^^
328-
Warning 213: This locality is overriden by meet_with(global) later.
328+
Warning 213: This locality is overriden by global later.
329329

330330
type t = Foo of global_ string
331331
|}]
@@ -354,7 +354,7 @@ type r = {
354354
Line 2, characters 2-9:
355355
2 | global_ x : string @@ global
356356
^^^^^^^
357-
Warning 213: This locality is overriden by meet_with(global) later.
357+
Warning 213: This locality is overriden by global later.
358358

359359
type r = { global_ x : string; }
360360
|}]
@@ -381,7 +381,7 @@ type r = {
381381
Line 2, characters 16-23:
382382
2 | x : string @@ aliased global many aliased
383383
^^^^^^^
384-
Warning 213: This uniqueness is overriden by join_with(aliased) later.
384+
Warning 213: This uniqueness is overriden by aliased later.
385385

386386
type r = { x : string @@ global many aliased; }
387387
|}]

testsuite/tests/typing-modes/val_modalities.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,27 @@ end
4545
Line 2, characters 22-28:
4646
2 | val x : string @@ global local unique aliased once many uncontended contended
4747
^^^^^^
48-
Warning 213: This locality is overriden by meet_with(local) later.
48+
Warning 213: This locality is overriden by local later.
4949

5050
Line 2, characters 50-54:
5151
2 | val x : string @@ global local unique aliased once many uncontended contended
5252
^^^^
53-
Warning 213: This linearity is overriden by meet_with(many) later.
53+
Warning 213: This linearity is overriden by many later.
5454

5555
Line 3, characters 6-14:
5656
3 | portable nonportable
5757
^^^^^^^^
58-
Warning 213: This portability is overriden by meet_with(nonportable) later.
58+
Warning 213: This portability is overriden by nonportable later.
5959

6060
Line 2, characters 35-41:
6161
2 | val x : string @@ global local unique aliased once many uncontended contended
6262
^^^^^^
63-
Warning 213: This uniqueness is overriden by join_with(aliased) later.
63+
Warning 213: This uniqueness is overriden by aliased later.
6464

6565
Line 2, characters 60-71:
6666
2 | val x : string @@ global local unique aliased once many uncontended contended
6767
^^^^^^^^^^^
68-
Warning 213: This contention is overriden by join_with(contended) later.
68+
Warning 213: This contention is overriden by contended later.
6969

7070
module type S = sig val x : string @@ many aliased contended end
7171
|}]

typing/typemode.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ let sort_dedup_modalities ~warn l =
559559
if warn
560560
then
561561
let axis = Format.asprintf "%a" Value.Axis.print ax0 in
562-
let overriden_by = Format.asprintf "%a" Modality.print a1 in
562+
let { txt = Modality overriden_by; _ } = untransl_modality a1 in
563563
Location.prerr_warning loc0
564564
(Warnings.Modal_axis_specified_twice { axis; overriden_by })
565565
in
@@ -574,7 +574,6 @@ let transl_modalities ~maturity mut attrs modalities =
574574
(* - mut_modalities is applied before explicit modalities.
575575
- explicit modalities can override mut_modalities.
576576
- For the same axis, later modalities overrides earlier modalities. *)
577-
(* CR zqian: warn if an axis is specified multiple times in a modality expr. *)
578577
List.fold_left
579578
(fun m (Atom (ax, a) as t) ->
580579
let m = Value.Const.set ax a m in

0 commit comments

Comments
 (0)