Fix bug in vector signatures.

This commit is contained in:
Mike Sperber 2011-05-01 11:18:10 +02:00
parent c8d476c76e
commit d582dd55dd
2 changed files with 6 additions and 3 deletions

View File

@ -195,8 +195,8 @@
(if (andmap eq? orig els) (if (andmap eq? orig els)
obj obj
(let ((new (list->vector els))) (let ((new (list->vector els)))
(hash-set! vectors-table obj new old-sigs) (hash-set! vectors-table obj old-sigs)
obj))))) new)))))
(cond (cond
((not (vector? obj)) ((not (vector? obj))

View File

@ -88,9 +88,12 @@
(test-case (test-case
"vector" "vector"
(define integer-vector (make-vector-signature 'integer-list integer #f)) (define integer-vector (make-vector-signature 'integer-vector integer #f))
(define a-vector (make-vector-signature 'a-vector %a #f))
(check-equal? (say-no (apply-signature integer-vector '#(1 2 3))) (check-equal? (say-no (apply-signature integer-vector '#(1 2 3)))
'#(1 2 3)) '#(1 2 3))
(check-equal? (say-no (apply-signature a-vector '#(1 2 3)))
'#(1 2 3))
(check-equal? (say-no (apply-signature integer-vector '#f)) (check-equal? (say-no (apply-signature integer-vector '#f))
'no) 'no)
(check-eq? (failed-signature (apply-signature integer-vector '#(1 #f 3))) (check-eq? (failed-signature (apply-signature integer-vector '#(1 #f 3)))