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

missing error for non-atomic pattern variable #6537

Open
3 tasks done
cppio opened this issue Jan 5, 2025 · 3 comments · May be fixed by #6551
Open
3 tasks done

missing error for non-atomic pattern variable #6537

cppio opened this issue Jan 5, 2025 · 3 comments · May be fixed by #6551
Labels
bug Something isn't working P-medium We may work on this issue if we find the time

Comments

@cppio
Copy link
Contributor

cppio commented Jan 5, 2025

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

Non-atomic variables (e.g. x.y) are normally disallowed in match patterns. If the non-atomic identifier exists in the environment, then the error no longer occurs.

Steps to Reproduce

def x.y := ()

example : Nat → Nat | x.y => x.y

Expected behavior: The error invalid pattern variable, must be atomic. This error appears if def x.y is removed.

Actual behavior: No error.

Versions

Lean 4.16.0-nightly-2025-01-05

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@cppio cppio added the bug Something isn't working label Jan 5, 2025
@cppio cppio linked a pull request Jan 6, 2025 that will close this issue
@nomeata
Copy link
Collaborator

nomeata commented Jan 6, 2025

Thanks for the report! Is this a regression and do you have a hunch which change causes it?

@cppio
Copy link
Contributor Author

cppio commented Jan 6, 2025

The bug was introduced in d86164c.

@nomeata
Copy link
Collaborator

nomeata commented Jan 6, 2025

Thanks! In that case I'd give @leodemoura a chance to look at your fix in #6551, in case he has a different implementation in mind.

@leanprover-bot leanprover-bot added the P-medium We may work on this issue if we find the time label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-medium We may work on this issue if we find the time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants