From 2678fa679ad6bbdec11945e4ca9ba78eab490188 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 6 Jul 2019 15:23:57 +0200 Subject: [PATCH] fixes #7057 --- compiler/lowerings.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/lowerings.nim b/compiler/lowerings.nim index 55917a2f50..3672a2e295 100644 --- a/compiler/lowerings.nim +++ b/compiler/lowerings.nim @@ -707,7 +707,7 @@ proc wrapProcForSpawn*(g: ModuleGraph; owner: PSym; spawnExpr: PNode; retType: P var fn = n.sons[0] # templates and macros are in fact valid here due to the nature of # the transformation: - if fn.kind == nkClosure: + if fn.kind == nkClosure or (fn.typ != nil and fn.typ.callConv == ccClosure): localError(g.config, n.info, "closure in spawn environment is not allowed") if not (fn.kind == nkSym and fn.sym.kind in {skProc, skTemplate, skMacro, skFunc, skMethod, skConverter}):