lean4-htt/tests/lean/run/extractClosed.lean
Cameron Zwarich b579c5c7d8
fix: make compiler.extract_closed option work again after migration (#9279)
This PR fixes the `compiler.extract_closed` option after migrating it to
Lean (and adds a test so it would be caught in the future).
2025-07-09 14:31:58 +00:00

28 lines
717 B
Text

/--
trace: [Compiler.IR] [result]
def f._closed_0 : obj :=
let x_1 : obj := 1;
let x_2 : obj := Array.mkEmpty ◾ x_1;
ret x_2
def f (x_1 : obj) : obj :=
let x_2 : obj := f._closed_0;
let x_3 : obj := Array.push ◾ x_2 x_1;
ret x_3
-/
#guard_msgs in
set_option trace.compiler.ir.result true in
def f (a : Nat) : Array Nat := #[a]
/--
trace: [Compiler.IR] [result]
def g (x_1 : obj) : obj :=
let x_2 : obj := 1;
let x_3 : obj := Array.mkEmpty ◾ x_2;
let x_4 : obj := Array.push ◾ x_3 x_1;
ret x_4
-/
#guard_msgs in
set_option trace.compiler.ir.result true in
set_option compiler.extract_closed false in
def g (a : Nat) : Array Nat := #[a]