(cl-return-from comp-cstr-intersection-homogeneous dst))
(setf (neg dst) (when srcs
- (neg (car srcs))))
+ (neg (car srcs))))
;; Type propagation.
(setf (typeset dst)
;; If (member value) is subtypep of all other sources then
;; is good to be colleted.
when (cl-every (lambda (s)
- (or (memq val (valset s))
+ (or (memql val (valset s))
(cl-some (lambda (type)
(cl-typep val type))
(typeset s))))
(cl-return cstr)
finally (setf (valset cstr)
(append vals-to-add (valset cstr))))
+ (when (memql 0.0 (valset cstr))
+ (cl-pushnew -0.0 (valset cstr)))
+ (when (memql -0.0 (valset cstr))
+ (cl-pushnew 0.0 (valset cstr)))
cstr))
(comp-cstr-intersection dst (relax-cstr op1) (relax-cstr op2)))))
(error "")))
cons)
- ;; 69
+ ;; 68
((defun comp-tests-ret-type-spec-f (x)
(if (and (floatp x)
- (= x 0))
+ (= x 1))
x
(error "")))
;; Conservative (see cstr relax in `comp-cstr-=').
- (or (member 0.0) (integer 0 0)))
+ (or (member 1.0) (integer 1 1)))
- ;; 70
+ ;; 69
((defun comp-tests-ret-type-spec-f (x)
(if (and (integer x)
- (= x 0))
+ (= x 1))
x
(error "")))
;; Conservative (see cstr relax in `comp-cstr-=').
- (or (member 0.0) (integer 0 0)))
+ (or (member 1.0) (integer 1 1)))
- ;; 71
+ ;; 70
((defun comp-tests-ret-type-spec-f (x y)
(if (and (floatp x)
(integerp y)
(= x y))
x
(error "")))
- (or float integer))))
+ (or float integer))
+
+ ;; 71
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (= x 0.0)
+ x
+ (error "")))
+ (or (member -0.0 0.0) (integer 0 0)))
+
+ ;; 72
+ ((defun comp-tests-ret-type-spec-f (x)
+ (unless (= x 0.0)
+ (error ""))
+ (unless (eql x -0.0)
+ (error ""))
+ x)
+ float)))
(defun comp-tests-define-type-spec-test (number x)
`(comp-deftest ,(intern (format "ret-type-spec-%d" number)) ()