lean4-htt/tests/elab/lcnf3.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

26 lines
510 B
Text

import Lean
set_option compiler.checkTypes true
def f1 (x : Option Nat) (y : Nat) : Nat :=
let z := some y
if let (some x, some y) := (x, z) then
x + y
else
0
set_option compiler.checkTypes false -- disabled due to type checking withCtor
inductive Ty where
| c1 | c2 | c3 | c4 | c5
set_option compiler.checkTypes true
def f2 (a b : Ty) (n : Nat) : Nat :=
let x := match a with
| .c1 => 10 * n
| _ => 20 * n
let y := match b with
| .c2 => 10 + n
| _ => 20 + n
x + y