summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-08-30 22:08:59 +0800
committerGitHub <noreply@github.com>2024-08-30 16:08:59 +0200
commit11ead19bc1c811f8733637d8be44833803d0a0af (patch)
tree916d7fabcb8cc7f1a5769c765d505c6f25f5c3fe /compiler
parentaa0d8e9cfee7b15f80bd147b9bcf626012abb093 (diff)
downloadNim-11ead19bc1c811f8733637d8be44833803d0a0af.tar.gz
fixes #24034; fixes lent types after taking implicit address (#24035)
fixes #24034
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 91e318a63..1b73b9b20 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -1879,6 +1879,8 @@ proc takeImplicitAddr(c: PContext, n: PNode; isLent: bool): PNode =
     else:
       localError(c.config, n.info, errExprHasNoAddress)
   result = newNodeIT(nkHiddenAddr, n.info, if n.typ.kind in {tyVar, tyLent}: n.typ else: makePtrType(c, n.typ))
+  if n.typ.kind in {tyVar, tyLent}:
+    n.typ = n.typ.elementType
   result.add(n)
 
 proc asgnToResultVar(c: PContext, n, le, ri: PNode) {.inline.} =