DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B7011: a session object needs an initial value

Catalog status: active. Default severity: error. Stable name: session-object-value. Family: Driver and session failures.

An object declared in the REPL must be given its value in its declaration. A program assigns an object before reading it, which flow analysis checks; a session has no "before": any later input may read the object.

Example (Vada)

verada> Count : Natural;
error[B7011]: session object `Count` has no initial value

Example (Varc)

verada> var count: Natural;
error[B7011]: session object `count` has no initial value

What to do (Vada)

Give it a value: Count : Natural := 0;.

What to do (Varc)

Give it a value: var count: Natural = 0;.

Regression source and further reading

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

See driver and session failures, the code index, and diagnostic interpretation for modes, replay, fix-its and JSON.