This commit is contained in:
Araq 2012-04-16 16:31:15 +02:00
commit 17d67ab828
7 changed files with 63 additions and 85 deletions

View file

@ -269,7 +269,9 @@ proc genProcParams(m: BModule, t: PType, rettype, params: var PRope,
var arr = param.typ
if arr.kind == tyVar: arr = arr.sons[0]
var j = 0
while arr.Kind == tyOpenArray:
while arr.Kind == tyOpenArray:
# this fixes the 'sort' bug:
if param.typ.kind == tyVar: param.loc.s = OnUnknown
# need to pass hidden parameter:
appff(params, ", NI $1Len$2", ", @NI $1Len$2", [param.loc.r, j.toRope])
inc(j)
@ -288,7 +290,7 @@ proc genProcParams(m: BModule, t: PType, rettype, params: var PRope,
if tfVarargs in t.flags:
if params != nil: app(params, ", ")
app(params, "...")
if (params == nil) and (gCmd != cmdCompileToLLVM): app(params, "void)")
if params == nil and gCmd != cmdCompileToLLVM: app(params, "void)")
else: app(params, ")")
params = con("(", params)