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

Nested super constructor calls crash Nagini #176

Closed
marcoeilers opened this issue Mar 15, 2024 · 0 comments
Closed

Nested super constructor calls crash Nagini #176

marcoeilers opened this issue Mar 15, 2024 · 0 comments

Comments

@marcoeilers
Copy link
Owner

Found by @edgarsvitolins, the following program crashes Nagini (by crashing Viper):

from nagini_contracts.contracts import *

class Grandparent:
    def __init__(self) -> None:
        self.x = 1
        Ensures(Acc(self.x))
        Ensures(self.x == 1)


class Parent(Grandparent):
    def __init__(self) -> None:
        super().__init__()
        Ensures(Acc(self.x))
        Ensures(self.x == 1)


class Child(Parent):
    def __init__(self) -> None:
        super().__init__()
        Ensures(Acc(self.x))
        Ensures(self.x == 1)


def main() -> None:
    c = Child()
    Assert(c.x == 1)


if __name__ == "__main__":
    main()
marcoeilers added a commit that referenced this issue Mar 15, 2024
marcoeilers added a commit that referenced this issue Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant