Fixes #2798
This commit is contained in:
parent
77b010bd36
commit
d3c4c7c52f
2 changed files with 25 additions and 2 deletions
20
tests/js/tobjfieldbyvar.nim
Normal file
20
tests/js/tobjfieldbyvar.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
discard """
|
||||
output: '''5
|
||||
'''
|
||||
"""
|
||||
|
||||
# bug #2798
|
||||
|
||||
type Inner = object
|
||||
value: int
|
||||
|
||||
type Outer = object
|
||||
i: Inner
|
||||
|
||||
proc test(i: var Inner) =
|
||||
i.value += 5
|
||||
|
||||
var o: Outer
|
||||
test(o.i)
|
||||
|
||||
echo o.i.value
|
||||
Loading…
Add table
Add a link
Reference in a new issue