lean4-htt/tests/lean/CompilerProvokeFloatLet.lean
2022-10-10 23:56:20 +02:00

12 lines
256 B
Text

set_option trace.Compiler.floatLetIn true in
def provokeFloatLet (x y : Nat) (cond : Bool) : Nat :=
let a := x ^ y
let b := x + y
let c := x - y
let dual := x * y
if cond then
match dual with
| 0 => a
| _ + 1 => c
else
b + dual