The compiler panics with Solidity assertion failed in libsolidity/ast/Types.cpp:409 inside Type::operatorDefinitions() when a using { f } for T directive binds a zero-parameter function as an operator alongside a valid binding.
MRE:
type T is int256;
function f(T a, T b) pure returns (T) {}
function g() pure returns (T) {}
using {f as -, g as -} for T global;
Reproduce: save as mre.sol, run solc --bin mre.sol.
Output:
Internal compiler error:
/solidity/libsolidity/ast/Types.cpp(409): Throw in function std::set<const solidity::frontend::FunctionDefinition*, solidity::frontend::ASTCompareByID<solidity::frontend::ASTNode> > solidity::frontend::Type::operatorDefinitions(solidity::langutil::Token, const solidity::frontend::ASTNode&, bool) 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 at the using directive rejecting g as an operator binding because it has no parameters.
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:409insideType::operatorDefinitions()when ausing { f } for Tdirective binds a zero-parameter function as an operator alongside a valid binding.MRE:
Reproduce: save as
mre.sol, runsolc --bin mre.sol.Output:
Expected behavior: a type error at the
usingdirective rejectinggas an operator binding because it has no parameters.Git commit: 9be6619
solc 0.8.35-develop.2026.4.18+commit.9be66192.Linux.g++