Struct StaticSemanticsEvaluationResult
Represents the result of the evaluation of any static semantics.
public readonly record struct StaticSemanticsEvaluationResult : IEquatable<StaticSemanticsEvaluationResult>
- Implements
- Inherited Members
Constructors
StaticSemanticsEvaluationResult(VBType?, VBCompileErrorInfo?)
Represents the result of the evaluation of any static semantics.
public StaticSemanticsEvaluationResult(VBType? Result, VBCompileErrorInfo? ErrorInfo)
Parameters
ResultVBTypeThe result of the static evaluation, if one was produced.
ErrorInfoVBCompileErrorInfoThe error metadata for the compile-time error to be reported, if applicable.
Properties
ErrorInfo
The error metadata for the compile-time error to be reported, if applicable.
public VBCompileErrorInfo? 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 the program module is invalid due to a specific compilation 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 static evaluation, if one was produced.
public VBType? Result { get; init; }
Property Value
Methods
Error(VBCompileErrorInfo)
Creates a new (failed) StaticSemanticsEvaluationResult with the specified VBCompileErrorInfo error information metadata.
public static StaticSemanticsEvaluationResult Error(VBCompileErrorInfo error)
Parameters
errorVBCompileErrorInfoThe compile-time error metadata describing the evaluation failure.
Returns
Remarks
❌ Use this method only to signal a failed expression evaluation.
Success(VBType)
Creates a new (successful) StaticSemanticsEvaluationResult with the specified evaluation result.
public static StaticSemanticsEvaluationResult Success(VBType result)
Parameters
resultVBTypeThe successfully evaluated static semantics evaluation result.
Returns
Remarks
✅ Use this method only to signal a successully evaluated expression result.