Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PythonAddDeclarationsPass always infers FieldDeclarations in a method #1975

Closed
KuechA opened this issue Jan 24, 2025 · 0 comments · Fixed by #1977
Closed

PythonAddDeclarationsPass always infers FieldDeclarations in a method #1975

KuechA opened this issue Jan 24, 2025 · 0 comments · Fixed by #1977
Assignees
Labels
bug Something isn't working python

Comments

@KuechA
Copy link
Contributor

KuechA commented Jan 24, 2025

When we're in a method (i.e., inside the scope of a RecordDeclaration), the PythonAddDeclarationsPass will always add a FieldDeclaration instead of a local VariableDeclaration, even if we do not see the receiver.

Example:

class SomeClass:
    def method(self, a):
        self.x = a
        b = self.x
        return b

This will generate two FieldDeclarations: one for x and one for b even if IMHO it's more likely that b is a local variable

@KuechA KuechA added bug Something isn't working python labels Jan 24, 2025
@KuechA KuechA self-assigned this Jan 27, 2025
@oxisto oxisto added bug Something isn't working and removed bug Something isn't working labels Jan 28, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants