From b5d2a4ecd7ed971a962bac1d61b5d3ffca824084 Mon Sep 17 00:00:00 2001 From: Chim Kan Date: Wed, 23 Aug 2017 20:25:12 -0400 Subject: [PATCH] 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. --- docs/solidity-by-example.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst index dde4495b5..88eaadd59 100644 --- a/docs/solidity-by-example.rst +++ b/docs/solidity-by-example.rst @@ -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