2016-02-18 07:11:59 -08:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* OCaml *)
|
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
|
|
|
(* en Automatique. *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. This file is distributed under the terms of *)
|
|
|
|
(* the GNU Lesser General Public License version 2.1, with the *)
|
|
|
|
(* special exception on linking described in the file LICENSE. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
1995-08-09 08:06:35 -07:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Inclusion checks for the module language *)
|
|
|
|
|
|
|
|
open Typedtree
|
2012-05-30 07:52:37 -07:00
|
|
|
open Types
|
2000-03-06 14:12:09 -08:00
|
|
|
open Format
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2018-03-14 09:57:31 -07:00
|
|
|
(** Type describing which arguments of an inclusion to consider as used
|
|
|
|
for the usage warnings. [Mark_both] is the default. *)
|
|
|
|
type mark =
|
|
|
|
| Mark_both
|
|
|
|
(** Mark definitions used from both arguments *)
|
|
|
|
| Mark_positive
|
|
|
|
(** Mark definitions used from the positive (first) argument *)
|
|
|
|
| Mark_negative
|
|
|
|
(** Mark definitions used from the negative (second) argument *)
|
|
|
|
| Mark_neither
|
|
|
|
(** Do not mark definitions used from either argument *)
|
|
|
|
|
2017-05-09 04:17:41 -07:00
|
|
|
val modtypes:
|
2018-03-14 09:57:31 -07:00
|
|
|
loc:Location.t -> Env.t -> ?mark:mark ->
|
2017-05-09 04:17:41 -07:00
|
|
|
module_type -> module_type -> module_coercion
|
|
|
|
|
2017-12-03 08:58:28 -08:00
|
|
|
val check_modtype_inclusion :
|
2017-08-12 13:24:41 -07:00
|
|
|
loc:Location.t -> Env.t -> Types.module_type -> Path.t -> Types.module_type ->
|
|
|
|
unit
|
2017-12-03 08:58:28 -08:00
|
|
|
(** [check_modtype_inclusion ~loc env mty1 path1 mty2] checks that the
|
|
|
|
functor application F(M) is well typed, where mty2 is the type of
|
|
|
|
the argument of F and path1/mty1 is the path/unstrenghened type of M. *)
|
|
|
|
|
2018-03-14 09:57:31 -07:00
|
|
|
val signatures: Env.t -> ?mark:mark ->
|
|
|
|
signature -> signature -> module_coercion
|
2017-05-09 04:17:41 -07:00
|
|
|
|
2014-04-29 04:56:17 -07:00
|
|
|
val compunit:
|
2018-03-14 09:57:31 -07:00
|
|
|
Env.t -> ?mark:mark -> string -> signature ->
|
|
|
|
string -> signature -> module_coercion
|
2017-05-09 04:17:41 -07:00
|
|
|
|
1996-07-25 06:18:53 -07:00
|
|
|
val type_declarations:
|
2018-03-14 09:57:31 -07:00
|
|
|
loc:Location.t -> Env.t -> ?mark:mark ->
|
2017-05-09 04:17:41 -07:00
|
|
|
Ident.t -> type_declaration -> type_declaration -> unit
|
|
|
|
|
2014-08-22 06:45:02 -07:00
|
|
|
val print_coercion: formatter -> module_coercion -> unit
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2011-10-19 22:49:38 -07:00
|
|
|
type symptom =
|
2014-01-30 01:55:35 -08:00
|
|
|
Missing_field of Ident.t * Location.t * string (* kind *)
|
1995-05-04 03:15:53 -07:00
|
|
|
| Value_descriptions of Ident.t * value_description * value_description
|
2010-05-20 20:36:52 -07:00
|
|
|
| Type_declarations of Ident.t * type_declaration
|
2018-08-08 09:07:53 -07:00
|
|
|
* type_declaration * Includecore.type_mismatch
|
|
|
|
| Extension_constructors of Ident.t * extension_constructor
|
2019-07-30 00:56:28 -07:00
|
|
|
* extension_constructor * Includecore.extension_constructor_mismatch
|
1995-05-04 03:15:53 -07:00
|
|
|
| Module_types of module_type * module_type
|
|
|
|
| Modtype_infos of Ident.t * modtype_declaration * modtype_declaration
|
2019-03-27 11:04:24 -07:00
|
|
|
| Modtype_permutation of Types.module_type * Typedtree.module_coercion
|
1995-09-02 11:55:37 -07:00
|
|
|
| Interface_mismatch of string * string
|
1998-06-24 12:22:26 -07:00
|
|
|
| Class_type_declarations of
|
2012-05-30 07:52:37 -07:00
|
|
|
Ident.t * class_type_declaration * class_type_declaration *
|
1998-06-24 12:22:26 -07:00
|
|
|
Ctype.class_match_failure list
|
|
|
|
| Class_declarations of
|
|
|
|
Ident.t * class_declaration * class_declaration *
|
|
|
|
Ctype.class_match_failure list
|
2006-09-20 04:14:37 -07:00
|
|
|
| Unbound_modtype_path of Path.t
|
2013-09-29 00:22:34 -07:00
|
|
|
| Unbound_module_path of Path.t
|
2014-04-21 03:38:04 -07:00
|
|
|
| Invalid_module_alias of Path.t
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2011-10-19 22:49:38 -07:00
|
|
|
type pos =
|
2019-10-09 06:15:37 -07:00
|
|
|
| Module of Ident.t
|
|
|
|
| Modtype of Ident.t
|
|
|
|
| Arg of functor_parameter
|
|
|
|
| Body of functor_parameter
|
2012-01-22 23:59:45 -08:00
|
|
|
type error = pos list * Env.t * symptom
|
2011-10-19 22:49:38 -07:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
exception Error of error list
|
|
|
|
|
2000-03-06 14:12:09 -08:00
|
|
|
val report_error: formatter -> error list -> unit
|
2013-10-02 06:23:48 -07:00
|
|
|
val expand_module_alias: Env.t -> pos list -> Path.t -> Types.module_type
|