KaFunctionValueParameter¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
abstract class KaFunctionValueParameter : KaLifetimeOwner
Represents a function value parameter
Constructors¶
KaFunctionValueParameter¶
constructor()
Properties¶
name¶
abstract val name: Name?
Name of the parameter, as specified in the function signature.
Note that some parameters might not have names by their nature. This applies to, for example, receiver parameters in references to member functions.
fooRef from the example above has KaFunctionType. This type has two KaFunctionValueParameters:
-
One receiver parameter of type
A, which doesn't have any specified name -
One regular parameter
xof typeInt
token¶
abstract val token: KaLifetimeToken
The KaLifetimeToken which determines the lifetime of the lifetime owner.
type¶
Functions¶
assertIsValidAndAccessible¶
inline fun KaLifetimeOwner.assertIsValidAndAccessible()
isValid¶
fun KaLifetimeOwner.isValid(): Boolean
Whether the lifetime owner is still valid, i.e. we are still in the scope of the lifetime owner's regular lifetime.
withValidityAssertion¶
inline fun <R> KaLifetimeOwner.withValidityAssertion(action: () -> R): R
Executes action only if the KaLifetimeOwner is still valid and accessible. Otherwise, throws a validity exception based on the concrete violation.