Class BoundArgument
The argument a call gives one parameter of the procedure it calls, bound (MS-VBAL §5.3.1.11): which of the arguments written at the call it is, and how it is passed - decided once, from the declarations and the arguments as they are written, rather than each time the call is made.
public sealed record BoundArgument : IEquatable<BoundArgument>
- Inheritance
-
BoundArgument
- Implements
- Inherited Members
Remarks
What only the call can decide stays the call's: whether a variable given to a ByRef parameter is of its declared type (an element type, a field of an
object only known at run time), what a Variant argument holds, an error the argument raises.
Constructors
BoundArgument(VBParameterSymbol, ArgumentPassing, ExpressionNode?, BoundNode?, ConversionPlan?, ImmutableArray<BoundNode>)
The argument a call gives one parameter of the procedure it calls, bound (MS-VBAL §5.3.1.11): which of the arguments written at the call it is, and how it is passed - decided once, from the declarations and the arguments as they are written, rather than each time the call is made.
public BoundArgument(VBParameterSymbol Parameter, ArgumentPassing Passing, ExpressionNode? Expression, BoundNode? Value, ConversionPlan? Plan, ImmutableArray<BoundNode> Elements)
Parameters
ParameterVBParameterSymbolThe parameter.
PassingArgumentPassingHow the argument is passed.
ExpressionExpressionNodeThe argument as it is written - the value of a named argument; null for one that is Omitted or ParamArray.
ValueBoundNodeThe argument, bound; null when there is no
Expression.PlanConversionPlanHow an argument passed by Value is let-coerced to the parameter's declared type, made for the argument's declared type - deferred when it is a
Variant; null when the argument has no declared type, and for any other passing.ElementsImmutableArray<BoundNode>The arguments a ParamArray collects, bound; empty for any other passing.
Remarks
What only the call can decide stays the call's: whether a variable given to a ByRef parameter is of its declared type (an element type, a field of an
object only known at run time), what a Variant argument holds, an error the argument raises.
Properties
Elements
The arguments a ParamArray collects, bound; empty for any other passing.
public ImmutableArray<BoundNode> Elements { get; init; }
Property Value
Expression
The argument as it is written - the value of a named argument; null for one that is Omitted or ParamArray.
public ExpressionNode? Expression { get; init; }
Property Value
Parameter
The parameter.
public VBParameterSymbol Parameter { get; init; }
Property Value
Passing
How the argument is passed.
public ArgumentPassing Passing { get; init; }
Property Value
Plan
How an argument passed by Value is let-coerced to the parameter's declared type, made for the argument's declared
type - deferred when it is a Variant; null when the argument has no declared type, and for any other passing.
public ConversionPlan? Plan { get; init; }
Property Value
Value
The argument, bound; null when there is no Expression.
public BoundNode? Value { get; init; }
Property Value
Methods
IsByRef(VBParameterSymbol)
Whether the parameter is declared to be passed by reference: ByRef, said or not (MS-VBAL §5.3.1.5).
public static bool IsByRef(VBParameterSymbol parameter)
Parameters
parameterVBParameterSymbol