Bug in `type=`: second value computed incorrectly
See definition of type=:
(defun type= (type1 type2)
"Returns a primary value of T is TYPE1 and TYPE2 are the same type,
and a secondary value that is true is the type equality could be reliably
determined: primary value of NIL and secondary value of T indicates that the
types are not equivalent."
(multiple-value-bind (sub ok) (subtypep type1 type2)
(cond ((and ok sub)
(subtypep type2 type1))
(ok
(values nil ok))
(t
(multiple-value-bind (sub ok) (subtypep type2 type1)
(declare (ignore sub))
(values nil ok))))))
In the case where the first return is (NIL NIL)
and the second is (T T)
, this will return (NIL T)
, which is incorrect -- we are not certain that the two types are unequal.
If the second value is (NIL T)
then we should return (NIL T)
, otherwise we should return (NIL NIL)
since both results are uncertain.
See #34 (closed) for an example.