File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 24042404 (reset! (:flag frame) true )
24052405 (swap! (:tags frame) (fn [tags]
24062406 (mapv (fn [tag expr]
2407- (add-types tag (:tag expr)))
2407+ ; ; Widen by adding the type of the recur expression, except when recurring with a
2408+ ; ; loop local: Since its final widened type is unknown, conservatively assume 'any.
2409+ (if (= :loop (:local expr))
2410+ 'any
2411+ (add-types tag (:tag expr))))
24082412 tags exprs)))
24092413 (assoc {:env env :op :recur :form form}
24102414 :frame frame
Original file line number Diff line number Diff line change 21012101 (env/with-compiler-env test-cenv
21022102 (:tag (ana/analyze test-env '(let [x ^any []] (if (implements? ICounted x) x nil ))))))
21032103 '#{cljs.core/ICounted clj-nil})))
2104+
2105+ (deftest test-cljs-3158
2106+ (is (= (ana/no-warn
2107+ (env/with-compiler-env test-cenv
2108+ (:tag (analyze test-env '(loop [a " x" b " y" ]
2109+ (if (= a 1 )
2110+ a
2111+ (recur b 1 )))))))
2112+ 'any)))
You can’t perform that action at this time.
0 commit comments