fixes #1187
This commit is contained in:
parent
bce10ac1d3
commit
18cbd51600
3 changed files with 10 additions and 9 deletions
|
|
@ -947,10 +947,10 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
|
||||||
of nkConstDef, nkIdentDefs:
|
of nkConstDef, nkIdentDefs:
|
||||||
gcomma(g, n, 0, -3)
|
gcomma(g, n, 0, -3)
|
||||||
var L = sonsLen(n)
|
var L = sonsLen(n)
|
||||||
if n.sons[L - 2].kind != nkEmpty:
|
if L >= 2 and n.sons[L - 2].kind != nkEmpty:
|
||||||
putWithSpace(g, tkColon, ":")
|
putWithSpace(g, tkColon, ":")
|
||||||
gsub(g, n.sons[L - 2])
|
gsub(g, n.sons[L - 2])
|
||||||
if n.sons[L - 1].kind != nkEmpty:
|
if L >= 1 and n.sons[L - 1].kind != nkEmpty:
|
||||||
put(g, tkSpaces, Space)
|
put(g, tkSpaces, Space)
|
||||||
putWithSpace(g, tkEquals, "=")
|
putWithSpace(g, tkEquals, "=")
|
||||||
gsub(g, n.sons[L - 1], c)
|
gsub(g, n.sons[L - 1], c)
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,8 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType =
|
||||||
var newbody = replaceTypeVarsT(cl, lastSon(body))
|
var newbody = replaceTypeVarsT(cl, lastSon(body))
|
||||||
newbody.flags = newbody.flags + (t.flags + body.flags - tfInstClearedFlags)
|
newbody.flags = newbody.flags + (t.flags + body.flags - tfInstClearedFlags)
|
||||||
result.flags = result.flags + newbody.flags - tfInstClearedFlags
|
result.flags = result.flags + newbody.flags - tfInstClearedFlags
|
||||||
newbody.callConv = body.callConv
|
# This is actually wrong: tgeneric_closure fails with this line:
|
||||||
|
#newbody.callConv = body.callConv
|
||||||
# This type may be a generic alias and we want to resolve it here.
|
# This type may be a generic alias and we want to resolve it here.
|
||||||
# One step is enough, because the recursive nature of
|
# One step is enough, because the recursive nature of
|
||||||
# handleGenericInvokation will handle the alias-to-alias-to-alias case
|
# handleGenericInvokation will handle the alias-to-alias-to-alias case
|
||||||
|
|
@ -307,7 +308,7 @@ proc handleGenericInvokation(cl: var TReplTypeVars, t: PType): PType =
|
||||||
|
|
||||||
proc eraseVoidParams*(t: PType) =
|
proc eraseVoidParams*(t: PType) =
|
||||||
# transform '(): void' into '()' because old parts of the compiler really
|
# transform '(): void' into '()' because old parts of the compiler really
|
||||||
# doesn't deal with '(): void':
|
# don't deal with '(): void':
|
||||||
if t.sons[0] != nil and t.sons[0].kind == tyEmpty:
|
if t.sons[0] != nil and t.sons[0].kind == tyEmpty:
|
||||||
t.sons[0] = nil
|
t.sons[0] = nil
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue