Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix copy and paste, forget if
  • Loading branch information
elcritch committed Jan 7, 2025
commit f6df680690d39ef3a8e2cb3f8c3ab1d8ff37302d
5 changes: 3 additions & 2 deletions compiler/injectdestructors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ proc passCopyToSink(n: PNode; c: var Con; s: var Scope): PNode =
("cannot move '$1', passing '$1' to a sink parameter introduces an implicit copy") % $n)
else:
if c.graph.config.selectedGC in {gcArc, gcOrc, gcAtomicArc}:
localError(c.graph.config, n.info, errInternal,
"type contains managed memory: '$1' for '$2' " % [$nTyp, $n] )
if containsManagedMemory(nTyp):
localError(c.graph.config, n.info, errInternal,
"type contains managed memory: '$1' for '$2' " % [$nTyp, $n] )
if nTyp.skipTypes(abstractInst).kind in {tyOpenArray, tyVarargs}:
localError(c.graph.config, n.info, "cannot create an implicit openArray copy to be passed to a sink parameter")
result.add newTree(nkAsgn, tmp, p(n, c, s, normal))
Expand Down