An type with an unsupported CONS type cannot be replaced by just CONS. Use T instead for type estimates in TYPE-AND/OR

This commit is contained in:
Juan Jose Garcia Ripoll 2008-11-30 23:15:39 +01:00
parent 044caf8c4d
commit 7ae84753e8

View file

@ -144,9 +144,11 @@
(t
`(AND ,t1 ,t2))))
((eq tag1 'CONS)
(type-and 'CONS t2))
(cmpwarn "Unsupported CONS type ~S. Replacing it with T." t1)
t2)
((eq tag2 'CONS)
(type-and t1 'CONS))
(cmpwarn "Unsupported CONS type ~S. Replacing it with T." t2)
t1)
((null tag1)
(cmpwarn "Unknown type ~S. Assuming it is T." t1)
t2)
@ -176,15 +178,17 @@
(t
`(OR ,t1 ,t2))))
((eq tag1 'CONS)
(type-or 'CONS t2))
(cmpwarn "Unsupported CONS type ~S. Replacing it with T." t1)
T)
((eq tag2 'CONS)
(type-or t1 'CONS))
(cmpwarn "Unsupported CONS type ~S. Replacing it with T." t2)
T)
((null tag1)
(cmpwarn "Unknown type ~S" t1)
'T)
T)
(t
(cmpwarn "Unknown type ~S" t2)
'T))))
T))))
(defun type>= (type1 type2)
(subtypep type2 type1))