The compiler panics with internal error: entered unreachable code: Value in src/sema/types.rs:1427 (Type::is_fixed_reference_type's catch-all arm) when msg.value is placed inside an array literal and subscripted ([msg.value][0]), then used in a comparison.
MRE:
contract C {
function f() public payable returns (bool) {
return [msg.value][0] <= 0;
}
}
Reproduce: save as mre.sol, run solang compile --target polkadot mre.sol.
Output:
thread 'main' panicked at src/sema/types.rs:1427:18:
internal error: entered unreachable code: Value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expected behavior: the array-literal subscript coerces Type::Value to its underlying integer type (as bare msg.value does), or is_fixed_reference_type handles Type::Value (returning false).
Reproduces on all targets (polkadot, solana, evm).
Git commit: 901bfb9
Build: release
rustc 1.96.0-nightly (562dee482 2026-03-21)
The compiler panics with
internal error: entered unreachable code: Valueinsrc/sema/types.rs:1427(Type::is_fixed_reference_type's catch-all arm) whenmsg.valueis placed inside an array literal and subscripted ([msg.value][0]), then used in a comparison.MRE:
Reproduce: save as
mre.sol, runsolang compile --target polkadot mre.sol.Output:
Expected behavior: the array-literal subscript coerces
Type::Valueto its underlying integer type (as baremsg.valuedoes), oris_fixed_reference_typehandlesType::Value(returningfalse).Reproduces on all targets (
polkadot,solana,evm).Git commit: 901bfb9
Build: release
rustc 1.96.0-nightly (562dee482 2026-03-21)