-
Notifications
You must be signed in to change notification settings - Fork 12
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
~q
pattern match does not respect return
#21
Labels
bug
Something isn't working
Comments
I think the def foo₁ (T : Q(Type)) : MetaM Bool := do
if let ~q(Prop) := T then
return ()
return true It's returning from the inner macro, not the outer do block |
Here's a slightly more damning example: import Qq
open Qq Lean
def foo₂ (T : Q(Type)) : MetaM Bool := do
let x : Unit ← match T with
| ~q(Prop) => return true
| _ => return true
return false
#eval foo₂ q(Nat) -- false
#eval foo₂ q(Int) -- false |
eric-wieser
changed the title
Nov 15, 2023
~q
pattern match under if let
has wrong type~q
pattern match does not respect return
I added a lot of test-cases in #27 |
A possible solution is discussed at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Converting.20from.20doSeq.20to.20doSeqItem/near/402223969 |
This was referenced Feb 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the snippet below. I would expect the two functions
foo₁
andfoo₂
to be equivalent and both to work, howeverfoo₁
fails to elaborate with a type error.The text was updated successfully, but these errors were encountered: