summary refs log tree commit diff stats
path: root/tests/misc/t18079.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/t18079.nim')
-rw-r--r--tests/misc/t18079.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/misc/t18079.nim b/tests/misc/t18079.nim
new file mode 100644
index 000000000..352348daf
--- /dev/null
+++ b/tests/misc/t18079.nim
@@ -0,0 +1,11 @@
+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