Class ReturnValueFact
What the semantic analysis pass found out about the return value of a function or a property getter: whether the code assigns it (the function result variable, MS-VBAL §5.3.1).
public sealed record ReturnValueFact : IEquatable<ReturnValueFact>
- Inheritance
-
ReturnValueFact
- Implements
- Inherited Members
Remarks
A function whose return value is not assigned on a code path returns the default value of its declared type on it: 0, an empty string, Empty for a
Variant, Nothing for an object. Whether that is a mistake is for an analyzer to say. The fact is stated only for a procedure whose code paths the
pass could tell exactly (ReturnValueAnalysis), and is null on the model of the others.
Constructors
ReturnValueFact(ReturnValueAssignment, string, SourceLocation, bool)
What the semantic analysis pass found out about the return value of a function or a property getter: whether the code assigns it (the function result variable, MS-VBAL §5.3.1).
public ReturnValueFact(ReturnValueAssignment Assignment, string Name, SourceLocation Location, bool IsEmpty)
Parameters
AssignmentReturnValueAssignmentOn how many code paths the return value is assigned.
NamestringThe name of the procedure.
LocationSourceLocationWhere the name of the procedure is written.
IsEmptyboolWhether the body has no statement: such a procedure declares what it is called with and does nothing, which is how a member of an interface is written.
Remarks
A function whose return value is not assigned on a code path returns the default value of its declared type on it: 0, an empty string, Empty for a
Variant, Nothing for an object. Whether that is a mistake is for an analyzer to say. The fact is stated only for a procedure whose code paths the
pass could tell exactly (ReturnValueAnalysis), and is null on the model of the others.
Properties
Assignment
On how many code paths the return value is assigned.
public ReturnValueAssignment Assignment { get; init; }
Property Value
IsEmpty
Whether the body has no statement: such a procedure declares what it is called with and does nothing, which is how a member of an interface is written.
public bool IsEmpty { get; init; }
Property Value
Location
Where the name of the procedure is written.
public SourceLocation Location { get; init; }
Property Value
Name
The name of the procedure.
public string Name { get; init; }