summary refs log tree commit diff stats
path: root/tests/isolate
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-11-09 12:43:16 +0100
committerGitHub <noreply@github.com>2021-11-09 12:43:16 +0100
commitb7c66ce860cfbadfa8ed60784fc387a0818e2e5d (patch)
tree9009a0824ea365bc0eda9f67a477a1d66fd3e29c /tests/isolate
parent83a9c3ba31d180cd5e31026d8b7603bf7adea18c (diff)
downloadNim-b7c66ce860cfbadfa8ed60784fc387a0818e2e5d.tar.gz
fixes #19013 [backport:1.6] (#19111)
* fixes #19013 [backport:1.6]

* added test case
Diffstat (limited to 'tests/isolate')
-rw-r--r--tests/isolate/tisolate2.nim22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/isolate/tisolate2.nim b/tests/isolate/tisolate2.nim
new file mode 100644
index 000000000..9bf92d82e
--- /dev/null
+++ b/tests/isolate/tisolate2.nim
@@ -0,0 +1,22 @@
+discard """
+  errormsg: "expression cannot be isolated: a_to_b(a)"
+  line: 22
+"""
+
+# bug #19013
+import std/isolation
+
+type Z = ref object
+  i: int
+
+type A = object
+  z: Z
+
+type B = object
+  z: Z
+
+func a_to_b(a: A): B =
+  result = B(z: a.z)
+
+let a = A(z: Z(i: 3))
+let b = isolate(a_to_b(a))