diff options
author | Matthieu Sozeau <mattam@mattam.org> | 2016-05-23 18:58:01 +0200 |
---|---|---|
committer | Matthieu Sozeau <mattam@mattam.org> | 2016-05-23 18:58:01 +0200 |
commit | 891a8a9f7ea3bb5b0b07dc5a2df51314135d8b53 (patch) | |
tree | 1c5fd2dddb629dd8b7a8f3fa55e40b0fbf605d25 /plugins/extraction | |
parent | 265be83a546b0bec6d01f6650f7489442293cb0e (diff) |
Extraction/Projections: Fix bug #4710
Use the compatibility match construction to extract the compatibility
constant associated to a primitive projection.
Diffstat (limited to 'plugins/extraction')
-rw-r--r-- | plugins/extraction/extraction.ml | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/extraction/extraction.ml b/plugins/extraction/extraction.ml index 667721e67..bdf01e73b 100644 --- a/plugins/extraction/extraction.ml +++ b/plugins/extraction/extraction.ml @@ -974,7 +974,10 @@ let extract_constant env kn cb = | (Info,TypeScheme) -> (match cb.const_body with | Undef _ -> warn_info (); mk_typ_ax () - | Def c -> mk_typ (Mod_subst.force_constr c) + | Def c -> + (match cb.const_proj with + | None -> mk_typ (Mod_subst.force_constr c) + | Some pb -> mk_typ pb.proj_body) | OpaqueDef c -> add_opaque r; if access_opaque () then @@ -983,7 +986,10 @@ let extract_constant env kn cb = | (Info,Default) -> (match cb.const_body with | Undef _ -> warn_info (); mk_ax () - | Def c -> mk_def (Mod_subst.force_constr c) + | Def c -> + (match cb.const_proj with + | None -> mk_def (Mod_subst.force_constr c) + | Some pb -> mk_def pb.proj_body) | OpaqueDef c -> add_opaque r; if access_opaque () then |