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

init function calling order does not have a linearization check #3779

Open
charles-cooper opened this issue Feb 13, 2024 · 1 comment · May be fixed by #4038
Open

init function calling order does not have a linearization check #3779

charles-cooper opened this issue Feb 13, 2024 · 1 comment · May be fixed by #4038
Milestone

Comments

@charles-cooper
Copy link
Member

Version Information

  • vyper Version (output of vyper --version): 8ccacb3

What's your issue about?

init functions can be called before their "dependencies", e.g.

import lib1
import lib2

initializes: lib1[lib2 := lib2]
initializes: lib2

@deploy
def __init__():
    lib1.__init__()  # lib2.__init__() has not been called yet!
    lib2.__init__()

How can it be fixed?

add a dependency constraint for calling init functions

@charles-cooper charles-cooper added this to the v0.4.0 milestone Mar 27, 2024
@charles-cooper
Copy link
Member Author

we don't need to get fancy about checking branches and so on -- AST order works fine for satisfying the dependency constraint

@charles-cooper charles-cooper changed the title bug: init function calling order does not have a linearization check init function calling order does not have a linearization check May 25, 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

Successfully merging a pull request may close this issue.

1 participant