2.6.4 Rubberduck Core Diagnostics
Rubberduck Core diagnostics are the analyzer findings issued by the RDCore.Diagnostics analyzers. They cover implicit declarations, obsolete syntax, misleading constructs, every inspection that the legacy Rubberduck add-in shipped, and further inspections beyond those.
| Code family | RDC, defined by RDCoreDiagnosticId (in RDCore.Diagnostics); the enum value is the code |
| Title | per finding |
| Raised by | the RDCore.Diagnostics analyzers |
| Severity | spans Hint through Error, per finding |
Any other language core diagnostics issued from RDCore.Diagnostics are to be documented under an RDC00000 code; see RD-VBAL §1.1.4 Core Diagnostics.
Published codes
An analyzer is a pure function of facts (IModuleAnalyzer): the environment host runs the semantic analysis pass and says what
is true of the code, and an analyzer decides what is worth saying
(RD-VBAL §5.0.3 Semantic Analysis). An analyzer that is not given the fact it reads has nothing to say.
What the code means is a fact the host vouches for. How it is written - a keyword that is there or is not, where a name is - is a fact of the syntax tree, which the analyzer is given along with the model: those analyzers read the tree, and a module that did not parse has nothing for them to say.
Not every fact is ready at the same time, and a finding that is ready is not held back for one that is not. An analyzer belongs to a phase
(IModuleAnalyzer.Phase, AnalysisPhase): the static phase has the syntax tree and the facts of the host's static pass, which are there as soon as a module is
loaded; the runtime phase has the facts that come of evaluating the code of the module, which take longer. The language server asks for the phases in turn and, for a
client that is pushed diagnostics, publishes each as soon as it arrives together with the ones before it (a publication replaces the one before it). A client that
pulls diagnostics is answered when every phase is. An analyzer that does not say is of the static phase.
The severity of a finding is a choice of the analyzer (RD-VBAL §2.6 Diagnostics): a Hint states a fact, an Information (a suggestion) is a finding that a code action could fix, and a Warning is serious enough to break a build that treats warnings as errors.
| Code | Title | Severity | Reads |
|---|---|---|---|
RDC00101 |
Implicit declarations enabled | Warning | ModuleSemanticModel.OptionExplicit |
RDC00102 |
Implicit non-default array base | Hint | the syntax tree: an Option Base 1 directive |
RDC00103 |
Implicit type declarations enabled | Hint | the syntax tree: a Def<Type> directive |
RDC00104 |
Implicit ByRef modifier | Information | the syntax tree: ParameterDeclarationNode.ParameterKind, when DiagnosticsOptions.ByRefModifier is Explicit, except in a procedure whose DeclarationFact.Role is InterfaceImplementation or EventHandler |
RDC00105 |
Implicit Public member | Information | the syntax tree: MemberDeclarationNode.AccessModifier |
RDC00106 |
Implicit Variant declaration | Information | the syntax tree: a declaration with no type, and the Def<Type> directives |
RDC00107 |
Implicit Variant return type | Information | the syntax tree: a function with no type, and the Def<Type> directives |
RDC00112 |
Implicit narrowing conversion | Warning | ProcedureSemanticModel.Runtime: the ConversionFacts the language core states about the code of the procedure |
RDC00114 |
Implicit array declaration | Information | ModuleSemanticModel.Declarations: a local whose DeclarationFact.DeclaredBy is ReDim |
RDC00115 |
Implicit result local | Information | the syntax tree, and ProcedureSemanticModel.Expressions: a name of the procedure, read in its body, bound to it and not a call of it |
RDC00116 |
Implicit For step | Information | the syntax tree: a ForStatementNode with no StepExpression, when DiagnosticsOptions.ForStep is Explicit |
RDC00117 |
Implicit constant type | Information | the syntax tree: a ConstantDeclarationNode with no As clause and no type hint |
RDC00119 |
Implicit default member access | Information | ProcedureSemanticModel.Runtime: a ConversionFact with ConversionSemanticFlags.ObjectOperand, at its operand of a class type; and the syntax tree's Let assignments whose target has a MemberAccessOperationSemanticFlags.DefaultMember access without ArgumentList, of a member the target does not name |
RDC00120 |
Implicit unbound default member access | Warning | the same facts as RDC00119, at an operand or a Let target declared Object |
RDC00121 |
Indexed default member access | Information | ProcedureSemanticModel.Runtime: the member accesses with MemberAccessOperationSemanticFlags.Implicit, DefaultMember and ArgumentList (an empty list included), and neither DictionaryAccess nor LateBound, read or assigned |
RDC00122 |
Indexed unbound default member access | Warning | the same, with LateBound |
RDC00123 |
Bang notation | Information | the member accesses with Implicit, DefaultMember and DictionaryAccess, and not LateBound |
RDC00124 |
Unbound bang notation | Warning | the same, with DictionaryAccess and LateBound |
RDC00125 |
Suspicious Let assignment | Warning | the syntax tree's Let assignments whose target is an object (a DefaultMember access, or declared Object) and whose value is the operand of a ConversionSemanticFlags.ObjectOperand conversion |
RDC00201 |
Integer data type declaration | Information | the syntax tree: AsTypeExpressionNode and the TypeHint of a declaration node, except in the header of a procedure whose DeclarationFact.Role is InterfaceImplementation or EventHandler |
RDC00202 |
Module-scope Dim declaration | Information | the syntax tree: a module-level variable with no access modifier |
RDC00203 |
Multiline parameter declaration | Information | the syntax tree: the range of a ParameterDeclarationNode |
RDC00204 |
Multiple declarations | Information | the syntax tree: the declarations one statement makes |
RDC00205 |
Misleading ByRef parameter | Information | the syntax tree: ParameterDeclarationNode.IsByRefIgnored |
RDC00206 |
Not all code paths return a value | Warning | ProcedureSemanticModel.ReturnValue, from the ControlFlowGraph of the procedure |
RDC00207 |
IsMissing that is always False | Warning | the syntax tree: an IsMissing call of one name, bound to the library's IsMissing (ExpressionFact.Binding, ValueExpressionSemanticFlags.BoundToLibrary); the ParameterDeclarationNode of the parameter the name is bound to (DeclarationFact.Location): no ParamArray, and either not a Variant (ExpressionFact.DeclaredType) or given a default value; any other name whose ExpressionFact.Classification is Constant, or Variable with a DeclaredType that is not Variant |
RDC00208 |
Shadowed declaration | Information | DeclarationFact.Hides, from the resolver: what the name of a local or a parameter means as seen from the module, and what the name of a declaration of the module would mean there without it |
RDC00209 |
Boolean assigned in If…Else | Information | the syntax tree: an IfBlockStatementNode whose Body and ElseBlock, or an InlineIfStatementNode whose ThenBody and ElseBody, each hold one Let-assignment of a Boolean literal to the same target (ExpressionEquivalence.AreEquivalent) |
RDC00210 |
Stop statement | Information | the syntax tree: a KeywordStatementNode of Stop |
RDC00211 |
On Error GoTo -1 | Hint | the syntax tree: an OnErrorGoToStatementNode whose label is the literal -1 |
RDC00212 |
Unrestored On Error Resume Next | Warning | the syntax tree: an OnErrorResumeStatementNode that no OnErrorGoToStatementNode to a label or 0 follows in its procedure, in the order they are written |
RDC00213 |
Line continuation between keywords | Information | the trivia of the parse: LineContinuationTriviaNode.Keyword |
RDC00214 |
Procedure can be written as a function | Information | the syntax tree: a Sub with one ByRef parameter that is no ParamArray; the host's reference counts of that parameter: written; not a Declare, an implementation, a handler, or a Public member of a class module |
RDC00215 |
Self-assigned declaration | Hint | the syntax tree: AsTypeExpressionNode.AsAutoObject of a variable declaration |
RDC00216 |
Function result discarded | Hint | ExpressionFactDto.Flags: ResultDiscarded without BoundToLibrary, on a call whose name is classified Function |
RDC00218 |
IsMissing of a Variant that is not Optional | Warning | the syntax tree: an IsMissing call of one name, bound to the library's IsMissing (ExpressionFact.Binding, ValueExpressionSemanticFlags.BoundToLibrary), whose ExpressionFact.DeclaredType is Variant: a parameter whose ParameterDeclarationNode (DeclarationFact.Location) is neither Optional nor a ParamArray, or any other name whose ExpressionFact.Classification is Variable |
RDC00302 |
Obsolete Call statement | Hint | ValueExpressionSemanticFlags.ExplicitCallKeyword |
RDC00303 |
Obsolete comment syntax | Information | ModuleSemanticModel.Language (SupportedLanguage.UsesClassicBasicSyntax), and the comments of the syntax tree |
RDC00304 |
Obsolete error syntax | Information | ModuleSemanticModel.Language, and the syntax tree: an Error statement |
RDC00305 |
Obsolete Global modifier | Information | the syntax tree: AccessModifier.Global |
RDC00306 |
Obsolete Let statement | Information | the syntax tree: AssignmentKind.ExplicitLet |
RDC00307 |
Obsolete type hint | Information | the syntax tree: the type hints of declarations; ExpressionFact.Binding of the references, bound to the project (no ValueExpressionSemanticFlags.BoundToLibrary) |
RDC00308 |
Obsolete While…Wend | Information | the syntax tree: a WhileWendStatementNode |
RDC00309 |
Obsolete On Local Error statement | Information | the syntax tree: OnErrorGoToStatementNode.IsLocal |
RDC00310 |
Redundant ByVal argument | Hint | the syntax tree: a ByVal argument with no compile error; its ArgumentFact: Mechanism ExplicitByVal, not a ParamArray, and a ParameterType other than the unknown type (As Any) |
RDC00311 |
Early binding opportunity | Information | ExpressionFact.Creates (ObjectClassSource.ReferencedLibrary) |
RDC00312 |
Empty string literal | Information | the syntax tree: a LiteralExpressionNode of a String, two characters long |
RDC00313 |
Redundant Step 1 | Information | the syntax tree: a StepExpression that is the Integer literal 1, when DiagnosticsOptions.ForStep is Implicit |
RDC00314 |
Redundant ByRef modifier | Information | the syntax tree: ParameterKind.ExplicitByRef, when DiagnosticsOptions.ByRefModifier is Implicit; DeclarationFact.Role leaves out implementations and event handlers |
RDC00315 |
Redundant module option | Information | the syntax tree: a ModuleOptionDirectiveNode of Option Base 0 or Option Compare Binary |
RDC00405 |
Implementations should be private | Information | DeclarationFact.Role and DeclarationFact.Access |
RDC00407 |
Unmatched event handler | Hint | DeclarationFact.Role (DeclarationRole.UnmatchedEventHandler) and DeclarationFact.References |
RDC00408 |
Underscore in a public class member | Warning | ModuleSemanticModel.Declarations of a class module: a public procedure, property or variable of the module named with _, whose DeclarationFact.Role is None, and that the syntax tree declares |
RDC00409 |
Public field | Information | ModuleSemanticsDto.Class (a class module), and the syntax tree: a module-level variable declared Public |
RDC00410 |
Default instance in its own class | Warning | ModuleSemanticsDto.Class (ClassModuleSemanticFlags.DefaultInstance), and ExpressionFactDto.Binding: a name bound to the default instance variable the global scope declares for the class |
RDC00411 |
Code in a class implemented as an interface | Warning | ModuleSemanticsDto.Class (ClassModuleSemanticFlags.Implemented, which the host sets for a class that the Implements directive of a module of the project names), and the syntax tree: the first procedure of the class with code (a statement, or a Dim, Static or Const) |
RDC01001 |
Use meaningful identifier names | Information | the names the syntax tree declares, and the allow-list in DiagnosticsOptions.MeaningfulNames |
RDC01002 |
Hungarian notation | Information | the names the syntax tree declares, and the allow-list in DiagnosticsOptions.HungarianNotation |
RDC01003 |
Empty If block | Information | the syntax tree: the Body of an IfBlockStatementNode or an ElseIfBlockStatementNode, the ThenBody of an InlineIfStatementNode, with no StatementNode |
RDC01004 |
Empty code block | Information | the syntax tree: the block of an ElseBlockStatementNode, a CaseExpressionStatementNode, a Do loop, a ForStatementNode, a ForEachStatementNode or a WhileWendStatementNode, with no StatementNode |
RDC01005 |
Hosted document code | Error | the host's DocumentModuleFact of a document module whose code presumes its host, with the bindings of its expressions and its procedures named as the host's event handlers; and the module's DocumentModules, with each use of one of those names that refers to nothing or to the variable it implicitly declares, which it reports in place of Variable not defined |
RDC01006 |
Unsupported document module | Error | the host's DocumentModuleFact, which names no host class; or a .doccls document that has none |
RDC01007 |
Host library not referenced | Error | the host's DocumentModuleFact, whose host class the project's references do not have |
RDC01009 |
Empty procedure | Information | the syntax tree: a procedure with no StatementNode; ModuleSemanticModel.Class and Document, and in a class module MemberDeclarationNode.AccessModifier and DeclarationFact.Role (a Public member with no role may be a member of an interface) |
RDC01010 |
Empty module | Information | the syntax tree: no declaration, Implements or statement; ModuleSemanticModel.Document, and ModuleParseResult.Designer or a designer's Begin in the module header |
RDC01011 |
Variable not used | Information | the host's reference counts of a local or Private variable: no read, no argument; not a WithEvents variable, not a loop's control variable |
RDC01012 |
Variable not assigned | Warning | the host's reference counts of a local or Private variable: read, never written, and passed to no call that may assign it (a procedure of the module is followed); not a dynamic array (a fixed-size one is judged: an element write counts as a write), a variable a ReDim target is bound to (by name when it is bound to nothing), a WithEvents variable, a class or a user-defined type (an Object variable is judged) |
RDC01013 |
Parameter not used | Information | the host's reference counts of a parameter: none; not of a Declare, an Event, an implementation, a handler, or a Public member of a class module |
RDC01014 |
Assigned ByVal parameter | Information | the host's reference counts of a ByVal parameter (or the value parameter of a Property Let/Set): written |
RDC01015 |
Constant not used | Information | the host's reference counts of a constant: no read, no argument; a Public constant that other projects can use has no count |
RDC01016 |
Line label not used | Information | the syntax tree: a LineLabelNode that no GoTo, GoSub, Resume or On Error GoTo of its procedure names; line numbers are not reported |
RDC01017 |
Write-only property | Information | the syntax tree: a Public, Global or implicitly public Property Let/Set with no Property Get of its name; once per name |
RDC01018 |
Keyword used as a member name | Information | the names the syntax tree declares: an Enum member or a member of a user-defined type that VBIdentifier.IsReserved, in brackets or not; a name RDC11033 or RDC11034 reports is left to them |
RDC11005 |
Bitwise operator | Hint | ProcedureSemanticModel.Runtime: LogicalOperatorSemanticFlags.IsBitwiseSemantics of the LogicalOperatorFacts |
RDC11006 |
Ambiguous concatenation | Information | ProcedureSemanticModel.Runtime: ArithmeticOperatorSemanticFlags.VBStringEffectiveType of the ArithmeticOperatorFacts of + |
RDC11011 |
Variant number compared with a Variant String | Warning | ProcedureSemanticModel.Runtime: ComparisonOperatorSemanticFlags.IsVariantStringNumericException of the ComparisonOperatorFacts |
RDC11012 |
Set of a call that always fails | Error | the syntax tree's Set statements: a target that calls a function, or a property with a Property Get and no Property Set (ExpressionFact.Accessors), outside its own body, whose TypeKind is Class, not an array, of a class whose default member has no Property Set (ExpressionFact.DefaultMember); on a line where ProcedureSemanticModel.Runtime does not already report the error 438 |
RDC11013 |
Variant compared with a String as text | Warning | ProcedureSemanticModel.Runtime: ComparisonOperatorSemanticFlags.IsVariantComparedWithStringAsText of the ComparisonOperatorFacts |
RDC11014 |
Case Is compared in the selector's type | Warning | ProcedureSemanticModel.Runtime: CaseClauseSemanticFlags.ComparisonForm of the CaseClauseStatementFacts, where ComparedIn is not SpecifiedEffectiveType |
RDC11015 |
Object with no default member used as a value | Warning | the ExpressionFacts that are IsLetCoerced, whose TypeKind is Class, not an array, with no DefaultMember |
RDC11016 |
Empty or Null assigned to an array | Warning | the syntax tree's Let assignments to a target whose ExpressionFact.IsArray, and the ArgumentFacts of a parameter declared an array, not a ParamArray, not IsExternal: a value whose ExpressionFact.DeclaredType is Empty or Null |
RDC11017 |
Like pattern MS-VBA matches otherwise than specified | Warning | ProcedureSemanticModel.Runtime: ComparisonOperatorSemanticFlags.LikePatternHasEmptyCharList and LikePatternIsInvalid of the ComparisonOperatorFacts |
RDC11018 |
Integer arithmetic of Abs, Int or Fix that can overflow | Warning | the syntax tree: a +, - or * whose ExpressionFact.DeclaredType is Byte, Integer or Long, an operand of which is a call of one argument bound to the library's Abs, Int or Fix (ValueExpressionSemanticFlags.BoundToLibrary), and the argument is declared a number |
RDC11019 |
Type character ignored on a function of the library | Warning | the syntax tree: a reserved name written with a type character, bound to what a library declares under the name without it (ValueExpressionSemanticFlags.BoundToLibrary), whose ExpressionFact.DeclaredType is not the character's type |
RDC11020 |
Variant String that is no number, compared with a number | Warning | ProcedureSemanticModel.Runtime: ComparisonOperatorSemanticFlags.IsVariantStringThatIsNoValueRanked of the ComparisonOperatorFacts |
RDC11021 |
Constant of a procedure valued with Len | Warning | the syntax tree: a Const of a procedure whose value calls Len |
RDC11022 |
ReDim of a variable declared implicitly | Warning | the syntax tree's ReDim statements, and ModuleSemanticModel.Declarations: a local whose DeclarationFact.DeclaredBy is Implicit, used before the ReDim |
RDC11023 |
Procedure MS-VBA refuses as too large | Warning | the syntax tree: the statements of a procedure |
RDC11024 |
Implements in a document module | Warning | the host's DocumentModuleFact, and the module's Implements directives |
RDC11025 |
Array given a second empty argument list | Warning | the syntax tree: an empty argument list given to an expression that has one, whose ExpressionFact.DeclaredType is an array |
RDC11026 |
Public variable of an object passed ByRef as a copy | Warning | its ArgumentFact: Mechanism by reference or a ParamArray, not IsLibrary; the syntax tree: a member access whose owner (or With target) has the TypeKind Class, classified as a variable, or an element of one whose TypeKind is Variant |
RDC11027 |
String compared with a number as a Double | Warning | ProcedureSemanticModel.Runtime: the ComparisonOperatorFacts of Double effective type whose StringOperand has another SpecifiedEffectiveType, where its two Let-coerced values, or the errors they raise, can answer otherwise |
RDC11028 |
New of a class that is never created | Warning | ModuleSemanticModel.Classes: a ClassFact that is not IsRegistered; the syntax tree's New expressions, by the Binding of their ExpressionFacts; ModuleSemanticModel.Declarations: DeclarationFact.AutoInstantiates |
RDC11029 |
Public variable of an object passed late as a copy | Hint | the syntax tree: a call of a member whose owner (or With target) has the TypeKind Object or Variant; each argument judged as for RDC11026 |
RDC11031 |
True value that is not -1 | Warning | the syntax tree's conditions, with the ConstantValue and the declared type of each operand's ExpressionFact (TruthValueOperations); the syntax tree's precompiler trivia for #If, #ElseIf and #Const, with the module's own #Const values and the predefined constants, 1 or 0 (PredefinedConditionalConstants) |
RDC11032 |
For Each variable read after the loop ran out | Warning | ProcedureSemanticModel.EmptiedControlReads: the EmptiedControlReadFacts ForEachControlAnalysis finds on the ControlFlowGraph |
RDC11033 |
Reserved name that MS-VBA accepts | Warning | the names the syntax tree declares: an Enum member named Date, DoEvents or CDec, not in brackets |
RDC11034 |
Name that MS-VBA refuses | Warning | the names the syntax tree declares outside brackets: Local, or a reserved type identifier other than Date and String, except as a member of a user-defined type; Me as a member of one; Name as an Enum member |
RDC11035 |
Collection set to Nothing inside its own For Each loop | Warning | the syntax tree: a Set to Nothing of the variable a For Each walks, inside the loop, whose target has an ExpressionFact |
RDC11036 |
Negative line number | Warning | the syntax tree: a LineNumberNode below 0, or a jump whose label is a negated literal (On Error GoTo -1 aside) |
RDC11037 |
Non-breaking space in a name | Warning | the syntax tree: the name of a declaration or a line label, or the module's VB_Name attribute value, with a U+00A0 |
RDC11039 |
Function called whatever the IIf condition | Warning | the syntax tree (the TruePart and FalsePart arguments of a call bound to Interaction.IIf) and ExpressionFactDto: a ProcedureCall of a Function or Property Get, bound to anything but a VBA library function that changes nothing and raises no error; or an UnboundMember member access (. or !) |
RDC11040 |
Str of a number between -1 and 1 | Warning | ProcedureSemanticModel.Expressions: a call whose callee is bound to Conversion.Str or Conversion.Str$, with the declared type of its argument (Single, Double, Currency, Decimal, Variant), or the value of a literal |
RDC11041 |
Str of an Error value | Warning | ProcedureSemanticModel.Expressions: a call whose callee is bound to Conversion.Str or Conversion.Str$, given a call bound to Conversion.CVErr |
RDC11042 |
Write # of a number between -1 and 1 | Warning | The syntax tree's PrintStatementNodes of Write, with the declared type of each item (Single, Double, Currency, Decimal, Variant) in ProcedureSemanticModel.Expressions, or the value of a literal |
RDC11043 |
Object assigned with Let to a Variant property | Warning | the syntax tree's Let assignments and ExpressionFactDto: the property the target names, bound outside the procedure the Let is in, with a LetValueTypeKind of Variant; and the value's: a TypeKind of Class or Object, not an array |
RDC11044 |
LSet of a record that holds a variable-length String | Warning | ProcedureSemanticModel.Runtime: FixedAssignmentSemanticFlags.SourceHoldsVariableLengthString or DestinationHoldsVariableLengthString of a UserDefinedTypeCopy |
RDC11045 |
Let through a default member with no Property Let | Warning | the syntax tree's Let assignments to a name, a member access or Me with no argument list, and the target's ExpressionFact: TypeKind Class, not an array, a DefaultMember that is a function or a Property Get with no Property Let and no required parameter, and a target that is not a property with a Property Let of its own (Accessors) |
RDC11046 |
Let through a Variant property or function | Warning | the syntax tree's Let assignments, and the ExpressionFact of the target's callee: a function, or a property with a Property Get and no Property Let (Accessors), declared Variant, and bound to a member other than the procedure the Let is in |
RDC11047 |
Object assigned with Let to an object property | Warning | the syntax tree's Let assignments and ExpressionFactDto: the property the target names, bound outside the procedure the Let is in, with a LetValueTypeKind of Class or Object; and the value's: a TypeKind of Class or Object, not an array |
RDC20001 |
Edit not applied to the waiting program | Information | the language server, while a program waits: the host's rdcore/host/debug/editStatus |
RDC30001 |
No entry point | Error | rdc run and rdc build, on standard error: ProgramEntryPoint.Of resolves none (NotFound, Library) |
RDC30002 |
More than one entry point | Error | rdc run and rdc build, on standard error: ProgramEntryPoint.Of resolves several (Ambiguous, its Candidates named) |
What the host's static pass found wrong with the code is not an opinion: it is reported as the VBC compile error it is, by the same
extension, from the same model. Likewise, a run-time error that evaluating the code finds an instruction raises whenever it runs (RuntimeFacts.Errors) is reported
in the runtime phase as the VBR error it is, where the instruction is, with the severity of an error: n = 5678 into a Byte is
VBR00006 before the program runs. An error the code raises for itself (Error, Err.Raise) is a fact an analyzer may read, and is not
reported; see RD-VBAL §2.6.3 Runtime Errors.
Runtime facts
What an analyzer of the runtime phase reads is ProcedureSemanticModel.Runtime (RuntimeFacts), which travels
as RuntimeFactsDto. Every fact is stated by the runtime semantics themselves, as they evaluate each
instruction of the procedure once (the sweep), and only when it is true of the code however the procedure is called:
| Facts | What they say | Flags |
|---|---|---|
Conversions (ConversionFact) |
every let-coercion the code asks for, its site and operand | ConversionSemanticFlags |
Operations (OperatorFact) |
every operation of an operator, with its effective type; a comparison says how String values compare (Option Compare) |
ArithmeticOperatorSemanticFlags, ConcatOperationSemanticFlags, ComparisonOperatorSemanticFlags, LogicalOperatorSemanticFlags |
Operations (MemberAccessFact) |
every member the code accesses: named (a.b, .b), a dictionary access (a!b), the default member of an indexed object, the enumeration member a For Each uses, and the member an assignment writes |
MemberAccessOperationSemanticFlags |
Statements (StatementFact) |
what an LSet, RSet or With statement is |
FixedAssignmentSemanticFlags, WithStatementSemanticFlags |
Errors |
every run-time error an instruction raises whenever it runs | - |
An error is stated only when nothing the instruction did was assumed: the value of a variable or a parameter, what a procedure that is not called returns, the
state of the standard library or of the outside world (files, Rnd, CreateObject), or what another instruction left behind (a loop's counter, a With block's
target). Dim c As Collection: c.Add 1 raises error 91 when it runs, but the sweep does not follow paths and cannot tell that nothing set c, so it says nothing.
The bounds of a fixed-size array are not assumed: they are its declaration's, whatever it holds. Dim a(5) As Long: a(6) = 1 is error 9 whenever it runs, and
is stated; what an element holds is assumed, so x = 1 \ a(1) says nothing.
MemberAccessOperationSemanticFlags.CallByNameAccess is not stated yet: a CallByName call is a call of the library, which the sweep does not look into.
Language Core Conditions and Analyzer Opinions
The VBC, VBR and VBA diagnostic families describe conditions the language core defines. RDC diagnostics are opinions of the analyzer.
Shadowing of VBA library definitions should be detected in the semantic layer and reported through semantic flags, so that RDCore.Diagnostics can issue shadowed declaration diagnostics; see RD-VBAL §2.3.1.3 Name Resolution and RD-VBAL §1.1.3 Core Semantic Flags.
Extension Diagnostics
Extension point: diagnostics contributed by other extensions must use their own prefix, distinct from RDC, so that codes stay unique and traceable to their source. The RDX00000 format and third-party prefixes are specified in RD-VBAL §1.1.4 Core Diagnostics.