File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ inductive HasUnitParam where
2+ | yes : Unit → HasUnitParam
3+ | no : HasUnitParam
4+
5+ def foo (x : HasUnitParam) : Bool := x.casesOn (fun _ => true ) false
6+ def bar (x : HasUnitParam) : Bool := match x with
7+ | HasUnitParam.yes _x => true
8+ | HasUnitParam.no => false
9+
10+ -- Checks that the delaboration of `casesOn` does not confuse genuine unit fields with
11+ -- the thunking parameter of a genuine matcher
12+
13+ /--
14+ info: def foo : HasUnitParam → Bool :=
15+ fun x =>
16+ match x with
17+ | HasUnitParam.yes x => true
18+ | HasUnitParam.no => false
19+ -/
20+ #guard_msgs in
21+ #print foo
22+
23+ /--
24+ info: def bar : HasUnitParam → Bool :=
25+ fun x =>
26+ match x with
27+ | HasUnitParam.yes _x => true
28+ | HasUnitParam.no => false
29+ -/
30+ #guard_msgs in
31+ #print bar
You can’t perform that action at this time.
0 commit comments