fixes #2377
This commit is contained in:
parent
d83eb70643
commit
1d186ee9c3
2 changed files with 15 additions and 1 deletions
|
|
@ -426,7 +426,12 @@ proc semGenericStmt(c: PContext, n: PNode,
|
||||||
n.sons[paramsPos] = semGenericStmt(c, n.sons[paramsPos], flags, ctx)
|
n.sons[paramsPos] = semGenericStmt(c, n.sons[paramsPos], flags, ctx)
|
||||||
n.sons[pragmasPos] = semGenericStmt(c, n.sons[pragmasPos], flags, ctx)
|
n.sons[pragmasPos] = semGenericStmt(c, n.sons[pragmasPos], flags, ctx)
|
||||||
var body: PNode
|
var body: PNode
|
||||||
if n.sons[namePos].kind == nkSym: body = n.sons[namePos].sym.getBody
|
if n.sons[namePos].kind == nkSym:
|
||||||
|
let s = n.sons[namePos].sym
|
||||||
|
if sfGenSym in s.flags and s.ast == nil:
|
||||||
|
body = n.sons[bodyPos]
|
||||||
|
else:
|
||||||
|
body = s.getBody
|
||||||
else: body = n.sons[bodyPos]
|
else: body = n.sons[bodyPos]
|
||||||
n.sons[bodyPos] = semGenericStmtScope(c, body, flags, ctx)
|
n.sons[bodyPos] = semGenericStmtScope(c, body, flags, ctx)
|
||||||
closeScope(c)
|
closeScope(c)
|
||||||
|
|
|
||||||
9
tests/async/tgeneric_async.nim
Normal file
9
tests/async/tgeneric_async.nim
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
import asyncdispatch
|
||||||
|
|
||||||
|
when true:
|
||||||
|
# bug #2377
|
||||||
|
proc test[T](v: T) {.async.} =
|
||||||
|
echo $v
|
||||||
|
|
||||||
|
asyncCheck test[int](1)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue