I'm just trying to get confirmation as to whether this is supported within Solidity currently. Older responses to this question seem to imply this has been added, but I can't find any concrete literature to confirm.
If I have a struct within the contract, can I return it via a getter on the contract? For example:
struct myDetails {
string firstName;
string lastName;
}
function getName() returns (???) {
return myName;
}
Thx
Marty
mapping(uint => player) public players, the value typeplayerseems to be a user-defined, i.e. non-primitive type. So I presume it would be some struct or mapping. So ifsomeContract.players(7)returns aplayer, does that mean that structs inside of mappings can be returned even though mappings inside of structs cannot (which you mention in the caveat later)? – Ajoy Bhatia Apr 20 '17 at 18:01