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

Require properties of dynamic types to be initialized #192

Merged
merged 1 commit into from
May 8, 2018

Conversation

franklinsch
Copy link
Collaborator

No description provided.

@franklinsch franklinsch force-pushed the all-properties-inited branch from 49bc456 to c994c24 Compare May 8, 2018 21:27
@franklinsch franklinsch merged commit bd87d85 into master May 8, 2018
@franklinsch franklinsch deleted the all-properties-inited branch May 8, 2018 21:48
@vietlq
Copy link
Contributor

vietlq commented May 9, 2018

Awesome @franklinsch ! I believe the grammar has to be updated too. Currently it assumes assignment is optional. From my experience programming in OCaml/C++, explicit assignment requirement makes things clear & safe.

@franklinsch
Copy link
Collaborator Author

Strongly agree :) The rule is: each property needs to be assigned a default value at the declaration site, or by the end of the struct/contract's initializer. This semantic test describes it: https://github.com/franklinsch/flint/blob/master/Tests/SemanticTests/inits.flint

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 this pull request may close these issues.

2 participants