Eric
06/07/2023, 5:46 PMfun verifyOnce(
ordering: Ordering = Ordering.UNORDERED,
inverse: Boolean = false,
timeout: Long = 0,
verifyBlock: MockKVerificationScope.() -> Unit,
) = verify(ordering = ordering, inverse = inverse, exactly = 1, timeout = timeout, verifyBlock = verifyBlock)
If I write it like that ^ then running w/ type resolution fails due to ImplicitUnitReturnType
fun verifyOnce(
ordering: Ordering = Ordering.UNORDERED,
inverse: Boolean = false,
timeout: Long = 0,
verifyBlock: MockKVerificationScope.() -> Unit,
): Unit = verify(ordering = ordering, inverse = inverse, exactly = 1, timeout = timeout, verifyBlock = verifyBlock)
If I write it like that ^ then w/o type resolution it fails due to OptionalUnit
What should I do in a situation like this? Just suppress one or the other? Which one?Eric
06/07/2023, 5:47 PMfun verifyOnce(
ordering: Ordering = Ordering.UNORDERED,
inverse: Boolean = false,
timeout: Long = 0,
verifyBlock: MockKVerificationScope.() -> Unit,
) {
verify(ordering = ordering, inverse = inverse, exactly = 1, timeout = timeout, verifyBlock = verifyBlock)
}
Brais Gabin
06/08/2023, 3:15 PM=
notation when you return Unit
. It's counter intuitive. Use the good old {}
Eric
06/08/2023, 3:16 PM