From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#50219: 28.0.50; Provide better errors when trying to specialize on optional args in generic methods Date: Sat, 28 Aug 2021 17:47:12 -0700 Message-ID: <87fsutkrfz.fsf@ericabrahamsen.net> References: <87k0k7by2w.fsf@ericabrahamsen.net> <87bl5ju3me.fsf@gnus.org> <87pmtzpta7.fsf@ericabrahamsen.net> <871r6dimlb.fsf@gnus.org> <87wno5h4sy.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25941"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 50219@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 29 02:48:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mK8za-0006YN-DJ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 29 Aug 2021 02:48:10 +0200 Original-Received: from localhost ([::1]:51706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mK8zY-0002ep-BY for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Aug 2021 20:48:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mK8zS-0002eS-7Z for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 20:48:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mK8zR-0003C4-T5 for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 20:48:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mK8zR-0006FW-Rp for bug-gnu-emacs@gnu.org; Sat, 28 Aug 2021 20:48:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Aug 2021 00:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50219 X-GNU-PR-Package: emacs Original-Received: via spool by 50219-submit@debbugs.gnu.org id=B50219.163019804723939 (code B ref 50219); Sun, 29 Aug 2021 00:48:01 +0000 Original-Received: (at 50219) by debbugs.gnu.org; 29 Aug 2021 00:47:27 +0000 Original-Received: from localhost ([127.0.0.1]:55175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mK8yt-0006E2-BY for submit@debbugs.gnu.org; Sat, 28 Aug 2021 20:47:27 -0400 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:36794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mK8yq-0006Dl-1h for 50219@debbugs.gnu.org; Sat, 28 Aug 2021 20:47:26 -0400 Original-Received: from localhost (c-73-109-4-106.hsd1.wa.comcast.net [73.109.4.106]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id DD955FA82D; Sun, 29 Aug 2021 00:47:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1630198038; bh=tzwnqlD5tOaQkaUikIiU5NbB5pqLTgWRcEUVnvnMeqU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=JVTnf6mTvJtE7VzdUYASLMnQJw4v/m2X8Q+VVsQbv9wa4xdbux3FTNgXmenAGh7kr t5qI6xXbAlLATI3N6e0MmzMmnOHTbP/HaZRNdhP3qFNnWJfnvCfj/5HY9PD82aqqpy mJRx7MUSv2TjKb+OYN+4FM5Lbuf2WhP+oxDd0V6A= In-Reply-To: (Stefan Monnier's message of "Sat, 28 Aug 2021 13:41:48 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212904 Archived-At: On 08/28/21 13:41 PM, Stefan Monnier wrote: >> (cl-defmethod foo ((a integer) &optional (b string)) >> ...) >> >> on the other hand, looks like the person who wrote it wanted to >> specialise on b, so if the default is something that is a type >> specifier, then we could output an additional warning about that. > > The default value part of args in Common lisp arglists is an > *expression*, so (b string) just means that `b` should take the value of > the `string` variable. > > The best I can see (if we keep the CL arglist feature) is to try and see > if that expression looks like a valid CLOS specializer and if so emit > a warning about possible confusion. That's a pretty byzantine set of rules! Anyway, I think "reference to free variable string" is probably close enough to clue the developer in to what is happening. In the case of an EIEIO class name, though, the error was: "`ebdb-record' is an obsolete variable, use `ebdb-record' instead" which is just... So maybe something special for class and struct types would be sufficient?