Table of Contents

Class PublicMemberSemantics

Namespace
RDCore.SDK.Semantics.Static
Assembly
RDCore.SDK.dll

The static semantics of what a module exposes: which types a public member may be declared with, and which members an object module may expose at all (MS-VBAL §5.2.3.1, §5.2.3.3, §5.3.1).

public static class PublicMemberSemantics
Inheritance
PublicMemberSemantics
Inherited Members

Remarks

A public member is one declared Public or Global, or declared with no modifier when it is a procedure, a property, an event, a Declare or a type, which are then public; a variable or a constant declared with none (Dim, Const) is private, and a Friend member is not public either.

  • A class module defines no public user-defined type (PublicUserDefinedTypeInObjectModule): a Type declared with no modifier is public, and refused as Public Type is.
  • A class module exposes no constant, fixed-length string, array, user-defined type or Declare, and no Global variable at all (NotAllowedAsPublicMemberOfObjectModule). A member refused for this is not checked for the rule below: MS-VBA reports this one.
  • A public member is not declared with a private Enum - as the type of a variable, of a parameter, or of the result of a function or a property - and, in a class module, with a private user-defined type either (PrivateTypeInPublicMember). An array of one is one.

👉 What MS-VBA does, recorded in Excel, and not all of it what MS-VBAL says: the message of the last rule names fields of a public user-defined type too, but a field of a Public Type of a procedural module may be of a private Enum or a private type; and a procedural module's public members may be of its private types, where §5.2.3.1 and §5.3.1 only speak of a class module. §5.3.1.5 refuses a procedural module's Public Type as a parameter of a public procedure or an event of a class, which MS-VBA accepts. RD-VBA does what MS-VBA does.

A type that does not resolve is not a type that is private: whatever is declared as one is not reported.

Methods

Evaluate(Symbol, IReadOnlyList<VBTypeMemberSymbol>, ISymbolResolver)

Checks what module exposes.

public static ImmutableArray<VBCompileErrorInfo> Evaluate(Symbol module, IReadOnlyList<VBTypeMemberSymbol> members, ISymbolResolver resolver)

Parameters

module Symbol

The module, a procedural module or a class module.

members IReadOnlyList<VBTypeMemberSymbol>

The members declared by the module.

resolver ISymbolResolver

What finds the type a declared type names, when it did not resolve where the declaration was read.

Returns

ImmutableArray<VBCompileErrorInfo>

Every error found, in declaration order; at most one for each member; empty when the declarations are valid.