Files
Nim/tests/effects/thooks.nim
ringabout 0b7f9e95e6 Improve effect propagation by skipping hooks in trackCall (#25940)
ref https://github.com/nim-lang/Nim/pull/25731
don't propagate effects for assignment hooks without effect lists

(cherry picked from commit 6828effd13)
2026-06-30 13:31:37 +02:00

24 lines
373 B
Nim

discard """
matrix: "--warningAsError:Effect"
"""
import std/isolation
# bug #23129
type
Thing = object
x: string
proc send(x: string) =
let wrapper = Thing(x: x)
discard isolate(wrapper)
send("la")
block:
func enqueue[T](buf: var array[10, T], elem: sink T) =
`=sink`(buf[0], elem)
var buf: array[10, int]
enqueue(buf, 42)
assert buf[0] == 42