lean4-htt/tests/lean/run/inlineApp.lean
Leonardo de Moura ca098d3769 feat: inline applications of the form inline (f ...)
The `inline` identity function is a directive for the compiler.
2022-09-10 13:28:49 -07:00

16 lines
385 B
Text

import Lean
def f (x : Nat) :=
(x - 1) + x * 2 + x*x
def h (x : Nat) :=
inline <| f (x + x)
#eval Lean.Compiler.compile #[``h]
open Lean Compiler LCNF in
@[cpass] def simpInline : PassInstaller :=
Testing.assertDoesNotContainConstAfter `simp `simpInlinesInline ``inline "simp did not inline `inline`"
set_option trace.Compiler.result true
#eval Lean.Compiler.compile #[``h]