summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/isolation_check.nim8
-rw-r--r--tests/stdlib/tisolation.nim8
2 files changed, 14 insertions, 2 deletions
diff --git a/compiler/isolation_check.nim b/compiler/isolation_check.nim
index 01f0a002a..9c8ca58b4 100644
--- a/compiler/isolation_check.nim
+++ b/compiler/isolation_check.nim
@@ -100,7 +100,12 @@ proc checkIsolate*(n: PNode): bool =
       for it in n:
         result = checkIsolate(it.lastSon)
         if not result: break
-    of nkCaseStmt, nkObjConstr:
+    of nkCaseStmt:
+      for i in 1..<n.len:
+        result = checkIsolate(n[i].lastSon)
+        if not result: break
+    of nkObjConstr:
+      result = true
       for i in 1..<n.len:
         result = checkIsolate(n[i].lastSon)
         if not result: break
@@ -123,4 +128,3 @@ proc checkIsolate*(n: PNode): bool =
   else:
     # no ref, no cry:
     result = true
-
diff --git a/tests/stdlib/tisolation.nim b/tests/stdlib/tisolation.nim
index 11c51fe05..e43fd558a 100644
--- a/tests/stdlib/tisolation.nim
+++ b/tests/stdlib/tisolation.nim
@@ -8,6 +8,14 @@ import std/[isolation, json]
 
 
 proc main() =
+  block:
+    type
+      Empty = ref object
+
+
+    var x = isolate(Empty())
+    discard extract(x)
+
   block: # string literals
     var data = isolate("string")
     doAssert data.extract == "string"