diff options
| author | Gaëtan Gilbert | 2019-03-06 20:58:26 +0100 |
|---|---|---|
| committer | Gaëtan Gilbert | 2019-03-06 20:58:26 +0100 |
| commit | c9fd99644e223ada3aad53915f1cd0d2598882b3 (patch) | |
| tree | 784938d42cf4c37436c305cf625d240c154ac9c9 /interp/constrintern.ml | |
| parent | a83eac8463787c13a2dbd3903baf2b59ca1a4635 (diff) | |
| parent | 7b724139a09c5d875131c5861a32d225d5b4b07b (diff) | |
Merge PR #9476: Constructor type information uses the expanded form.
Reviewed-by: SkySkimmer
Reviewed-by: gares
Diffstat (limited to 'interp/constrintern.ml')
| -rw-r--r-- | interp/constrintern.ml | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/interp/constrintern.ml b/interp/constrintern.ml index 24894fc9f5..7f1dc70d95 100644 --- a/interp/constrintern.ml +++ b/interp/constrintern.ml @@ -1188,7 +1188,6 @@ let check_constructor_length env loc cstr len_pl pl0 = (error_wrong_numarg_constructor ?loc env cstr (Inductiveops.constructor_nrealargs cstr))) -open Term open Declarations (* Similar to Cases.adjust_local_defs but on RCPat *) @@ -1197,16 +1196,15 @@ let insert_local_defs_in_pattern (ind,j) l = if mip.mind_consnrealdecls.(j-1) = mip.mind_consnrealargs.(j-1) then (* Optimisation *) l else - let typi = mip.mind_nf_lc.(j-1) in - let (_,typi) = decompose_prod_n_assum (Context.Rel.length mib.mind_params_ctxt) typi in - let (decls,_) = decompose_prod_assum typi in + let (ctx, _) = mip.mind_nf_lc.(j-1) in + let decls = List.skipn (Context.Rel.length mib.mind_params_ctxt) (List.rev ctx) in let rec aux decls args = match decls, args with | Context.Rel.Declaration.LocalDef _ :: decls, args -> (DAst.make @@ RCPatAtom None) :: aux decls args | _, [] -> [] (* In particular, if there were trailing local defs, they have been inserted *) | Context.Rel.Declaration.LocalAssum _ :: decls, a :: args -> a :: aux decls args | _ -> assert false in - aux (List.rev decls) l + aux decls l let add_local_defs_and_check_length loc env g pl args = match g with | ConstructRef cstr -> |
