VBC09328 — Invalid Implements directive
Severity: Error · Family: VBC (static semantics / abstract syntax tree) ·
Source metadata: VBCompileErrorInfo
An Implements directive names a class that cannot be an interface class of this module, or the directives of the
module do not go together.
MS-VBAL §5.2.4.2 Implements Directive gives the rules.
This code is raised by
ImplementsSemantics. The verbose detail says which rule.
How it is raised
| Situation | Example, in the class module Disc |
Resolution |
|---|---|---|
| The interface class is the class of the module itself. | Implements Disc |
A class cannot implement itself. |
| A class is the interface class of more than one directive of the module. | Implements IShape twice |
Name it once. |
The module is extensible (VB_Extensible = True). |
Any Implements directive |
Remove the directive: an extensible module cannot implement an interface. |
| The class has a public variable or method with an underscore in its name. | Implements IBad, where IBad has Public Sub Do_It() |
Rename the member, or make it Private. The underscore is where the interface's name ends in the name of an implementation. |
| The implemented interface name prefix of one interface begins the prefix of another. | Implements IA and Implements IA_B: the prefix IA_ begins IA_B_ |
Rename an interface, so that IA_B_Member does not read as IA_'s B_Member. |
Notes
A name that is no class at all is not reported with this code: it is VBC09311
(user-defined type not defined).
See also
- VBC09329 — a member of the interface the module does not implement
- VBC09330 — an implemented name declaration that does not correspond to its member
- RD-VBAL §2.6.2 Semantic Compilation Errors
- RD-VBAL §5.2.4.2 Implements Directive
⏮️ VBC09327 ByVal argument not allowed here | ⏭️ VBC09329 Object module needs to implement all members of its interface
ACCUEIL • HOME | ℹ️ BIENVENUE • WELCOME | 🧩 BÂTISSONS • BUILD | RD-VBAL | SDK | 🌐 rubberduckvba.ca