fixes #2366
This commit is contained in:
parent
880e39d123
commit
16adfcdfa6
3 changed files with 8 additions and 2 deletions
|
|
@ -762,6 +762,7 @@ proc genRecordField(p: BProc, e: PNode, d: var TLoc) =
|
||||||
if field.loc.r == nil: internalError(e.info, "genRecordField 3")
|
if field.loc.r == nil: internalError(e.info, "genRecordField 3")
|
||||||
appf(r, ".$1", [field.loc.r])
|
appf(r, ".$1", [field.loc.r])
|
||||||
putIntoDest(p, d, field.typ, r)
|
putIntoDest(p, d, field.typ, r)
|
||||||
|
#d.s = a.s
|
||||||
|
|
||||||
proc genInExprAux(p: BProc, e: PNode, a, b, d: var TLoc)
|
proc genInExprAux(p: BProc, e: PNode, a, b, d: var TLoc)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1269,9 +1269,12 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
|
||||||
putWithSpace(g, tkColon, ":")
|
putWithSpace(g, tkColon, ":")
|
||||||
gcoms(g)
|
gcoms(g)
|
||||||
gstmts(g, n.sons[0], c)
|
gstmts(g, n.sons[0], c)
|
||||||
of nkFinally:
|
of nkFinally, nkDefer:
|
||||||
optNL(g)
|
optNL(g)
|
||||||
put(g, tkFinally, "finally")
|
if n.kind == nkFinally:
|
||||||
|
put(g, tkFinally, "finally")
|
||||||
|
else:
|
||||||
|
put(g, tkDefer, "defer")
|
||||||
putWithSpace(g, tkColon, ":")
|
putWithSpace(g, tkColon, ":")
|
||||||
gcoms(g)
|
gcoms(g)
|
||||||
gstmts(g, n.sons[0], c)
|
gstmts(g, n.sons[0], c)
|
||||||
|
|
|
||||||
|
|
@ -2224,6 +2224,8 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
|
||||||
result = semPragmaBlock(c, n)
|
result = semPragmaBlock(c, n)
|
||||||
of nkStaticStmt:
|
of nkStaticStmt:
|
||||||
result = semStaticStmt(c, n)
|
result = semStaticStmt(c, n)
|
||||||
|
of nkDefer:
|
||||||
|
localError(n.info, errGenerated, "'defer' not allowed in this context")
|
||||||
else:
|
else:
|
||||||
localError(n.info, errInvalidExpressionX,
|
localError(n.info, errInvalidExpressionX,
|
||||||
renderTree(n, {renderNoComments}))
|
renderTree(n, {renderNoComments}))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue