Commit b12ed599 authored by Phoebe Goldman's avatar Phoebe Goldman
Browse files

more precise type constraints in REDUCING

this better matches previous behavior when RESULT-TYPE is not supplied.
parent b6b7d821
......@@ -2917,7 +2917,7 @@ e.g. (DSETQ (VALUES (a . b) nil c) form)"
(defclause (reducing expr by op &optional initial-value (init-val nil iv?)
into var-spec
result-type (type (expr-type-only op)))
result-type type)
"Generalized reduction"
;; VALUE: the value accumulated so far.
;; If we don't know the initial value, we can't use RETURN-REDUCTION-CODE.
......@@ -2933,13 +2933,14 @@ e.g. (DSETQ (VALUES (a . b) nil c) form)"
:expression expr
:test nil
:variable var-spec
:type type
:type (or type (expr-type-only op))
:accum-kind nil)) ; matches anything
(setq expr (walk-expr expr))
(setq var-spec (or var-spec *result-var*))
(let* ((var (extract-var var-spec))
(entry (make-accum-var-default-binding var-spec nil
:using-type-of expr
:type type))
(prev-first-time-var (third entry)))
(multiple-value-bind (update-code first-time-var)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment