ICE in `FunctionDefinition::type` when an `external` free function is bound via `using for`
- 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/AST.cpp:490`](https://github.com/ethereum/solidity/blob/9be66192f9db40e5a43f71fc78e06b2f35e9ccdd/libsolidity/ast/AST.cpp#L490) inside `FunctionDefinition::type()` when a free function declared `external` is listed in a `using { f } for T` directive.
MRE:
```solidity
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
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: 9be66192f
solc 0.8.35-develop.2026.4.18+commit.9be66192.Linux.g++
Contributor guide
Research direction
Start in libsolidity/ast/AST.cpp at FunctionDefinition::type(), then reproduce the ICE with `solc --bin mre.sol` using the issue's minimal Solidity example. Trace validation of `using {f} for int global` and ensure an `external` free function produces a type error rather than an assertion; add regression coverage for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100