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

Adapt to coq/coq#16798 (cast in pattern is an error by default) #804

Closed
wants to merge 1 commit into from

Conversation

SkySkimmer
Copy link

A pattern x : y is equivalent to just x.

Some of the casts were bogus and so were removed.

Other casts come from notations (from constructive_ereals around line 260), for these the warning was ignored as it seems ignoring them was not a problem.

A pattern `x : y` is equivalent to just `x`.

Some of the casts were bogus and so were removed.

Other casts come from notations (from constructive_ereals around line
260), for these the warning was ignored as it seems ignoring them was not a
problem.
@SkySkimmer
Copy link
Author

(if you think making this warning error by default this is the right time to say so, the right place is the coq side PR)

Copy link
Member

@affeldt-aist affeldt-aist left a comment

Choose a reason for hiding this comment

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

I am ok with these changes.

@CohenCyril
Copy link
Member

I'm not so happy about them...

@affeldt-aist
Copy link
Member

Do you mean that you are unhappy with the fact that they are ineffective?

@CohenCyril
Copy link
Member

No I'm unhappy about the verbosity

@@ -2427,7 +2427,11 @@ Arguments lee_sum_nneg_natr {R}.
Arguments lee_sum_npos_natr {R}.
Arguments lee_sum_nneg_natl {R}.
Arguments lee_sum_npos_natl {R}.

(* <=%E contains casts but we don't mind that they are ignored when matching for this hint *)
Set Warnings "-cast-in-pattern".
#[global] Hint Extern 0 (is_true (0 <= `| _ |)%E) => solve [apply: abse_ge0] : core.
Copy link
Author

@SkySkimmer SkySkimmer Dec 8, 2022

Choose a reason for hiding this comment

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

An alternative to unsetting warnings would be to avoid the notation, ie here we would do

Suggested change
#[global] Hint Extern 0 (is_true (0 <= `| _ |)%E) => solve [apply: abse_ge0] : core.
#[global] Hint Extern 0 (is_true (lee 0 `| _ |)%E) => solve [apply: abse_ge0] : core.

(not sure if we need %E for the `| _ |)
also with coq/coq#16902 we could do

Suggested change
#[global] Hint Extern 0 (is_true (0 <= `| _ |)%E) => solve [apply: abse_ge0] : core.
#[global, warnings="-cast-in-pattern"] Hint Extern 0 (is_true (0 <= `| _ |)%E) => solve [apply: abse_ge0] : core.

(no Unset Warnings) which is less verbose

@affeldt-aist affeldt-aist added this to the 0.6.1 milestone Jan 17, 2023
@SkySkimmer SkySkimmer closed this Jan 18, 2023
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

Successfully merging this pull request may close these issues.

3 participants