Skip to content

Semantics of functions returning multiple values #10

@bitbart

Description

@bitbart

Extend the semantics and TinySol so to handle functions with multiple return values:

https://docs.soliditylang.org/en/latest/control-structures.html#destructuring-assignments-and-returning-multiple-values

For example, the contract:

contract C {
    int x;
    bool b;

    function f() public view returns (int,bool) { return(x,b); }
    function g() public { int y; bool z; (y,z) = this.f(); x +=y; b = !z; }
}

has a function f that returns a pair of values. The returned pair can be deconstructed through an assignment when calling the function, as done in g.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions