ADR-317: A Call’s ( Is on the Line of What It Calls — a ( That Begins a Line Begins What Is Written There

Status: Accepted Date: October 4, 2026 Answers: #426, the owner’s choice between the two ways out it named Related: ADR-135 D3 (a [ at the start of a line begins a literal - this record is the same rule for (); ADR-276 D23 (return x if cond); Part I 5.1 (calls)

1. Question

The grammar reads no newlines, so a line that begins with ( was read as the arguments of whatever the line before it ended with:

let (a, b) = match e {
    E::V(x) => {
        return null if open
        (x, 2)
    },
    else => return null,
}

was if open(x, 2) { return null }: the tuple that is the arm’s value became arguments to a bool, the function was taken to pause (a call no ledger knows) and lowered async, and rustc refused a call on a bool. Nothing in the program looks like a call. The same held after any line ending in a name - a tuple, or a parenthesised expression, written as the next statement.

2. How others do it

3. Options, weighed

Option For Against
A. A call’s ( on its callee’s line (Go, Kotlin) One rule, no message to learn; the same rule [ already has (ADR-135 D3) A call written with its ( on the next line - which nobody writes - stops parsing as one
B. Keep the call, refuse or warn at a line that begins with ( (JavaScript and its linters) Nothing that parses today changes meaning A second rule to learn, and a refusal for a line that says exactly what it means

4. Decision

Option A.

D1 — A call’s ( is written on the line of what it calls.

For a function (f(…), module::f(…)) and a method (x.m(…), x?.m(…)) alike. A ( that is the first thing on its line is not a call’s: it begins whatever is written there - a tuple, a parenthesised expression.

D2 — It is the rule ADR-135 D3 made for [, and read the same way.

The parser asks whether the token begins a line, from the whitespace it skipped; nothing is inserted and nothing is looked ahead for.

5. Consequences

6. What this does not decide

This site is open source. Improve this page.