Skip to content

Wrong type ascription pattern in generated F* #1170

Closed
@maximebuyse

Description

@maximebuyse
struct Other<'a>(&'a i32);

enum Test<'a> {
    C1(Other<'a>)
}

impl<'a> Test<'a> {
    fn test(&self) -> i32 {
        match self {
            Self::C1(c) => *c.0

        }
    }
}

Open this code snippet in the playground

The generated F* for the test method from the example is:

let impl__test (self: t_Test) : i32 =
  match self with
  | (Test_C1 c: t_Test) -> c._0

F* rejects it with Type ascriptions within patterns are only allowed on variables

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingf*F* backend

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions