Don't produce a compile time warning for (setf (char string 0) #\é)

This commit is contained in:
Stas Boukarev 2026-08-09 01:20:46 +03:00
parent 93c205db17
commit adcd474725
3 changed files with 8 additions and 1 deletions

View file

@ -268,7 +268,7 @@
(let ((data (truly-the (simple-array ,element-type-specifier 1) data)))
,(if stringp
`(if (simple-base-string-p data)
(data-vector-set (truly-the (simple-array base-char (*)) data) index (the base-char ,new-value))
(data-vector-set (truly-the (simple-array base-char (*)) data) index (the* (base-char :silent-conflict t) ,new-value))
(data-vector-set (truly-the (simple-array character (*)) data) index (the character ,new-value)))
`(data-vector-set data index ,new-value))
,truly-new-value))))))

View file

@ -1166,3 +1166,9 @@
(lambda (x n)
(aref (if n (the string n) #(1 2)) x))
(or (integer 1 2) character)))
#+sb-unicode
(with-test (:name :char-base-char-warning)
(checked-compile
`(lambda (s)
(setf (char s 0) (code-char 233)))))

View file

@ -334,6 +334,7 @@
(error "~s" vector))))))
(free-protected-array string))))
#+(or arm64 x86-64)
(with-test (:name :character-string-to-utf8)
(flet ((run-test (string obuf vector)
(loop repeat (* 256 #+slow 10)