ConstructorInvocationException

class ConstructorInvocationException(val type: KClass<*>, val admissibleTypes: List<Set<KClass<*>>>) : OopException

Thrown by it.unibo.tuprolog.solve.libs.oop.OverloadSelector.findConstructor (and, through it, by it.unibo.tuprolog.solve.libs.oop.TypeRef.create) when type has no public constructor accepting arguments whose types are compatible with admissibleTypes -- e.g. new_object('java.util.ArrayList', [foo], X) fails this way, since no ArrayList constructor accepts an atom.

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

Parameters

type

the type a constructor was sought on.

admissibleTypes

, for each actual argument (in order), every JVM/Kotlin type it could have been converted into.

Constructors

Link copied to clipboard
constructor(type: KClass<*>, admissibleTypes: List<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
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.