Add supertype Extension for AbstractExtensionPoint

This commit is contained in:
Him188 2020-09-04 20:31:19 +08:00
parent a10e48cc36
commit 4ed8948e94

View File

@ -22,7 +22,7 @@ import kotlin.internal.LowPriorityInOverloadResolution
import kotlin.reflect.KClass import kotlin.reflect.KClass
@ConsoleExperimentalAPI @ConsoleExperimentalAPI
public open class AbstractExtensionPoint<T : Any>( public open class AbstractExtensionPoint<T : Extension>(
@ConsoleExperimentalAPI @ConsoleExperimentalAPI
public val type: KClass<T> public val type: KClass<T>
) { ) {
@ -110,6 +110,8 @@ internal fun <T : Any> AbstractExtensionPoint<T>.throwExtensionException(
) )
} }
internal fun <T : Any> AbstractExtensionPoint<T>
internal inline fun <T : Any> AbstractExtensionPoint<T>.useExtensions(block: (extension: T) -> Unit): Unit = internal inline fun <T : Any> AbstractExtensionPoint<T>.useExtensions(block: (extension: T) -> Unit): Unit =
withExtensions(block) withExtensions(block)