Files
Nim/tests/effects/tissue25976.nim
ringabout 4b1444e728 fix #25976: treat proc-type forbids as an empty tag set (#25980)
fix #25976

Initialize tagEffects for proc types that declare .forbids but omit
.tags,
so they behave like explicit tags: [] during indirect-call effect
tracking.
Add a regression for the nested callback assignment case.
2026-07-10 07:39:32 +02:00

29 lines
739 B
Nim

type
NestedPoll = object of RootEffect
CallbackFunc = proc(arg: pointer) {.gcsafe, raises: [], forbids: [NestedPoll].}
TaggedCallbackFunc = proc(arg: pointer) {.gcsafe, raises: [], tags: [], forbids: [NestedPoll].}
InternalAsyncCallback = object
fn: CallbackFunc
TaggedInternalAsyncCallback = object
fn: TaggedCallbackFunc
proc closeSocket(aftercb: CallbackFunc = nil) =
proc continuation(udata: pointer) =
aftercb(nil)
let acb = InternalAsyncCallback(fn: continuation)
discard acb
proc closeSocketTagged(aftercb: TaggedCallbackFunc = nil) =
proc continuation(udata: pointer) =
aftercb(nil)
let acb = TaggedInternalAsyncCallback(fn: continuation)
discard acb
closeSocket()
closeSocketTagged()