Solidity Function to Retrieve String Array Causes Compilation Error #4784
Unanswered
gregfraz
asked this question in
General Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm working with the pet-shop app to get up to speed. I added the following function to the Solidity code:
function getAdopterNames() public view returns (string[] memory) { return adopterNames;
This code causes the following compilation error:
project:/contracts/Adoption.sol:54:51: TypeError: This type is only supported in the new experimental ABI encoder. Use "pragma experimental ABIEncoderV2;" to enable the feature.
function getAdopterNames() public view returns (string[] memory) {
^-------------^
Is this capability only supported in the experimental phase? Is there an alternative method for retrieving string arrays? Or am I doing something incorrectly?
Greg
Beta Was this translation helpful? Give feedback.
All reactions