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

Propagate type aliases from base to derived contracts #2693

Merged
merged 2 commits into from
Apr 7, 2025

Conversation

smonicas
Copy link
Collaborator

Fix #2680
We were not propagating the type aliases to derived contracts and when used they were not found by the find_variable function. In the issue fixed a structure with the same name of the type alias was found by the find_variable function hence a seemingly unrelated error.

# We keep parse_ in the name just to keep the naming convention even if we already parsed them initially.
# Here we only update the current contract type_aliases_as_dict with the fathers' values
# It's useful to keep using the same pattern anyway as we know all the fathers have been analyzed
for father in self._contract.inheritance_reverse:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is reversed right? I think the most recent ancestor should take priority

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type alias declarations can not be shadowed or you get an identifier already declared error so i believe you get the same result

@smonicas smonicas merged commit aa322d9 into dev Apr 7, 2025
46 checks passed
@smonicas smonicas deleted the dev-fix-typealias-inherited branch April 7, 2025 12:35
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