The compiler panics with internal error: entered unreachable code: Type is not an array in src/sema/types.rs:1397 (Type::elem_ty) when tx.accounts (a Solana-specific builtin returning AccountInfo[]) is passed to abi.encodePacked.
MRE:
contract C {
function f() public {
abi.encodePacked(tx.accounts);
}
}
Reproduce: save as mre.sol, run solang compile --target solana mre.sol.
Output:
thread 'main' panicked at src/sema/types.rs:1397:18:
internal error: entered unreachable code: Type is not an array
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected behavior: sema rejects encoding tx.accounts (or the encoder handles the AccountInfo struct's non-array fields correctly) instead of panicking.
Solana-only (the tx.accounts builtin does not exist on other targets).
Git commit: 901bfb9
Build: release
rustc 1.96.0-nightly (562dee482 2026-03-21)
The compiler panics with
internal error: entered unreachable code: Type is not an arrayinsrc/sema/types.rs:1397(Type::elem_ty) whentx.accounts(a Solana-specific builtin returningAccountInfo[]) is passed toabi.encodePacked.MRE:
Reproduce: save as
mre.sol, runsolang compile --target solana mre.sol.Output:
Expected behavior: sema rejects encoding
tx.accounts(or the encoder handles theAccountInfostruct's non-array fields correctly) instead of panicking.Solana-only (the
tx.accountsbuiltin does not exist on other targets).Git commit: 901bfb9
Build: release
rustc 1.96.0-nightly (562dee482 2026-03-21)