Skip to content

Conversation

@qzirak
Copy link

@qzirak qzirak commented Oct 16, 2024

@github-actions
Copy link

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

@matheusaaguiar
Copy link
Collaborator

matheusaaguiar commented Oct 29, 2024

I think this is a misunderstanding.
The text in the docs shows a problematic use of calling a function from a base by explicitly specifying the contract (Base2.emitEvent). In this case, the contract Base1 in the inheritance hierarchy is skipped and the resulting sequence of events will not contain Base1Emitted.
After that, the text then presents the proper way of avoiding the problem, by using super instead, which then calls the function on the next base contract and so on and so forth. Now, Final will call Base2 which in turn will call Base1 that was missing on the previous example.
That's the reason the text says that it will call Base1.emitEvent(). Because, now super ensures that the inheritance hierarchy is properly followed instead of having the direct call to Base2 bypass the call to Base1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants