From db1e523119bbc3217e12d24fd82a1c0b36e319a3 Mon Sep 17 00:00:00 2001 From: Gabriel Scherer Date: Thu, 28 Apr 2016 08:45:40 -0400 Subject: [PATCH] warning 52: change wording (Jacques Garrigue and Mark Shinwell) --- Changes | 6 ++++++ manual/manual/cmds/comp.etex | 6 +++--- utils/warnings.ml | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Changes b/Changes index 68fa0b112..d25ae2a3c 100644 --- a/Changes +++ b/Changes @@ -47,6 +47,12 @@ OCaml 4.04.0: "transitive" heap size of a value (Alain Frisch, review by Marc Shinwell and Damien Doligez) +### Manual: + +- PR#7245, GPR#565: clarification to the wording and documentation + of Warning 52 (fragile constant pattern) + (Gabriel Scherer, William, Adrien Nader, Jacques Garrigue) + ### Build system: - GPR#324: Compiler developpers only: Adding new primitives to the diff --git a/manual/manual/cmds/comp.etex b/manual/manual/cmds/comp.etex index afc3435d4..62b4fd25e 100644 --- a/manual/manual/cmds/comp.etex +++ b/manual/manual/cmds/comp.etex @@ -801,9 +801,9 @@ This section describes and explains in detail some warnings: > | Foo "specific value" -> 0 > ^^^^^^^^^^^^^^^^ -> Warning 52: the argument of this constructor should not be matched against a -> constant pattern; the actual value of the argument could change -> in the future. +> Warning 52: Code should not depend on the actual values of +> this constructor's arguments. They are only for information +> and may change in future versions. (See manual section 8.5) \end{verbatim} In particular, all built-in exceptions with a string argument have diff --git a/utils/warnings.ml b/utils/warnings.ml index 5ffda3367..775a7d79b 100644 --- a/utils/warnings.ml +++ b/utils/warnings.ml @@ -438,9 +438,9 @@ let message = function Printf.sprintf "expected tailcall" | Fragile_literal_pattern -> Printf.sprintf - "the argument of this constructor should not be matched against a\n\ - constant pattern; the actual value of the argument could change\n\ - in the future." + "Code should not depend on the actual values of\n\ + this constructor's arguments. They are only for information\n\ + and may change in future versions. (See manual section 8.5)" | Unreachable_case -> "this match case is unreachable.\n\ Consider replacing it with a refutation case ' -> .'"