summary refs log tree commit diff stats
path: root/compiler/semobjconstr.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2020-01-26 10:50:21 +0100
committerAndreas Rumpf <rumpf_a@web.de>2020-01-26 13:43:02 +0100
commita10cc18247cb576aa409e9056ed99f23539d14f9 (patch)
tree8ad1a8ac55ccb34b9438bbfb57476fcad01d7261 /compiler/semobjconstr.nim
parentab35f07e774c3faaee3708479523e66614eb3aa6 (diff)
downloadNim-a10cc18247cb576aa409e9056ed99f23539d14f9.tar.gz
ARC: optimize complete object constructors to use nimNewObjUninit
Diffstat (limited to 'compiler/semobjconstr.nim')
-rw-r--r--compiler/semobjconstr.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/semobjconstr.nim b/compiler/semobjconstr.nim
index 0ddec1706..489bc6684 100644
--- a/compiler/semobjconstr.nim
+++ b/compiler/semobjconstr.nim
@@ -388,3 +388,6 @@ proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =
       # 2) No such field exists in the constructed type
       localError(c.config, field.info, errUndeclaredFieldX % id.s)
       return
+
+  if initResult == initFull:
+    incl result.flags, nfAllFieldsSet