summary refs log tree commit diff stats
path: root/tests/objects/tobjconstr.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/objects/tobjconstr.nim')
-rw-r--r--tests/objects/tobjconstr.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/objects/tobjconstr.nim b/tests/objects/tobjconstr.nim
index b7da176aa..d1f3c8bdb 100644
--- a/tests/objects/tobjconstr.nim
+++ b/tests/objects/tobjconstr.nim
@@ -15,7 +15,8 @@ discard """
 (y: 678, x: 123)
 (y: 678, x: 123)
 (y: 0, x: 123)
-(y: 678, x: 123)'''
+(y: 678, x: 123)
+(y: 123, x: 678)'''
 """
 
 type
@@ -75,3 +76,7 @@ when true:
   echo b                  # (y: 0, x: 123)
   b=B(y: 678, x: 123)
   echo b                  # (y: 678, x: 123)
+  b=B(y: b.x, x: b.y)
+  echo b                  # (y: 123, x: 678)
+
+GC_fullCollect()