DEVELOPMENT EDITION · 769442725406
Diagnostics Reference
On this page

B2008: name or expression is ambiguous

Catalog status: active. Default severity: error. Stable name: ambiguous-name. Family: Types and constraints.

The name (or call) could mean more than one declaration, and nothing in the context decides which: for example the same name made visible by two use clauses, or a call whose arguments fit two overloaded subprograms.

Example (Vada)

with Metric;   use Metric;     --  declares Limit
with Imperial; use Imperial;   --  also declares Limit
...
   X : Integer := Limit;

Example (Varc)

import Metric;   use Metric;     // declares limit
import Imperial; use Imperial;   // also declares limit
...
    var x: Integer = limit;

What to do (Vada)

Qualify the name with its package (Metric.Limit), or qualify an argument (T'(X)).

What to do (Varc)

Qualify the name with its package (Metric.limit), or qualify an argument (x as T).

Regression source and further reading

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

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