solidity/test/libsolidity/syntaxTests/nameAndTypeResolution/402_assignment_to_constant.sol

7 lines
144 B
Solidity
Raw Normal View History

contract c {
uint constant a = 1;
function f() public { a = 2; }
}
// ----
// TypeError: (64-65): Cannot assign to a constant variable.