( Is on the Line of What It Calls — a ( That Begins a Line Begins What Is Written ThereStatus: 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)
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.
; at a newline after a name or a ), so a ( on the
next line begins a statement. Kotlin and Swift end the statement at
the newline in the same position.;.| 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 |
Option A.
( 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.
[, 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.
return null if open then (x, 2) is a guard and a tuple, which is what it
looks like.( on the next line no longer parses that call.
None in the repository did.f() fn { … }) on the line after its call: it is begun by
a keyword, so it has no reading but one, and is left as it is.