Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engine: F*: wrong field name for enum variant with record payload #1132

Open
W95Psp opened this issue Nov 25, 2024 · 0 comments
Open

engine: F*: wrong field name for enum variant with record payload #1132

W95Psp opened this issue Nov 25, 2024 · 0 comments
Labels
bug Something isn't working engine Issue in the engine

Comments

@W95Psp
Copy link
Collaborator

W95Psp commented Nov 25, 2024

enum Enum {
    A,
    B { x: usize },
}
fn f() {
    let v = Enum::B { x: 3 };
    match v {
        Enum::A => (),
        Enum::B {x} => (),        
    }
}

Open this code snippet in the playground

extracts to:

type t_Enum =
  | Enum_A : t_Enum
  | Enum_B { f_x:usize }: t_Enum

let f (_: Prims.unit) : Prims.unit =
  let v:t_Enum =
    Enum_B
    ({ Playground.Enum.f_x = sz 3 })
    <:
    t_Enum
  in
  match v with
  | Enum_A  -> () <: Prims.unit
  | Enum_B { Playground.Enum.f_x = x } ->
    () <: Prims.unit

The second last line is wrong: Playground.Enum is not the namespace of the field Enum::x.

@W95Psp W95Psp added bug Something isn't working engine Issue in the engine labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working engine Issue in the engine
Projects
None yet
Development

No branches or pull requests

1 participant