GNU bug report logs - #36691
GOOPS: accessor breaks inherited slots with getters

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guile; Reported by: "Thompson, David" <dthompson2@HIDDEN>; dated Tue, 16 Jul 2019 14:22:01 UTC; Maintainer for guile is bug-guile@HIDDEN.

Message received at submit <at>

Received: (at submit) by; 16 Jul 2019 14:21:50 +0000
From debbugs-submit-bounces <at> Tue Jul 16 10:21:50 2019
Received: from localhost ([]:50930
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1hnOKz-00025a-JF
	for submit <at>; Tue, 16 Jul 2019 10:21:50 -0400
Received: from ([]:43674)
 by with esmtp (Exim 4.84_2)
 (envelope-from <dthompson2@HIDDEN>) id 1hnOKx-00025Q-0K
 for submit <at>; Tue, 16 Jul 2019 10:21:47 -0400
Received: from ([2001:470:142:3::10]:39645)
 by with esmtp (Exim 4.86_2)
 (envelope-from <dthompson2@HIDDEN>) id 1hnOKw-0005Jq-1s
 for bug-guile@HIDDEN; Tue, 16 Jul 2019 10:21:46 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
Received: from Debian-exim by with spam-scanned (Exim 4.71)
 (envelope-from <dthompson2@HIDDEN>) id 1hnOKv-0001l8-2N
 for bug-guile@HIDDEN; Tue, 16 Jul 2019 10:21:45 -0400
Received: from ([2a00:1450:4864:20::42d]:34096)
 by with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <dthompson2@HIDDEN>)
 id 1hnOKu-0001k7-Ho
 for bug-guile@HIDDEN; Tue, 16 Jul 2019 10:21:45 -0400
Received: by with SMTP id 31so21210981wrm.1
 for <bug-guile@HIDDEN>; Tue, 16 Jul 2019 07:21:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20150623;
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025;
X-Gm-Message-State: APjAAAU3i4YA8OEIAs2qS1uxBVpGwuGA5sV3ZP23d2sBXe8+Cb7hmSzs
X-Google-Smtp-Source: APXvYqwpLZrbfpwvvPWE4zxDKOA/KC8Cbq4YAku3LwdKoY8TzqyNYmcRYjSwMX1zvJ2U1XmC7bEeVK4CfdbtME/ON7U=
X-Received: by 2002:a5d:53ca:: with SMTP id a10mr37044461wrw.131.1563286902081; 
 Tue, 16 Jul 2019 07:21:42 -0700 (PDT)
MIME-Version: 1.0
From: "Thompson, David" <dthompson2@HIDDEN>
Date: Tue, 16 Jul 2019 10:21:31 -0400
Message-ID: <CAJ=RwfaRhV_gb53rPMHh8JtZ6xadDupwuoMRsAPN2brsneK_mA@HIDDEN>
Subject: GOOPS: accessor breaks inherited slots with getters
To: bug-guile@HIDDEN
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by Genre and OS details not
X-Received-From: 2a00:1450:4864:20::42d
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -2.3 (--)


When a subclass inherits a slot with a getter, but a previously
defined class creates an accessor with the same name, the inherited
getter is seemingly ignored and an error is thrown when attempting to
use the getter on an instance of the subclass.  It's hard to explain
in a clear way, so here's a minimal example that demonstrates the

    (use-modules (oop goops))

    (define-class <cat> ()
      (name #:getter name #:init-keyword #:name))

    (define-class <boat> ()
      (name #:accessor name #:init-keyword #:name))

    (define-class <leopard> (<cat>))

    (display (name (make <cat> #:name "Mittens")))
    (display (name (make <boat> #:name "Boaty McBoatface")))
    (display (name (make <leopard> #:name "Spot")))

This program outputs "Mittens" and "Boaty McBoatface" then prints a
backtrace when it should print "Spot":

               7 (apply-smob/1 #<catch-closure 5556814626c0>)
    In ice-9/boot-9.scm:
        702:2  6 (call-with-prompt ("prompt") #<procedure 55568147c920 =E2=
=80=A6> =E2=80=A6)
    In ice-9/eval.scm:
        619:8  5 (_ #(#(#<directory (guile-user) 555681529750>)))
    In ice-9/boot-9.scm:
       2296:4  4 (save-module-excursion #<procedure 55568153acc0 at ice-=E2=
      3816:12  3 (_)
    In /home/dthompson/Code/starling/examples/tetra/test.scm:
         15:9  2 (_)
    In oop/goops.scm:
       1460:4  1 (cache-miss #<<leopard> 5556815fd730>)
       1585:2  0 (goops-error _ . _)

    oop/goops.scm:1585:2: In procedure goops-error:
    No applicable method for #<<accessor> name (2)> in call (name
#<<leopard> 5556815fd730>)

I am using Guile 2.9.2 on GNU/Linux.

- Dave

Acknowledgement sent to "Thompson, David" <dthompson2@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guile@HIDDEN. Full text available.
Report forwarded to bug-guile@HIDDEN:
bug#36691; Package guile. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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