summary refs log tree commit diff stats
path: root/compiler/ic/ic.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-12-04 23:20:19 +0800
committerGitHub <noreply@github.com>2023-12-04 16:20:19 +0100
commit202e21daba1424762cf330effb52220c6f1d5772 (patch)
tree16881772d2d3344f42d5c86051abcaa83305edd7 /compiler/ic/ic.nim
parent618ccb6b6a60f9a315997f95cbbd81be9e9d7f53 (diff)
downloadNim-202e21daba1424762cf330effb52220c6f1d5772.tar.gz
forbides adding sons for `PType` (#23030)
I image `add` for `PType` to be used everythere
Diffstat (limited to 'compiler/ic/ic.nim')
-rw-r--r--compiler/ic/ic.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/ic/ic.nim b/compiler/ic/ic.nim
index b12db194c..0085ea748 100644
--- a/compiler/ic/ic.nim
+++ b/compiler/ic/ic.nim
@@ -994,8 +994,10 @@ proc typeBodyFromPacked(c: var PackedDecoder; g: var PackedModuleGraph;
     for op, item in pairs t.attachedOps:
       result.attachedOps[op] = loadSym(c, g, si, item)
   result.typeInst = loadType(c, g, si, t.typeInst)
+  var sons = newSeq[PType]()
   for son in items t.types:
-    result.addSon loadType(c, g, si, son)
+    sons.add loadType(c, g, si, son)
+  result.setSons(sons)
   loadAstBody(t, n)
   when false:
     for gen, id in items t.methods: