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

Small conflict between the proper variables of a let-pattern and the variable in its "as" clause #14795

Open
herbelin opened this issue Aug 21, 2021 · 0 comments
Labels
part: printer The printing mechanism of Coq.

Comments

@herbelin
Copy link
Member

Description of the problem

Check fun '(x,y) => eq_refl (x,y).

is displayed as

fun pat : ?T * ?T0 =>
let '(x, y) as x := pat return (x = x) in eq_refl

which is not reinterpretable due to the x of as x is used in the pattern (in addition to being used in the return clause). Being used in the pattern, it clashes with the other x.

Interestingly,

Check fun pat : nat * nat => let '(x, y) := pat in eq_refl (x,y).

does not have the problem. It gives:

fun pat : ?T * ?T0 =>
let '(x, y) as pat0 := pat return (pat0 = pat0) in eq_refl

A fix shall come soon.

Coq Version

A priori all versions since fun 'pat => ... is supported.

herbelin added a commit to herbelin/github-coq that referenced this issue Aug 21, 2021
…t-pattern.

The compilation can still be improved though (e.g. there seems to be a
useless "p := p0" in the environment of the types of the variables).
herbelin added a commit to herbelin/github-coq that referenced this issue Aug 21, 2021
…t-pattern.

The compilation can still be improved though (e.g. there seems to be a
useless "p := p0" in the environment of the types of the variables).
herbelin added a commit to herbelin/github-coq that referenced this issue Aug 25, 2021
…t-pattern.

The compilation can still be improved though (e.g. there seems to be a
useless "p := p0" in the environment of the types of the variables).
@Alizter Alizter added the part: printer The printing mechanism of Coq. label Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: printer The printing mechanism of Coq.
Projects
None yet
2 participants