Skip to content

ICE in FunctionDefinition::type when an external free function is bound via using for #16620

@jubnzv

Description

@jubnzv

The compiler panics with Solidity assertion failed in libsolidity/ast/AST.cpp:490 inside FunctionDefinition::type() when a free function declared external is listed in a using { f } for T directive.

MRE:

function f(int) external;
using {f} for int global;

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

Output:

Internal compiler error:
/solidity/libsolidity/ast/AST.cpp(490): Throw in function virtual const solidity::frontend::Type* solidity::frontend::FunctionDefinition::type() const
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 rejecting external free functions in using for bindings, since only internal and public free functions make sense as bound methods.

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

Metadata

Metadata

Assignees

No one assigned

    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 have eventuallySomething we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.

    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