argotorg / argotorg/solidity

ICE in `Type::operatorDefinitions` when a zero-parameter function is bound as an operator via `using for`

Open
#16,613 0 comments 0 reactions 1 assignee Claimed by @r0qs View on GitHub
bug :bug:
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

The compiler panics with `Solidity assertion failed` in [`libsolidity/ast/Types.cpp:409`](https://github.com/ethereum/solidity/blob/9be66192f9db40e5a43f71fc78e06b2f35e9ccdd/libsolidity/ast/Types.cpp#L409) inside `Type::operatorDefinitions()` when a `using { f } for T` directive binds a zero-parameter function as an operator alongside a valid binding.

MRE:
```solidity
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 > solidity::frontend::Type::operatorDefinitions(solidity::langutil::Token, const solidity::frontend::ASTNode&, bool) const
Dynamic exception type: boost::wrapexcept
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: 9be66192f
solc 0.8.35-develop.2026.4.18+commit.9be66192.Linux.g++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.