GNU bug report logs - #30990
Should the byte compiler warn about :type mismatches?

Previous Next

Package: emacs;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Thu, 29 Mar 2018 16:56:02 UTC

Severity: wishlist

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #47 received at 30990 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: alex.branham <at> gmail.com,  Stefan Kangas <stefan <at> marxist.se>,
 30990 <at> debbugs.gnu.org
Subject: Re: bug#30990: Should the byte compiler warn about :type mismatches?
Date: Fri, 25 Sep 2020 15:18:47 +0200
Robert Pluim <rpluim <at> gmail.com> writes:

> Except that the underlying type is '(repeat ....) so I wonder if this:
>
>     (dolist (ext '(".json.gpg" ".gpg" ".json" "") wallet)
>       (unless wallet
>         (setq w (locate-user-emacs-file (concat "sql-wallet" ext)
>                                         (concat ".sql-wallet" ext)))
>         (when (file-exists-p w)
>           (setq wallet w))))) ; <= this returns a string
>
> should use (setq wallet (list w)) instead

I went ahead and fixed this along with a bunch of other warnings
revealed by the test (that has snuck in after Rober fixed the last batch,
I think).

There's some that are rather intractable, though, like
sql-postgres-login-params.

These remain:

whitespace-indentation-regexp
whitespace-space-after-tab-regexp
sql-postgres-login-params
gdb-display-source-buffer-action

I don't quite understand what's wrong here:

(defcustom whitespace-indentation-regexp
  '("^\t*\\(\\( \\{%d\\}\\)+\\)[^\n\t]"
    . "^ *\\(\t+\\)[^\n]")
[...]
  :type '(cons (regexp :tag "Indentation SPACEs")
	       (regexp :tag "Indentation TABs"))
  :group 'whitespace)

Isn't that how you specify a cons of two values?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 238 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.