fixes #26023; incorrect sink requires a copy

This commit is contained in:
ringabout
2026-07-20 20:58:43 +08:00
parent 2463ef970d
commit 7349b1e4db
3 changed files with 24 additions and 4 deletions

View File

@@ -65,3 +65,17 @@ method handleConn*(myParam: PubSub,
proto: string) {.base, async.} =
myParam.peers.withValue(conn.peerInfo.peerId, peer):
let peerB = peer[]
block:
type M = object
proc `=dup`(_: M): M {.error.}
proc take(_: sink M) = discard
proc test() =
var value: M
take(value)
test()