X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_acic%2FdoubleTypeInference.ml;h=7f93716b26c6685e1b3a2c74e3da64fc1b4d95cc;hb=1b36fc4540d93ff21c1afcf485e47e3fe3f26ddb;hp=1671b98d25321ca6492f8565715ba99d5ddfedba;hpb=6719c0e318b312b51b089fea3d69d1b7103245ea;p=helm.git diff --git a/helm/software/components/cic_acic/doubleTypeInference.ml b/helm/software/components/cic_acic/doubleTypeInference.ml index 1671b98d2..7f93716b2 100644 --- a/helm/software/components/cic_acic/doubleTypeInference.ml +++ b/helm/software/components/cic_acic/doubleTypeInference.ml @@ -339,17 +339,18 @@ let rec type_of_aux' subterms_to_types metasenv context t expectedty = | C.Lambda (n,s,t) -> (* Let's visit all the subterms that will not be visited later *) let _ = type_of_aux context s None in - let expected_target_type = + let n, expected_target_type = match expectedty with - None -> None + | None -> n, None | Some expectedty' -> - let ty = + let n, ty = match R.whd context expectedty' with - C.Prod (_,_,expected_target_type) -> - beta_reduce expected_target_type + | C.Prod (n',_,expected_target_type) -> + let xtt = beta_reduce expected_target_type in + if n <> C.Anonymous then n, xtt else n', xtt | _ -> assert false in - Some ty + n, Some ty in let type2 = type_of_aux ((Some (n,(C.Decl s)))::context) t expected_target_type