DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
B0705: a call or conversion written with brackets
Catalog status: active. Default severity: error. Stable name: brackets-for-call. Family: Syntax and source text.
In Varc brackets index an array (a[i], a[1..=3]) and parentheses call a subprogram or convert a value (f(x), Integer(x)), so a reader can tell the two apart at a glance. This name is a subprogram or a type, so it is called or converted with parentheses.
Example (Varc)
fn main() {
fn twice(n: Integer) -> Integer = 2 * n;
let x: Integer = twice[3];
}
What to do
Write parentheses: twice(3). (Vada writes both with parentheses, as Ada does.)
Regression source and further reading
Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.
See syntax and source text, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.