DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B1008: a variable is required

Catalog status: active. Default severity: error. Stable name: not-a-variable. Family: Names and declarations.

Only variables can be assigned or passed as out and in out parameters: not constants, in parameters, loop parameters or values computed by expressions.

Example (Vada)

   Limit : constant Integer := 10;
   ...
   Limit := 11;
   for I in 1 .. 3 loop
      I := 2;
   end loop;

Example (Varc)

    let limit: Integer = 10;
    ...
    limit = 11;
    for i in 1..=3 {
        i = 2;
    }

What to do (Vada)

Declare a variable (without constant), copy the value into a local variable, or change the parameter's mode.

What to do (Varc)

Declare a variable (with var instead of let), copy the value into a local variable, or change the parameter's mode (out or inout).

Regression source and further reading

Complete regression example: source, command arguments and expected results. The fixture deliberately reproduces this diagnostic.

See names and declarations, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.