Skip to content

Commit

Permalink
Test case-of-case
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeata committed Nov 5, 2024
1 parent e989412 commit bda38cc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/lean/run/matchfloat.lean
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,25 @@ example (b : Bool) (o : Option Bool) (P : Bool → Prop) (abort : ∀ b, P b):
fail_if_success simp only [match_float]
apply abort

-- Can float out of a match target (aka case-of-case)
/--
error: tactic 'fail' failed
o : Option Bool
P : Nat → Prop
⊢ P
(match o with
| some b =>
match b with
| true => 1
| false => 2
| none => 1)
-/
#guard_msgs in
example (o : Option Bool) (P : Nat → Prop):
P (match (match o with | some b => b | none => true) with | true => 1 | false => 2) := by
simp only [match_float]
fail

-- Dependent context; must not rewrite

set_option trace.match_float true in
Expand Down

0 comments on commit bda38cc

Please sign in to comment.