fixes #14805
This commit is contained in:
parent
ecf8cbbbe0
commit
e42ce877a6
2 changed files with 15 additions and 1 deletions
14
tests/lent/tlent_from_var.nim
Normal file
14
tests/lent/tlent_from_var.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
discard """
|
||||
output: "x"
|
||||
"""
|
||||
|
||||
# bug #14805
|
||||
|
||||
type Foo = object
|
||||
a: string
|
||||
|
||||
proc bar(f: var Foo): lent string =
|
||||
result = f.a
|
||||
|
||||
var foo = Foo(a: "x")
|
||||
echo bar(foo)
|
||||
Loading…
Add table
Add a link
Reference in a new issue