mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-12 04:09:34 +00:00
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.
29 lines
739 B
Nim
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()
|