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

::> only declares an instance without a coercion when it should do both #18971

Open
Alizter opened this issue Apr 23, 2024 · 2 comments
Open
Labels
kind: bug An error, flaw, fault or unintended behaviour.

Comments

@Alizter
Copy link
Contributor

Alizter commented Apr 23, 2024

Description of the problem

There is a difference in behaviour of ::> when in a record or in an class. In both cases ::> is expected to register an instance and a coercion.

When ::> is given in a record, it works as expected. However when ::> is given in a class, only the instance is declared and the coercion is ignored.

cc @proux01

Small Coq file to reproduce the bug

Class A := { a : Type }.
Class B := { ba ::> A }.

(** No coercion! *)
Print Coercions.
Print HintDb typeclass_instances.

Record B' := { ba' ::> A }.

(** Coercion registered as expected. *)
Print Coercions.
Print HintDb typeclass_instances.

Version of Coq where this bug occurs

8.19.1

Last version of Coq where the bug did not occur

No response

@Alizter Alizter added kind: bug An error, flaw, fault or unintended behaviour. needs: triage The validity of this issue needs to be checked, or the issue itself updated. labels Apr 23, 2024
@proux01
Copy link
Contributor

proux01 commented Apr 23, 2024

Sounds consistent with the fact that ::> means both :: and :>. Will be fixed in 8.21 when the deprecation phase will finally be over. Is it worth changing in 8.20?

@Alizter
Copy link
Contributor Author

Alizter commented Apr 23, 2024

@proux01 Not worth changing I suppose, but I guess you should add this test when the deprecation phase is over. There is also no warning compared to using :> directly in a class.

@Alizter Alizter removed the needs: triage The validity of this issue needs to be checked, or the issue itself updated. label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug An error, flaw, fault or unintended behaviour.
Projects
None yet
Development

No branches or pull requests

2 participants