-
Notifications
You must be signed in to change notification settings - Fork 983
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
Improve support using for directive #1378
Conversation
What's the state of this PR? |
@CodeSandwich this should work on your codebase now. Lmk if you find additional issues |
@@ -574,21 +574,26 @@ def analyze_state_variables(self): | |||
except (VariableNotFound, KeyError) as e: | |||
self.log_incorrect_parsing(f"Missing state variable {e}") | |||
|
|||
def analyze_using_for(self): | |||
def analyze_using_for(self): # pylint: disable=too-many-branches | |||
try: | |||
for father in self._contract.inheritance: | |||
self._contract.using_for.update(father.using_for) |
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.
@smonicas One thing I wasn't sure about is if there'd be a reason we also need to update child contracts' using_for_complete
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.
I don't think there is a need because the first use of using_for_complete
is when converting to slithir which comes after parsing is finished
|
||
def _analyze_library_function(self, function_name: str, type_name: Type) -> None: | ||
function_name_split = function_name.split(".") | ||
# TODO this doesn't handle the case if there is an import with an alias |
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.
Can we open a separate issue to track this, with an example?
Fixes #1352