Zulip Chat Archive

Stream: new members

Topic: Possible pattern matching bug?


Fernando Chu (Jul 29 2025 at 14:09):

Is this behavior expected?

import Mathlib

inductive Foo :   Type where
  | proj {n} {f : Fin n  } (i : Fin n) : Foo (f i)

-- Works
def test' {n : } : Foo n  Foo n := fun
  | .proj (f := f) i => sorry

-- Invalid pattern ?m.2299 i
def test {n : } : Foo n  Foo n := fun
  | .proj i => sorry

Why do I have to specify f above?

Kyle Miller (Jul 29 2025 at 17:20):

Not sure, and it seems like it's potentially a bug. Reported it: lean#9617


Last updated: Dec 20 2025 at 21:32 UTC