Add assertion for copy-on-failure? type.

Closes #987.
This commit is contained in:
Alex Shinn 2024-05-31 18:46:39 +09:00
parent 0b55c0b718
commit 193424f74d
2 changed files with 2 additions and 0 deletions

View file

@ -3787,6 +3787,7 @@
(vector 'foo 'bar 'baz)) (vector 'foo 'bar 'baz))
(make-interval '#(1))) (make-interval '#(1)))
(make-interval '#())))) (make-interval '#()))))
(test-error (specialized-array-reshape A-ref (make-interval '#(100)) 'a))
) )
(test-group "curry tests" (test-group "curry tests"

View file

@ -579,6 +579,7 @@
(= (interval-volume (array-domain array)) (= (interval-volume (array-domain array))
(interval-volume new-domain)))) (interval-volume new-domain))))
(let ((copy-on-failure? (and (pair? o) (car o)))) (let ((copy-on-failure? (and (pair? o) (car o))))
(assert (boolean? copy-on-failure?))
(cond (cond
((reshape-without-copy array new-domain)) ((reshape-without-copy array new-domain))
(copy-on-failure? (copy-on-failure?