mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adding storage into the pointer for Voter delegate
Hi, The example from https://github.com/ethereum/solidity/blob/develop/docs/solidity-by-example.rst is not working. It keeps giving this error in the Mist program: Could not compile source code. Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning. Voter delegate = voters[to]; ^------------^ The solution is just to add the keyword "storage" and then the example works again.
This commit is contained in:
parent
957f23a9f4
commit
b5d2a4ecd7
@ -126,7 +126,7 @@ of votes.
|
||||
// modifies `voters[msg.sender].voted`
|
||||
sender.voted = true;
|
||||
sender.delegate = to;
|
||||
Voter delegate = voters[to];
|
||||
Voter storage delegate = voters[to];
|
||||
if (delegate.voted) {
|
||||
// If the delegate already voted,
|
||||
// directly add to the number of votes
|
||||
|
Loading…
Reference in New Issue
Block a user