Class VmTypeException
Represents errors that occur when type checking fails in the virtual machine.
Implements
Inherited Members
Namespace: VM.Core.Instructions
Assembly: VM.dll
Syntax
public class VmTypeException : VmException, ISerializable
Constructors
VmTypeException(string, int, int)
Initializes a new instance of the VmTypeException class with a custom message.
Declaration
public VmTypeException(string message, int line = -1, int ip = -1)
Parameters
Type | Name | Description |
---|---|---|
string | message | The error message that explains the reason for the exception. |
int | line | The source line number where the error occurred (-1 if unknown). |
int | ip | The instruction pointer value when the error occurred (-1 if unknown). |
VmTypeException(VmType, VmType, int, int)
Initializes a new instance of the VmTypeException class with the actual and expected types.
Declaration
public VmTypeException(VmType actual, VmType expected, int line = -1, int ip = -1)
Parameters
Type | Name | Description |
---|---|---|
VmType | actual | The actual type encountered. |
VmType | expected | The expected type. |
int | line | The source line number where the error occurred (-1 if unknown). |
int | ip | The instruction pointer value when the error occurred (-1 if unknown). |
Properties
ActualType
Gets the actual type encountered during execution.
Declaration
public VmType ActualType { get; }
Property Value
Type | Description |
---|---|
VmType |
ExpectedType
Gets the expected type that should have been encountered.
Declaration
public VmType ExpectedType { get; }
Property Value
Type | Description |
---|---|
VmType |