close #9691 and close #10913('spawn'ed function cannot have a 'typed' or 'untyped' parameter) (#17775)
This commit is contained in:
parent
54fe44135e
commit
c776498170
3 changed files with 40 additions and 1 deletions
20
tests/parallel/t10913.nim
Normal file
20
tests/parallel/t10913.nim
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
discard """
|
||||
matrix: "--threads:on"
|
||||
errormsg: "'spawn'ed function cannot have a 'typed' or 'untyped' parameter"
|
||||
"""
|
||||
|
||||
# bug #10913
|
||||
|
||||
import threadpool
|
||||
|
||||
proc useParallel*[T](unused: T) =
|
||||
# use a generic T here to show the problem.
|
||||
{.push experimental: "parallel".}
|
||||
parallel:
|
||||
for i in 0..4:
|
||||
spawn echo "echo in parallel"
|
||||
sync()
|
||||
|
||||
{.pop.}
|
||||
|
||||
useParallel(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue