Table of Contents

Struct RuntimeSemanticsEvaluationResult

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

Represents the result of the evaluation of any runtime semantics.

public readonly record struct RuntimeSemanticsEvaluationResult : IRuntimeSemanticsEvaluationResult, IEquatable<RuntimeSemanticsEvaluationResult>
Implements
Inherited Members

Constructors

RuntimeSemanticsEvaluationResult(VBTypedValue?, IVBRaisableError?)

Represents the result of the evaluation of any runtime semantics.

public RuntimeSemanticsEvaluationResult(VBTypedValue? Result, IVBRaisableError? ErrorInfo)

Parameters

Result VBTypedValue

The result of the evaluation, if one was produced.

ErrorInfo IVBRaisableError

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

Properties

ErrorInfo

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

public IVBRaisableError? ErrorInfo { get; init; }

Property Value

IVBRaisableError

IsError

true if the evaluation semantically yields a runtime error.

public bool IsError { get; }

Property Value

bool

Remarks

👉 This value represents a specified, consistent state where program execution resumes in a controlled error state.
A result value may or may not have been assigned before the failure: most errors carry none, which is why this asks only whether there is an error. It used to require a value too, and so answered false for every error raised without one - which is what Error(VBRuntimeErrorInfo, VBTypedValue?)'s own default produces.

IsInternalError

true if an evaluation strategy could not be determined.

public bool IsInternalError { get; }

Property Value

bool

Remarks

⚠️ This value represents an unspecified, inconsistent internal state that is ultimately surfaced as an InternalError run-time error.

IsSuccess

true if the evaluation was successfully completed.

public bool IsSuccess { get; }

Property Value

bool

Remarks

✅ This value represents a normally completed, successful evaluation.

Result

The result of the evaluation, if one was produced.

public VBTypedValue? Result { get; init; }

Property Value

VBTypedValue

Methods

Error(IVBRaisableError, VBTypedValue?)

Creates a new (failed) RuntimeSemanticsEvaluationResult with the specified IVBRaisableError error information metadata.

public static RuntimeSemanticsEvaluationResult Error(IVBRaisableError error, VBTypedValue? result = null)

Parameters

error IVBRaisableError

The runtime error metadata describing the evaluation failure.

result VBTypedValue

Returns

RuntimeSemanticsEvaluationResult

Remarks

❌ Use this method only to signal a failed expression evaluation. A result value may still have been assigned.

InternalError()

Creates a new RuntimeSemanticsEvalutationResult without a result, and without any IVBRaisableError error metadata.

public static RuntimeSemanticsEvaluationResult InternalError()

Returns

RuntimeSemanticsEvaluationResult

Remarks

💥 This results signals a InternalError run-time error to the evaluation pipeline. Use it only as a fallback result, when no result can be evaluated for a given effective type.

Success(VBTypedValue)

Creates a new (successful) RuntimeSemanticsEvaluationResult with the specified evaluation result.

public static RuntimeSemanticsEvaluationResult Success(VBTypedValue result)

Parameters

result VBTypedValue

The successfully evaluated runtime semantics evaluation result.

Returns

RuntimeSemanticsEvaluationResult

Remarks

✅ Use this method only to signal a successully evaluated expression result.