TermToObjectConversionException

class TermToObjectConversionException(val term: Term, val targetType: KClass<*>? = null) : OopException

Thrown by it.unibo.tuprolog.solve.libs.oop.TermToObjectConverter.convertInto when term cannot be turned into an instance of targetType (or of any type at all, if targetType is null) -- e.g. converting a compound term that is not a recognized as/$ expression, or an it.unibo.tuprolog.solve.libs.oop.ObjectRef whose wrapped object is not a subtype of the requested type.

Surfaces to Prolog as an it.unibo.tuprolog.solve.exception.error.RepresentationError with limit it.unibo.tuprolog.solve.exception.error.RepresentationError.Limit.OOP_OBJECT.

Parameters

term

the term that could not be converted.

targetType

the JVM/Kotlin type conversion was attempted into, if any was specified.

Constructors

Link copied to clipboard
constructor(term: Term, targetType: KClass<*>? = null)
constructor(term: Term)

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
expect open val message: String?
Link copied to clipboard
Link copied to clipboard
val term: Term

Functions

Link copied to clipboard
open override fun toLogicError(context: ExecutionContext, signature: Signature): LogicError

Converts this exception into the LogicError that should actually be thrown by context's solver, while executing signature.