Class ConversionPlan
What a let-coercion does, decided from the type of the value and the type it is let-coerced to - before, and apart from, the value itself (IR lowering §3.2).
public sealed record ConversionPlan : IEquatable<ConversionPlan>
- Inheritance
-
ConversionPlan
- Implements
- Inherited Members
Remarks
A plan is the value-independent half of a let-coercion: the rule of MS-VBAL §5.5.1.2 that applies, or that none does. The other half, the conversion of a value by that rule - which may overflow, fail to read a number from a string, or ask an object for its default member - is the runtime's.
Like an OperationPlan, a plan made for the value type of the source - the type of what a Variant holds - is final, and a plan made
for a source declared Variant is IsDeferred: the value it will hold decides.
Constructors
ConversionPlan(VBType, VBType, ConversionRule, bool)
What a let-coercion does, decided from the type of the value and the type it is let-coerced to - before, and apart from, the value itself (IR lowering §3.2).
public ConversionPlan(VBType Source, VBType Destination, ConversionRule Rule, bool IsDeferred = false)
Parameters
SourceVBTypeThe type the plan was made for: the value type of the source, or the type a deferred plan's source is declared as.
DestinationVBTypeThe type the value is let-coerced to: the destination's declared type, but for an Enum, whose values are
Long(§5.2.3.4), andLongPtr, an alias ofLongLongin a 64-bit environment and ofLongin a 32-bit one (§2.2).RuleConversionRuleThe rule that applies, None when none does or the plan is deferred.
IsDeferredboolWhether the plan depends on the value a source declared
Variantholds, and is made at run time.
Remarks
A plan is the value-independent half of a let-coercion: the rule of MS-VBAL §5.5.1.2 that applies, or that none does. The other half, the conversion of a value by that rule - which may overflow, fail to read a number from a string, or ask an object for its default member - is the runtime's.
Like an OperationPlan, a plan made for the value type of the source - the type of what a Variant holds - is final, and a plan made
for a source declared Variant is IsDeferred: the value it will hold decides.
Properties
Destination
The type the value is let-coerced to: the destination's declared type, but for an Enum, whose values are Long (§5.2.3.4), and
LongPtr, an alias of LongLong in a 64-bit environment and of Long in a 32-bit one (§2.2).
public VBType Destination { get; init; }
Property Value
IsBySource
Whether the rule is the source's - an object, Null, Empty or an Error - rather than the destination's.
public bool IsBySource { get; }
Property Value
IsDeferred
Whether the plan depends on the value a source declared Variant holds, and is made at run time.
public bool IsDeferred { get; init; }
Property Value
IsTypeMismatch
Whether no rule applies: run-time error 13, Type mismatch.
public bool IsTypeMismatch { get; }
Property Value
Rule
The rule that applies, None when none does or the plan is deferred.
public ConversionRule Rule { get; init; }
Property Value
Source
The type the plan was made for: the value type of the source, or the type a deferred plan's source is declared as.
public VBType Source { get; init; }