-
Notifications
You must be signed in to change notification settings - Fork 156
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
feat: no lazy init (contract parameters) #1985
Conversation
2515a2a
to
2d24c36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this changes with @verytactical and agreed on adding more comments here, especially for field names, such as separate
, contract
and some others.
Also now new constructor requires to add fake ASTNode of init() function, but this cannot be bypassed easily, so it will stay as is.
Besides new constructor lacks the possibility to make some arguments optional, but we decided not to implement that in this PR not to overcomplicate it.
ad4b50d
to
cf451ee
Compare
src/types/resolveDescriptors.ts
Outdated
); | ||
} else { | ||
throwCompilationError( | ||
"Cannot define init() on a contract that has contract initializer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contract parameters
@@ -365,6 +365,24 @@ exports[`resolveDescriptors should fail descriptors for getter-outside-contract | |||
" | |||
`; | |||
|
|||
exports[`resolveDescriptors should fail descriptors for init-on-contract-no-fields 1`] = ` | |||
"<unknown>:6:5: All fields must be defined in contract initializer if it exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as contract parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot use contract fields along with contract parameters
`; | ||
|
||
exports[`resolveDescriptors should fail descriptors for init-on-contract-no-init 1`] = ` | ||
"<unknown>:6:5: Initialization was already defined on contract Contract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init() cannot be used along with contract parameters
Issue
Closes #1756.
Checklist