lean4-htt/tests/lean/run/emptyLcnf.lean
Cameron Zwarich c292ae2e0e
fix: don't create reduced arity LCNF decls with no params (#7086)
This PR makes the arity reduction pass in the new code generator match
the old one when it comes to the behavior of decls with no used
parameters. This is important, because otherwise we might create a
top-level decl with no params that contains unreachable code, which
would get evaluated unconditionally during initialization. This actually
happens when initializing Init.Core built with the new code generator.
2025-02-27 01:23:34 +00:00

15 lines
245 B
Text

import Lean
inductive MyEmpty
def f (x : MyEmpty) : Nat :=
MyEmpty.casesOn _ x
set_option trace.Compiler.result true
/--
info: [Compiler.result] size: 0
def f x : Nat :=
-/
#guard_msgs in
run_meta Lean.Compiler.compile #[``f]