Nim/tests/ccgbugs/tderefblock.nim
Andreas Rumpf 5211a471c8
fixes the regressions caused by the fix for #20107 [backport] (#20287)
* fixes the regressions caused by the fix for #20107 [backport]
2022-08-31 13:19:26 +02:00

25 lines
322 B
Nim

discard """
cmd: "nim c -d:release -d:danger $file"
matrix: ";--gc:orc"
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()