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

feat: check duplicate calls to base constructor #171

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

@TilakMaddy TilakMaddy marked this pull request as ready for review December 15, 2024 15:28
))
.span(main_contract.name.span)
.emit();
self.dcx().note("first call here").span(bc_error.first_call_span).emit();
Copy link
Member

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 {
Copy link
Member

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() {
Copy link
Member

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

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