Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.5.0 updates for VAR and Return Value Selection #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tutorial-20/Assignments.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.0;
pragma solidity ^0.5.0;

contract Assignments {
function returnFirstValue(uint a, uint b) returns (uint) {
Expand All @@ -9,15 +9,15 @@ contract Assignments {
return returnFirstValue({b:4, a:8});
}

function returnAllValues(uint a, uint b, uint c) returns (uint, uint, uint) {
function returnAllValues(uint a, uint b, uint c) public returns (uint, uint, uint) {
return (a,b,c);
}

function callerAll() public returns (uint, uint, uint) {
var(x,y,z) = returnAllValues(4,5,6);
(uint x, uint y, uint z) = returnAllValues(4,5,6);
(x,y) = (y,x);
(x,) = returnAllValues(5,10,15);
(,z) = returnAllValues(10,20,30);
(x,,) = returnAllValues(5,10,15);
(,,z) = returnAllValues(10,20,30);
return (x,y,z);
}
}
}