RDC00121: Indexed default member access
Severity: Information · Family: RDC (Rubberduck Core analyzers) ·
Raised by: IndexedDefaultMemberAccessAnalyzer
An argument list is given to an object of a known class, and its default member takes the arguments.
items(1), with items a Collection, calls items.Item(1) (RD-VBAL §5.6.13 Index Expressions).
The code reads like an array, and the member it calls is hidden.
The finding is the whole expression.
How it is raised
| Situation | Example | Resolution |
|---|---|---|
| An argument list given to an object. | first = items(1) |
Name the member: first = items.Item(1). |
| An argument list given to an object that is assigned a value. | scores(1) = 10 |
Name the member: scores.Item(1) = 10. |
| An empty argument list given to an object whose default member takes only optional parameters. | total = report() |
Name the member: total = report.Item(). |
See also
- RD-VBAL §2.6.4 Rubberduck Core Diagnostics
RDC00122: the same, of anObjectRDC00123:items!key, which gives a name to the default member
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca