All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kotlinx.io.core.internal.Require.kt Maven / Gradle / Ivy

The newest version!
package kotlinx.io.core.internal

@PublishedApi
internal inline fun require(condition: Boolean, crossinline message: () -> String) {
    if (!condition) {
        val m = object : RequireFailureCapture() {
            override fun doFail(): Nothing {
                throw IllegalArgumentException(message())
            }
        }
        m.doFail()
    }
}

@PublishedApi
internal abstract class RequireFailureCapture {
    abstract fun doFail(): Nothing
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy