I am practicing my Solidity skills and while I did expect to get an error, I did not expect this error
TypeError: This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature. function getArray() public view returns (string[]) {
This is my code in Remix:
pragma solidity ^0.4.17;
contract Test {
string[] public myArray;
function Test() public {
myArray.push("hola");
}
function getArray() public view returns (string[]) {
return myArray;
}
}
What gives here?
Is this because the standard ABI does not support dynamic nested arrays?
TypeError: This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
string[]
is not yet supported as a return value for a solidity function, but is planned to be supported sometime in the future, and they have started that implementation using the "experimental ABI Encoder V2". If this is a qualified answer, let me know and I will respond with similar details.