I'm wondering why if my function is meant to return a string of indeterminate length, I can't return a string array of definite length.
This function, for example doesn't compile
function BindingTypeList() public pure returns(string[] memory) {
return ["DocumentTemplate", "Definition", "RepAndWarranty", "Restriction", "Entitlement"];
}
the error message is TypeError: Return argument type string memory[5] memory is not implicitly convertible to expected type (type of first return variable) string memory[] memory.
It seems like they are saying that string[5]
is incompatible with returns(string[])
. I don't get that at all.