aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorsoubiran2008-10-21 11:42:50 +0000
committersoubiran2008-10-21 11:42:50 +0000
commit3857df7438d49220fc1bfc85883ad33868c35ee7 (patch)
tree4a75737d4245934b345a628f806d1c6a96f1d75d /kernel
parent05f91178923218b864d8c921dfb557c7c13f14ca (diff)
Correction bug #1969.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11483 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel')
-rw-r--r--kernel/mod_typing.ml2
-rw-r--r--kernel/modops.ml7
2 files changed, 5 insertions, 4 deletions
diff --git a/kernel/mod_typing.ml b/kernel/mod_typing.ml
index 941d219ba7..afde8d557c 100644
--- a/kernel/mod_typing.ml
+++ b/kernel/mod_typing.ml
@@ -209,7 +209,7 @@ and check_with_aux_mod env mtb with_decl now =
| With_Module (_,c) -> With_Module (idl,c) in
let cst,_,typ_opt =
check_with_aux_mod env'
- (type_of_mb env old) new_with_decl false in
+ (type_of_mb env' old) new_with_decl false in
if now then
let mtb' = lookup_modtype mp env' in
let mp' = scrape_alias mp env' in
diff --git a/kernel/modops.ml b/kernel/modops.ml
index 750d393cb3..dbd44b84a8 100644
--- a/kernel/modops.ml
+++ b/kernel/modops.ml
@@ -317,13 +317,14 @@ and merge_with env mtb with_decl alias=
| [] -> MPself msid
| i::r -> MPdot(mp_rec r,label_of_id i)
in
+ let env' = add_signature (MPself msid) before env in
let new_spec,subst = match with_decl with
| With_definition_body ([],_)
| With_module_body ([],_,_,_) -> assert false
| With_definition_body ([id],c) ->
SFBconst c,None
| With_module_body ([id], mp,typ_opt,cst) ->
- let mp' = scrape_alias mp env in
+ let mp' = scrape_alias mp env' in
let new_alias = update_subst alias (map_mp (mp_rec [id]) mp') in
SFBalias (mp,typ_opt,Some cst),
Some(join (map_mp (mp_rec [id]) mp') new_alias)
@@ -337,7 +338,7 @@ and merge_with env mtb with_decl alias=
match with_decl with
With_definition_body (_,c) -> With_definition_body (idl,c),None
| With_module_body (idc,mp,typ_opt,cst) ->
- let mp' = scrape_alias mp env in
+ let mp' = scrape_alias mp env' in
With_module_body (idl,mp,typ_opt,cst),
Some(map_mp (mp_rec (List.rev idc)) mp')
in
@@ -345,7 +346,7 @@ and merge_with env mtb with_decl alias=
| None -> None
| Some s -> Some (join s (update_subst alias s)) in
let modtype,subst_msb =
- merge_with env (type_of_mb env old) new_with_decl alias in
+ merge_with env' (type_of_mb env' old) new_with_decl alias in
let msb =
{ mod_expr = None;
mod_type = Some modtype;