bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19770: goops - setter inheritance bug - serious


From: David Pirotte
Subject: bug#19770: goops - setter inheritance bug - serious
Date: Wed, 4 Feb 2015 13:43:58 -0200

Hello,

        GNU Guile 2.0.11.114-649ec
        goops - setter inheritance bug
        severity - serious

setters are beeing redefined, not inhereted:  this is a serious bug.

Cheers,
David


--8<---------------cut here---------------start------------->8---
(define-module (a)
  #:use-module (oop goops)
  #:export (<a>
            !width))


(define-class <a> ()
  (width #:accessor !width #:init-keyword #:width #:init-value 0))

(define-method ((setter !width) (self <a>) width)
  ;; here comes complex code, computing earth orbit, captain's age...
  (pk "this is <a> !width setter method, hello!")
  (slot-set! self 'width width))
--8<---------------cut here---------------start------------->8---

--8<---------------cut here---------------start------------->8---
(define-module (b)
  #:use-module (oop goops)
  #:use-module (a)
  #:export (<b>)

  #:re-export (!width))


(define-class <b> (<a>))
--8<---------------cut here---------------start------------->8---

GNU Guile 2.0.11.114-649ec
Copyright (C) 1995-2014 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> 
scheme@(guile-user)> ,use (oop goops)
scheme@(guile-user)> ,use (b)
;;; note: source file ./b.scm
;;;       newer than compiled 
/home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects/guile-tests/goops/setter-inheritance-bug/b.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling ./b.scm
;;; note: source file ./a.scm
;;;       newer than compiled 
/home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects/guile-tests/goops/setter-inheritance-bug/a.scm.go
;;; compiling ./a.scm
;;; compiled 
/home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects/guile-tests/goops/setter-inheritance-bug/a.scm.go
;;; compiled 
/home/david/.cache/guile/ccache/2.0-LE-8-2.0/usr/alto/projects/guile-tests/goops/setter-inheritance-bug/b.scm.go
scheme@(guile-user)> (set! (!width (make <b>)) 20)
$2 = 20
scheme@(guile-user)> 
                           

Attachment: pgpv8cYApPXhI.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]