Re: Problem with type conflict style warning

Stas Boukarev <[email protected]>
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CAF63=10=6d9L_Y3LMgMHi1Kz4ykDDXLup8ON+UTimJ9zzVDdnQ@mail.gmail.com>
Fixed. Thanks.

On Wed, May 15, 2024 at 3:30 PM syll-dev via Sbcl-help <
[email protected]> wrote:

>
> Hello
>
> I don't understand this style warning...
>
> Here is the code (problem with test1 only) :
> "
> (ql:quickload :alexandria)
> (use-package :alexandria)
>
> (defvar *l* '(1 2 3))
>
> (defun test1 ()
>   (copy-sequence 'vector (reverse *l*)))
>
> (defun test2 ()
>   (copy-sequence 'vector *l*))
>
> (defun test3 ()
>   (copy-sequence 'vector '(1 2 3)))
>
> (defun test4 ()
>   (let ((l '(1 2 3)))
>     (copy-sequence 'vector l)))
> "
>
> And here is the result :
> "
> ; in: DEFUN TEST1
> ;     (COPY-SEQUENCE 'VECTOR (REVERSE *L*))
> ; --> BLOCK IF COERCE
> ; ==>
> ;   1
> ;
> ; caught STYLE-WARNING:
> ;   Derived type of SB-C::X is
> ;     (VALUES (OR LIST SB-KERNEL:EXTENDED-SEQUENCE) &OPTIONAL),
> ;   conflicting with its asserted type
> ;     VECTOR.
> ;   See also:
> ;     The SBCL Manual, Node "Handling of Types"
> "
>
> sbcl 2.4.1 and 2.4.4 (other versions not tested).
>
> I have the same problem with remove-if-not instead of reverse.
>
> Thank you
>
> syll
>
>
>
> _______________________________________________
> Sbcl-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-help
>

_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.