@@ -364,6 +364,7 @@ let string_of_renaming_kind = function
364364 | `Module -> " module"
365365 | `ModType -> " module type"
366366 | `Theory -> " theory"
367+ | `Exn -> " exception"
367368
368369(* -------------------------------------------------------------------- *)
369370let rename ?(fold = true ) ove subst (kind , name ) =
@@ -386,7 +387,7 @@ let rename ?(fold = true) ove subst (kind, name) =
386387
387388 let nameok =
388389 match kind with
389- | `Lemma | `Type ->
390+ | `Lemma | `Type | `Exn ->
390391 EcIo. is_sym_ident newname
391392 | `Op | `Pred ->
392393 EcIo. is_op_ident newname
@@ -787,11 +788,11 @@ and replay_ntd (ove : _ ovrenv) (subst, ops, proofs, scope) (import, x, oont) =
787788
788789
789790(* -------------------------------------------------------------------- *)
790- and replay_excep
791- ( ove : _ ovrenv ) ( subst , ops , proofs , scope ) ( import , name , excep )
792- =
793- let scope = ove.ovre_hooks.hadd_item scope ~import ( Th_exception (name, excep) ) in
794- (subst, ops, proofs, scope)
791+ and replay_exception ( ove : _ ovrenv ) ( subst , ops , proofs , scope ) ( import , name , excep ) =
792+ let subst, name = rename ove subst ( `Exn , name) in
793+ let excep = EcSubst. subst_excep subst excep in
794+ let item = Th_exception (name, excep) in
795+ (subst, ops, proofs, ove.ovre_hooks.hadd_item scope ~import item )
795796
796797(* -------------------------------------------------------------------- *)
797798and replay_axd (ove : _ ovrenv ) (subst , ops , proofs , scope ) (import , x , ax ) =
@@ -1067,7 +1068,7 @@ and replay1 (ove : _ ovrenv) (subst, ops, proofs, scope) (hidden, item) =
10671068 replay_ntd ove (subst, ops, proofs, scope) (import, x, oont)
10681069
10691070 | Th_exception (x , e ) ->
1070- replay_excep ove (subst, ops, proofs, scope) (import, x, e)
1071+ replay_exception ove (subst, ops, proofs, scope) (import, x, e)
10711072
10721073 | Th_axiom (x , ax ) ->
10731074 replay_axd ove (subst, ops, proofs, scope) (import, x, ax)
0 commit comments