Skip to content

Commit

Permalink
Correct imports for rename and type aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
smonicas committed Feb 20, 2024
1 parent c066ca3 commit 970cfca
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions slither/core/scope/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,20 @@ def variables(self) -> Dict[str, TopLevelVariable]:

@property
def renaming(self) -> Dict[str, str]:
# TODO check it's correct
if len(self.items_to_import) != 0:
result = {}
for name, rename in self.filescope.renaming.items():
if name in self.items_to_import:
result[name] = rename
return result
return self.filescope.renaming

@property
def type_aliases(self) -> Dict[str, TypeAlias]:
# TODO check it's correct
if len(self.items_to_import) != 0:
result = {}
for name, type_alias in self.filescope.type_aliases.items():
if name in self.items_to_import:
result[name] = type_alias
return result
return self.filescope.type_aliases

0 comments on commit 970cfca

Please sign in to comment.