compiler distinguishes between 2 different 'var' types for C++ interop; code cleanups

This commit is contained in:
Araq 2015-02-07 01:06:25 +01:00
commit 74c6c8c903
7 changed files with 45 additions and 104 deletions

View file

@ -1209,6 +1209,7 @@ proc asgnToResultVar(c: PContext, n, le, ri: PNode) {.inline.} =
if x.typ.kind == tyVar and x.kind == nkSym and x.sym.kind == skResult:
n.sons[0] = x # 'result[]' --> 'result'
n.sons[1] = takeImplicitAddr(c, ri)
x.typ.flags.incl tfVarIsPtr
template resultTypeIsInferrable(typ: PType): expr =
typ.isMetaType and typ.kind != tyTypeDesc