parent
1c31de361d
commit
b1fe1690c4
2 changed files with 38 additions and 0 deletions
24
tests/ccgbugs/tderefblock.nim
Normal file
24
tests/ccgbugs/tderefblock.nim
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue