Skip to content

ICE in ConstantEvaluator::endVisit(FunctionCall) when erc7201() is called with no arguments as a constant #16633

@jubnzv

Description

@jubnzv

The compiler panics with Solidity assertion failed in libsolidity/analysis/ConstantEvaluator.cpp:456 inside ConstantEvaluator::endVisit(FunctionCall) when erc7201() is called with zero arguments and the result is used as a constant.

MRE:

contract C { int public constant Y = erc7201(); uint[Y] public x; }

Reproduce: save as mre.sol, run solc --bin mre.sol.

Output:

Internal compiler error:
/solidity/libsolidity/analysis/ConstantEvaluator.cpp(456): Throw in function virtual void solidity::frontend::ConstantEvaluator::endVisit(const solidity::frontend::FunctionCall&)
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed

Expected behavior: a type error at the erc7201() call site explaining that it requires exactly one string argument.

Git commit: 9be6619
solc 0.8.35-develop.2026.4.18+commit.9be66192.Linux.g++

Metadata

Metadata

Labels

bug 🐛low effortThere is not much implementation work to be done. The task is very easy or tiny.low impactChanges are not very noticeable or potential benefits are limited.must haveSomething we consider an essential part of Solidity 1.0.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions