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 we have a nested struct and a top-level struct with the same name, the nested struct is incorrectly used as the type for parameters that are declared with the top-level struct.
Code example to reproduce the issue:
Run --print slithir on the following code.
pragma solidity 0.8.13;
interface Interface {
struct ZZZ {
int x;
int y;
}
}
struct ZZZ {
int x;
int y;
int z;
}
contract A {
function test(ZZZ memory zzz) external {
zzz.z = 3;
Interface.ZZZ memory zzz2 = Interface.ZZZ(1,2);
}
}
Version:
0.9.6
Relevant log output:
Contract A
Function A.test(Interface.ZZZ) (*)
Expression: zzz.z = 3
IRs:
REF_0(uint256) -> zzz.z
REF_0(uint256) (->zzz) := 3(uint256)
Expression: zzz2 = Interface.ZZZ(1,2)
IRs:
TMP_0(Interface.ZZZ) = new ZZZ(1,2)
zzz2(Interface.ZZZ) := TMP_0(Interface.ZZZ)
Note that above we have Function A.test(Interface.ZZZ) instead of Function A.test(ZZZ)
The text was updated successfully, but these errors were encountered:
Describe the issue:
When we have a nested struct and a top-level struct with the same name, the nested struct is incorrectly used as the type for parameters that are declared with the top-level struct.
Code example to reproduce the issue:
Run
--print slithir
on the following code.Version:
0.9.6
Relevant log output:
Note that above we have
Function A.test(Interface.ZZZ)
instead ofFunction A.test(ZZZ)
The text was updated successfully, but these errors were encountered: