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

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions