Fix bug in struct-wrap signature checking.

Only check the fields if we know the struct type is right.
This commit is contained in:
Mike Sperber 2011-01-06 13:53:51 +01:00
parent 7cac1f6ac2
commit 69963a1f2c

View File

@ -484,9 +484,9 @@
(make-signature
name
(lambda (self thing)
(if (not (predicate thing))
(signature-violation thing self #f #f)
(begin
(let ((log (wrap-ref thing)))
(cond
((not log)
@ -506,10 +506,10 @@
(ormap check (lazy-wrap-log-checked log)))))
(wrap-set! thing
(make-lazy-wrap-log (cons not-checked (lazy-wrap-log-not-checked log))
(lazy-wrap-log-checked log)))))))
(lazy-wrap-log-checked log))))))
(when eager-checking?
(check-lazy-wraps! type-descriptor thing))
(check-lazy-wraps! type-descriptor thing))))
thing)
(delay syntax)