mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-08 21:57:42 +03:00
result from if-s are freed too
This commit is contained in:
parent
e81e4a76ae
commit
959b374537
@ -270,6 +270,11 @@
|
||||
|
||||
vars-after-all (remove (fn (v) (contains? all-freed v)) vars-after-expr)
|
||||
|
||||
if-ret-type (:type ast)
|
||||
vars-after-all-with-ret-val (if (managed-type? if-ret-type)
|
||||
(cons {:name (:result-name ast) :type if-ret-type :doc "if ret val"} vars-after-all)
|
||||
vars-after-all)
|
||||
|
||||
eaten-left (get-maybe data-after-left :eaten)
|
||||
eaten-right (get-maybe data-after-right :eaten)
|
||||
;;_ (println (str "eaten-left:\n" eaten-left "\neaten-right:\n" eaten-right))
|
||||
@ -285,7 +290,7 @@
|
||||
|
||||
]
|
||||
{:ast ast-after-all
|
||||
:vars vars-after-all
|
||||
:vars vars-after-all-with-ret-val
|
||||
:eaten eaten})
|
||||
|
||||
:let (let [;;_ (println (str "\nLET vars in body " (get-maybe ast :result-name) ":\n" vars))
|
||||
|
@ -465,7 +465,7 @@
|
||||
free-left (get-in own-asta-13b '(:body :free-left))
|
||||
free-right (get-in own-asta-13b '(:body :free-right))]
|
||||
(do (assert-eq '(:fn (:string) :string) (:type own-asta-13b))
|
||||
;;(bake own-if-13b)
|
||||
(bake own-if-13b)
|
||||
(assert-eq 1 (count free))
|
||||
(assert-eq 2 (count free-left))
|
||||
(assert-eq 2 (count free-right))
|
||||
|
Loading…
Reference in New Issue
Block a user