Skip to content

Commit

Permalink
fix copy and paste, forget if
Browse files Browse the repository at this point in the history
  • Loading branch information
elcritch committed Jan 7, 2025
1 parent 5b63c81 commit f6df680
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit f6df680

Please sign in to comment.