diff --git a/src/Init/Prelude.lean b/src/Init/Prelude.lean index 9987e6605a..773371e861 100644 --- a/src/Init/Prelude.lean +++ b/src/Init/Prelude.lean @@ -1551,7 +1551,7 @@ instance instAddNat : Add Nat where /- We mark the following definitions as pattern to make sure they can be used in recursive equations, and reduced by the equation Compiler. -/ -attribute [match_pattern] Nat.add Add.add HAdd.hAdd Neg.neg +attribute [match_pattern] Nat.add Add.add HAdd.hAdd Neg.neg Mul.mul HMul.hMul set_option bootstrap.genMatcherCode false in /-- diff --git a/tests/lean/run/mul_match_pattern.lean b/tests/lean/run/mul_match_pattern.lean new file mode 100644 index 0000000000..4b474698db --- /dev/null +++ b/tests/lean/run/mul_match_pattern.lean @@ -0,0 +1,14 @@ +namespace mul_match_pattern + +inductive Foo + | x + | bar (y z : Foo) + +instance : Mul Foo where + mul := Foo.bar + +def quux : Foo → Foo + | .x => .x + | y * _z => y + +end mul_match_pattern