close #9691 and close #10913('spawn'ed function cannot have a 'typed' or 'untyped' parameter) (#17775)

This commit is contained in:
flywind 2021-04-20 21:39:58 +08:00 • committed by GitHub
commit c776498170
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 1 deletions

20
tests/parallel/t10913.nim Normal file
View 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)