Skip to content

abap args counts call-site parameter keywords (CALL FUNCTION ... EXPORTING, PERFORM ... CHANGING) as declared parameters #2824

Closed

Description

@squid-protocol

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): 167 args hits, 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's FORM dispatch never 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 — moves main.abap's args cell from 4 to 7: three call statements, three "declared" parameters. The corpus PR re-blesses the cell to 7 and ledgers it as abap-args-counts-call-site-keywords (upstream-bug, still_reproduces: true) pointing here, per docs/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

  1. added
    bug
    metrics
    core-engine
    on Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-enginemetrics

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions