[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#31350: 27.0; `pcase' message: "Redundant pcase pattern"
From: |
Michael Heerdegen |
Subject: |
bug#31350: 27.0; `pcase' message: "Redundant pcase pattern" |
Date: |
Sun, 04 Oct 2020 00:52:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Lars Ingebrigtsen <larsi@gnus.org> writes:
> > These are the two clauses in question:
> >
> > (`,a `(not,a))
> > ((and a (guard (not recursivep))) `(not ,a))
>
> Can you post a complete test case that demonstrates the problem?
Well, when we compile something like
(defun test (foo recursivep)
(pcase foo
(a `(not ,a))
((and a (guard recursivep))
`(not ,a))))
the message Drew means says
Redundant pcase pattern: (and a (guard recursivep))
I'm happy with that, I think it tells anything I need to know. I'm not
happy about the fact that I missed the `message' because it's only a
message and I only see it when I look into the *Messages* buffer because
it's overwritten very soon in the echo area.
The compiler log only shows
Compiling file /home/micha/today/pctest.el at Sun Oct 4 00:44:51 2020
pctest.el:46:1: Warning: Unused lexical argument `recursivep'
which is confusing if you missed the message about the redundant
pattern.
Michael.
- bug#31350: 27.0; `pcase' message: "Redundant pcase pattern",
Michael Heerdegen <=