solidity/test/libsolidity/syntaxTests/nameAndTypeResolution/167_constant_string_literal_disallows_assignment.sol

11 lines
360 B
Solidity
Raw Normal View History

contract Test {
string constant x = "abefghijklmnopqabcdefghijklmnopqabcdefghijklmnopqabca";
function f() public {
// Even if this is made possible in the future, we should not allow assignment
// to elements of constant arrays.
x[0] = "f";
}
}
// ----
// TypeError 9961: (261-265): Index access for string is not possible.