Make 'sure' an inline function with a lazy parameter
Also replace some other non-lazy stdlib function usages with the new lazy 'sure'
This commit is contained in:
@@ -16,12 +16,4 @@
|
||||
|
||||
package org.jetbrains.kotlin.utils
|
||||
|
||||
public fun <T : Any> T?.sure(message: String): T = this ?: throw AssertionError(message)
|
||||
|
||||
fun <T> T.printAndReturn(message: String = ""): T {
|
||||
if (!message.isEmpty()) {
|
||||
println("$message:")
|
||||
}
|
||||
println(this)
|
||||
return this
|
||||
}
|
||||
public inline fun <T : Any> T?.sure(message: () -> String): T = this ?: throw AssertionError(message())
|
||||
|
||||
Reference in New Issue
Block a user