Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid return type" error when definining inductive propositions can be attached to more suitable text range #802

Open
1 task done
ddrone opened this issue Feb 25, 2023 · 1 comment

Comments

@ddrone
Copy link

ddrone commented Feb 25, 2023

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Checked that your issue isn't already filed.
    • Reduced the issue to a self-contained, reproducible test case.

Description

When defining inductive propositions (probably for types as well, but I haven't checked), "invalid return type" error is not attached to the text range of the actual erroneous return type, making it harder to understand.

Steps to Reproduce

Here is a code that you can paste into a new file:

structure relation :=
(c : Type) -- c for "carrier"
(holds : c → c → Prop)

inductive trans_closure (r : relation) : r.c → r.c → Prop
| base : ∀ {x y : r.c}, r.holds x y → trans_closure x y
| step : ∀ {x y z : r.c}, r.holds x y → trans_closure y z → r.holds x z

Expected behavior: [What you expect to happen]

Red squiggly line in VSCode is under the r.holds x z

Actual behavior: [What actually happens]

Red squiggly line in VSCode is under the word inductive, which makes the actual mistake harder to spot:

Screenshot at 2023-02-25 12-15-11

Reproduces how often: [What percentage of the time does it reproduce?]

Reproduces consistently from limited testing.

Versions

Lean (version 3.50.3, commit 855e5b7, Release), Linux Mint.

@ddrone
Copy link
Author

ddrone commented Feb 25, 2023

By the way, if someone can provide me pointers about the relevant code I'm happy to try to contribute a fix myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant