Skip to content

Commit 7ab7232

Browse files
committed
Merge pull request ocaml#424 from mshinwell/flambda_prereq-warnings
GPR#424: New warning 59: assignment to non-mutable value
2 parents 98fa936 + 776b489 commit 7ab7232

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

man/ocamlc.m

+3
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,9 @@ compilation in any way (even if it is fatal). If a warning is enabled,
855855
50
856856
\ \ Unexpected documentation comment.
857857

858+
59
859+
\ \ Assignment on non-mutable value.
860+
858861
The letters stand for the following sets of warnings. Any letter not
859862
mentioned here corresponds to the empty set.
860863

utils/warnings.ml

+6-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ type t =
7676
| Unreachable_case (* 56 *)
7777
| Ambiguous_pattern of string list (* 57 *)
7878
| No_cmx_file of string (* 58 *)
79+
| Assignment_to_non_mutable_value (* 59 *)
7980
;;
8081

8182
(* If you remove a warning, leave a hole in the numbering. NEVER change
@@ -143,10 +144,12 @@ let number = function
143144
| Unreachable_case -> 56
144145
| Ambiguous_pattern _ -> 57
145146
| No_cmx_file _ -> 58
147+
| Assignment_to_non_mutable_value -> 59
146148
;;
147149

148-
let last_warning_number = 58
150+
let last_warning_number = 59
149151
;;
152+
150153
(* Must be the max number returned by the [number] function. *)
151154

152155
let letter = function
@@ -445,6 +448,7 @@ let message = function
445448
Printf.sprintf
446449
"no cmx file was found in path for module %s, \
447450
and its interface was not compiled with -opaque" name
451+
| Assignment_to_non_mutable_value -> "Assignment to non-mutable value"
448452
;;
449453

450454
let nerrors = ref 0;;
@@ -541,6 +545,7 @@ let descriptions =
541545
56, "Unreachable case in a pattern-matching (based on type information).";
542546
57, "Ambiguous binding by pattern.";
543547
58, "Missing cmx file";
548+
59, "Assignment to non-mutable value";
544549
]
545550
;;
546551

utils/warnings.mli

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ type t =
7171
| Unreachable_case (* 56 *)
7272
| Ambiguous_pattern of string list (* 57 *)
7373
| No_cmx_file of string (* 58 *)
74+
| Assignment_to_non_mutable_value (* 59 *)
7475
;;
7576

7677
val parse_options : bool -> string -> unit;;

0 commit comments

Comments
 (0)