Repository navigation
Description
ABAP's args rule matches the parameter-passing keywords wherever they appear, and in ABAP those same six keywords appear at the call site as well as in the declaration:
"args": re.compile(
r"\b(IMPORTING|EXPORTING|CHANGING|RETURNING|RECEIVING|EXCEPTIONS)\s+(?!TYPE\b)"
r"(?:VALUE\s*\([^)]*\)|!?[a-zA-Z_][a-zA-Z0-9_-]*)",
re.I,
)That is corollary 1 of the stated args contract (docs/args_rule_contract.md, #2773/#2786) — a call is not a declaration — with the same failure shape the contract already documents for objective-c (message sends), typescript (call statements) and groovy/apex/css. ABAP was audited as clean in #2773 because neither corpus contained a call site that used them.
Measured
- language-crucible (
data/abap, abapGit — almost entirely OO method declarations): 167argshits, 5 on a call statement (3%):CALL FUNCTION 'ENQUEUE_EZABAPGIT' EXPORTING mode_zabapgit = ...,CALL FUNCTION ... EXCEPTIONS foreign_lock,RAISE EXCEPTION TYPE zcx_... EXPORTING obj_type. The rate is low here only because this corpus is barely procedural; every one of those five is a caller passing actuals to somebody else's parameter list. - keyword-rosetta (this is how it surfaced):
data/abap/main.abap'sFORM dispatchnever invoked its probes, which is the plant gap orphaned_logic reports 100% dead code for five languages whose invocation model never names the callee — the family #2727 closed without covering #2806 fixed. Planting the language's own idiom —PERFORM probe_branch CHANGING cv_argv.×3 — movesmain.abap'sargscell from 4 to 7: three call statements, three "declared" parameters. The corpus PR re-blesses the cell to 7 and ledgers it asabap-args-counts-call-site-keywords(upstream-bug,still_reproduces: true) pointing here, perdocs/GATING.md.
The fix shape
The declaration forms are anchored: METHODS/CLASS-METHODS/FORM/FUNCTION/MODULE, or the continuation lines of one of those statements. The call forms are equally anchored: CALL FUNCTION/CALL METHOD/CALL BADI, PERFORM, RAISE EXCEPTION, and the functional-method-call form x = obj->m( EXPORTING p = v ). A statement-scoped exclusion (the statement that owns the keyword, ABAP statements ending at .) is the natural anchor, and matches how args was fixed for the other languages in the contract's audit. Both directions need measuring on the crucible before landing: the declaration continuation lines are physically separate lines from the METHODS keyword that owns them, so a naive line anchor loses the real ones.
Found while auditing #2806 (unreferenced_by_name); the corpus plant that exposes it lands in the same wave. Part of #2812.
Activity
unreferenced_by_name: state the census contract, and stop asking the …
fix(abap): args counts declared parameter surfaces, not call sites (#…