MethodInvocationException

class MethodInvocationException(val type: KClass<*>, val missingMethodName: String, val admissibleTypes: List<Set<KClass<*>>>) : OopException

Thrown by it.unibo.tuprolog.solve.libs.oop.OverloadSelector.findMethod (and, through it, by it.unibo.tuprolog.solve.libs.oop.Ref.invoke) when type has no public member named missingMethodName accepting arguments whose types are compatible with admissibleTypes -- e.g. invoking foo on an object whose class declares no such method, or calling an existing method with the wrong number/kind of arguments.

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

Parameters

type

the type a method was sought on.

missingMethodName

the method name that could not be resolved.

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<*>, missingMethodName: String, 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
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.