summaryrefslogtreecommitdiff
path: root/libguile/procs.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-03-08 09:30:33 +0100
committerAndy Wingo <wingo@pobox.com>2011-03-08 20:53:17 +0100
commit534491d0b7fcd17558751110610bcef971d414a8 (patch)
treef4b8d2f50f7836ce213611f6cfb8ac6da7e83a34 /libguile/procs.c
parent0b0e066a26b437f7320abd126ec05a7a7c056dd9 (diff)
downloadguile-534491d0b7fcd17558751110610bcef971d414a8.tar.gz
fix scm_setter
* libguile/procs.c (scm_setter): Only get at the setter slot if the pure generic actually has a setter. Needs test. * test-suite/tests/goops.test ("defining generics"): ("defining accessors"): Add `setter' tests.
Diffstat (limited to 'libguile/procs.c')
-rw-r--r--libguile/procs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libguile/procs.c b/libguile/procs.c
index 2b7225efe..a096591df 100644
--- a/libguile/procs.c
+++ b/libguile/procs.c
@@ -149,7 +149,8 @@ SCM_PRIMITIVE_GENERIC (scm_setter, "setter", 1, 0, 0,
SCM_GASSERT1 (SCM_STRUCTP (proc), g_scm_setter, proc, SCM_ARG1, FUNC_NAME);
if (SCM_STRUCT_SETTER_P (proc))
return SCM_STRUCT_SETTER (proc);
- if (SCM_PUREGENERICP (proc))
+ if (SCM_PUREGENERICP (proc)
+ && SCM_IS_A_P (proc, scm_class_generic_with_setter))
/* FIXME: might not be an accessor */
return SCM_GENERIC_SETTER (proc);
SCM_WTA_DISPATCH_1 (g_scm_setter, proc, SCM_ARG1, FUNC_NAME);