abcl
abcl copied to clipboard
SUBTYPEP failures on ABCL 1.8.0
From https://gitlab.common-lisp.net/alexandria/alexandria/-/jobs/27735 (@phmarek)
Test ALEXANDRIA-TESTS::TYPE=.2 failed
Form: (ALEXANDRIA:TYPE= (QUOTE LIST) (QUOTE (OR NULL CONS)))
Expected values: T
T
Actual values: NIL
T.
Test ALEXANDRIA-TESTS::TYPE=.3 failed
Form: (ALEXANDRIA:TYPE= (QUOTE NULL) (QUOTE (AND SYMBOL LIST)))
Expected values: T
T
Actual values: NIL
NIL.
In the Bear:
CL-USER(3): (subtypep '(or null cons) 'list)
T
T
CL-USER(4): (subtypep 'list '(or null cons))
NIL
NIL
CL-USER(5): (subtypep 'null '(and symbol list))
T
T
CL-USER(6): (subtypep '(and symbol list) 'null)
NIL
NIL
I'm not a 100% sure of this but I've been reading the standard for subtypep and it seems that this behaviour is allowed.

subtypepis permitted to return the values false and false only when at least one argument involves one of these type specifiers:and,eql, the list form offunction,member,not,or,satisfies, orvalues.
Hm. As un-useful as it is for the end user, that's correct, and therefore not strictly a conformance bug. Looks like the Alexandria tests might need to get corrected in that case?...
Yes maybe they should change it. And also, maybe add some conditional warning inside the code of alexandria:type= when any of these type identifiers are used in at least one of the parameters.
https://gitlab.common-lisp.net/alexandria/alexandria/-/issues/26 was created, let's see how this goes.
abcl-1.9.3-dev now contains "emergency" special (i.e. ugly) fix for this case. This has revealed the need to treat ABCL's subtypep implementation with more care.
Thanks, as always, @phoe