Skip to content

Commit

Permalink
Add assertion for copy-on-failure? type.
Browse files Browse the repository at this point in the history
Closes #987.
  • Loading branch information
ashinn committed May 31, 2024
1 parent 0b55c0b commit 193424f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/srfi/231/test.sld
Original file line number Diff line number Diff line change
Expand Up @@ -3787,6 +3787,7 @@
(vector 'foo 'bar 'baz))
(make-interval '#(1)))
(make-interval '#()))))
(test-error (specialized-array-reshape A-ref (make-interval '#(100)) 'a))
)

(test-group "curry tests"
Expand Down
1 change: 1 addition & 0 deletions lib/srfi/231/transforms.scm
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@
(= (interval-volume (array-domain array))
(interval-volume new-domain))))
(let ((copy-on-failure? (and (pair? o) (car o))))
(assert (boolean? copy-on-failure?))
(cond
((reshape-without-copy array new-domain))
(copy-on-failure?
Expand Down

0 comments on commit 193424f

Please sign in to comment.