The compiler panics with Solidity assertion failed in libsolidity/ast/Types.cpp:3753 inside FunctionType::withBoundFirstArgument() when a free function with no parameters is listed in a using { f } for T directive and called as a bound method. The semantic check that rejects zero-parameter functions in using for bindings is bypassed when the using declaration appears after the call site in the contract body.
MRE:
function zero() pure returns (uint) { return 0; }
contract C {
function f(uint z) pure external returns (uint) {
return z.zero();
}
using {zero} for uint;
}
Reproduce: save as mre.sol, run solc --bin mre.sol.
Output:
Internal compiler error:
/solidity/libsolidity/ast/Types.cpp(3753): Throw in function const solidity::frontend::FunctionType* solidity::frontend::FunctionType::withBoundFirstArgument() 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 zero in the using for binding because it has no parameters to bind to.
Git commit: 9be6619
solc 0.8.35-develop.2026.4.18+commit.9be66192.Linux.g++
The compiler panics with
Solidity assertion failedinlibsolidity/ast/Types.cpp:3753insideFunctionType::withBoundFirstArgument()when a free function with no parameters is listed in ausing { f } for Tdirective and called as a bound method. The semantic check that rejects zero-parameter functions inusing forbindings is bypassed when theusingdeclaration appears after the call site in the contract body.MRE:
Reproduce: save as
mre.sol, runsolc --bin mre.sol.Output:
Expected behavior: a type error rejecting
zeroin theusing forbinding because it has no parameters to bind to.Git commit: 9be6619
solc 0.8.35-develop.2026.4.18+commit.9be66192.Linux.g++