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:
Paul Tan 2020-10-07 00:05:31 +08:00 • committed by GitHub
commit fa84121421
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View 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()