DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B0110: chained operators need parentheses

Catalog status: active. Default severity: error. Stable name: non-associative-operators. Family: Syntax and source text.

A relation has at most one relational operator (=, /=, <, <=, >, >=), and ** cannot be chained (RM 4.4). A < B < C does not mean "B is between A and C" in Ada.

Example (Vada)

   Ok := A < B < C;
   A := A ** B ** C;

Example (Varc)

    ok = a < b < c;
    a = a ** b ** c;

What to do (Vada)

   Ok := A < B and then B < C;
   A := A ** (B ** C);

What to do (Varc)

    ok = a < b && b < c;
    a = a ** (b ** c);

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.