Skip to content

Commit 2fedde4

Browse files
committed
Update descriptions of warnings in default list
1 parent 5f3b4f7 commit 2fedde4

File tree

1 file changed

+8
-32
lines changed

1 file changed

+8
-32
lines changed

compiler/ext/bsc_warnings.ml

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,52 +22,28 @@
2222
* along with this program; if not, write to the Free Software
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424

25-
(**
26-
See the meanings of the warning codes here: https://caml.inria.fr/pub/docs/manual-ocaml/comp.html#sec281
27-
28-
- 30 Two labels or constructors of the same name are defined in two mutually recursive types.
29-
- 40 Constructor or label name used out of scope.
30-
31-
- 6 Label omitted in function application.
32-
- 7 Method overridden.
33-
- 9 Missing fields in a record pattern. (*Not always desired, in some cases need [@@@warning "+9"] *)
34-
- 27 Innocuous unused variable: unused variable that is not bound with let nor as, and doesn’t start with an underscore (_) character.
35-
- 29 Unescaped end-of-line in a string constant (non-portable code).
36-
- 32 .. 39 Unused blabla
37-
- 44 Open statement shadows an already defined identifier.
38-
- 45 Open statement shadows an already defined label or constructor.
39-
- 48 Implicit elimination of optional arguments. https://caml.inria.fr/mantis/view.php?id=6352
40-
- 101 (bsb-specific) unsafe polymorphic comparison.
41-
*)
42-
4325
(*
44-
The purpose of default warning set is to make it strict while
45-
not annoy user too much
26+
The purpose of the default warning set is to make it strict while not annoying the user too much.
4627
47-
-4 Fragile pattern matching: matching that will remain complete even if additional con- structors are added to one of the variant types matched.
48-
We turn it off since common pattern
28+
- 4 Fragile pattern matching: matching that will remain complete even if additional constructors are added to one of the variant types matched.
29+
We turn it off since the following is a common pattern:
4930
{[
50-
match x with | A -> .. | _ -> false
31+
switch x { | A => .. | _ => false }
5132
]}
5233
53-
-9 Missing fields in a record pattern.
54-
only in some special cases that we need all fields being listed
34+
- 9 Missing fields in a record pattern.
35+
Only in some special cases that we need all fields being listed
5536
56-
We encourage people to write code based on type based disambigution
57-
40,41,42 are enabled for compatiblity reasons
58-
-40 Constructor or label name used out of scope
59-
This is intentional, we should never warn it
6037
- 41 Ambiguous constructor or label name.
6138
It is turned off since it prevents such cases below:
6239
{[
63-
type a = A |B
40+
type a = A | B
6441
type b = A | B | C
6542
]}
66-
- 42 Disambiguated constructor or label name (compatibility warning).
6743
6844
- 50 Unexpected documentation comment.
6945
70-
- 102 Bs_polymorphic_comparison
46+
- 102 Bs_polymorphic_comparison.
7147
*)
7248
(* If you change this, don't forget to adapt docs/docson/build-schema.json as well. *)
7349
let defaults_w = "+a-4-9-20-41-50-102"

0 commit comments

Comments
 (0)