improve the error message for mutability problems

This commit is contained in:
Araq 2018-02-16 19:41:06 +01:00
commit 037ce16f44
2 changed files with 8 additions and 2 deletions

View file

@ -474,7 +474,7 @@ proc newHiddenAddrTaken(c: PContext, n: PNode): PNode =
result = newNodeIT(nkHiddenAddr, n.info, makeVarType(c, n.typ))
addSon(result, n)
if isAssignable(c, n) notin {arLValue, arLocalLValue}:
localError(n.info, errVarForOutParamNeededX, $n)
localError(n.info, errVarForOutParamNeededX, renderNotLValue(n))
proc analyseIfAddressTaken(c: PContext, n: PNode): PNode =
result = n