master: More thorough type checking for concatenate arguments

stassats via Sbcl-commits <[email protected]> Tue, 02 Jun 2026 20:52:12 +0000
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  91b8b81d14e0b722eee160765e151fae84c0637b (commit)
      from  2329ddf0dca2f182c77e2dea9f72a03fecae3069 (commit)

- Log -----------------------------------------------------------------
commit 91b8b81d14e0b722eee160765e151fae84c0637b
Author: Stas Boukarev <[email protected]>
Date:   Tue Jun 2 23:50:22 2026 +0300

    More thorough type checking for concatenate arguments
    
    Using sequence-elements-type, which works for constant lists and vectors.
---
 src/compiler/seqtran.lisp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/compiler/seqtran.lisp b/src/compiler/seqtran.lisp
index 7f0fbc0fc..db4f7bfc9 100644
--- a/src/compiler/seqtran.lisp
+++ b/src/compiler/seqtran.lisp
@@ -1842,14 +1842,14 @@
                 (eq result-element-type *universal-type*))
       (loop for i from 0
             for sequence in sequences
-            for sequence-type = (lvar-type sequence)
-            for element-type = (type-array-element-type sequence-type)
-            do (unless (or (eq element-type *wild-type*)
-                           (types-equal-or-intersect element-type result-element-type))
+            for element-type = (sequence-elements-type sequence)
+            do (when (and element-type
+                          (not (eq element-type *wild-type*))
+                          (not (types-equal-or-intersect element-type result-element-type)))
                  (let ((*compiler-error-context* node))
-                   (compiler-warn "Can't ~a ~s into ~s"
+                   (compiler-warn "Can't ~a elements of type ~s into ~s"
                                   description
-                                  (type-specifier sequence-type)
+                                  (type-specifier element-type)
                                   (if (ctype-p type)
                                       (type-specifier (make-array-type '(*)
                                                                        :specialized-element-type type

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL