Skip to content

with .. unfold wrongly binds at unit type #473

@mtzguido

Description

@mtzguido
let my_pts_to (r : ref int) (x : int) : slprop = r |-> x

fn test (r : ref int)
  preserves my_pts_to r x
{
  with v. unfold my_pts_to r v;
  fold my_pts_to r v;
}

Fails highlighting the last use of v, saying:

- Could not instantiate implicits in term: my_pts_to r _
- Expected expression of type int got expression _ of type unit
- See also <input>:79.32-80.21

Doing this instead works fine:

fn test (r : ref int)
  preserves my_pts_to r x
{
  with v.
    assert my_pts_to r v;
  unfold my_pts_to r v;
  fold my_pts_to r v;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions