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.
15 lines
245 B
Text
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]
|