class TypeError: LogicError
Fields
Constructors
<init>
constructor(message: String?, cause: Throwable?, context: ExecutionContext, expectedType: Expected, culprit: Term, extraData: Term?)
Parameters
Name | Description |
---|---|
message: String?
|
|
cause: Throwable?
|
|
context: ExecutionContext
|
|
expectedType: Expected
|
|
culprit: Term
|
|
extraData: Term?
|
<init>
constructor(message: String?, cause: Throwable?, contexts: Array<ExecutionContext>, expectedType: Expected, culprit: Term, extraData: Term?)
The type error occurs when something is not of Expected type
Parameters
Name | Description |
---|---|
message: String?
|
the detail message string. |
cause: Throwable?
|
the cause of this exception. |
contexts: Array<ExecutionContext>
|
a stack of contexts localising the exception |
expectedType: Expected
|
The type expected, that wouldn't have raised the error |
culprit: Term
|
The value not respecting expectedType |
extraData: Term?
|
The possible extra data to be carried with the error |
Methods
updateContext
fun updateContext(newContext: ExecutionContext, index: Int): TypeError
Creates a new exception instance with the context with in position index updated to newContext. Subclasses should override this method and return the correct instance.
Parameters
Name | Description |
---|---|
newContext: ExecutionContext
|
|
index: Int
|
ReturnValue
Name | Description |
---|---|
TypeError
|
updateLastContext
fun updateLastContext(newContext: ExecutionContext): TypeError
Parameters
Name | Description |
---|---|
newContext: ExecutionContext
|
ReturnValue
Name | Description |
---|---|
TypeError
|
pushContext
fun pushContext(newContext: ExecutionContext): TypeError
Parameters
Name | Description |
---|---|
newContext: ExecutionContext
|
ReturnValue
Name | Description |
---|---|
TypeError
|
CompanionObject
TypeError
class TypeError: LogicError
The type error occurs when something is not of Expected type
Fields
Name | Description |
---|---|
const typeFunctor: String
|
The type error Struct functor |
Methods
of
fun of(context: ExecutionContext, expectedType: Expected, actualValue: Term, message: String): TypeError
Parameters
Name | Description |
---|---|
context: ExecutionContext
|
|
expectedType: Expected
|
|
actualValue: Term
|
|
message: String
|
ReturnValue
Name | Description |
---|---|
TypeError
|
forArgumentList
fun forArgumentList(context: ExecutionContext, procedure: Signature, expectedType: Expected, culprit: Term, index: Int?): TypeError
Parameters
Name | Description |
---|---|
context: ExecutionContext
|
|
procedure: Signature
|
|
expectedType: Expected
|
|
culprit: Term
|
|
index: Int?
|
ReturnValue
Name | Description |
---|---|
TypeError
|
forArgument
fun forArgument(context: ExecutionContext, procedure: Signature, expectedType: Expected, culprit: Term, index: Int?): TypeError
Parameters
Name | Description |
---|---|
context: ExecutionContext
|
|
procedure: Signature
|
|
expectedType: Expected
|
|
culprit: Term
|
|
index: Int?
|
ReturnValue
Name | Description |
---|---|
TypeError
|
forGoal
fun forGoal(context: ExecutionContext, procedure: Signature, expectedType: Expected, culprit: Term): TypeError
Parameters
Name | Description |
---|---|
context: ExecutionContext
|
|
procedure: Signature
|
|
expectedType: Expected
|
|
culprit: Term
|
ReturnValue
Name | Description |
---|---|
TypeError
|
The type error occurs when something is not of Expected type