bugfix: typo in actors.nim

This commit is contained in:
Araq
2012-08-15 08:13:31 +02:00
parent 51de278bd4
commit 1215193010
5 changed files with 18 additions and 2 deletions

View File

@@ -166,6 +166,7 @@ proc myOpen(module: PSym, filename: string): PPassContext =
c.semConstExpr = semConstExpr
c.semExpr = semExprNoFlags
c.semConstBoolExpr = semConstBoolExpr
c.semOverloadedCall = semOverloadedCall
pushProcCon(c, module)
pushOwner(c.module)
openScope(c.tab) # scope for imported symbols

View File

@@ -72,6 +72,8 @@ type
semConstExpr*: proc (c: PContext, n: PNode): PNode {.nimcall.} # for the pragmas
semExpr*: proc (c: PContext, n: PNode): PNode {.nimcall.} # for the pragmas
semConstBoolExpr*: proc (c: PContext, n: PNode): PNode {.nimcall.} # XXX bite the bullet
semOverloadedCall*: proc (c: PContext, n, nOrig: PNode,
filter: TSymKinds): PNode {.nimcall.}
includedFiles*: TIntSet # used to detect recursive include files
filename*: string # the module's filename
userPragmas*: TStrTable

View File

@@ -603,6 +603,18 @@ proc userConvMatch(c: PContext, m: var TCandidate, f, a: PType,
inc(m.convMatches)
return
proc localConvMatch(c: PContext, m: var TCandidate, f, a: PType,
arg: PNode): PNode =
var call = newNodeI(nkCall, arg.info)
call.add(f.n.copyTree)
call.add(arg.copyTree)
result = c.semOverloadedCall(c, call, call, RoutineKinds)
if result != nil:
# resulting type must be consistent with the other arguments:
var r = typeRel(m, f, result.typ)
if r < isGeneric: return nil
if result.kind == nkCall: result.kind = nkHiddenCallConv
inc(m.convMatches)
proc ParamTypesMatchAux(c: PContext, m: var TCandidate, f, a: PType,
arg, argOrig: PNode): PNode =

View File

@@ -118,7 +118,8 @@ proc poolWorker[TIn, TOut](self: PActor[TIn, TOut]) {.thread.} =
when TOut is void:
m.action(m.data)
else:
self.repy(m.action(m.data))
send(m.receiver[], m.action(m.data))
#self.reply()
proc createActorPool*[TIn, TOut](a: var TActorPool[TIn, TOut], poolSize = 4) =
## creates an actor pool.

View File

@@ -1,6 +1,6 @@
discard """
line: 10
errormsg: "invalid capture: 'A'"
errormsg: "illegal capture: 'A'"
"""
proc outer() =