Skip to content

Raise useful error message when using a dynamic type as a key in a mapping #633

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

Closed
bortzmeyer opened this issue Jun 6, 2016 · 5 comments
Assignees
Labels

Comments

@bortzmeyer
Copy link

% solc multi-valued-mappings.sol   
Internal compiler error during compilation:
/build/cpp-ethereum-F1MTmh/cpp-ethereum-1.2.5~xenial/solidity/libsolidity/codegen/ExpressionCompiler.cpp(102): Throw in function void dev::solidity::ExpressionCompiler::appendStateVariableAccessor(const dev::solidity::VariableDeclaration&)
Dynamic exception type: boost::exception_detail::clone_impl<dev::solidity::InternalCompilerError>
std::exception::what: std::exception
[dev::tag_comment*] = Accessors for mapping with dynamically-sized keys not yet implemented.

% solc --version
solc, the solidity compiler commandline interface
Version: 0.3.3-0/RelWithDebInfo-Linux/g++/Interpreter

The source code is attached.
multi-valued-mappings.txt

@bortzmeyer
Copy link
Author

Removing "public" from the variable "data" allow the program to be compiled. But I would prefer a clear error message than an internal error.

@axic
Copy link
Member

axic commented Aug 2, 2016

@bortzmeyer the error message is there also:
[dev::tag_comment*] = Accessors for mapping with dynamically-sized keys not yet implemented.

@chriseth chriseth changed the title Internal compiler error Accessors for dynamic keys Aug 11, 2016
@chriseth chriseth added this to the 5-functionality milestone Aug 11, 2016
@chriseth chriseth added soon and removed accepted labels Oct 27, 2016
@axic
Copy link
Member

axic commented Feb 2, 2017

Duplicate of #498.

@axic axic closed this as completed Feb 2, 2017
@axic axic removed the soon label Feb 2, 2017
@Pipeliner
Copy link

@axic I guess @bortzmeyer meant that it was not immediately obvious from the error message that removing public would work. A more friendly message would probably be very helpful here.

@axic
Copy link
Member

axic commented Feb 21, 2018

Actually it would be nice to raise this issue in the type checker so a proper error message can be displayed as opposed to an assertion.

@axic axic reopened this Feb 21, 2018
@axic axic changed the title Accessors for dynamic keys Raise useful error message when using a dynamic type as a key in a mapping Feb 21, 2018
@axic axic added the bug 🐛 label Jul 30, 2018
@axic axic removed this from the 5-functionality milestone Jul 30, 2018
@leonardoalt leonardoalt self-assigned this Jul 30, 2018
axic pushed a commit to ipsilon/solidity that referenced this issue Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants