mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-22 03:30:22 +02:00
fix bug in goops' method cache with rest args
* module/oop/goops/compile.scm (code-table-lookup): Fix a tricky little bug! * test-suite/tests/goops.test ("the method cache"): Add a wee test.
This commit is contained in:
parent
12798872ff
commit
4bcc952d45
2 changed files with 19 additions and 5 deletions
|
@ -261,6 +261,19 @@
|
|||
(method-more-specific? m1 m2 '()))
|
||||
(current-module))))
|
||||
|
||||
(with-test-prefix "the method cache"
|
||||
(pass-if "defining a method with a rest arg"
|
||||
(let ((m (current-module)))
|
||||
(eval '(define-method (foo bar . baz)
|
||||
(cons bar baz))
|
||||
m)
|
||||
(eval '(foo 1)
|
||||
m)
|
||||
(eval '(foo 1 2)
|
||||
m)
|
||||
(eval '(equal? (foo 1 2) '(1 2))
|
||||
m))))
|
||||
|
||||
(with-test-prefix "defining accessors"
|
||||
|
||||
(with-test-prefix "define-accessor"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue