-
Notifications
You must be signed in to change notification settings - Fork 27
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: check duplicate calls to base constructor #171
base: main
Are you sure you want to change the base?
Conversation
)) | ||
.span(main_contract.name.span) | ||
.emit(); | ||
self.dcx().note("first call here").span(bc_error.first_call_span).emit(); |
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.
these should be notes on the error, this creates a separate diagnostic
} | ||
} | ||
|
||
for bc_error in bc_errors { |
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.
you can make this a closure that is called instead of pushing
@@ -196,6 +196,84 @@ impl super::LoweringContext<'_, '_, '_> { | |||
} | |||
} | |||
|
|||
#[instrument(level = "debug", skip_all)] | |||
pub(super) fn check_base_ctor_args(&self) { | |||
for main_contract in self.hir.contracts() { |
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.
why is this using the AST instead of being a HIR check like the other ones you did? this shouldnt happen during lowering
https://github.com/ethereum/solidity/blob/df01dcc7b759f53ba45811979d3286562eab7846/libsolidity/analysis/ContractLevelChecker.h#L73C2-L78C4