lean4-htt/tests/lean/run/ifThenElseIssue.lean
Leonardo de Moura 8598dde6e6 fix: if-then-else elaboration issue
@Kha I hate this kind of hack, but the behavior looked unacceptabled
to me. I added a big comment describing the issue and the hack.
2020-11-21 20:51:28 -08:00

32 lines
782 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- set_option trace.Meta.isDefEq true
-- set_option trace.Elab true
def f1 (s : Nat × Bool) : Bool :=
if s.2 then false else true
def f2 (s : Nat × Bool) : Bool :=
if @Prod.snd _ _ s then false else true
def f3 (s : Nat × Bool) : Bool :=
if Prod.snd s then false else true
def f4 (s : Nat × String × Bool) : Bool :=
if s.2.2 then false else true
def sec (s : α × β) : β :=
s.2
def f5 (s : Nat × Bool) : Bool :=
if sec s then false else true
def f6 (s : Nat × (Bool → Bool)) : Bool :=
if sec s true then false else true
def f7 (s : List Bool) : Bool :=
if s.head! then false else true
def f8 (s : List Bool) : Bool :=
if (s.map not).head! then false else true
def f9 (s : List Bool) : Bool :=
if List.head! (s.map not) then false else true