这是indexloc提供的服务,不要输入任何密码
Skip to content

Borrow checker is confused by using a match-ref with a let block #1065

@TimDeve

Description

@TimDeve

The following code produces a borrow checker error even though there is no shared values between the two match-ref:

(deftype Sum One Two)

(defn main []
  (do
   (let []
    (match-ref &(Sum.One)
     Sum.One ()
     Sum.Two ()))
   (match-ref &(Sum.Two)
    Sum.One ()
    Sum.Two ())))
The reference '(ref (Sum.Two))' (depending on the variable '_9') isn't alive at line 9, column 15 in '/tmp/main.carp'. at /tmp/main.carp:3:1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions