From Solidity tutorials:
contract C {
uint[] counters;
function getCounter(uint index)
returns (uint counter, bool error) {
if (index >= counters.length) return (0, true);
else return (counters[index], false);
}
function checkCounter(uint index) {
var (counter, error) = getCounter(index);
if (error) { ... }
else { ... }
}
}
If I compile this with truffle, a warning is displayed:
Warning: Use of the "var" keyword is deprecated.
What is ther alternate to removing var when receiving tupples from returning functions? I tried removing var but truffle refuses from compiling with error.
Best Answer
You can define the variable first with their type and then assign to the tuple.