Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Wrongful detection of CallOfParameter for function calls with the same name as a parameter #298

Open
lukarade opened this issue Aug 30, 2024 · 0 comments
Labels
bug 🪲 Something isn't working purity Inferring the purity of functions

Comments

@lukarade
Copy link
Contributor

Describe the bug

If a function is called inside another function, which by chance defines a parameter with the same name as the called function, a CallOfParameter is falsely added to the reasons of the calling function.

Example

def foo():
    pass

def bar(foo):
    foo() # Wrong CallOfParameter: Here the function foo is called, which is pure

To Reproduce

  1. Copy the example into the test file for testing the purity analysis
  2. Run the tests

Expected behavior

For such cases, a special condition must be implemented to check if the function or the parameter is referenced.

Screenshots (optional)

No response

Additional Context (optional)

No response

@lukarade lukarade added bug 🪲 Something isn't working purity Inferring the purity of functions labels Aug 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🪲 Something isn't working purity Inferring the purity of functions
Projects
Status: Backlog
Development

No branches or pull requests

1 participant