AND type checks for subtypeness
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
A type check like this
> (typep x '(and vector (not string)))
fails with the error
#<NEGATION-TYPE (NOT (VECTOR STRING))> is not a subtype of VECTOR
While that is certainly true, this seems overzealous – the intersection of these types isn't empty and the type declaration should be absolutely valid. The assumption that in an intersection type one type needs to be a subtype of the other is false.
This has been done on Linux thomas 4.6.0-1-amd64 #1 SMP Debian 4.6.4-1 (2016-07-18) x86_64 GNU/Linux with SBCL 1.3.7.61-5fc41bd.
* *features*
(:HTML-TEMPLATE :CL-FAD :BORDEAUX-THREADS ALEXANDRIA.
:THREAD-SUPPORT :QUICKLISP :SB-BSD-
:ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-
:64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
:C-STACK-
:COMPLEX-
:FP-AND-
:INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE :LINUX :LITTLE-ENDIAN
:MEMORY-
:OS-PROVIDES-
:OS-PROVIDES-POLL :OS-PROVIDES-PUTWC :OS-PROVIDES-
:PACKAGE-
:SB-AFTER-XC-CORE :SB-CORE-
:SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-
:SB-TEST :SB-THREAD :SB-UNICODE :SB-XREF-
:SBCL :STACK-
:STACK-
:STACK-
:UNWIND-
Changed in sbcl: | |
status: | New → Fix Released |
status: | Fix Released → New |
Changed in sbcl: | |
status: | Incomplete → Fix Released |
> with SBCL 1.3.7.61-5fc41bd
You appear to be using an unreleased version of SBCL. The problem you describe has likely been fixed a couple of commits later in
a6d81f1 Fix sequence type derivation in the presence of negation types.
just before the 1.3.8 release. Please try to reproduce the problem with a released version or the current master.