This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Bug fix: Fail inheritance search on bad base node type #2873
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a (partial?) fix for the reopened #2723. Basically, when going through the base contracts of a given contract to find where a given function is defined, I have code that says, give up if you fail to locate one of the base contracts. However, I didn't have code that said, give up if due to ID collisions the "base contract" you locate is not a contract at all. This caused an error when attempting to test @Amxx's project.
I'm actually still getting errors when I try to test his project, but they're unrelated errors and it's not clear they're our fault, so I'm putting up this PR as it is to just fix this one issue.
One thing worth noting: In the particular case at hand, the base contract we're trying to look up is actually the contract itself! Wondering if perhaps I should put in code so that for the first contract in the base contracts list (i.e. the contract itself) we don't do a lookup, so that this sort of error can't happen unless there's a collision in one of the actual base contracts other than the contract itself?
Also: It's really weird that there was a collision here at all! IDs are supposed to be unique within a compilation, I thought? @Amxx might want to report that to Solidity...
(Nonetheless this is still our fault because we ought to be able to recover gracefully from such collisions one way or another.)