-
Notifications
You must be signed in to change notification settings - Fork 45
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
Conversation
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.
(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) |
There was a problem hiding this 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.
I'm not so happy about them... |
Do you mean that you are unhappy with the fact that they are ineffective? |
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. |
There was a problem hiding this comment.
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
#[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
#[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
A pattern
x : y
is equivalent to justx
.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.