Carp icon indicating copy to clipboard operation
Carp copied to clipboard

Borrow checker gets confused by references inside `if`

Open hellerve opened this issue 5 years ago • 0 comments

When a reference is taken inside an if and returned from it the borrow checker will be happy, but emit code that frees that reference before it’s used outside. An example

(Debug.sanitize-addresses)

(defn main []
  (let [f (if true &id &id)]
    (~f 0)))

This bug reared its head in #1106.

Cheers

hellerve avatar Dec 29 '20 10:12 hellerve