PropertyAssignmentException

class PropertyAssignmentException(val type: KClass<*>, val missingPropertyName: String, val admissibleTypes: Set<KClass<*>>) : OopException

Thrown by it.unibo.tuprolog.solve.libs.oop.OverloadSelector.findProperty (and, through it, by it.unibo.tuprolog.solve.libs.oop.Ref.assign) when type has no public mutable property named missingPropertyName whose setter accepts a value compatible with admissibleTypes -- e.g. assigning to a read-only val, to a non-existent property, or to a property of an incompatible type.

Surfaces to Prolog as an it.unibo.tuprolog.solve.exception.error.ExistenceError of type it.unibo.tuprolog.solve.exception.error.ExistenceError.ObjectType.OOP_PROPERTY.

Parameters

type

the type a property was sought on.

missingPropertyName

the property name that could not be resolved.

admissibleTypes

every JVM/Kotlin type the value being assigned could have been converted into.

Constructors

Link copied to clipboard
constructor(type: KClass<*>, missingPropertyName: String, admissibleTypes: Set<KClass<*>>)

Properties

Link copied to clipboard
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 type: KClass<*>

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.