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

let mut does not work with ~q matching #36

Open
eric-wieser opened this issue Feb 18, 2024 · 0 comments
Open

let mut does not work with ~q matching #36

eric-wieser opened this issue Feb 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@eric-wieser
Copy link
Member

eric-wieser commented Feb 18, 2024

This complains on each x :=

import Qq
open Qq Lean

example : MetaM Nat := do
  let mut x := 1
  if let ~q(Prop) := q(Type) then
    x := 2
  else
    x := 3
  return x

with error

x cannot be mutated, only variables declared using let mut can be mutated. If you did not intent to mutate but define x, consider using let x instead

Normally this would be legal:

example : MetaM Nat := do
  let mut x := 1
  if let true := false then
    x := 2
  else
    x := 3
  return x

This is almost certainly related to #21

@eric-wieser eric-wieser added the bug Something isn't working label Feb 18, 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
Projects
None yet
Development

No branches or pull requests

1 participant