summary refs log tree commit diff stats
path: root/compiler/ic
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-12-15 15:13:25 +0800
committerGitHub <noreply@github.com>2023-12-15 08:13:25 +0100
commitcca5684a17e654a13ddac046f1e76873d8c19f55 (patch)
treeafda8a5c8a114bbb85db9a2e743e6e88b4f899fb /compiler/ic
parenta4628532b27857d095e69b7b162b453fc2b8373c (diff)
downloadNim-cca5684a17e654a13ddac046f1e76873d8c19f55.tar.gz
fixes yet another strictdefs bug (#23069)
Diffstat (limited to 'compiler/ic')
-rw-r--r--compiler/ic/ic.nim7
-rw-r--r--compiler/ic/packed_ast.nim2
2 files changed, 4 insertions, 5 deletions
diff --git a/compiler/ic/ic.nim b/compiler/ic/ic.nim
index a7d3ed81c..e85621910 100644
--- a/compiler/ic/ic.nim
+++ b/compiler/ic/ic.nim
@@ -383,10 +383,9 @@ proc storeType(t: PType; c: var PackedEncoder; m: var PackedModule): PackedItemI
 proc toPackedLib(l: PLib; c: var PackedEncoder; m: var PackedModule): PackedLib =
   ## the plib hangs off the psym via the .annex field
   if l.isNil: return
-  result.kind = l.kind
-  result.generated = l.generated
-  result.isOverridden = l.isOverridden
-  result.name = toLitId($l.name, m)
+  result = PackedLib(kind: l.kind, generated: l.generated,
+    isOverridden: l.isOverridden, name: toLitId($l.name, m)
+  )
   storeNode(result, l, path)
 
 proc storeSym*(s: PSym; c: var PackedEncoder; m: var PackedModule): PackedItemId =
diff --git a/compiler/ic/packed_ast.nim b/compiler/ic/packed_ast.nim
index 8971d72be..2599e07d1 100644
--- a/compiler/ic/packed_ast.nim
+++ b/compiler/ic/packed_ast.nim
@@ -124,7 +124,7 @@ proc `==`*(a, b: NodePos): bool {.borrow.}
 proc `==`*(a, b: NodeId): bool {.borrow.}
 
 proc newTreeFrom*(old: PackedTree): PackedTree =
-  result.nodes = @[]
+  result = PackedTree(nodes: @[])
   when false: result.sh = old.sh
 
 proc addIdent*(tree: var PackedTree; s: LitId; info: PackedLineInfo) =