summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-09-22 09:43:06 +0200
committerGitHub <noreply@github.com>2021-09-22 09:43:06 +0200
commit0ad601d3c1657216d27be839173861594e3e2421 (patch)
tree392bd4a1efbb39e4bebdf9964bc371c2035ba452
parent928ea6bb4c0cc791f1b81e55dbebd14d5c6a7315 (diff)
downloadNim-0ad601d3c1657216d27be839173861594e3e2421.tar.gz
fixes #18856 [backport] (#18879)
-rw-r--r--compiler/semexprs.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 5a1426f2b..ee2626922 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -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.} =