You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I define I type alias in one contract and define a struct with the same name in the other contract, the type alias is used as the called field of the struct constructor call. This causes an assertion error.
Code example to reproduce the issue:
pragma solidity 0.8.13;
contract OtherTest {
struct Z {
int x;
int y;
}
function myfunc() external {
Z memory z = Z(2,3);
}
}
contract DeleteTest {
type Z is int;
}
Version:
0.9.3
Relevant log output:
...
File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/visitors/slithir/expression_to_slithir.py", line 160, in __init__
self._visit_expression(self.expression)
File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/visitors/expression/expression.py", line 46, in _visit_expression
self._visit_assignement_operation(expression)
File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/visitors/expression/expression.py", line 102, in _visit_assignement_operation
self._visit_expression(expression.expression_right)
File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/visitors/expression/expression.py", line 96, in _visit_expression
self._post_visit(expression)
File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/visitors/expression/expression.py", line 276, in _post_visit
self._post_call_expression(expression)
File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/visitors/slithir/expression_to_slithir.py", line 366, in _post_call_expression
message_call = TmpCall(called, len(args), val, expression.type_call)
File "/Users/kevin.clancy/.pyenv/versions/3.9.13/lib/python3.9/site-packages/slither/slithir/tmp_operations/tmp_call.py", line 29, in __init__
assert isinstance(
AssertionError
The text was updated successfully, but these errors were encountered:
0xalpharush
changed the title
[Bug-Candidate]: type alias namespace collision causes assertion failure in tmp_call.py
[Bug]: type alias namespace collision causes assertion failure in tmp_call.py
Mar 30, 2023
Describe the issue:
When I define I type alias in one contract and define a struct with the same name in the other contract, the type alias is used as the
called
field of the struct constructor call. This causes an assertion error.Code example to reproduce the issue:
Version:
0.9.3
Relevant log output:
The text was updated successfully, but these errors were encountered: