fix #7535(Poor error message for spawn when a procedure (without calling it)) (#17774)

This commit is contained in:
flywind 2021-04-21 23:53:31 +08:00 • committed by GitHub
commit 4471141a1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

11
tests/parallel/t7535.nim Normal file
View file

@ -0,0 +1,11 @@
discard """
matrix: "--threads:on"
errormsg: "'spawn' takes a call expression; got proc (x: uint32) = echo [x]"
"""
import threadpool
# bug #7535
proc print_parallel_nok(r: uint32) =
for x in 0..r:
spawn (proc (x: uint32) = echo x)