function f3(string[2] ss) {} results in compiler error:
Type error: Internal type is not allowed for public and external functions.
function f3(string[2] ss) {
^----------^
Looks like the ABI supports this, but the Solidity compiler doesn't
unfortunately nested arrays aren't yet implemented as arguments for external functions.
also please implement structs
what's the status of this? function f (string[] _s) does not work, function f (address[] _a) does though.
@5chdn string is an array itself, so string[] is actually two-dimensional. The story is still pending, as can be seen from PT.
struct Patient {
bytes32 name;
uint weight; // weight is accumulated by delegation
uint height; // if true, that person already voted
uint NHSNum; //include timestamp
bytes32 specialty;
bytes32 consultant;
bytes32 diagnoses;
uint Creatinite;
uint Sodium;
uint Potassium;
uint eGFR;
uint Urea;
}
Patient[] patients;
function allPatients() constant returns(Patient[]) {
return patients;
}
without internal in allPatients() it will cause same error.
why such a basic feature not implement in?
Several reasons, but you are lucky, I'm working on exactly this right as I type (not exactly right but you get the point ;) )
@chriseth Is passing and returning struct in functions in production yet? You have mentioned this in 0.4.17 release notes, but it is not clear if support is only for _internal_ functions as the docs say or if this is also available between contracts and in _function types_? The doc: http://solidity.readthedocs.io/en/develop/frequently-asked-questions.html?highlight=struct%20function#can-a-contract-function-return-a-struct
Thank you so much for all work! :)
@aayarushin no, not yet in production. It is fully implemented, but pending review: https://github.com/ethereum/solidity/pull/2863
The documentation has to be updated, yes.
This explains why I get a Error: invalid solidity type!: tuple when I try to get back a struct
Most helpful comment
@aayarushin no, not yet in production. It is fully implemented, but pending review: https://github.com/ethereum/solidity/pull/2863
The documentation has to be updated, yes.