You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing simpa using e, if the simplified type of e is not defeq to the simplified type of the target, then the error message is obscure, saying that h✝ has a type mismatch.
example (p q : Prop) (hp : p ∧ True) : p ∧ q ∧ True := by
simpa using hp
/-
type mismatch
h✝
has type
p : Prop
but is expected to have type
p ∧ q : Prop
-/
The expected behavior is that the error message explains that the simplified type of hp is p and the simplified target is p ∧ q, and that it doesn't mention the inaccessible variable created by simpa to process the using expression.
Closes#5634. Before assigning the simplified `using` clause expression
to the goal, this adds a check that the expression has no new
metavariables. It also adjusts how new hypotheses are added to the goal
to prevent spurious "don't know how to synthesize placeholder" errors on
that goal metavariable. We also throw in an occurs check immediately
after elaboration to avoid some counterintuitive behavior when
simplifying such a term closes the goal.
Closes#4101. This also improves the type mismatch error message,
showing the elaborated `using` clause rather than `h✝`:
```lean
example : False := by
simpa using (fun x : True => x)
/-
error: type mismatch, term
fun x => x
after simplification has type
True : Prop
but is expected to have type
False : Prop
-/
```
Description
When doing
simpa using e
, if the simplified type ofe
is not defeq to the simplified type of the target, then the error message is obscure, saying thath✝
has a type mismatch.Context
This came up on Zulip
Steps to Reproduce
Here is an example:
The expected behavior is that the error message explains that the simplified type of
hp
isp
and the simplified target isp ∧ q
, and that it doesn't mention the inaccessible variable created bysimpa
to process theusing
expression.Versions
4.8.0-rc1
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: