New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cryptic type error for multiple return values #164
Comments
There is a story to improve this: https://www.pivotaltracker.com/n/projects/1189488/stories/103488704 |
I just realised that I should probably explain why this happens: |
I don't understand how this can be an EVM restriction, if it can read fixed-size data of arbitrary size when you know the type. |
The only explanation I can think of is that the evm requires you to say the size of the calldata buffer for the return value when you are making the call. What happens if you just say that it has size 2^256, then parse the return value lengths yourself? |
Chris, |
Before making the call, you have to specify the location where the return value should be put (position and length). The problem is that you already have to pay for memory usage before you make the call, so just specifying 2**256 for the length will use up all your gas. These restrictions are not specific to Solidity. |
This is another argument for supporting a feature like |
So if there is a contract returning |
@nmushegian @Nashatyrev you are right. We plan to remove this limitation in Ethereum 2.0. |
What I meant was that I specify the size in the caller. I'm that if the callee tries to write too much to the return data, it just truncates it or crashes the transaction. So the caller should be able to interpret it as a dynamic array if I insist, if the array size is in the first word then I can check if it was too big and know that it failed. Then in the callee I just return |
Would it be possible to just get a better error message in the mean time? This seems like a common gotcha. |
same error if I switch the order. No error if I use
bytes32
instead ofbytes
.The text was updated successfully, but these errors were encountered: