argotorg / argotorg/solidity

ICE in `ExpressionCompiler`: `Unknown magic member` on bare `abi.encodeCall` reference

Open
#16,612 1 comment 0 reactions 0 assignees View on GitHub
bug :bug: low effort low impact must have eventually
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

The compiler panics with `Unknown magic member` in [`libsolidity/codegen/ExpressionCompiler.cpp:2058`](https://github.com/ethereum/solidity/blob/9be66192f9db40e5a43f71fc78e06b2f35e9ccdd/libsolidity/codegen/ExpressionCompiler.cpp#L2058) when `abi.encodeCall` is referenced as a bare member expression (not called).

MRE:
```solidity
contract C { function f() public { abi.encodeCall; } }
```

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

Output:
```
Internal compiler error:
/solidity/libsolidity/codegen/ExpressionCompiler.cpp(2058): Throw in function virtual bool solidity::frontend::ExpressionCompiler::visit(const solidity::frontend::MemberAccess&)
Dynamic exception type: boost::wrapexcept
std::exception::what: Unknown magic member.
[solidity::util::tag_comment*] = Unknown magic member.
```

Expected behavior: a type error explaining that `abi.encodeCall` cannot be used as a value, or a no-op matching the treatment of the other `abi.*` members.

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

Contributor guide

Open the contributing guide

Research direction

Start in libsolidity/codegen/ExpressionCompiler.cpp at line 2058 and reproduce the ICE with solc --bin on the provided mre.sol example. Trace how a bare abi.encodeCall member expression is handled compared with other abi.* members. Done means the compiler no longer panics and the example produces the expected type error or no-op behavior, with a regression test covering the case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.