fixes #18856 [backport] (#18879)

This commit is contained in:
Andreas Rumpf 2021-09-22 09:43:06 +02:00 • committed by GitHub
commit 0ad601d3c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1661,7 +1661,7 @@ proc takeImplicitAddr(c: PContext, n: PNode; isLent: bool): PNode =
localError(c.config, n.info, errXStackEscape % renderTree(n, {renderNoComments}))
else:
localError(c.config, n.info, errExprHasNoAddress)
result = newNodeIT(nkHiddenAddr, n.info, makePtrType(c, n.typ))
result = newNodeIT(nkHiddenAddr, n.info, if n.typ.kind in {tyVar, tyLent}: n.typ else: makePtrType(c, n.typ))
result.add(n)
proc asgnToResultVar(c: PContext, n, le, ri: PNode) {.inline.} =