Struct RuntimeSemanticsEvaluationResult
Represents the result of the evaluation of any runtime semantics.
public readonly record struct RuntimeSemanticsEvaluationResult : IEquatable<RuntimeSemanticsEvaluationResult>
- Implements
- Inherited Members
Constructors
RuntimeSemanticsEvaluationResult(VBTypedValue?, VBRuntimeErrorInfo?)
Represents the result of the evaluation of any runtime semantics.
public RuntimeSemanticsEvaluationResult(VBTypedValue? Result, VBRuntimeErrorInfo? ErrorInfo)
Parameters
ResultVBTypedValueThe result of the evaluation, if one was produced.
ErrorInfoVBRuntimeErrorInfoThe 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 VBRuntimeErrorInfo? ErrorInfo { get; init; }
Property Value
IsError
true if the evaluation semantically yields a runtime error.
public bool IsError { get; }
Property Value
Remarks
👉 This value represents a specified, consistent state where program execution resumes in a controlled error state.
IsInternalError
true if an evaluation strategy could not be determined.
public bool IsInternalError { get; }
Property Value
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
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
Methods
Error(VBRuntimeErrorInfo, VBTypedValue?)
Creates a new (failed) RuntimeSemanticsEvaluationResult with the specified VBRuntimeErrorInfo error information metadata.
public static RuntimeSemanticsEvaluationResult Error(VBRuntimeErrorInfo error, VBTypedValue? result = null)
Parameters
errorVBRuntimeErrorInfoThe runtime error metadata describing the evaluation failure.
resultVBTypedValue
Returns
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 VBRuntimeErrorInfo error metadata.
public static RuntimeSemanticsEvaluationResult InternalError()
Returns
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
resultVBTypedValueThe successfully evaluated runtime semantics evaluation result.
Returns
Remarks
✅ Use this method only to signal a successully evaluated expression result.