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

Don't make too many coercions reversible by default #18705

Merged
merged 1 commit into from Mar 1, 2024

Conversation

proux01
Copy link
Contributor

@proux01 proux01 commented Feb 22, 2024

The doc reads

By default coercions are not reversible except for Record fields specified using :>.

The previous code was making some other coercions (particularly Coercion foo := bar. but not Coercion foo : bar >-> baz.) reversible by default. The new behavior should be closer from the spec in the doc.

  • Added / updated test-suite.
  • Added changelog.
  • Added / updated documentation.
    • Documented any new / changed user messages.
    • Updated documented syntax by running make doc_gram_rsts.

Overlay (to be merged before the current PR)

@proux01 proux01 added kind: fix This fixes a bug or incorrect documentation. part: coercions The coercion mechanism. needs: changelog entry This should be documented in doc/changelog. labels Feb 22, 2024
@proux01 proux01 added this to the 8.20+rc1 milestone Feb 22, 2024
@proux01
Copy link
Contributor Author

proux01 commented Feb 22, 2024

Cc @ggonthier who noticed the issue

@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Feb 22, 2024
@proux01 proux01 added request: full CI Use this label when you want your next push to trigger a full CI. and removed needs: changelog entry This should be documented in doc/changelog. labels Feb 24, 2024
@coqbot-app coqbot-app bot removed request: full CI Use this label when you want your next push to trigger a full CI. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels Feb 24, 2024
Copy link
Contributor

coqbot-app bot commented Feb 24, 2024

🔴 CI failure at commit 429a53a without any failure in the test-suite

✔️ Corresponding job for the base commit 954e315 succeeded

❔ Ask me to try to extract a minimal test case that can be added to the test-suite

🏃 @coqbot ci minimize will minimize the following target: ci-unimath
  • You can also pass me a specific list of targets to minimize as arguments.

proux01 added a commit to proux01/UniMath that referenced this pull request Feb 24, 2024
proux01 added a commit to proux01/UniMath that referenced this pull request Feb 27, 2024
nmvdw added a commit to UniMath/UniMath that referenced this pull request Feb 28, 2024
Adapt to coq/coq#18705
This is backward compatible (down to Coq 8.16).

Co-authored-by: Niels van der Weide <nnmvdw@gmail.com>
The doc reads

> By default coercions are not reversible
> except for Record fields specified using :>.

The previous code was making way too many coercion reversible by
default. The new behavior should be closer from the spec in the doc.
@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Feb 29, 2024
@coqbot-app coqbot-app bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Feb 29, 2024
@proux01 proux01 marked this pull request as ready for review March 1, 2024 12:06
@proux01 proux01 requested a review from a team as a code owner March 1, 2024 12:06
@proux01
Copy link
Contributor Author

proux01 commented Mar 1, 2024

@coq/vernac-maintainers this is ready, CI green

@@ -32,7 +32,7 @@ let declare_variable is_coe ~kind typ univs imps impl name =
let () =
if is_coe = Vernacexpr.AddCoercion then
ComCoercion.try_add_new_coercion
r ~local:true ~reversible:true in
r ~local:true ~reversible:false in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should reversible be optional (defaulting to false)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yes. I guess, my initial intent in not making optional was to avoid forgetting a callsite. But I managed to screw up anyway, so that was probably a bad choice.

Comment on lines +8 to +9
The previous code was making way too many coercion reversible by default.
The new behavior should be closer from the spec in the doc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is less formal language than usual but I don't mind.

@SkySkimmer SkySkimmer self-assigned this Mar 1, 2024
@SkySkimmer
Copy link
Contributor

@coqbot merge now

@coqbot-app coqbot-app bot merged commit 139b6ce into coq:master Mar 1, 2024
6 checks passed
@proux01 proux01 deleted the fix_reversible_coercion branch March 1, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: fix This fixes a bug or incorrect documentation. part: coercions The coercion mechanism.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants