diff options
-rw-r--r-- | pretyping/indrec.ml | 6 | ||||
-rw-r--r-- | test-suite/success/letproj.v | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/pretyping/indrec.ml b/pretyping/indrec.ml index 547268ef0..54f76fa33 100644 --- a/pretyping/indrec.ml +++ b/pretyping/indrec.ml @@ -105,8 +105,10 @@ let mis_make_case_com dep env sigma (ind, u as pind) (mib,mip as specif) kind = Termops.rel_vect ndepar k) | Some ps -> let term = mkApp (mkRel 2, Array.map (fun p -> mkProj (p, mkRel 1)) ps) in - let ty = mkApp (mkRel 3, [| mkRel 1 |]) in - mkCast (term, DEFAULTcast, ty) + if dep then + let ty = mkApp (mkRel 3, [| mkRel 1 |]) in + mkCast (term, DEFAULTcast, ty) + else term in it_mkLambda_or_LetIn_name env' obj deparsign else diff --git a/test-suite/success/letproj.v b/test-suite/success/letproj.v new file mode 100644 index 000000000..a183be622 --- /dev/null +++ b/test-suite/success/letproj.v @@ -0,0 +1,9 @@ +Set Primitive Projections. +Set Record Elimination Schemes. +Record Foo (A : Type) := { bar : A -> A; baz : A }. + +Definition test (A : Type) (f : Foo A) := + let (x, y) := f in x. + +Scheme foo_case := Case for Foo Sort Type. + |