Files
Nim/tests/arc/t24764.nim
ringabout 96f5b693ba fixes #24764; cross-module sink analysis broken (#24862)
fixes  #24764

It now consumes the `conv(x)` arg for the explicit sinking. So the
explicit sinking is kept as it is.

Follows up https://github.com/nim-lang/Nim/pull/20585

Related issues: https://github.com/nim-lang/Nim/issues/20572

Probably the same needs to be applied to explicit `copy` to prevent a
copy turning into a sink

(cherry picked from commit 42df731a2d)
2025-04-14 10:52:13 +02:00

22 lines
367 B
Nim

discard """
matrix: "--mm:arc"
"""
import m24764
type QWidget* = object of QObject
proc `=copy`(dest: var QWidget, source: QWidget) {.error.}
proc `=sink`(dest: var QWidget, source: QWidget) =
`=sink`(QObject(dest), QObject(source))
proc show(v: QWidget) = discard
proc main() =
let btn = QWidget()
let tmp = proc() =
btn.show()
btn.show()
main()