kotlinx.io.core.internal.Require.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlinx-io-native Show documentation
Show all versions of kotlinx-io-native Show documentation
IO support libraries for Kotlin
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