//...
struct Z {
bool z;
}
struct Z2 {
bool z;
}
function _testClash(S storage t) internal {}
function _testClash(Z storage t) internal {}
function _testClash(Z2 storage t) internal {}
function _testClash(S memory t) internal {}
function _testClash(Z memory t) internal {}
function _testClash(Z2 memory t) internal {}
}
causes
TypeError: Function overload clash during conversion to external types for arguments.
--> contracts-exposed/Test.sol:54:5:
|
54 | function $_testClash(Foo.Z2 calldata t) external {
| ^ (Relevant source part starts here and spans across multiple lines).
This is because the internal function use different types, but Z and Z2 have the same underlying type, cause the external version to have function selector clash.
Possible fix:
When constructing the clashingFunctions record, consider the resulting function selector, and not the internal type.
Reproducible example
In
Test.sol:Foo
causes
This is because the internal function use different types, but
Z
andZ2
have the same underlying type, cause the external version to have function selector clash.Possible fix:
When constructing the
clashingFunctions
record, consider the resulting function selector, and not the internal type.