Table of Contents

Struct LetCoercionResult

Namespace
RDCore.SDK.Runtime.Shared
Assembly
RDCore.SDK.dll

Represents the result of a let-coercion (implicit type conversion) semantic operation.

public readonly record struct LetCoercionResult : IEquatable<LetCoercionResult>
Implements
Inherited Members

Constructors

LetCoercionResult(bool, VBTypedValue?, VBRuntimeErrorInfo?, ImmutableArray<LetCoercionStackFrame>)

Represents the result of a let-coercion (implicit type conversion) semantic operation.

public LetCoercionResult(bool IsApplicable, VBTypedValue? Result, VBRuntimeErrorInfo? ErrorInfo, ImmutableArray<LetCoercionStackFrame> Frames)

Parameters

IsApplicable bool

true if the let-coercion strategy is applicable for the specified inputs, false otherwise (another implementation shall then handle the conversion).

Result VBTypedValue

The let-coerced result of the conversion operation, if one was produced.

ErrorInfo VBRuntimeErrorInfo

The error metadata for the run-time error to be reported, if applicable.

Frames ImmutableArray<LetCoercionStackFrame>

The let-coercion evaluation frames associated with this result, if any.

Properties

ErrorInfo

The error metadata for the run-time error to be reported, if applicable.

public VBRuntimeErrorInfo? ErrorInfo { get; init; }

Property Value

VBRuntimeErrorInfo

Frame

Gets the current (top-most) frame in the evaluation stack.

public LetCoercionStackFrame Frame { get; }

Property Value

LetCoercionStackFrame

Frames

The let-coercion evaluation frames associated with this result, if any.

public ImmutableArray<LetCoercionStackFrame> Frames { get; init; }

Property Value

ImmutableArray<LetCoercionStackFrame>

IsApplicable

true if the let-coercion strategy is applicable for the specified inputs, false otherwise (another implementation shall then handle the conversion).

public bool IsApplicable { get; init; }

Property Value

bool

IsSuccess

true if the let-coercion semantic operation was successfully completed.

public bool IsSuccess { get; }

Property Value

bool

Result

The let-coerced result of the conversion operation, if one was produced.

public VBTypedValue? Result { get; init; }

Property Value

VBTypedValue

Methods

Error(VBRuntimeErrorInfo, params LetCoercionStackFrame[])

Creates a new (failed) LetCoercionResult with the specified VBRuntimeErrorInfo error information metadata.

public static LetCoercionResult Error(VBRuntimeErrorInfo info, params LetCoercionStackFrame[] frames)

Parameters

info VBRuntimeErrorInfo

The runtime error metadata describing the let-coercion failure.

frames LetCoercionStackFrame[]

All the LetCoercionStackFrame frames in the let-coercion evaluation stack.

Returns

LetCoercionResult

NotApplicable(LetCoercionStackFrame)

Creates a new (not applicable) LetCoercionResult indicating that a let-coercion strategy is not applicable in the context of the evaluated expression.

public static LetCoercionResult NotApplicable(LetCoercionStackFrame frame)

Parameters

frame LetCoercionStackFrame

Returns

LetCoercionResult

Success(VBTypedValue, params LetCoercionStackFrame[])

Creates a new (successful) LetCoercionResult with the specified result value.

public static LetCoercionResult Success(VBTypedValue result, params LetCoercionStackFrame[] frames)

Parameters

result VBTypedValue

The successfully let-coerced result value.

frames LetCoercionStackFrame[]

Returns

LetCoercionResult

WithFrame(LetCoercionStackFrame)

Gets a copy of this let-coercion result, with the specified LetCoercionStackFrame appended to the Frames array.

public LetCoercionResult WithFrame(LetCoercionStackFrame frame)

Parameters

frame LetCoercionStackFrame

The let-coercion evaluation stack frame to append to the new result.

Returns

LetCoercionResult