fix: missing unboxing in interpreter when loading initialized value (#4512)
Fixes #4457
This commit is contained in:
parent
7d7f378e02
commit
1f732bb3b7
6 changed files with 17 additions and 1 deletions
|
|
@ -796,7 +796,7 @@ private:
|
|||
}
|
||||
if (object * const * o = g_init_globals->find(fn)) {
|
||||
// persistent, so no `inc` needed
|
||||
return *o;
|
||||
return type_is_scalar(t) ? unbox_t(*o, t) : *o;
|
||||
}
|
||||
|
||||
symbol_cache_entry e = lookup_symbol(fn);
|
||||
|
|
|
|||
1
tests/pkg/initialize/.gitignore
vendored
Normal file
1
tests/pkg/initialize/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/.lake
|
||||
5
tests/pkg/initialize/Initialize.lean
Normal file
5
tests/pkg/initialize/Initialize.lean
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import Initialize.Basic
|
||||
|
||||
/-- info: 42 -/
|
||||
#guard_msgs in
|
||||
#eval initNat
|
||||
1
tests/pkg/initialize/Initialize/Basic.lean
Normal file
1
tests/pkg/initialize/Initialize/Basic.lean
Normal file
|
|
@ -0,0 +1 @@
|
|||
initialize initNat : Nat ← pure 42
|
||||
5
tests/pkg/initialize/lakefile.toml
Normal file
5
tests/pkg/initialize/lakefile.toml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
name = "initialize"
|
||||
defaultTargets = ["Initialize"]
|
||||
|
||||
[[lean_lib]]
|
||||
name = "Initialize"
|
||||
4
tests/pkg/initialize/test.sh
Executable file
4
tests/pkg/initialize/test.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
rm -rf .lake/build
|
||||
lake build
|
||||
Loading…
Add table
Reference in a new issue