summary refs log tree commit diff stats
path: root/compiler/semobjconstr.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-09-27 22:23:31 +0200
committerGitHub <noreply@github.com>2021-09-27 22:23:31 +0200
commit576fece90967ed2a6209c18ca839f30c751f4332 (patch)
tree2a76def9f4da47d51a780519b1dd4c8a052981aa /compiler/semobjconstr.nim
parentcdf9ac675b4348a7b5239186637c54920bb92619 (diff)
downloadNim-576fece90967ed2a6209c18ca839f30c751f4332.tar.gz
fixes 'lent T' inside object constructor [backport] (#18911)
* fixes 'lent T' inside object constructor [backport]

* progress
Diffstat (limited to 'compiler/semobjconstr.nim')
-rw-r--r--compiler/semobjconstr.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semobjconstr.nim b/compiler/semobjconstr.nim
index 1563e5c16..001956ede 100644
--- a/compiler/semobjconstr.nim
+++ b/compiler/semobjconstr.nim
@@ -79,7 +79,7 @@ proc semConstrField(c: PContext, flags: TExprFlags,
 
     var initValue = semExprFlagDispatched(c, assignment[1], flags)
     if initValue != nil:
-      initValue = fitNode(c, field.typ, initValue, assignment.info)
+      initValue = fitNodeConsiderViewType(c, field.typ, initValue, assignment.info)
     assignment[0] = newSymNode(field)
     assignment[1] = initValue
     assignment.flags.incl nfSem