From c4058daad68d34ff32acab843e6ca607088a820c Mon Sep 17 00:00:00 2001
From: Basile Desloges <basile.desloges@cea.fr>
Date: Wed, 19 Jan 2022 16:55:48 +0100
Subject: [PATCH] REVUE 2 : supprime module type Exn inutile

---
 src/plugins/e-acsl/src/libraries/error.ml  | 13 ++++++++-----
 src/plugins/e-acsl/src/libraries/error.mli | 11 +----------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/src/plugins/e-acsl/src/libraries/error.ml b/src/plugins/e-acsl/src/libraries/error.ml
index e61770e7eda..69bd43df172 100644
--- a/src/plugins/e-acsl/src/libraries/error.ml
+++ b/src/plugins/e-acsl/src/libraries/error.ml
@@ -22,16 +22,19 @@
 
 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 Not_yet of Options.category option * string
   exception Not_memoized of Options.category option
 end
 
-module type Exn = module type of Exn_impl
-
 module type S = sig
-  include Exn
+  include module type of Exn
   val make_untypable: string -> exn
   val make_not_yet: string -> exn
   val make_not_memoized: unit -> exn
@@ -55,7 +58,7 @@ module type S = sig
 end
 
 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_not_yet msg = Not_yet (P.phase, msg)
diff --git a/src/plugins/e-acsl/src/libraries/error.mli b/src/plugins/e-acsl/src/libraries/error.mli
index 3f14c2453d9..3e34e8b81f9 100644
--- a/src/plugins/e-acsl/src/libraries/error.mli
+++ b/src/plugins/e-acsl/src/libraries/error.mli
@@ -23,12 +23,7 @@
 (** Handling errors. *)
 open Error_types
 
-(** Internal module holding the exception of [Error].
-
-    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
+module type S = sig
   exception Typing_error of Options.category option * string
   (** Typing error where the first element is the phase where the error occured
       and the second element is the error message. *)
@@ -39,10 +34,6 @@ module type Exn = sig
 
   exception Not_memoized of Options.category option
   (** "Not memoized" error with the phase where the error occured. *)
-end
-
-module type S = sig
-  include Exn
 
   val make_untypable: string -> exn
   (** Make a [Typing_error] exception with the given message. *)
-- 
GitLab