effects: exclude swap() from "indirect calls" assumption (#15504)
swap() will never call any procs passed to it, and so it can be safely excluded from the "assume indirect calls are taken" effects tracking rule.
This commit is contained in:
parent
695f955f70
commit
fa84121421
2 changed files with 13 additions and 1 deletions
12
tests/effects/teffects10.nim
Normal file
12
tests/effects/teffects10.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
action: compile
|
||||
"""
|
||||
|
||||
# https://github.com/nim-lang/Nim/issues/15495
|
||||
|
||||
proc f() {.raises: [].} =
|
||||
var a: proc ()
|
||||
var b: proc ()
|
||||
swap(a, b)
|
||||
|
||||
f()
|
||||
Loading…
Add table
Add a link
Reference in a new issue