Skip to content
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

ABIEncoderV2 + external = UnimplementedFeatureError #5479

Closed
Amxx opened this issue Nov 22, 2018 · 2 comments

Comments

@Amxx
Copy link

commented Nov 22, 2018

I have solidity code that contains methods which rely on the ABIEncoderV2 to get input structs.

If the method is public (input stored in memory) everything works well. However, if the method is external (input stored in calldata) then the compiler gives me a "NotImplementedFeatureError"

Minimal reproducible code:

pragma solidity ^0.4.25;
pragma experimental ABIEncoderV2;
contract Test {
    event MyEvent(uint256 a);
    struct MyStruct { uint256 a; }
    function broadcast(MyStruct _value) external { emit MyEvent(_value.a); }
}

Error visible on remix with 0.4.25+commit.59dbf8f1.Emscripten.clang

@axic axic transferred this issue from ethereum/solc-js Nov 22, 2018

@axic

This comment has been minimized.

Copy link
Member

commented Nov 22, 2018

Unimplemented feature:
/Users/alex/Projects/solidity/libsolidity/codegen/ABIFunctions.cpp(1283): Throw in function std::__1::string dev::solidity::ABIFunctions::abiDecodingFunctionStruct(const dev::solidity::StructType &, bool)
Dynamic exception type: boost::exception_detail::clone_impl<dev::solidity::UnimplementedFeatureError>
std::exception::what: 
[dev::tag_comment*] = 

I think this is about decoding from calldata for structs is not implemented.

(The feature is also missing in 0.5.0.)

@chriseth

This comment has been minimized.

Copy link
Contributor

commented Nov 22, 2018

The problem is that calldata structs are not a defined concept in Solidity. We might want to disallow calldata structs at the type checker level.

@axic axic added this to To do in 0.5.3 via automation Jan 2, 2019

@ekpyron ekpyron self-assigned this Jan 17, 2019

@ekpyron ekpyron moved this from To do to In progress in 0.5.3 Jan 17, 2019

@ekpyron ekpyron moved this from In progress to Needs review in 0.5.3 Jan 17, 2019

0.5.3 automation moved this from Needs review to Done Jan 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4 participants
You can’t perform that action at this time.