mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add tests for large calldata arrays
This commit is contained in:
parent
cb4875a28b
commit
e640bb2aed
@ -6297,6 +6297,31 @@ BOOST_AUTO_TEST_CASE(implicit_conversion_disallowed)
|
||||
CHECK_ERROR(text, TypeError, "Return argument type uint32 is not implicitly convertible to expected type (type of first return variable) bytes4.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(too_large_arrays_for_calldata)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract C {
|
||||
function f(uint[85678901234] a) external {
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_ERROR(text, TypeError, "Array is too large to be encoded as calldata.");
|
||||
text = R"(
|
||||
contract C {
|
||||
function f(uint[85678901234] a) internal {
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||
text = R"(
|
||||
contract C {
|
||||
function f(uint[85678901234] a) {
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user