sharplispers / split-sequence

SPLIT-SEQUENCE is a member of the Common Lisp Utilities family of programs, designed by community consensus.

Home Page:http://cliki.net/split-sequence

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to compile on sbcl 1.3.1: type error

shamazmazum opened this issue · comments

Hello. There is a type error in function split-sequence. Its declared type is (function (&rest t) (values list integer)), but derived type also include null in return type, so it is (function (&rest t) (or (values list integer) null)). See that cond in split-sequence? Even if practically impossible, theoretically, cond can return nil which is not of type (values list integer). It makes sbcl very unhappy, so it compiles it with warning and ASDF fails. Please fix declared type or add something like (t (values nil 0)) in the end of cond

I don't see how that cond can possibly go through the implicit clause. Seems like an SBCL bug/limitation. I've sent a bug report to sbcl-devel. I suspect we will end up following your suggestion of adding a default clause. Thanks.

It's a limitation, but it seems like one that would be hard to overcome. The type analysis required to catch this case would be rather sophisticated.

Just confirming, that (error "Something") works for me, at least for this version of sbcl

Committed Stas's suggestion, replacing the last predicate with T. Thanks for the report.