Description
Solidity’s --via-ir compilation pipeline incorrectly ABI‑encodes custom error arguments when require(condition, Error({named args})) uses named parameters written out of declaration order.
Steps to Reproduce
error NamedArgsError(uint256 a, uint256 b);
contract ViaIRNamedArgsTarget {
function trigger() external pure {
require(false, NamedArgsError({b: 7, a: 2}));
}
}
Decoding in legacy yield a=2 and b=7 as it should, whereas under via-IR it yields a=7 and b=2.