mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Change array too large error message as it is valid for non-calldata too
This commit is contained in:
parent
f242331cc0
commit
3326a2282e
@ -623,7 +623,7 @@ bool TypeChecker::visit(VariableDeclaration const& _variable)
|
|||||||
(arrayType->location() == DataLocation::CallData)) &&
|
(arrayType->location() == DataLocation::CallData)) &&
|
||||||
!arrayType->validForCalldata()
|
!arrayType->validForCalldata()
|
||||||
)
|
)
|
||||||
m_errorReporter.typeError(_variable.location(), "Array is too large to be encoded as calldata.");
|
m_errorReporter.typeError(_variable.location(), "Array is too large to be encoded.");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -6217,21 +6217,21 @@ BOOST_AUTO_TEST_CASE(too_large_arrays_for_calldata)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
CHECK_ERROR(text, TypeError, "Array is too large to be encoded as calldata.");
|
CHECK_ERROR(text, TypeError, "Array is too large to be encoded.");
|
||||||
text = R"(
|
text = R"(
|
||||||
contract C {
|
contract C {
|
||||||
function f(uint[85678901234] a) internal {
|
function f(uint[85678901234] a) internal {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
CHECK_ERROR(text, TypeError, "Array is too large to be encoded.");
|
||||||
text = R"(
|
text = R"(
|
||||||
contract C {
|
contract C {
|
||||||
function f(uint[85678901234] a) {
|
function f(uint[85678901234] a) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
CHECK_ERROR(text, TypeError, "Array is too large to be encoded as calldata.");
|
CHECK_ERROR(text, TypeError, "Array is too large to be encoded.");
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(explicit_literal_to_storage_string)
|
BOOST_AUTO_TEST_CASE(explicit_literal_to_storage_string)
|
||||||
|
Loading…
Reference in New Issue
Block a user