Skip to content

Borrow checker gets confused by references inside if #1107

Open
@hellerve

Description

@hellerve

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions