diff options
author | Matthieu Sozeau <matthieu.sozeau@inria.fr> | 2014-07-29 14:31:11 +0200 |
---|---|---|
committer | Matthieu Sozeau <matthieu.sozeau@inria.fr> | 2014-07-29 14:57:12 +0200 |
commit | 883611696f3388ac5fb9b08930f0ea4564749446 (patch) | |
tree | 84c2c529c185ba968169be9c849c0a974db55ff4 /kernel | |
parent | cc0dc21e24c2cd45cd1c6723fcd524e6db89f7bd (diff) |
Fix eta-conversion code which was failing in nested cases. Fixes bug #3429.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/closure.ml | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/closure.ml b/kernel/closure.ml index 586661d16..62ee5db5d 100644 --- a/kernel/closure.ml +++ b/kernel/closure.ml @@ -869,18 +869,16 @@ let eta_expand_ind_stacks env ind m s (f, s') = | Some (exp,projs) when Array.length projs > 0 -> let primitive = Environ.is_projection projs.(0) env in if primitive then - (* Construct, pars1 .. parsm :: arg1...argn :: s ~= (f, s') -> - arg1..argn ~= (proj1 t...projn t) && s = s' <-> - arg1..argn @ s ~= (proj1 t...projn t) @ s' *) + (* (Construct, pars1 .. parsm :: arg1...argn :: []) ~= (f, s') -> + arg1..argn ~= (proj1 t...projn t) where t = zip (f,s') *) let pars = mib.Declarations.mind_nparams in - let (depth', args', s') = strip_update_shift_app_red f s' in - let right = fapp_stack (f, args') in + let right = fapp_stack (f, s') in let (depth, args, s) = strip_update_shift_app m s in (** Try to drop the params, might fail on partially applied constructors. *) let argss = try_drop_parameters depth pars args in let hstack = Array.map (fun p -> { norm = Red; (* right can't be a constructor though *) term = FProj (p, right) }) projs in - argss, (Zapp hstack :: s') + argss, [Zapp hstack] else raise Not_found (* disallow eta-exp for non-primitive records *) | _ -> raise Not_found |