mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-01 04:59:05 +00:00
ref https://github.com/nim-lang/Nim/pull/25731 don't propagate effects for assignment hooks without effect lists
24 lines
373 B
Nim
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 |