Skip to content

Conversation

@ringabout
Copy link
Member

@ringabout ringabout commented Jan 7, 2026

  • inline =copy since the hook is not really needed
proc makeiter(v: sink string): string =
  result = v

var iter = makeiter("foo")
echo iter

It seems that we need to handle string literals either by copying it when it is passed to the call or when moving it to the target

template hasDestructorOrAsgn(c: var Con, typ: PType): bool =
# bug #23354; an object type could have a non-trivial assignements when it is passed to a sink parameter
hasDestructor(c, typ) or (c.graph.config.selectedGC in {gcArc, gcOrc, gcAtomicArc} and
hasDestructor(c, typ) or (c.graph.config.selectedGC == gcRefc and typ.kind == tyString) or (c.graph.config.selectedGC in {gcArc, gcOrc, gcAtomicArc} and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for seq?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants