Skip to content
Newer
Older
100644 55 lines (46 sloc) 1.63 KB
fccc685 Initial open-source release
MLstate authored Jun 21, 2011
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 (**
19 Regrouping all warnings for the typer.
20 @author Mathieu Barbin
21 @author Francois Pessaux
22 *)
23
24 (**
25 This module is meant to contained all warnings class used by any typer.
26 The file has no mli because is would just duplicate everything,
27 everything is exported.
28 *)
29
30 (**
31 The root of warnings handled by the typer.
32 *)
33 let typer =
34 let doc = "Type system warnings" in
35 WarningClass.create ~name:"typer" ~doc ~err:false ~enable:true ()
36
37 (**
38 The class of warning for @@warncoerce directive.
39 Principally used for ensuring that the expression after a [do]
40 has type void.
41 *)
42 let warncoerce =
43 let doc = "Unexpected type for an expression" in
44 WarningClass.create ~parent:typer ~name:"warncoerce" ~doc ~err:false ~enable:true ()
45
46 (**
47 Regrouping all previous classes.
48 Any application is free to load these warning or not.
49 *)
50 let warning_set = WarningClass.Set.create_from_list [typer]
51 (*
52 adding the root node 'typer' in enough, since other classes
53 are defined as children of the root
54 *)
Something went wrong with that request. Please try again.