fixes #20107 (#20246) [backport]

This commit is contained in:
Andreas Rumpf 2022-08-19 13:42:08 +02:00 • committed by GitHub
commit b1fe1690c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,24 @@
discard """
cmd: "nim c -d:release -d:danger $file"
output: "42"
"""
# bug #20107
type Foo = object
a, b, c, d: uint64
proc c(i: uint64): Foo =
Foo(a: i, b: i, c: i, d: i)
func x(f: Foo): lent Foo {.inline.} =
f
proc m() =
let f = block:
let i = c(42)
x(i)
echo $f.a
m()