Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

lobster-python: false positive on duplicate function definition #36

Closed
jnow-87 opened this issue Apr 30, 2024 · 1 comment · Fixed by #39
Closed

lobster-python: false positive on duplicate function definition #36

jnow-87 opened this issue Apr 30, 2024 · 1 comment · Fixed by #39
Assignees
Labels
lobster-core Affects core LOBSTER tools lobster-python Affects Python integration

Comments

@jnow-87
Copy link

jnow-87 commented Apr 30, 2024

lobster-python reports a duplicated function definition for severity() in the following example:

import dataclasses

@dataclasses.dataclass
class Diagnostic: 
    _severity: int = dataclasses.field()

    @property
    def severity(self):
        return self._severity

    @severity.setter
    def severity(self, value: int):
        self._severity = value

These are clearly not duplicate functions but separate ones which can both be called on the same instance if Diagnostic. Hence, this case should be fixed within lobster.

The problem might originate from here

l_item = Implementation(tag = Tracing_Tag("python",
self.fqn()),
since the function tag is built only using self.fqn(), which is probably the function name. A solution might be to consider the entire function signature as the tag.

@phiwuu
Copy link
Member

phiwuu commented Apr 30, 2024

Possible duplicate of #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lobster-core Affects core LOBSTER tools lobster-python Affects Python integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants