mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test that literal strings cannot be assigned to storage pointers.
This commit is contained in:
parent
09f1f1e595
commit
c4b7916c14
@ -2308,6 +2308,16 @@ BOOST_AUTO_TEST_CASE(array_out_of_bound_access)
|
||||
SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(literal_string_to_storage_pointer)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract C {
|
||||
function f() { string x = "abc"; }
|
||||
}
|
||||
)";
|
||||
SOLIDITY_CHECK_ERROR_TYPE(parseAndAnalyseReturnError(text), TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user