summary refs log tree commit diff stats
path: root/tests/destructor/tcaseobj_transitions.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/destructor/tcaseobj_transitions.nim')
-rw-r--r--tests/destructor/tcaseobj_transitions.nim18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/destructor/tcaseobj_transitions.nim b/tests/destructor/tcaseobj_transitions.nim
index 9377d57b0..61464101f 100644
--- a/tests/destructor/tcaseobj_transitions.nim
+++ b/tests/destructor/tcaseobj_transitions.nim
@@ -1,5 +1,5 @@
 discard """
-  cmd: '''nim c --newruntime $file'''
+  cmd: '''nim c --gc:arc $file'''
   output: '''no crash'''
 """
 
@@ -31,3 +31,19 @@ var y = MyCaseObjectB(kind: A)
 y.x = 1
 y.kind = C
 echo "no crash"
+
+
+#################
+## bug #12821
+
+type
+  RefBaseObject* = ref object of RootObj
+    case kind: bool
+      of true: a: int
+      of false: b: float
+
+  MyRefObject = ref object of RefBaseObject
+    x: float
+
+let z = new(MyRefObject)
+z.kind = false