Table of Contents

Class ConversionPlan

Namespace
RDCore.SDK.Semantics.Plans
Assembly
RDCore.SDK.dll

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

Source VBType

The type the plan was made for: the value type of the source, or the type a deferred plan's source is declared as.

Destination VBType

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).

Rule ConversionRule

The rule that applies, None when none does or the plan is deferred.

IsDeferred bool

Whether the plan depends on the value a source declared Variant holds, 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

VBType

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

bool

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

bool

IsTypeMismatch

Whether no rule applies: run-time error 13, Type mismatch.

public bool IsTypeMismatch { get; }

Property Value

bool

Rule

The rule that applies, None when none does or the plan is deferred.

public ConversionRule Rule { get; init; }

Property Value

ConversionRule

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; }

Property Value

VBType