Skip to content
Snippets Groups Projects
Commit c4058daa authored by Basile Desloges's avatar Basile Desloges
Browse files

REVUE 2 : supprime module type Exn inutile

parent ed7d9f6f
No related branches found
No related tags found
No related merge requests found
...@@ -22,16 +22,19 @@ ...@@ -22,16 +22,19 @@
open Error_types open Error_types
module Exn_impl = struct (** Internal module holding the exception of [Error].
The module is included into [Make_with_opt] later and should not be used
directly. However we need to have a separate module for the exception so
that every exception built by [Make] is the exact same type. *)
module Exn = struct
exception Typing_error of Options.category option * string exception Typing_error of Options.category option * string
exception Not_yet of Options.category option * string exception Not_yet of Options.category option * string
exception Not_memoized of Options.category option exception Not_memoized of Options.category option
end end
module type Exn = module type of Exn_impl
module type S = sig module type S = sig
include Exn include module type of Exn
val make_untypable: string -> exn val make_untypable: string -> exn
val make_not_yet: string -> exn val make_not_yet: string -> exn
val make_not_memoized: unit -> exn val make_not_memoized: unit -> exn
...@@ -55,7 +58,7 @@ module type S = sig ...@@ -55,7 +58,7 @@ module type S = sig
end end
module Make_with_opt(P: sig val phase:Options.category option end): S = struct module Make_with_opt(P: sig val phase:Options.category option end): S = struct
include Exn_impl include Exn
let make_untypable msg = Typing_error (P.phase, msg) let make_untypable msg = Typing_error (P.phase, msg)
let make_not_yet msg = Not_yet (P.phase, msg) let make_not_yet msg = Not_yet (P.phase, msg)
......
...@@ -23,12 +23,7 @@ ...@@ -23,12 +23,7 @@
(** Handling errors. *) (** Handling errors. *)
open Error_types open Error_types
(** Internal module holding the exception of [Error]. module type S = sig
The module is included into [S] later and should not be used directly.
However we need to have a separate module for the exception so that every
exception built by [Make] is the exact same type. *)
module type Exn = sig
exception Typing_error of Options.category option * string exception Typing_error of Options.category option * string
(** Typing error where the first element is the phase where the error occured (** Typing error where the first element is the phase where the error occured
and the second element is the error message. *) and the second element is the error message. *)
...@@ -39,10 +34,6 @@ module type Exn = sig ...@@ -39,10 +34,6 @@ module type Exn = sig
exception Not_memoized of Options.category option exception Not_memoized of Options.category option
(** "Not memoized" error with the phase where the error occured. *) (** "Not memoized" error with the phase where the error occured. *)
end
module type S = sig
include Exn
val make_untypable: string -> exn val make_untypable: string -> exn
(** Make a [Typing_error] exception with the given message. *) (** Make a [Typing_error] exception with the given message. *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment