Open MiddleAdjunction opened 1 week ago
The following is potentially another manifestation of this issue (misleading error message):
inductive C0 : Prop where
| mkC0 (p : Prop) : C0
def C0.p (c0 : C0) : Prop :=
match c0 with
| mkC0 p => p
leads to
tactic 'cases' failed, nested error:
tactic 'induction' failed, recursor 'C0.casesOn' can only eliminate into Prop
motive : C0 → Sort ?u.26
h_1 : (p : Prop) → motive ⋯
c0✝ : C0
⊢ motive c0✝
after processing
Thanks for the report. Note that match
and cases
are very related. It’s certainly possible to fix this message, by passing down the “user-visible name”, but given the relatively minor impact, we probably won’t complicate the code this way for now.
Prerequisites
Please put an X between the brackets as you perform the following steps:
Description
Consider the following seemingly correct dependent pattern matching using
match
:Running the code leads to the following misleading error message:
Notice the code does not use
cases
, or any tactics.Context
I raised this issue on a Discord server (Lean 4 anarchy); the description above summarises the issue fairly well.
Steps to Reproduce
You can reproduce the error by running the code.
Expected behavior:
match
is a commonly used construct, and related error messages should refer to the surface language rather than the internals (e.g.,cases
)Actual behavior:
match
leads to an error aboutcases
Versions
[
4.12.0-nightly-2024-10-22
]Impact
Add :+1: to issues you consider important. If others are impacted by this issue, please ask them to add :+1: to it.