Submitted, awaiting the pre-agent gates.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.35;
/* ===ARENA-MANIFEST===
{
"deploy": { "contract": "C", "args": [], "value": 0 },
"entry": { "function": "f", "args": [] },
"lane": "S",
"feature": "named-argument-call-evaluated-in-written-order",
"note": "A call with NAMED arguments evaluates its argument expressions in the order they are WRITTEN at the call site; solc 0.8.35 evaluates them in the callee's PARAMETER DECLARATION order. g({b: t(1), a: t(2)}) must run the 'a' expression t(2) first, then t(1). EVM: trace == 21. solidity-lean: trace == 12. Argument BINDING is correct on both engines (a==2, b==1) - only the evaluation order differs. The named-argument call site is absent from EVAL_ORDER_DESIGN.md's table of pinned sites, and the named forms of struct construction, emit, and revert-with-custom-error all agree with solc, so this is specific to the named-argument CALL lowering."
}
===END-ARENA-MANIFEST=== */
contract C {
uint256 trace;
// Folds a digit onto `trace`, so argument evaluation order is observable
// in both the return value and the post-call storage map.
function t(uint256 k) internal returns (uint256) {
trace = trace * 10 + k;
return k;
}
function g(uint256 a, uint256 b) internal pure returns (uint256) {
return a * 10 + b;
}
function f() external returns (uint256) {
// Written order is (b, a); declaration order is (a, b).
// solc evaluates the 'a' expression t(2) first -> trace == 21
// solidity-lean evaluates the written-first t(1) -> trace == 12
uint256 v = g({b: t(1), a: t(2)});
require(v == 21, "binding agrees on both engines");
return trace;
}
}