mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-01 01:21:16 +00:00
12 lines
166 B
Nim
12 lines
166 B
Nim
type
|
|
Foo = object
|
|
y: int
|
|
|
|
Bar = object
|
|
x: Foo
|
|
|
|
proc baz(state: var Bar):int =
|
|
state.x.y = 2
|
|
state.x.y
|
|
doAssert baz((ref Bar)(x: (new Foo)[])[]) == 2
|