fixes #26023; incorrect sink requires a copy (#26028)

fixes #26023
This commit is contained in:
ringabout
2026-08-03 18:02:29 +08:00
committed by GitHub
parent 71fca17360
commit 23365deef0
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()