summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorcooldome <cdome@bk.ru>2020-04-20 14:57:36 +0100
committerGitHub <noreply@github.com>2020-04-20 15:57:36 +0200
commit65c5367dc1c29d01f00dbc2bcfb574af5f3334fa (patch)
treee8e919192a2c00ea5cdfd2afdb750ec63bba6959 /tests
parentba0af0f827d97532516e4c2acc1fdbb9cdba7b61 (diff)
downloadNim-65c5367dc1c29d01f00dbc2bcfb574af5f3334fa.tar.gz
Fixes #14014 (#14029)
* add test

* improve test

* progress

* fix #14014

* fix bug

Co-authored-by: cooldome <ariabushenko@bk.ru>
Diffstat (limited to 'tests')
-rw-r--r--tests/parallel/tsysspawn.nim35
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/parallel/tsysspawn.nim b/tests/parallel/tsysspawn.nim
index 7244a5ee6..09a77b358 100644
--- a/tests/parallel/tsysspawn.nim
+++ b/tests/parallel/tsysspawn.nim
@@ -1,6 +1,10 @@
 discard """
   output: '''4
-8'''
+8
+(a: 1)
+2
+2
+'''
   cmd: "nim $target --threads:on $options $file"
 """
 
@@ -29,3 +33,32 @@ sync()
 
 echo x
 echo y
+
+
+#--------------------------------------------------------
+# issue #14014
+
+import threadpool
+
+type A = object
+    a: int
+
+proc f(t: typedesc): t =
+  t(a:1)
+
+let r = spawn f(A)
+echo ^r
+
+proc f2(x: static[int]): int =
+  x
+
+let r2 = spawn f2(2)
+echo ^r2
+
+type statint = static[int]
+
+proc f3(x: statint): int =
+  x
+
+let r3 = spawn f3(2)
+echo ^r3