From 282c4412574c955e9ff3bfdba1866b9afffa4955 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sat, 11 Oct 2014 21:22:45 +0200 Subject: Relaxing again the test on types of replacements in tactic change (continuation of 3087e0012eb12833a79b and 1f05decaea97f1dc). It may be the case that the new expression lives in a higher sorts and the context where it is substituted in supports it. So, it is too strong to expect that, when the substituted objects are types, the sort of the new one is smaller than the sort of the original one. Consider e.g. Goal @eq Type nat nat. change nat with (@id Type nat). which is a correct replacement, even if (id Type nat) is in a higher sort. Introducing typing in "contextually" would be a big change for a little numbers of uses, so we instead (hackily) recheck the whole term (even though typing with evars uses evar_conv which accept to unify Type with Set, leading to wrongly accept "Goal @eq Set nat nat. change nat with (@id Type nat).". Evar conv is however rejecting Prop=Type.) --- test-suite/success/change.v | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test-suite') diff --git a/test-suite/success/change.v b/test-suite/success/change.v index f775f818a..cd2dd77f9 100644 --- a/test-suite/success/change.v +++ b/test-suite/success/change.v @@ -45,3 +45,8 @@ Abort. Goal True. change ?x with x. Abort. + +(* Check typability after change of type subterms *) +Goal nat = nat :> Set. +Fail change nat with (@id Type nat). (* would otherwise be ill-typed *) +Abort. -- cgit v1.2.3